From: Timur Tabi <timur@codeaurora.org>
To: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: [PATCH 1/5] [net-next] net: qcom/emac: display the phy driver info after we connect
Date: Fri, 27 Jan 2017 16:43:43 -0600 [thread overview]
Message-ID: <1485557028-32510-2-git-send-email-timur@codeaurora.org> (raw)
In-Reply-To: <1485557028-32510-1-git-send-email-timur@codeaurora.org>
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>
---
drivers/net/ethernet/qualcomm/emac/emac-mac.c | 4 +++-
drivers/net/ethernet/qualcomm/emac/emac-phy.c | 3 ---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index e4793d7..155e273 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -981,6 +981,7 @@ 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) {
@@ -988,11 +989,12 @@ int emac_mac_up(struct emac_adapter *adpt)
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);
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-phy.c b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
index 1d7852f..441c1936 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-phy.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
@@ -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;
}
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2017-01-27 22:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 22:43 [PATCH 0/5] [net-next] net: qcom/emac: Timur Tabi
2017-01-27 22:43 ` Timur Tabi [this message]
2017-01-27 22:43 ` [PATCH 2/5] [net-next] net: qcom/emac: always use autonegotiation to configure the SGMII link Timur Tabi
2017-01-27 22:43 ` [PATCH 3/5] [net-next] net: qcom/emac: do not call emac_mac_start twice Timur Tabi
2017-01-27 22:43 ` [PATCH 4/4] [net-next] net: qcom/emac: add an error interrupt handler for the sgmii Timur Tabi
2017-01-27 23:21 ` Timur Tabi
2017-01-27 22:43 ` [PATCH 4/5] [net-next] net: qcom/emac: remove extraneous wake-on-lan code Timur Tabi
2017-01-27 22:43 ` [PATCH 5/5] [net-next] net: qcom/emac: add an error interrupt handler for the sgmii Timur Tabi
2017-01-30 0:07 ` [PATCH 0/5] [net-next] net: qcom/emac: David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485557028-32510-2-git-send-email-timur@codeaurora.org \
--to=timur@codeaurora.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.