mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports
@ 2020-09-16 10:08 Matthias Schiffer
  2020-09-16 10:33 ` Codrin.Ciubotariu
  2020-09-17  0:47 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Matthias Schiffer @ 2020-09-16 10:08 UTC (permalink / raw)
  To: Woojung Huh, Microchip Linux Driver Support, Andrew Lunn,
	Vivien Didelot, Florian Fainelli
  Cc: David S. Miller, Jakub Kicinski, Codrin Ciubotariu, netdev,
	linux-kernel, Matthias Schiffer

The KSZ9477 and KSZ8795 use the port_cnt field differently: For the
KSZ9477, it includes the CPU port(s), while for the KSZ8795, it doesn't.

It would be a good cleanup to make the handling of both drivers match,
but as a first step, fix the recently broken assignment of num_ports in
the KSZ8795 driver (which completely broke probing, as the CPU port
index was always failing the num_ports check).

Fixes: af199a1a9cb0 ("net: dsa: microchip: set the correct number of
ports")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
 drivers/net/dsa/microchip/ksz8795.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index f7d59d7b2cbe..f5779e152377 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -1260,7 +1260,7 @@ static int ksz8795_switch_init(struct ksz_device *dev)
 	}
 
 	/* set the real number of ports */
-	dev->ds->num_ports = dev->port_cnt;
+	dev->ds->num_ports = dev->port_cnt + 1;
 
 	return 0;
 }
-- 
2.17.1


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

* Re: [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports
  2020-09-16 10:08 [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports Matthias Schiffer
@ 2020-09-16 10:33 ` Codrin.Ciubotariu
  2020-09-17  0:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Codrin.Ciubotariu @ 2020-09-16 10:33 UTC (permalink / raw)
  To: matthias.schiffer, Woojung.Huh, UNGLinuxDriver, andrew,
	vivien.didelot, f.fainelli
  Cc: davem, kuba, netdev, linux-kernel

On 16.09.2020 13:08, Matthias Schiffer wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The KSZ9477 and KSZ8795 use the port_cnt field differently: For the
> KSZ9477, it includes the CPU port(s), while for the KSZ8795, it doesn't.
> 
> It would be a good cleanup to make the handling of both drivers match,
> but as a first step, fix the recently broken assignment of num_ports in
> the KSZ8795 driver (which completely broke probing, as the CPU port
> index was always failing the num_ports check).
> 
> Fixes: af199a1a9cb0 ("net: dsa: microchip: set the correct number of
> ports")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---

Sorry about this. I assumed consistency between the two drivers.

Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>

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

* Re: [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports
  2020-09-16 10:08 [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports Matthias Schiffer
  2020-09-16 10:33 ` Codrin.Ciubotariu
@ 2020-09-17  0:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-09-17  0:47 UTC (permalink / raw)
  To: matthias.schiffer
  Cc: woojung.huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
	kuba, codrin.ciubotariu, netdev, linux-kernel

From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Date: Wed, 16 Sep 2020 12:08:39 +0200

> The KSZ9477 and KSZ8795 use the port_cnt field differently: For the
> KSZ9477, it includes the CPU port(s), while for the KSZ8795, it doesn't.
> 
> It would be a good cleanup to make the handling of both drivers match,
> but as a first step, fix the recently broken assignment of num_ports in
> the KSZ8795 driver (which completely broke probing, as the CPU port
> index was always failing the num_ports check).
> 
> Fixes: af199a1a9cb0 ("net: dsa: microchip: set the correct number of
> ports")

Please do not a tag into multiple lines.  Especially do not do this
with Fixes tags as people will do string matching on it.

> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

Applied and queued up for -stable.

Thanks.

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

end of thread, other threads:[~2020-09-17  0:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 10:08 [PATCH net] net: dsa: microchip: ksz8795: really set the correct number of ports Matthias Schiffer
2020-09-16 10:33 ` Codrin.Ciubotariu
2020-09-17  0:47 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®