Re: [PATCH net-next] dsa: sja1105: fix reverse dependency

From: Vladimir Oltean
Date: Thu Aug 05 2021 - 07:49:53 EST


On Thu, Aug 05, 2021 at 01:39:34PM +0200, Arnd Bergmann wrote:
> Do you have any opinion on whether that 'select' going the other way is still
> relevant?

Yes, of course it is. It also has nothing to do with build dependencies.
With the original DSA design from 2008, an Ethernet switch has separate
drivers for
(a) accessing its registers
(b) manipulating the packets that the switch sends towards a host
Ethernet controller ("DSA master")

The register access drivers are in drivers/net/dsa/*, the packet
manipulation ("tagging protocol") drivers are in net/dsa/tag_*.c.

[ This is because it was originally thought that a "tagging protocol" is
completely stateless and you should never need to access a hardware
register when manipulating a packet. ]

When you enable a driver for a switch, you absolutely want to ping
through it too, so all register access drivers enable the tagging
protocol driver specific to their hardware as well, using 'select'.
This works just fine because tagging protocol drivers generally have no
dependencies, or if they do, the register access driver inherits them too.
So a user does not need to manually enable the tagging protocol driver.