public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Woojung.Huh@microchip.com, UNGLinuxDriver@microchip.com,
	andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
	horms@kernel.org, pascal.eberhard@se.com,
	miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	maxime.chevallier@bootlin.com, Tristram.Ha@microchip.com
Subject: Re: [PATCH net-next v6 1/9] net: dsa: microchip: Add support for KSZ8463 global irq
Date: Wed, 11 Mar 2026 11:02:35 +0100	[thread overview]
Message-ID: <dde60639-af13-4653-9a34-38c4bd98b149@bootlin.com> (raw)
In-Reply-To: <20260309205401.bk5fpw6kqnmlktbu@skbuf>

On 3/9/26 9:54 PM, Vladimir Oltean wrote:
> On Mon, Mar 09, 2026 at 01:54:28PM +0100, Bastien Curutchet wrote:
>> I have a new iteration ready. It uses only the high byte of the interrupt
>> registers for the KSZ8463, which keeps unchanged the current 8-bit accesses
>> logic.
>>
>> Shall I send it ? Or would you like more time to think/discuss about whether
>> we should split ksz_common into several drivers ?
> 
> "Send it", you mean on Thursday after the weekly 'net' -> 'net-next'
> merge so it doesn't conflict with your "net: dsa: microchip: Fix error
> path in PTP IRQ setup" change, right?
> 
> I don't know. I have to say that I may be partly responsible for guiding
> Arun Ramadoss a few years ago towards unifying all ksz_switch drivers
> under a single dsa_switch_ops, and that doesn't seem to have been a
> great move, given their amount of differences.
> 
> Prior to Arun Ramadoss' refactoring such that lan937x could come in and
> make use of ksz9477 code, we had two distinct core drivers: ksz8795.c
> and ksz9477.c.  Having checked out an old kernel before his changes,
> I'm not sure why I was so blinded by all the false code sharing hidden
> behind dev_ops that was already there.  If you factor out the MIB worker
> thread and other inconsequential small driver things like that, they're
> perfectly separate hardware architectures which could use perfectly
> isolated drivers with only minimal duplication, and we possibly wouldn't
> even need the 8/16/32 regmap tables.
> 
> "Resources global in one family and per-port in another" is a recurring
> theme, and the inability to have clearly distinct code paths that handle
> these clearly distinct hardware architectures is a problem. I'm not sure
> of the extent to which I was aware of it when making those suggestions
> to Arun. I can recall this thread that indicates a still unsolved, to
> this day, problem which was caused by the desire to have a unified driver:
> https://patchwork.kernel.org/project/netdevbpf/patch/20230316161250.3286055-3-vladimir.oltean@nxp.com/
> > I don't have a good plan, but the current state of affairs is not your
> fault, and I don't want it to stop you from making progress with the
> KSZ8463 PTP support. Maybe we can continue discussing a clean line for a
> KSZ8 (and maybe even KSZ8463) split where the code duplication would be
> minimal, with further input from Tristram.

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.


Best regards,
BAstein



  reply	other threads:[~2026-03-11 10:02 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 10:18 [PATCH net-next v6 0/9] net: dsa: microchip: Add PTP support for the KSZ8463 Bastien Curutchet (Schneider Electric)
2026-03-04 10:18 ` [PATCH net-next v6 1/9] net: dsa: microchip: Add support for KSZ8463 global irq Bastien Curutchet (Schneider Electric)
2026-03-05  9:56   ` Vladimir Oltean
2026-03-05 12:39     ` Bastien Curutchet
2026-03-05 12:51       ` Vladimir Oltean
2026-03-05 14:45         ` Bastien Curutchet
2026-03-06  1:10           ` Tristram.Ha
2026-03-06  9:03             ` Bastien Curutchet
2026-03-09 12:54             ` Bastien Curutchet
2026-03-09 20:54               ` Vladimir Oltean
2026-03-11 10:02                 ` Bastien Curutchet [this message]
2026-03-11 11:53                   ` Vladimir Oltean
2026-03-11 12:53                     ` Bastien Curutchet
2026-03-11 13:56                       ` Vladimir Oltean
2026-03-11 16:58                         ` Bastien Curutchet
2026-03-11 18:24                           ` Andrew Lunn
2026-03-11 21:24                           ` Vladimir Oltean
2026-03-12 18:28                             ` Bastien Curutchet
2026-03-13  2:05                               ` Tristram.Ha
2026-03-13  2:17                                 ` Tristram.Ha
2026-03-12  0:14                           ` Tristram.Ha
2026-03-12 13:45                             ` Vladimir Oltean
2026-03-13 15:38                               ` Vladimir Oltean
2026-03-13 17:29                                 ` Tristram.Ha
2026-03-18  9:26                                   ` Bastien Curutchet
2026-03-18 14:02                                     ` Vladimir Oltean
2026-03-04 10:18 ` [PATCH net-next v6 2/9] net: dsa: microchip: Decorrelate IRQ domain from port Bastien Curutchet (Schneider Electric)
2026-03-05 10:07   ` Vladimir Oltean
2026-03-06  9:18     ` Bastien Curutchet
2026-03-04 10:18 ` [PATCH net-next v6 3/9] net: dsa: microchip: Decorrelate msg_irq index from IRQ bit offset Bastien Curutchet (Schneider Electric)
2026-03-04 10:18 ` [PATCH net-next v6 4/9] net: dsa: microchip: Add support for KSZ8463's PTP interrupts Bastien Curutchet (Schneider Electric)
2026-03-05 10:19   ` Vladimir Oltean
2026-03-06  9:29     ` Bastien Curutchet
2026-03-04 10:18 ` [PATCH net-next v6 5/9] net: dsa: tag_ksz: Share code for KSZ8795 and KSZ9893 xmit operations Bastien Curutchet (Schneider Electric)
2026-03-04 10:18 ` [PATCH net-next v6 6/9] net: dsa: microchip: Add KSZ8463 tail tag handling Bastien Curutchet (Schneider Electric)
2026-03-04 10:18 ` [PATCH net-next v6 7/9] net: dsa: microchip: Explicitly enable detection of L2 PTP frames Bastien Curutchet (Schneider Electric)
2026-03-04 10:18 ` [PATCH net-next v6 8/9] net: dsa: microchip: Adapt port offset for KSZ8463's PTP register Bastien Curutchet (Schneider Electric)
2026-03-04 10:19 ` [PATCH net-next v6 9/9] net: dsa: microchip: Add two-step PTP support for KSZ8463 Bastien Curutchet (Schneider Electric)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dde60639-af13-4653-9a34-38c4bd98b149@bootlin.com \
    --to=bastien.curutchet@bootlin.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=pascal.eberhard@se.com \
    --cc=richardcochran@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox