netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port
@ 2021-05-21 17:46 Florian Fainelli
  2021-05-21 17:53 ` Rafał Miłecki
  2021-05-21 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-05-21 17:46 UTC (permalink / raw)
  To: netdev
  Cc: zajec5, Florian Fainelli, Andrew Lunn, Vivien Didelot,
	Vladimir Oltean, David S. Miller, Jakub Kicinski,
	Rafał Miłecki, open list

We cannot call bcm_sf2_reg_rgmii_cntrl() for a port that is not RGMII,
yet we do that in bcm_sf2_sw_mac_link_up() irrespective of the port's
interface. Move that read until we have properly qualified the PHY
interface mode. This avoids triggering a warning on 7278 platforms that
have GMII ports.

Fixes: 55cfeb396965 ("net: dsa: bcm_sf2: add function finding RGMII register")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
David, Jakub, please queue this up for stable because the offnending
commit is already in 5.12, thanks!

 drivers/net/dsa/bcm_sf2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 9150038b60cb..3b018fcf4412 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -821,11 +821,9 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
 	bcm_sf2_sw_mac_link_set(ds, port, interface, true);
 
 	if (port != core_readl(priv, CORE_IMP0_PRT_ID)) {
-		u32 reg_rgmii_ctrl;
+		u32 reg_rgmii_ctrl = 0;
 		u32 reg, offset;
 
-		reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
-
 		if (priv->type == BCM4908_DEVICE_ID ||
 		    priv->type == BCM7445_DEVICE_ID)
 			offset = CORE_STS_OVERRIDE_GMIIP_PORT(port);
@@ -836,6 +834,7 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
 		    interface == PHY_INTERFACE_MODE_RGMII_TXID ||
 		    interface == PHY_INTERFACE_MODE_MII ||
 		    interface == PHY_INTERFACE_MODE_REVMII) {
+			reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
 			reg = reg_readl(priv, reg_rgmii_ctrl);
 			reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port
  2021-05-21 17:46 [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port Florian Fainelli
@ 2021-05-21 17:53 ` Rafał Miłecki
  2021-05-21 21:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2021-05-21 17:53 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: zajec5, Andrew Lunn, Vivien Didelot, Vladimir Oltean,
	David S. Miller, Jakub Kicinski, open list

On 21.05.2021 19:46, Florian Fainelli wrote:
> We cannot call bcm_sf2_reg_rgmii_cntrl() for a port that is not RGMII,
> yet we do that in bcm_sf2_sw_mac_link_up() irrespective of the port's
> interface. Move that read until we have properly qualified the PHY
> interface mode. This avoids triggering a warning on 7278 platforms that
> have GMII ports.
> 
> Fixes: 55cfeb396965 ("net: dsa: bcm_sf2: add function finding RGMII register")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Rafał Miłecki <rafal@milecki.pl>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port
  2021-05-21 17:46 [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port Florian Fainelli
  2021-05-21 17:53 ` Rafał Miłecki
@ 2021-05-21 21:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-21 21:20 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, zajec5, andrew, vivien.didelot, olteanv, davem, kuba,
	rafal, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Fri, 21 May 2021 10:46:14 -0700 you wrote:
> We cannot call bcm_sf2_reg_rgmii_cntrl() for a port that is not RGMII,
> yet we do that in bcm_sf2_sw_mac_link_up() irrespective of the port's
> interface. Move that read until we have properly qualified the PHY
> interface mode. This avoids triggering a warning on 7278 platforms that
> have GMII ports.
> 
> Fixes: 55cfeb396965 ("net: dsa: bcm_sf2: add function finding RGMII register")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port
    https://git.kernel.org/netdev/net/c/fc516d3a6aa2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-21 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-21 17:46 [PATCH net] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port Florian Fainelli
2021-05-21 17:53 ` Rafał Miłecki
2021-05-21 21:20 ` patchwork-bot+netdevbpf

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).