Re: [PATCH net-next v6 1/9] net: dsa: microchip: Add support for KSZ8463 global irq
From: Bastien Curutchet
Date: Wed Mar 11 2026 - 12:58:55 EST
On 3/11/26 2:56 PM, Vladimir Oltean wrote:
On Wed, Mar 11, 2026 at 01:53:38PM +0100, Bastien Curutchet wrote:
On 3/11/26 12:53 PM, Vladimir Oltean wrote:
On Wed, Mar 11, 2026 at 11:02:35AM +0100, Bastien Curutchet wrote:
I, more or less, managed to fit this PTP support in the current framework,
but the next series I prepared to add periodic output support is full of
is_ksz8463() branches. So I think that I'll go with what you suggested and
try to move the KSZ8463 support in the ksz8995.c driver. It will probably be
cleaner this way.
TBH I'm a bit lost with all these KSZ variants but IIUC KSZ8463 and KSZ8995
both belong to the 'old generation' of the hardware. Maybe a good split
would be to have these old switches in the ksz8995.c driver and keep the
rest under ksz_common infra.
Wait, to make sure I understand, you said you're going to rebase this
series onto the ksz8995 driver?
Well I'll first add basic support for the KSZ8463 in the ksz8995 driver and
then add interrupt and PTP support on top of it yes. Did I misunderstand
you're suggestion ?
If we're splitting drivers, I would like to see them grouped by actual similarity,
so as to not repeat the same mistakes.
I took a random feature, user port separation, and I'm comparing how Linus
implemented it in ksz8995:
https://lore.kernel.org/netdev/20260219-ks8995-fixups-v3-5-a7fc63fe1916@xxxxxxxxxx/
vs the register map from KSZ8463:
https://www.microchip.com/en-us/product/ksz8463#Documentation
I took a look at the register maps from both datasheets. Registers aren't always at the same address and some bits differ here and there but following areas look very similar:
- global control
- port control
- TOS priority
- MAC address config
- Indirect access
- Data rate limit
Apart from some funky naming differences (KS8995_REG_PC1 corresponds to
"PORT 1 CONTROL REGISTER 2"), it should be pretty similar, right? Do you
see some differences requiring major surgery in ks8995?
The biggest difference I see is the way KSZ8463 accesses the registers through SPI. It uses byte enable bits in the command word that don't exist on the other switches.
Apart from the obvious incompleteness, of course. That driver currently
reports DSA_TAG_PROTO_NONE. It will have to return DSA_TAG_PROTO_KS8995
for ks8995:
https://lore.kernel.org/netdev/20260107-ks8995-dsa-tagging-v1-1-1a92832c1540@xxxxxxxxxx/
and DSA_TAG_PROTO_KSZ9893 for your KSZ8463. Right?
Yes.
In the end, it feels OK to me to migrate KSZ8463 into ksz8863.c but it's hard to know for sure before actually doing it.