net: fec: fix spin_lock dead lock
authorFrank Li <Frank.Li@freescale.com>
Wed, 6 Feb 2013 14:59:59 +0000 (14:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Feb 2013 04:36:41 +0000 (23:36 -0500)
commit85bd1798b24a13462d7b064961e7a9da3bb12db1
treef320859920594383cc70f3448a943b11242757b6
parent365cc174648cd7e9b11e522c3d5b07ccf3c60d99
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>
drivers/net/ethernet/freescale/fec_ptp.c