Skip to contentSkip to conversation

Patch "net: bcmgenet: Power up the internal PHY before probing the MII" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Dec 18, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: bcmgenet: Power up the internal PHY before probing the MII

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-bcmgenet-power-up-the-internal-phy-before-probing-the-mii.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Dec 18 14:47:43 CET 2017

From: Doug Berger <[email protected]>
Date: Thu, 9 Mar 2017 16:58:48 -0800
Subject: net: bcmgenet: Power up the internal PHY before probing the MII

From: Doug Berger <[email protected]>

[ Upstream commit 6be371b053dc86f11465cc1abce2e99bda0a0574 ]

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")
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +8 -0
@@ -3384,6 +3384,7 @@ static int bcmgenet_probe(struct platfor
 	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,
@@ -3489,6 +3490,13 @@ static int bcmgenet_probe(struct platfor
 		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;

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/net-bcmgenet-correct-the-rbuf_ovfl_cnt-and-rbuf_err_cnt-mib-values.patch queue-4.4/net-bcmgenet-correct-mib-access-of-unimac-runt-counters.patch queue-4.4/net-bcmgenet-power-down-internal-phy-if-open-or-resume-fails.patch queue-4.4/net-bcmgenet-reserved-phy-revisions-must-be-checked-first.patch queue-4.4/net-bcmgenet-power-up-the-internal-phy-before-probing-the-mii.patch