diff options
author | Frank Li <Frank.Li@freescale.com> | 2013-02-06 09:59:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-07 23:36:41 -0500 |
commit | 85bd1798b24a13462d7b064961e7a9da3bb12db1 (patch) | |
tree | f320859920594383cc70f3448a943b11242757b6 /drivers/net/ethernet/freescale | |
parent | 365cc174648cd7e9b11e522c3d5b07ccf3c60d99 (diff) |
net: fec: fix spin_lock dead lock
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.8.0-rc5+ #82 Not tainted
---------------------------------------------------------
swapper/0/0 just changed the state of lock:
(&(&fep->hw_lock)->rlock){..-...}, at: [<8034e2f8>] fec_enet_start_xmit+0x48/0x 2cc
but this lock took another, SOFTIRQ-unsafe lock in the past:
(prepare_lock){+.+.+.}
and interrupts could create inverse lock ordering between them.
other info that might help us debug this:
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(prepare_lock);
local_irq_disable()
lock(&(&fep->hw_lock)->rlock);
lock(prepare_lock);
<Interrupt>
lock(&(&fep->hw_lock)->rlock);
*** DEADLOCK ***
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_ptp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index c40526c78c20..1f17ca0f2201 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c | |||
@@ -104,7 +104,7 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev) | |||
104 | unsigned long flags; | 104 | unsigned long flags; |
105 | int inc; | 105 | int inc; |
106 | 106 | ||
107 | inc = 1000000000 / clk_get_rate(fep->clk_ptp); | 107 | inc = 1000000000 / fep->cycle_speed; |
108 | 108 | ||
109 | /* grab the ptp lock */ | 109 | /* grab the ptp lock */ |
110 | spin_lock_irqsave(&fep->tmreg_lock, flags); | 110 | spin_lock_irqsave(&fep->tmreg_lock, flags); |
@@ -363,6 +363,8 @@ void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev) | |||
363 | fep->ptp_caps.settime = fec_ptp_settime; | 363 | fep->ptp_caps.settime = fec_ptp_settime; |
364 | fep->ptp_caps.enable = fec_ptp_enable; | 364 | fep->ptp_caps.enable = fec_ptp_enable; |
365 | 365 | ||
366 | fep->cycle_speed = clk_get_rate(fep->clk_ptp); | ||
367 | |||
366 | spin_lock_init(&fep->tmreg_lock); | 368 | spin_lock_init(&fep->tmreg_lock); |
367 | 369 | ||
368 | fec_ptp_start_cyclecounter(ndev); | 370 | fec_ptp_start_cyclecounter(ndev); |