OpenCloudOS-Kernel/drivers/net/ethernet
Geert Uytterhoeven 77972b55fb Revert "ravb: Fixed to be able to unload modules"
This reverts commit 1838d6c62f.

This commit moved the ravb_mdio_init() call (and thus the
of_mdiobus_register() call) from the ravb_probe() to the ravb_open()
call.  This causes a regression during system resume (s2idle/s2ram), as
new PHY devices cannot be bound while suspended.

During boot, the Micrel PHY is detected like this:

    Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=228)
    ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

During system suspend, (A) defer_all_probes is set to true, and (B)
usermodehelper_disabled is set to UMH_DISABLED, to avoid drivers being
probed while suspended.

  A. If CONFIG_MODULES=n, phy_device_register() calling device_add()
     merely adds the device, but does not probe it yet, as
     really_probe() returns early due to defer_all_probes being set:

       dpm_resume+0x128/0x4f8
	 device_resume+0xcc/0x1b0
	   dpm_run_callback+0x74/0x340
	     ravb_resume+0x190/0x1b8
	       ravb_open+0x84/0x770
		 of_mdiobus_register+0x1e0/0x468
		   of_mdiobus_register_phy+0x1b8/0x250
		     of_mdiobus_phy_device_register+0x178/0x1e8
		       phy_device_register+0x114/0x1b8
			 device_add+0x3d4/0x798
			   bus_probe_device+0x98/0xa0
			     device_initial_probe+0x10/0x18
			       __device_attach+0xe4/0x140
				 bus_for_each_drv+0x64/0xc8
				   __device_attach_driver+0xb8/0xe0
				     driver_probe_device.part.11+0xc4/0xd8
				       really_probe+0x32c/0x3b8

     Later, phy_attach_direct() notices no PHY driver has been bound,
     and falls back to the Generic PHY, leading to degraded operation:

       Generic PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=POLL)
       ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

  B. If CONFIG_MODULES=y, request_module() returns early with -EBUSY due
     to UMH_DISABLED, and MDIO initialization fails completely:

       mdio_bus e6800000.ethernet-ffffffff:00: error -16 loading PHY driver module for ID 0x00221622
       ravb e6800000.ethernet eth0: failed to initialize MDIO
       PM: dpm_run_callback(): ravb_resume+0x0/0x1b8 returns -16
       PM: Device e6800000.ethernet failed to resume: error -16

     Ignoring -EBUSY in phy_request_driver_module(), like was done for
     -ENOENT in commit 21e194425a ("net: phy: fix issue with loading
     PHY driver w/o initramfs"), would makes it fall back to the Generic
     PHY, like in the CONFIG_MODULES=n case.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-23 17:38:36 -07:00
..
3com treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8390 treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
adaptec starfire: use generic power management 2020-07-01 12:58:33 -07:00
aeroflex Replace HTTP links with HTTPS ones: GRETH 10/100/1G Ethernet MAC device driver 2020-07-07 15:44:27 -07:00
agere net: ethernet: et131x: Remove redundant register read 2020-07-17 18:48:15 -07:00
alacritech treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
allwinner treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
alteon treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
altera treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
amazon net: ena: Make missed_tx stat incremental 2020-08-19 15:32:58 -07:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-03 18:50:48 -07:00
apm
apple treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
aquantia net: atlantic: Use readx_poll_timeout() for large timeout 2020-08-19 16:25:29 -07:00
arc net: arc_emac: Fix memleak in arc_mdio_probe 2020-08-24 17:59:44 -07:00
atheros net: ag71xx: add missed clk_disable_unprepare in error path of probe 2020-07-20 18:37:38 -07:00
aurora net: nb8800: fix nb8800_xmit()'s return type 2020-06-28 20:52:53 -07:00
broadcom bnxt_en: Fix wrong flag value passed to HWRM_PORT_QSTATS_EXT fw call. 2020-09-20 19:04:45 -07:00
brocade treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cadence net: macb: fix for pause frame receive enable bit 2020-09-06 11:58:59 -07:00
calxeda
cavium treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
chelsio cxgb4: fix memory leak during module unload 2020-09-17 16:29:20 -07:00
cirrus docs: networking: reorganize driver documentation again 2020-06-26 16:08:44 -07:00
cisco treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cortina net: gemini: Fix another missing clk_disable_unprepare() in probe 2020-09-02 15:40:18 -07:00
davicom treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dec net: dec: de2104x: Increase receive ring size for Tulip 2020-09-10 15:28:53 -07:00
dlink net: sundance: Replace HTTP links with HTTPS ones 2020-07-15 17:41:34 -07:00
emulex treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ezchip treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
faraday treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
freescale dpaa2-eth: fix a build warning in dpmac.c 2020-09-18 14:36:00 -07:00
fujitsu treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
google
hisilicon net: hns: kerneldoc fixes 2020-09-18 14:22:58 -07:00
huawei hinic: fix sending pkts from core while self testing 2020-09-18 14:11:01 -07:00
i825xx treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ibm ibmvnic: add missing parenthesis in do_reset() 2020-09-07 14:03:11 -07:00
intel igc: Fix not considering the TX delay for timestamps 2020-09-09 15:06:24 -07:00
marvell net: mvneta: recycle the page in case of out-of-order 2020-09-20 14:12:24 -07:00
mediatek treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mellanox net/mlx5e: mlx5e_fec_in_caps() returns a boolean 2020-09-21 17:22:25 -07:00
micrel ksz884x: switch from 'pci_' to 'dma_' API 2020-07-14 15:10:29 -07:00
microchip treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
moxa treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mscc net: mscc: ocelot: fix some key offsets for IP4_TCP_UDP VCAP IS2 entries 2020-09-21 17:40:52 -07:00
myricom ethernet: myri10ge: use generic power management 2020-07-20 18:01:07 -07:00
natsemi treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
neterion treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
netronome nfp: use correct define to return NONE fec 2020-09-17 17:59:12 -07:00
ni net: nixge: fix potential memory leak in nixge_probe() 2020-07-30 16:55:39 -07:00
nvidia treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
nxp net: nxp: Fix use correct return type for ndo_start_xmit() 2020-05-05 11:17:56 -07:00
oki-semi treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
packetengines treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
pasemi treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
pensando ionic: fix txrx work accounting 2020-08-31 12:19:57 -07:00
qlogic net: qed: RDMA personality shouldn't fail VF load 2020-09-09 14:28:18 -07:00
qualcomm net: qcom/emac: add missed clk_disable_unprepare in error path of emac_clks_phase1_init 2020-08-11 10:36:47 -07:00
rdc r6040: switch from 'pci_' to 'dma_' API 2020-07-20 17:49:50 -07:00
realtek treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
renesas Revert "ravb: Fixed to be able to unload modules" 2020-09-23 17:38:36 -07:00
rocker treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
samsung treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
seeq treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
sfc sfc: Fix error code in probe 2020-09-21 13:55:13 -07:00
sgi net: sgi: ioc3-eth: Fix the size used in some 'dma_free_coherent()' calls 2020-08-03 16:00:26 -07:00
silan sc92031: use generic power management 2020-07-30 17:43:01 -07:00
sis treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
smsc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
socionext treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
stmicro treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sun treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
synopsys net: dwc-xlgmac: fix xlgmac_xmit()'s return type 2020-06-28 20:52:53 -07:00
tehuti treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ti net: ethernet: ti: cpsw_new: fix suspend/resume 2020-09-11 17:36:28 -07:00
toshiba treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
tundra treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
via via-velocity: Use more typical logging styles 2020-08-04 12:54:49 -07:00
wiznet treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
xilinx net: ll_temac: Use devm_platform_ioremap_resource_byname() 2020-07-30 17:44:28 -07:00
xircom treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
xscale treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c net/fealnx: switch from 'pci_' to 'dma_' API 2020-07-20 18:32:49 -07:00
jme.c net: jme: Replace HTTP links with HTTPS ones 2020-07-13 17:45:04 -07:00
jme.h net: jme: Replace HTTP links with HTTPS ones 2020-07-13 17:45:04 -07:00
korina.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
lantiq_etop.c
lantiq_xrx200.c net: lantiq: Disable IRQs only if NAPI gets scheduled 2020-09-14 14:53:15 -07:00