1
0
Fork 0
alistair23-linux/drivers/net/ethernet/freescale
Marek Vasut 9e70485b40 net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
[ Upstream commit 64a632da53 ]

The phy_reset_after_clk_enable() is always called with ndev->phydev,
however that pointer may be NULL even though the PHY device instance
already exists and is sufficient to perform the PHY reset.

This condition happens in fec_open(), where the clock must be enabled
first, then the PHY must be reset, and then the PHY IDs can be read
out of the PHY.

If the PHY still is not bound to the MAC, but there is OF PHY node
and a matching PHY device instance already, use the OF PHY node to
obtain the PHY device instance, and then use that PHY device instance
when triggering the PHY reset.

Fixes: 1b0a83ac04 ("net: fec: add phy_reset_after_clk_enable() support")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Richard Leitner <richard.leitner@skidata.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-29 09:57:23 +01:00
..
dpaa Revert "dpaa_eth: fix usage as DSA master, try 3" 2020-07-31 18:39:32 +02:00
dpaa2 dpaa2-eth: fix error return code in setup_dpni() 2020-10-01 13:17:57 +02:00
enetc enetc: Remove the mdio bus on PF probe bailout 2020-07-29 10:18:34 +02:00
fman fsl/fman: fix eth hash table allocation 2020-08-19 08:16:21 +02:00
fs_enet net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
Kconfig net: freescale: select CONFIG_FIXED_PHY where needed 2020-06-03 08:21:12 +02:00
Makefile enetc: Introduce basic PF and VF ENETC ethernet drivers 2019-01-24 21:55:53 -08:00
fec.h net: fec: set GPR bit on suspend by DT configuration. 2020-05-02 08:48:55 +02:00
fec_main.c net: fec: Fix phy_device lookup for phy_reset_after_clk_enable() 2020-10-29 09:57:23 +01:00
fec_mpc52xx.c net: ethernet: fix similar warning reported by kbuild test robot 2019-05-10 15:14:29 -07:00
fec_mpc52xx.h
fec_mpc52xx_phy.c
fec_ptp.c net: fec_ptp: Use platform_get_irq_xxx_optional() to avoid error message 2019-10-29 17:57:16 -07:00
fsl_pq_mdio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gianfar.c net: gianfar: Add of_node_put() before goto statement 2020-09-03 11:27:00 +02:00
gianfar.h gianfar: cleanup gianfar.h 2019-09-05 12:28:15 +02:00
gianfar_ethtool.c gianfar: remove forward declarations 2019-09-05 12:28:14 +02:00
ucc_geth.c net/ethernet/freescale: rework quiesce/activate for ucc_geth 2020-06-07 13:18:51 +02:00
ucc_geth.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ucc_geth_ethtool.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
xgmac_mdio.c net/fsl: treat fsl,erratum-a011043 2020-02-05 21:22:51 +00:00