Skip to content

Commit fe2cfbc

Browse files
michaelsit-iotgdavem330
authored andcommitted
net: stmmac: check if MAC needs to attach to a PHY
After the introduction of the fixed-link support, the MAC driver no longer attempt to scan for a PHY to attach to. This causes the non fixed-link setups to stop working. Using the phylink_expects_phy() to check and determine if the MAC should expect and attach a PHY. Fixes: ab21cf9 ("net: stmmac: make mdio register skips PHY scanning for fixed-link") Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> Signed-off-by: Lai Peter Jun Ann <peter.jun.ann.lai@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 653a180 commit fe2cfbc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ static int stmmac_init_phy(struct net_device *dev)
11351135
{
11361136
struct stmmac_priv *priv = netdev_priv(dev);
11371137
struct fwnode_handle *fwnode;
1138+
bool phy_needed;
11381139
int ret;
11391140

11401141
fwnode = of_fwnode_handle(priv->plat->phylink_node);
@@ -1144,10 +1145,11 @@ static int stmmac_init_phy(struct net_device *dev)
11441145
if (fwnode)
11451146
ret = phylink_fwnode_phy_connect(priv->phylink, fwnode, 0);
11461147

1148+
phy_needed = phylink_expects_phy(priv->phylink);
11471149
/* Some DT bindings do not set-up the PHY handle. Let's try to
11481150
* manually parse it
11491151
*/
1150-
if (!fwnode || ret) {
1152+
if (!fwnode || phy_needed || ret) {
11511153
int addr = priv->plat->phy_addr;
11521154
struct phy_device *phydev;
11531155

0 commit comments

Comments
 (0)