Skip to content

Commit

Permalink
ibm_newemac: Fix ZMII refcounting bug
Browse files Browse the repository at this point in the history
When using ZMII for MDIO only (such as 440GX with RGMII for data and ZMII for
MDIO), the ZMII code would fail to properly refcount, thus triggering a
BUG_ON().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Jeff Garzik committed Dec 7, 2007
1 parent 8df4538 commit 9685306
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ibm_newemac/zmii.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ int __devinit zmii_attach(struct of_device *ofdev, int input, int *mode)

ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode);

if (!zmii_valid_mode(*mode))
if (!zmii_valid_mode(*mode)) {
/* Probably an EMAC connected to RGMII,
* but it still may need ZMII for MDIO so
* we don't fail here.
*/
dev->users++;
return 0;
}

mutex_lock(&dev->lock);

Expand Down

0 comments on commit 9685306

Please sign in to comment.