Skip to content

Commit

Permalink
powerpc 4xx EMAC driver: device name reported on timeout is not correct
Browse files Browse the repository at this point in the history
Hi,

IBM EMAC driver performs device reset (drivers/net/ibm_newemac/core.c:
emac_probe() -> emac_init_phy() -> emac_reset()) before registering
appropriate net_device (emac_probe() -> register_netdev()), so
net_device name contains raw format string during EMAC reset ("eth%d").

If the case of reset timeout, emac_report_timeout_error() function is
called to report an error. The problem is this function uses net_device
name to report device related, which is not correct, as a result in the
kernel log buffer we see:

eth%d: reset timeout

The solution is to print device_node full_name instead. After applying
the patch proposed, error string is like the following:

/plb/opb/ethernet@ef600e00: reset timeout

Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mikhail Zolotaryov authored and David S. Miller committed Mar 21, 2009
1 parent ed734a9 commit 62f0c33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
EMAC_FTR_440EP_PHY_CLK_FIX))
DBG(dev, "%s" NL, error);
else if (net_ratelimit())
printk(KERN_ERR "%s: %s\n", dev->ndev->name, error);
printk(KERN_ERR "%s: %s\n", dev->ofdev->node->full_name, error);
}

/* EMAC PHY clock workaround:
Expand Down

0 comments on commit 62f0c33

Please sign in to comment.