linux/drivers/net/ethernet
Srinivas Kandagatla 989508ba60 stmmac: remove spin_lock in stmmac_ioctl.
This patch removes un-needed spin_lock in stmmac_ioctl while reading and
writing mdio registers. While holding spin_lock the code must be
atomic, which is not true in this case as both mdiobus_read and writes
have mutex locks.

Without this patch reading mdio registers via mii-tool results in below
BUG:
mii-tool -vvv eth0"
Using SIOCGMIIPHY=0x8947
BUG: sleeping function called from invalid context at kernel/mutex.c:287
in_atomic(): 1, irqs_disabled(): 0, pid: 614, name: mii-tool
2 locks held by mii-tool/614:
 #0:  (rtnl_mutex){......}, at: [<c01fd80c>] dev_ioctl+0x550/0x674
 #1:  (&priv->lock){......}, at: [<c01b34ec>] stmmac_ioctl+0x4c/0x78
[<c002ea14>] (unwind_backtrace+0x0/0xcc) from [<c0272c38>]
(mutex_lock_nested+0x24/0x35c)
[<c0272c38>] (mutex_lock_nested+0x24/0x35c) from [<c01b237c>]
(mdiobus_read+0x44/0x70)
[<c01b237c>] (mdiobus_read+0x44/0x70) from [<c01b0c64>]
(phy_mii_ioctl+0x4c/0x138)
[<c01b0c64>] (phy_mii_ioctl+0x4c/0x138) from [<c01b34fc>]
(stmmac_ioctl+0x5c/0x78)
[<c01b34fc>] (stmmac_ioctl+0x5c/0x78) from [<c01fcec8>]
(dev_ifsioc+0x2a4/0x2c8)
[<c01fcec8>] (dev_ifsioc+0x2a4/0x2c8) from [<c01fd81c>]
(dev_ioctl+0x560/0x674)
[<c01fd81c>] (dev_ioctl+0x560/0x674) from [<c00c36e0>]
(vfs_ioctl+0x2c/0x8c)
[<c00c36e0>] (vfs_ioctl+0x2c/0x8c) from [<c00c4130>]
(do_vfs_ioctl+0x530/0x578)
[<c00c4130>] (do_vfs_ioctl+0x530/0x578) from [<c00c41ac>]
(sys_ioctl+0x34/0x54)
[<c00c41ac>] (sys_ioctl+0x34/0x54) from [<c0028aa0>]
(ret_fast_syscall+0x0/0x2c)

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-17 03:13:42 -05:00
..
3com
8390
adaptec
adi
aeroflex
alteon
amd Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2011-11-03 13:28:14 -07:00
apple net/ethernet: Move mac89x0.c from apple to cirrus 2011-11-01 19:30:38 -04:00
atheros
broadcom bnx2x: cache-in compressed fw image 2011-11-16 17:37:15 -05:00
brocade
cadence net/cadence: enable by default NET_ATMEL 2011-11-16 17:33:50 -05:00
chelsio
cirrus net/ethernet: Move mac89x0.c from apple to cirrus 2011-11-01 19:30:38 -04:00
cisco
davicom
dec
dlink
emulex Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
faraday
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-11-07 10:55:33 -08:00
fujitsu
hp
i825xx drivers/net/ethernet/i825xx/3c505.c: fix build with dynamic debug 2011-11-01 00:53:33 -04:00
ibm
icplus
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-11-07 10:55:33 -08:00
marvell sky2: version 1.30 2011-11-16 20:27:30 -05:00
mellanox mlx4_en: Remove FCS bytes from packet length. 2011-11-14 14:25:36 -05:00
micrel
microchip
myricom
natsemi i825xx:xscale:8390:freescale: Fix Kconfig dependancies 2011-11-04 17:41:20 -04:00
neterion
nuvoton
nvidia forcedeth: fix stats on hardware without extended stats support 2011-11-14 00:14:39 -05:00
octeon
oki-semi pch_gbe: Move #include of module.h 2011-11-16 17:38:03 -05:00
packetengines
pasemi
qlogic
racal
rdc r6040: fix check against MCRO_HASHEN bit in r6040_multicast_list 2011-11-16 20:24:52 -05:00
realtek r8169: increase the delay parameter of pm_schedule_suspend 2011-11-08 12:37:06 -05:00
renesas
seeq
sfc
sgi
silan net/ethernet: sc92031 is not Realtek 2011-11-01 19:30:38 -04:00
sis
smsc net/smsc911x: Always wait for the chip to be ready 2011-11-14 00:40:50 -05:00
stmicro stmmac: remove spin_lock in stmmac_ioctl. 2011-11-17 03:13:42 -05:00
sun sunhme: Allow usage on SBI based SBus systems 2011-11-08 14:01:42 -05:00
tehuti
ti
tile
toshiba Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2011-11-06 17:12:03 -08:00
tundra
via
xilinx net/ll_temac: FIX : Wait for indirect wait to end 2011-11-09 15:39:57 -05:00
xircom
xscale
dnet.c
dnet.h
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig net/ethernet: sc92031 is not Realtek 2011-11-01 19:30:38 -04:00
korina.c
lantiq_etop.c NET: MIPS: lantiq: fix etop compile error 2011-11-14 14:34:54 -05:00
Makefile net/ethernet: sc92031 is not Realtek 2011-11-01 19:30:38 -04:00
mipsnet.c
netx-eth.c
s6gmac.c