All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
@ 2023-03-19 14:02 Marek Behún
  2023-03-19 14:40 ` Klaus Kudielka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marek Behún @ 2023-03-19 14:02 UTC (permalink / raw)
  To: netdev
  Cc: Jakub Kicinski, Vladimir Oltean, Klaus Kudielka,
	Florian Fainelli, Marek Behún

Commit 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing
phys during probing") added non-trivial bus->phy_mask in
mv88e6xxx_mdio_register() in order to avoid excessive mdio bus
transactions during probing.

But the mask is incorrect for switches with non-zero phy_base_addr (such
as 88E6341).

Fix this.

Fixes: 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing phys during probing")
Signed-off-by: Marek Behún <kabel@kernel.org>
---
I was unable to test this now, so this change needs testing.
---
 drivers/net/dsa/mv88e6xxx/chip.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 260e38c5c6e6..b73d1d6747b7 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3805,7 +3805,9 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
 	bus->read_c45 = mv88e6xxx_mdio_read_c45;
 	bus->write_c45 = mv88e6xxx_mdio_write_c45;
 	bus->parent = chip->dev;
-	bus->phy_mask = GENMASK(31, mv88e6xxx_num_ports(chip));
+	bus->phy_mask = ~GENMASK(chip->info->phy_base_addr +
+				 mv88e6xxx_num_ports(chip) - 1,
+				 chip->info->phy_base_addr);
 
 	if (!external) {
 		err = mv88e6xxx_g2_irq_mdio_setup(chip, bus);
-- 
2.39.2


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

* Re: [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
  2023-03-19 14:02 [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member Marek Behún
@ 2023-03-19 14:40 ` Klaus Kudielka
  2023-03-19 17:53 ` Vladimir Oltean
  2023-03-21 12:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Klaus Kudielka @ 2023-03-19 14:40 UTC (permalink / raw)
  To: Marek Behún, netdev
  Cc: Jakub Kicinski, Vladimir Oltean, Florian Fainelli

On Sun, 2023-03-19 at 15:02 +0100, Marek Behún wrote:
> Commit 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing
> phys during probing") added non-trivial bus->phy_mask in
> mv88e6xxx_mdio_register() in order to avoid excessive mdio bus
> transactions during probing.
> 
> But the mask is incorrect for switches with non-zero phy_base_addr (such
> as 88E6341).
> 
> Fix this.
> 
> Fixes: 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing phys during probing")
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
> I was unable to test this now, so this change needs testing.

Thanks for spotting.
I can only test this on Turris Omnia with 88E6176.
All 5 ports Ok, phy probe time unchanged.

Tested-by: Klaus Kudielka <klaus.kudielka@gmail.com>

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

* Re: [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
  2023-03-19 14:02 [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member Marek Behún
  2023-03-19 14:40 ` Klaus Kudielka
@ 2023-03-19 17:53 ` Vladimir Oltean
  2023-03-21 12:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2023-03-19 17:53 UTC (permalink / raw)
  To: Marek Behún; +Cc: netdev, Jakub Kicinski, Klaus Kudielka, Florian Fainelli

On Sun, Mar 19, 2023 at 03:02:38PM +0100, Marek Behún wrote:
> Commit 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing
> phys during probing") added non-trivial bus->phy_mask in
> mv88e6xxx_mdio_register() in order to avoid excessive mdio bus
> transactions during probing.
> 
> But the mask is incorrect for switches with non-zero phy_base_addr (such
> as 88E6341).
> 
> Fix this.
> 
> Fixes: 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing phys during probing")
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
> I was unable to test this now, so this change needs testing.

You should be able to test it if you remove the phy-handles and the mdio
subnode from the device tree.

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

* Re: [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
  2023-03-19 14:02 [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member Marek Behún
  2023-03-19 14:40 ` Klaus Kudielka
  2023-03-19 17:53 ` Vladimir Oltean
@ 2023-03-21 12:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-21 12:10 UTC (permalink / raw)
  To: =?utf-8?q?Marek_Beh=C3=BAn_=3Ckabel=40kernel=2Eorg=3E?=
  Cc: netdev, kuba, olteanv, klaus.kudielka, f.fainelli

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 19 Mar 2023 15:02:38 +0100 you wrote:
> Commit 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing
> phys during probing") added non-trivial bus->phy_mask in
> mv88e6xxx_mdio_register() in order to avoid excessive mdio bus
> transactions during probing.
> 
> But the mask is incorrect for switches with non-zero phy_base_addr (such
> as 88E6341).
> 
> [...]

Here is the summary with links:
  - [net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
    https://git.kernel.org/netdev/net-next/c/a4926c2943dd

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] 4+ messages in thread

end of thread, other threads:[~2023-03-21 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-19 14:02 [PATCH net-next] net: dsa: mv88e6xxx: fix mdio bus' phy_mask member Marek Behún
2023-03-19 14:40 ` Klaus Kudielka
2023-03-19 17:53 ` Vladimir Oltean
2023-03-21 12:10 ` patchwork-bot+netdevbpf

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.