[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5220876d-f226-117a-d8ed-1d380cd3f14e@asahilina.net>
Date: Fri, 24 Feb 2023 21:41:08 +0900
From: Asahi Lina <lina@...hilina.net>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
asahi@...ts.linux.dev, Finn Behrens <me@...enk.dev>,
Sumera Priyadarsini <sylphrenadin@...il.com>
Subject: Re: [PATCH 3/3] rust: macros: Allow specifying multiple module
aliases
On 24/02/2023 16.38, Greg KH wrote:
> On Fri, Feb 24, 2023 at 04:25:57PM +0900, Asahi Lina wrote:
>> Modules can (and usually do) have multiple alias tags, in order to
>> specify multiple possible device matches for autoloading. Allow this by
>> changing the alias ModuleInfo field to an Option<Vec<String>>.
>
> Note, manually specifying the MODULE_ALIAS is only really ever done for
> platform drivers today (and I would argue we need to fix that up),
> otherwise the use of MODULE_DEVICE_TABLE() should really really be used
> instead of having to manually specify aliases.
That's the plan, I just added this before adding support for
MODULE_DEVICE_TABLE() when I first realized that it wasn't yet in there!
We were briefly hardcoding the bus aliases for downstream kernels
because the depmod stuff couldn't work with the way device ID tables
were done in Rust downstream at the time (and I only noticed the first
time I tried to build it as a module, since I always develop with
monolithic kernels). That's fixed now ^^
However, the issue is that right now the module macro already takes a
single optional alias, and that doesn't make sense as an API. We could
remove support for this entirely (if I get my Rust MODULE_DEVICE_TABLE()
implementation in, there will be zero users of the alias argument as far
as I know), or add support for multiple aliases. But I think just
leaving it as a single alias doesn't really make sense? It doesn't
represent the way module aliases work, which is 0..N.
I'm fine with removing it if people prefer that, I just thought that for
something as basic as module metadata we might as well do it properly
even if there are no users right now, since it's already half in there...
~~ Lina
Powered by blists - more mailing lists