]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Merge branch 'dsa-realtek-common'
authorDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2024 10:42:17 +0000 (10:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2024 10:42:17 +0000 (10:42 +0000)
commit08f627164126101c823c68589e306d196d7b87f2
tree87e1fd4f2a788aa67a554e0619f8bda518fc8ca3
parent0918c1dcd55cfe3b8f9844731dc68eee948c9f92
parent9fc469b2943d9b1ff2a7800f823e7cd7a5cac0ca
Merge branch 'dsa-realtek-common'

Luiz Angelo Daros de Luca says:

====================
net: dsa: realtek: variants to drivers, interfaces to a common module

The current driver consists of two interface modules (SMI and MDIO) and
two family/variant modules (RTL8365MB and RTL8366RB). The SMI and MDIO
modules serve as the platform and MDIO drivers, respectively, calling
functions from the variant modules. In this setup, one interface module
can be loaded independently of the other, but both variants must be
loaded (if not disabled at build time) for any type of interface. This
approach doesn't scale well, especially with the addition of more switch
variants (e.g., RTL8366B), leading to loaded but unused modules.
Additionally, this also seems upside down, as the specific driver code
normally depends on the more generic functions and not the other way
around.

Each variant module was converted into real drivers, serving as both a
platform driver (for switches connected using the SMI interface) and an
MDIO driver (for MDIO-connected switches). The relationship between the
variant and interface modules is reversed, with the variant module now
calling both interface functions (if not disabled at build time). While
in most devices only one interface is likely used, the interface code is
significantly smaller than a variant module, consuming fewer resources
than the previous code. With variant modules now functioning as real
drivers, compatible strings are published only in a single variant
module, preventing conflicts.

The patch series introduces a new common module for functions shared by
both variants. This module also absorbs the two previous interface
modules, as they would always be loaded anyway.

The series relocates the user MII driver from realtek-smi to rtl83xx. It
is now used by MDIO-connected switches instead of the generic DSA
driver. There's a change in how this driver locates the MDIO node. It
now only searches for a child node named "mdio".

The dsa_switch in realtek_priv->ds is now embedded in the struct. It is
always in use and avoids dynamic memory allocation.

Testing has been performed with an RTL8367S (rtl8365mb) using MDIO
interface and an RTL8366RB (rtl8366) with SMI interface.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>