* [PATCH] powerpc 4xx EMAC driver: device name reported on timeout is not correct
@ 2009-03-10 18:32 Mikhail Zolotaryov
2009-03-20 5:38 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Zolotaryov @ 2009-03-10 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
Hi,
not critical problem here.
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>
[-- Attachment #2: emac_report_timeout_error.patch --]
[-- Type: text/plain, Size: 441 bytes --]
--- linux-2.6/drivers/net/ibm_newemac/core.c.orig 2009-03-10 20:24:12.000000000 +0200
+++ linux-2.6/drivers/net/ibm_newemac/core.c 2009-03-10 20:29:12.000000000 +0200
@@ -134,7 +134,7 @@
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:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc 4xx EMAC driver: device name reported on timeout is not correct
2009-03-10 18:32 [PATCH] powerpc 4xx EMAC driver: device name reported on timeout is not correct Mikhail Zolotaryov
@ 2009-03-20 5:38 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2009-03-20 5:38 UTC (permalink / raw)
To: Mikhail Zolotaryov; +Cc: linuxppc-dev, linux-kernel
On Tue, 2009-03-10 at 20:32 +0200, Mikhail Zolotaryov wrote:
> Hi,
>
> not critical problem here.
>
> 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>
---
Please submit with my Ack included to the netdev list.
Cheers,
Ben.
>
>
> plain text document attachment (emac_report_timeout_error.patch)
> --- linux-2.6/drivers/net/ibm_newemac/core.c.orig 2009-03-10 20:24:12.000000000 +0200
> +++ linux-2.6/drivers/net/ibm_newemac/core.c 2009-03-10 20:29:12.000000000 +0200
> @@ -134,7 +134,7 @@
> 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:
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-20 5:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-10 18:32 [PATCH] powerpc 4xx EMAC driver: device name reported on timeout is not correct Mikhail Zolotaryov
2009-03-20 5:38 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).