Skip to content

Commit

Permalink
net: qcom/emac: display the phy driver info after we connect
Browse files Browse the repository at this point in the history
The PHY driver is attached only when the driver calls
phy_connect_direct().  Calling phy_attached_print() to display
information about the PHY driver prior to that point is meaningless.
The interface can be brought down, a new PHY driver can be loaded,
and the interface then brought back up.  This is the correct time
to display information about the attached driver.

Since phy_attached_print() also prints information about the
interrupt, that needs to be set as well.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Timur Tabi authored and David S. Miller committed Jan 30, 2017
1 parent 5b8784a commit 9da34f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/qualcomm/emac/emac-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,18 +981,20 @@ int emac_mac_up(struct emac_adapter *adpt)
emac_mac_config(adpt);
emac_mac_rx_descs_refill(adpt, &adpt->rx_q);

adpt->phydev->irq = PHY_IGNORE_INTERRUPT;
ret = phy_connect_direct(netdev, adpt->phydev, emac_adjust_link,
PHY_INTERFACE_MODE_SGMII);
if (ret) {
netdev_err(adpt->netdev, "could not connect phy\n");
return ret;
}

phy_attached_print(adpt->phydev, NULL);

/* enable mac irq */
writel((u32)~DIS_INT, adpt->base + EMAC_INT_STATUS);
writel(adpt->irq.mask, adpt->base + EMAC_INT_MASK);

adpt->phydev->irq = PHY_IGNORE_INTERRUPT;
phy_start(adpt->phydev);

napi_enable(&adpt->rx_q.napi);
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/qualcomm/emac/emac-phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,5 @@ int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt)
return -ENODEV;
}

if (adpt->phydev->drv)
phy_attached_print(adpt->phydev, NULL);

return 0;
}

0 comments on commit 9da34f2

Please sign in to comment.