diff options
author | Fugang Duan <b38611@freescale.com> | 2014-11-25 13:34:56 +0800 |
---|---|---|
committer | Fugang Duan <b38611@freescale.com> | 2014-11-25 14:07:02 +0800 |
commit | 51efb4c5bfab6eae848fa857d534f5d82721d2e1 (patch) | |
tree | 111da82e8a771dbd22e0d0e292965cb9b1b0023b /drivers | |
parent | 4fea48c13ebf455f977905f076e978da8568a769 (diff) |
MLK-9913 net: fec: fix kernel dump when enable netdev as wakeup source
When enable CONFIG_DEBUG_SPINLOCK, kenrel boot up has kernel dump:
libphy: fec_enet_mii_bus: probed
BUG: spinlock bad magic on CPU#0, swapper/0/1
lock: 0xa830e2f0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.53-02595-g68a1d76 #144
[<80014c6c>] (unwind_backtrace+0x0/0xf4) from [<80011a78>] (show_stack+0x10/0x14)
[<80011a78>] (show_stack+0x10/0x14) from [<80287be0>] (do_raw_spin_lock+0x154/0x180)
[<80287be0>] (do_raw_spin_lock+0x154/0x180) from [<8033b908>] (device_wakeup_enable+0x3c/0x84)
[<8033b908>] (device_wakeup_enable+0x3c/0x84) from [<803cfff8>] (fec_probe+0xce8/0x1134)
[<803cfff8>] (fec_probe+0xce8/0x1134) from [<80334aa0>] (platform_drv_probe+0x18/0x1c)
[<80334aa0>] (platform_drv_probe+0x18/0x1c) from [<8033389c>] (driver_probe_device+0x108/0x244)
[<8033389c>] (driver_probe_device+0x108/0x244) from [<80333aa8>] (__driver_attach+0x8c/0x90)
[<80333aa8>] (__driver_attach+0x8c/0x90) from [<80331da0>] (bus_for_each_dev+0x60/0x94)
[<80331da0>] (bus_for_each_dev+0x60/0x94) from [<80333048>] (bus_add_driver+0x1c0/0x24c)
[<80333048>] (bus_add_driver+0x1c0/0x24c) from [<80334084>] (driver_register+0x78/0xf8)
[<80334084>] (driver_register+0x78/0xf8) from [<8000877c>] (do_one_initcall+0x108/0x158)
[<8000877c>] (do_one_initcall+0x108/0x158) from [<80d1ebe0>] (kernel_init_freeable+0x138/0x1d8)
[<80d1ebe0>] (kernel_init_freeable+0x138/0x1d8) from [<806f6738>] (kernel_init+0x8/0x158)
[<806f6738>] (kernel_init+0x8/0x158) from [<8000e218>] (ret_from_fork+0x14/0x3c)
The warning is driver calls device_wakeup_attach() to init wakeup source,
and this locks &dev->power.lock, but the lock is not initialized until
register_netdev(), so we move the device_init_wakeup() to behind of
register_netdev().
(cherry-picked from commit: 538271f9877c1f40c4e41f846993f964ff579908)
Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index b9e4a46291a9..7659f86325b2 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3229,9 +3229,6 @@ fec_probe(struct platform_device *pdev) /* Carrier starts down, phylib will bring it up */ netif_carrier_off(ndev); - device_init_wakeup(&ndev->dev, - fep->wol_flag & FEC_WOL_HAS_MAGIC_PACKET); - fec_enet_clk_enable(ndev, false); /* Select sleep pin state */ @@ -3241,6 +3238,9 @@ fec_probe(struct platform_device *pdev) if (ret) goto failed_register; + device_init_wakeup(&ndev->dev, + fep->wol_flag & FEC_WOL_HAS_MAGIC_PACKET); + if (fep->bufdesc_ex && fep->ptp_clock) netdev_info(ndev, "registered PHC device %d\n", fep->dev_id); |