Any plans to submit realtek target drivers to mainline Linux?

Luiz Angelo Daros de Luca luizluca at
Sun May 7 07:56:59 PDT 2023

Em sáb., 6 de mai. de 2023 06:12, Arınç ÜNAL <arinc.unal at> escreveu:
> Hi.

Hi Arinç,

> I see a lot of development on the network drivers like DSA, PHY, etc.
> Are there any plans to put all these drivers on the realtek target on
> mainline Linux? To fully support these SoCs on mainline Linux?
> Arınç

I'm a minor contributor to the DSA driver for the realtek target, but
I have my 2 cents to share. I believe we can start to enlist what
would be needed to get the drivers upstream. We can start the
discussion from there:

- The DSA driver uses a lot of magic numbers that would not be
accepted by the upstream kernel. They must be converted into macros,
enum, inline functions and friends.
- There are shared functions with internal conditions (if modelA then
...). Mixed with magic numbers, it is much easier to miss a
peculiarity about a subtarget and introduce bugs. A nice way to avoid
that is to convert them into indirect calls to subtarget functions
- The driver uses hardcoded addresses and direct memory writes. I
don't know if there is anything incompatible but upstream drivers
normally use regmap. It will also clean up a lot of things and
introduce nice functions.
- The DSA driver uses a generic tag that is converted afterwards by
each (ethernet?) driver into its CPU tag. The DSA taggers were
designed to decouple CPU tag from ethernet driver logic and upstream
maintainters might ask to implement each CPU tagger as a proper DSA
tag. Although it might not make sense to have an ethernet driver
without a tag in this target, it would get closer to how outer drivers
work and make it easier to understand the driver.



More information about the openwrt-devel mailing list