lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b304af68-7ce1-49b5-ab62-5473970e618f@kernel.org>
Date: Mon, 20 Nov 2023 15:07:16 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Luiz Angelo Daros de Luca <luizluca@...il.com>, netdev@...r.kernel.org,
 linus.walleij@...aro.org, alsi@...g-olufsen.dk, andrew@...n.ch,
 f.fainelli@...il.com, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, pabeni@...hat.com, arinc.unal@...nc9.com
Subject: Re: [net-next 2/2] net: dsa: realtek: load switch variants on demand

On 20/11/2023 14:48, Vladimir Oltean wrote:
> Hi Krzysztof,
> 
> On Mon, Nov 20, 2023 at 10:20:13AM +0100, Krzysztof Kozlowski wrote:
>> No, why do you need it? You should not need MODULE_ALIAS() in normal
>> cases. If you need it, usually it means your device ID table is wrong
>> (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is
>> not a substitute for incomplete ID table.
>>
>> Entire abstraction/macro is pointless and make the code less readable.
> 
> Are you saying that the line
> 
> MODULE_DEVICE_TABLE(of, realtek_common_of_match);
> 
> should be put in all of realtek-mdio.c, realtek-smi.c, rtl8365mb.c and
> rtl8366rb.c, but not in realtek-common.c?

Driver should use MODULE_DEVICE_TABLE() for the table not MODULE_ALIAS()
for each entry. I don't judge where should it be put. I just dislike
usage of aliases as a incomplete-substitute of proper table.

> 
> There are 5 kernel modules involved, 2 for interfaces and 2 for switches.
> 
> Even if the same OF device ID table could be used to load multiple
> modules, I'm not sure
> (a) how to avoid loading the interface driver which will not be used
>     (SMI if it's a MDIO-connected switch, or MDIO if it's an SMI
>     connected switch)
> (b) how to ensure that the drivers are loaded in the right order, i.e.
>     the switch drivers are loaded before the interface drivers

I am sorry, I do not understand the problem. The MODULE_DEVICE_TABLE and
MODULE_ALIAS create exactly the same behavior. How any of above would
happen with table but not with alias having exactly the same compatibles?

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ