From: Mikhail Zolotaryov Date: Thu, 19 Mar 2009 22:28:02 +0000 (+0000) Subject: powerpc 4xx EMAC driver: device name reported on timeout is not correct X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62f0c338d126fee75dc04bd23be30281a0e1e62f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git powerpc 4xx EMAC driver: device name reported on timeout is not correct 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 Acked-by: Benjamin Herrenschmidt Signed-off-by: David S. Miller --- diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 6fd7aa61736e..a815e17a0ab4 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c @@ -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: