netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Berger <opendmb@gmail.com>
To: f.fainelli@gmail.com
Cc: pgynther@google.com, jaedon.shin@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Doug Berger <opendmb@gmail.com>
Subject: [PATCH v2 net 6/8] net: bcmgenet: Power up the internal PHY before probing the MII
Date: Thu,  9 Mar 2017 16:58:48 -0800	[thread overview]
Message-ID: <20170310005850.10808-7-opendmb@gmail.com> (raw)
In-Reply-To: <20170310005850.10808-1-opendmb@gmail.com>

When using the internal PHY it must be powered up when the MII is probed
or the PHY will not be detected.  Since the PHY is powered up at reset
this has not been a problem.  However, when the kernel is restarted with
kexec the PHY will likely be powered down when the kernel starts so it
will not be detected and the Ethernet link will not be established.

This commit explicitly powers up the internal PHY when the GENET driver
is probed to correct this behavior.

Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Doug Berger <opendmb@gmail.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 527cecaf12c1..f93098840775 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3289,6 +3289,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
 	const void *macaddr;
 	struct resource *r;
 	int err = -EIO;
+	const char *phy_mode_str;
 
 	/* Up to GENET_MAX_MQ_CNT + 1 TX queues and RX queues */
 	dev = alloc_etherdev_mqs(sizeof(*priv), GENET_MAX_MQ_CNT + 1,
@@ -3396,6 +3397,13 @@ static int bcmgenet_probe(struct platform_device *pdev)
 		priv->clk_eee = NULL;
 	}
 
+	/* If this is an internal GPHY, power it on now, before UniMAC is
+	 * brought out of reset as absolutely no UniMAC activity is allowed
+	 */
+	if (dn && !of_property_read_string(dn, "phy-mode", &phy_mode_str) &&
+	    !strcasecmp(phy_mode_str, "internal"))
+		bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
+
 	err = reset_umac(priv);
 	if (err)
 		goto err_clk_disable;
-- 
2.11.1

  parent reply	other threads:[~2017-03-10  0:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  0:58 [PATCH v2 net 0/8] net: bcmgenet: minor bug fixes Doug Berger
2017-03-10  0:58 ` [PATCH v2 net 1/8] net: bcmgenet: correct the RBUF_OVFL_CNT and RBUF_ERR_CNT MIB values Doug Berger
2017-03-10  1:42   ` Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 2/8] net: bcmgenet: correct MIB access of UniMAC RUNT counters Doug Berger
2017-03-10  1:43   ` Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 3/8] net: bcmgenet: reserved phy revisions must be checked first Doug Berger
2017-03-10  1:43   ` Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 4/8] net: bcmgenet: power down internal phy if open or resume fails Doug Berger
2017-03-10  1:43   ` Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 5/8] net: bcmgenet: synchronize irq0 status between the isr and task Doug Berger
2017-03-10  1:44   ` Florian Fainelli
2017-03-10  0:58 ` Doug Berger [this message]
2017-03-10  1:44   ` [PATCH v2 net 6/8] net: bcmgenet: Power up the internal PHY before probing the MII Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 7/8] net: bcmgenet: add begin/complete ethtool ops Doug Berger
2017-03-10  1:44   ` Florian Fainelli
2017-03-10  0:58 ` [PATCH v2 net 8/8] net: bcmgenet: decouple flow control from bcmgenet_tx_reclaim Doug Berger
2017-03-10  1:45   ` Florian Fainelli
2017-03-10  1:45 ` [PATCH v2 net 0/8] net: bcmgenet: minor bug fixes Florian Fainelli
2017-03-10  2:39 ` 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=20170310005850.10808-7-opendmb@gmail.com \
    --to=opendmb@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=jaedon.shin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pgynther@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).