linux/drivers/net/ethernet/stmicro/stmmac
Niklas Cassel 90364feaf7 net: stmmac: do not call phy_ethtool_ksettings_set from atomic context
>From what I can tell, spin_lock(&priv->lock) is not needed, since the
phy_ethtool_ksettings_set call is not given the priv struct.

phy_start_aneg takes the phydev->lock. Calls to phy_adjust_link
from phy_state_machine also takes the phydev->lock.

[   13.718319] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:97
[   13.726717] in_atomic(): 1, irqs_disabled(): 0, pid: 1307, name: ethtool
[   13.742115] Hardware name: Axis ARTPEC-6 Platform
[   13.746829] [<80110568>] (unwind_backtrace) from [<8010c2bc>] (show_stack+0x18/0x1c)
[   13.754575] [<8010c2bc>] (show_stack) from [<80433484>] (dump_stack+0x80/0xa0)
[   13.761801] [<80433484>] (dump_stack) from [<80145428>] (___might_sleep+0x108/0x170)
[   13.769554] [<80145428>] (___might_sleep) from [<806c9b50>] (mutex_lock+0x24/0x44)
[   13.777128] [<806c9b50>] (mutex_lock) from [<8050cbc0>] (phy_start_aneg+0x1c/0x13c)
[   13.784783] [<8050cbc0>] (phy_start_aneg) from [<8050d338>] (phy_ethtool_ksettings_set+0x98/0xd0)
[   13.793656] [<8050d338>] (phy_ethtool_ksettings_set) from [<80517adc>] (stmmac_ethtool_set_link_ksettings+0xa0/0xb4)
[   13.804184] [<80517adc>] (stmmac_ethtool_set_link_ksettings) from [<805c5138>] (ethtool_set_settings+0xd4/0x13c)
[   13.814358] [<805c5138>] (ethtool_set_settings) from [<805c9718>] (dev_ethtool+0x13c4/0x211c)
[   13.822882] [<805c9718>] (dev_ethtool) from [<805dc7c0>] (dev_ioctl+0x480/0x8e0)
[   13.830291] [<805dc7c0>] (dev_ioctl) from [<80260e34>] (do_vfs_ioctl+0x94/0xa00)
[   13.837699] [<80260e34>] (do_vfs_ioctl) from [<802617dc>] (SyS_ioctl+0x3c/0x60)
[   13.845011] [<802617dc>] (SyS_ioctl) from [<801088bc>] (__sys_trace_return+0x0/0x10)

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-07 13:08:23 -05:00
..
altr_tse_pcs.c net: ethernet: Fix SGMII unable to switch speed and autonego failure 2016-11-15 12:06:24 -05:00
altr_tse_pcs.h net: ethernet: Add TSE PCS support to dwmac-socfpga 2016-07-10 22:07:50 -07:00
chain_mode.c net: ethernet: stmmac: change dma descriptors to __le32 2016-11-15 22:05:54 -05:00
common.h net: stmmac: unify mdio functions 2016-12-03 15:23:51 -05:00
descs_com.h net: ethernet: stmmac: change dma descriptors to __le32 2016-11-15 22:05:54 -05:00
descs.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
dwmac4_core.c net: stmmac: unify mdio functions 2016-12-03 15:23:51 -05:00
dwmac4_descs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
dwmac4_descs.h stmmac: fix PTP support for GMAC4 2016-11-15 19:56:17 -05:00
dwmac4_dma.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
dwmac4_dma.h stmmac: add DMA support for GMAC 4.xx 2016-04-02 20:23:08 -04:00
dwmac4_lib.c stmmac: add DMA support for GMAC 4.xx 2016-04-02 20:23:08 -04:00
dwmac4.h net: stmmac: enable tx queue 0 for gmac4 IPs synthesized with multiple TX queues 2016-11-29 19:10:47 -05:00
dwmac100_core.c net: stmmac: unify mdio functions 2016-12-03 15:23:51 -05:00
dwmac100_dma.c stmmac: rework DMA bus setting and introduce new platform AXI structure 2016-03-02 14:21:30 -05:00
dwmac100.h stmmac: share reset function between dwmac100 and dwmac1000 2016-03-02 14:21:30 -05:00
dwmac1000_core.c net: stmmac: unify mdio functions 2016-12-03 15:23:51 -05:00
dwmac1000_dma.c net: stmmac: clear reset value of snps, wr_osr_lmt/snps, rd_osr_lmt before writing 2016-12-06 10:33:48 -05:00
dwmac1000.h drivers: net: stmmac: rework core ISR to better manage PCS and PMT 2016-06-28 08:54:23 -04:00
dwmac_dma.h stmmac: rework DMA bus setting and introduce new platform AXI structure 2016-03-02 14:21:30 -05:00
dwmac_lib.c stmmac: share reset function between dwmac100 and dwmac1000 2016-03-02 14:21:30 -05:00
dwmac-generic.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-ipq806x.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-lpc18xx.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-meson8b.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-meson.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-oxnas.c net: stmmac: Add OXNAS Glue Driver 2016-11-03 15:31:33 -04:00
dwmac-rk.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
dwmac-socfpga.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
dwmac-sti.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
dwmac-stm32.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
dwmac-sunxi.c net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
enh_desc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
Makefile net: stmmac: Add OXNAS Glue Driver 2016-11-03 15:31:33 -04:00
mmc_core.c stmmac: enhance mmc counter management 2016-04-02 20:23:08 -04:00
mmc.h stmmac: enhance mmc counter management 2016-04-02 20:23:08 -04:00
norm_desc.c net: ethernet: stmmac: change dma descriptors to __le32 2016-11-15 22:05:54 -05:00
ring_mode.c net: ethernet: stmmac: change dma descriptors to __le32 2016-11-15 22:05:54 -05:00
stmmac_ethtool.c net: stmmac: do not call phy_ethtool_ksettings_set from atomic context 2016-12-07 13:08:23 -05:00
stmmac_hwtstamp.c stmmac: fix PTP support for GMAC4 2016-11-15 19:56:17 -05:00
stmmac_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-03 12:29:53 -05:00
stmmac_mdio.c net: stmmac: unify mdio functions 2016-12-03 15:23:51 -05:00
stmmac_pci.c stmmac: let remove/resume/suspend functions take device pointer 2016-05-03 15:22:19 -04:00
stmmac_pcs.h drivers: net: stmmac: reworking the PCS code. 2016-06-28 08:54:23 -04:00
stmmac_platform.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-12-06 21:33:19 -05:00
stmmac_platform.h net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks 2016-12-02 10:42:47 -05:00
stmmac_ptp.c stmmac: fix PTP support for GMAC4 2016-11-15 19:56:17 -05:00
stmmac_ptp.h stmmac: update the PTP header file 2016-11-15 19:56:17 -05:00
stmmac.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00