netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
To: netdev@vger.kernel.org
Cc: linus.walleij@linaro.org, alsi@bang-olufsen.dk, andrew@lunn.ch,
	f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	arinc.unal@arinc9.com
Subject: [PATCH net-next 0/7] net: dsa: realtek: variants to drivers, interfaces to a common module
Date: Fri,  8 Dec 2023 01:41:36 -0300	[thread overview]
Message-ID: <20231208045054.27966-1-luizluca@gmail.com> (raw)

The current driver comprises two interface modules (SMI and MDIO) and two family/variant modules (RTL8365MB and RTL8366RB). The SMI and MDIO modules are, respectively, the platform and MDIO drivers that call functions from the variant modules. In this scenario, one interface module can be loaded independently from the other one, but both variants, if not disabled at build time, must be loaded for any type of interface. This approach does not scale well, particularly with the addition of more switch variants (e.g., RTL8366B), resulting in loaded but unused modules. This also seems to be upside down, as the specific driver code normally depends on the more generic functions and not the other way around.

The series starts with two preliminary patches. The first just cleans an unused function declaration until someone actually references it. The second one moves the of_node_put from the driver remove to just after it was used. We don't really need to keep a reference for that node after the MDIO was registered.

Each variant module was converted into real drivers, both as 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 module is also reversed. Now the variant module calls interface functions, depending on both interface modules (if not disabled at build time). Although probably in all devices only one interface will be used, the interface code is multiple times smaller than a variant module, using much fewer resources than the previous code. With variant modules as real drivers, the compatible strings are published only in a single variant module, avoiding conflicts.

The patch series also introduces a new common module for functions used by both variants. This module also incorporates the two previous interface modules as they will always be loaded anyway.

Finally, the series moves the user MII driver from realtek-smi to common. It is now also used by MDIO-connected switches instead of the generic DSA driver.

In the end, the driver relation is simpler, with a common module and multiple independent variant modules, and we require much fewer resources.

Tested with an RTL8367S (RTL8365MB) using MDIO interface and an RTL8366RB (RTL8366) with SMI interface.

--

Luiz


             reply	other threads:[~2023-12-08  4:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  4:41 Luiz Angelo Daros de Luca [this message]
2023-12-08  4:41 ` [PATCH net-next 1/7] net: dsa: realtek: drop cleanup from realtek_priv Luiz Angelo Daros de Luca
2023-12-08  9:49   ` Alvin Šipraga
2023-12-08  4:41 ` [PATCH net-next 2/7] net: dsa: realtek: put of node after MDIO registration Luiz Angelo Daros de Luca
2023-12-08  5:13   ` Luiz Angelo Daros de Luca
2023-12-08  9:49     ` Alvin Šipraga
2023-12-08 18:05       ` Luiz Angelo Daros de Luca
2023-12-11 17:11         ` Vladimir Oltean
2023-12-12  3:47           ` Luiz Angelo Daros de Luca
2023-12-12 21:58             ` Vladimir Oltean
2023-12-13  4:37               ` Luiz Angelo Daros de Luca
2023-12-13 13:04                 ` Vladimir Oltean
2023-12-16  4:26                   ` Luiz Angelo Daros de Luca
2023-12-08  4:41 ` [PATCH net-next 3/7] net: dsa: realtek: convert variants into a real driver Luiz Angelo Daros de Luca
2023-12-08 10:23   ` Alvin Šipraga
2023-12-08  4:41 ` [PATCH net-next 4/7] net: dsa: realtek: create realtek-common Luiz Angelo Daros de Luca
2023-12-08  5:01   ` Luiz Angelo Daros de Luca
2023-12-08 10:52   ` Alvin Šipraga
2023-12-11  5:02     ` Luiz Angelo Daros de Luca
2023-12-11  9:44       ` Alvin Šipraga
2023-12-08 14:02   ` Alvin Šipraga
2023-12-11  5:02     ` Luiz Angelo Daros de Luca
2023-12-11  9:24       ` Alvin Šipraga
2023-12-11 17:19         ` Vladimir Oltean
2023-12-08  4:41 ` [PATCH net-next 5/7] net: dsa: realtek: merge interface modules into common Luiz Angelo Daros de Luca
2023-12-08 10:57   ` Alvin Šipraga
2023-12-11  5:13     ` Luiz Angelo Daros de Luca
2023-12-11  9:25       ` Alvin Šipraga
2023-12-08  4:41 ` [PATCH net-next 6/7] net: dsa: realtek: migrate user_mii setup to common Luiz Angelo Daros de Luca
2023-12-08 11:05   ` Alvin Šipraga
2023-12-11  5:16     ` Luiz Angelo Daros de Luca
2023-12-08  4:41 ` [PATCH net-next 7/7] net: dsa: realtek: always use the realtek user mdio driver Luiz Angelo Daros de Luca
2023-12-08 11:06   ` Alvin Šipraga
2023-12-11  5:29     ` Luiz Angelo Daros de Luca

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=20231208045054.27966-1-luizluca@gmail.com \
    --to=luizluca@gmail.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).