linux/drivers/net/ethernet/stmicro/stmmac
Samuel Holland 5292542167 net: stmmac: dwmac-sun8i: Balance internal PHY resource references
While stmmac_pltfr_remove calls sun8i_dwmac_exit, the sun8i_dwmac_init
and sun8i_dwmac_exit functions are also called by the stmmac_platform
suspend/resume callbacks. They may be called many times during the
device's lifetime and should not release resources used by the driver.

Furthermore, there was no error handling in case registering the MDIO
mux failed during probe, and the EPHY clock was never released at all.

Fix all of these issues by moving the deinitialization code to a driver
removal callback. Also ensure the EPHY is powered down before removal.

Fixes: 634db83b82 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-01-05 16:32:07 -08:00
..
altr_tse_pcs.c
altr_tse_pcs.h
chain_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
common.h net: stmmac: Enable EEE HW LPI timer with auto SW/HW switching 2020-10-30 09:59:26 -07:00
descs.h
descs_com.h
dwmac-anarion.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dwmac-dwc-qos-eth.c net: stmmac: dwc-qos: Change the dwc_eth_dwmac_data's .probe prototype 2020-11-11 15:15:02 -08:00
dwmac-generic.c
dwmac-imx.c net: stmmac: overwrite the dma_cap.addr64 according to HW design 2020-12-08 14:52:29 -08:00
dwmac-intel-plat.c net: stmmac: dwmac-intel-plat: fix error return code in intel_eth_plat_probe() 2020-11-16 15:32:30 -08:00
dwmac-intel.c stmmac: intel: Add PCI IDs for TGL-H platform 2020-12-23 12:12:26 -08:00
dwmac-intel.h
dwmac-ipq806x.c net: ethernet: stmmac: Disable hardware multicast filter 2020-08-12 13:12:52 -07:00
dwmac-lpc18xx.c
dwmac-mediatek.c
dwmac-meson.c
dwmac-meson8b.c net: stmmac: dwmac-meson8b: ignore the second clock input 2020-12-22 18:38:31 -08:00
dwmac-oxnas.c
dwmac-qcom-ethqos.c
dwmac-rk.c drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
dwmac-socfpga.c
dwmac-sti.c
dwmac-stm32.c
dwmac-sun8i.c net: stmmac: dwmac-sun8i: Balance internal PHY resource references 2021-01-05 16:32:07 -08:00
dwmac-sunxi.c
dwmac4.h net: stmmac: Enable EEE HW LPI timer with auto SW/HW switching 2020-10-30 09:59:26 -07:00
dwmac4_core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-11-27 18:25:27 -08:00
dwmac4_descs.c net: stmmac: set get_rx_header_len() as void for it didn't have any error code to return 2020-09-11 14:37:34 -07:00
dwmac4_descs.h
dwmac4_dma.c
dwmac4_dma.h
dwmac4_lib.c net: stmmac: increase the timeout for dma reset 2020-12-08 14:52:29 -08:00
dwmac5.c net: stmmac: simplify the return dwmac5_rxp_disable() 2020-12-09 17:05:37 -08:00
dwmac5.h net: stmmac: Add option for VLAN filter fail queue enable 2020-09-25 16:48:33 -07:00
dwmac100.h
dwmac100_core.c
dwmac100_dma.c
dwmac1000.h
dwmac1000_core.c net: stmmac: dwmac1000: provide multicast filter fallback 2020-08-12 13:12:52 -07:00
dwmac1000_dma.c
dwmac_dma.h
dwmac_lib.c net: stmmac: dwmac_lib: enlarge dma reset timeout 2020-11-14 16:04:02 -08:00
dwxgmac2.h
dwxgmac2_core.c
dwxgmac2_descs.c net: stmmac: set get_rx_header_len() as void for it didn't have any error code to return 2020-09-11 14:37:34 -07:00
dwxgmac2_dma.c
dwxlgmac2.h
enh_desc.c
hwif.c
hwif.h net: stmmac: Enable EEE HW LPI timer with auto SW/HW switching 2020-10-30 09:59:26 -07:00
Kconfig net: pcs: Move XPCS into new PCS subdirectory 2020-08-27 06:55:50 -07:00
Makefile net: stmmac: Add dwmac-intel-plat for GBE driver 2020-08-26 15:52:30 -07:00
mmc.h
mmc_core.c
norm_desc.c
ring_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
stmmac.h net: stmmac: Use hrtimer for TX coalescing 2020-11-24 08:47:44 -08:00
stmmac_ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
stmmac_hwtstamp.c
stmmac_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
stmmac_mdio.c net: stmmac: allow stmmac to probe for C45 PHY devices 2020-12-09 19:40:09 -08:00
stmmac_pci.c
stmmac_pcs.h
stmmac_platform.c net: stmmac: platform: use optional clk/reset get APIs 2020-11-13 16:31:52 -08:00
stmmac_platform.h
stmmac_ptp.c
stmmac_ptp.h
stmmac_selftests.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
stmmac_tc.c net: stmmac: simplify the return tc_delete_knode() 2020-12-10 12:58:55 -08:00