From: Greg KH <gregkh@linuxfoundation.org>
To: Asahi Lina <lina@asahilina.net>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
asahi@lists.linux.dev, "Finn Behrens" <me@kloenk.dev>,
"Sumera Priyadarsini" <sylphrenadin@gmail.com>
Subject: Re: [PATCH 3/3] rust: macros: Allow specifying multiple module aliases
Date: Fri, 24 Feb 2023 13:49:16 +0100 [thread overview]
Message-ID: <Y/iyTA3Nl5yZ/eMA@kroah.com> (raw)
In-Reply-To: <5220876d-f226-117a-d8ed-1d380cd3f14e@asahilina.net>
On Fri, Feb 24, 2023 at 09:41:08PM +0900, Asahi Lina wrote:
> 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...
How about just removing it so that people don't think it is something
that they really should be doing and adding real MODULE_DEVICE_TABLE()
support instead?
Although the first filesystem that gets written will need the
MODULE_ALIAS() logic added back, oh well.
Anyway, no objection for me for this for now, just trying to point out
that drivers really should not be using MODULE_ALIAS() at all.
thanks,
greg k-h
next prev parent reply other threads:[~2023-02-24 12:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 7:25 [PATCH 0/3] rust: Miscellaneous macro improvements Asahi Lina
2023-02-24 7:25 ` [PATCH 1/3] rust: macros: Make expect_punct() return the Punct directly Asahi Lina
2023-02-25 0:29 ` Gary Guo
2023-02-28 9:29 ` Finn Behrens
2023-03-01 17:16 ` Vincenzo Palazzo
2023-02-24 7:25 ` [PATCH 2/3] rust: macros: concat_idents: Allow :: paths in the first argument Asahi Lina
2023-02-25 0:31 ` Gary Guo
2023-03-07 20:22 ` Miguel Ojeda
2023-03-08 20:57 ` Miguel Ojeda
2023-03-01 17:18 ` Vincenzo Palazzo
2023-02-24 7:25 ` [PATCH 3/3] rust: macros: Allow specifying multiple module aliases Asahi Lina
2023-02-24 7:38 ` Greg KH
2023-02-24 12:41 ` Asahi Lina
2023-02-24 12:49 ` Greg KH [this message]
2023-03-01 17:19 ` Vincenzo Palazzo
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=Y/iyTA3Nl5yZ/eMA@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alex.gaynor@gmail.com \
--cc=asahi@lists.linux.dev \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=lina@asahilina.net \
--cc=linux-kernel@vger.kernel.org \
--cc=me@kloenk.dev \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sylphrenadin@gmail.com \
--cc=wedsonaf@gmail.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
all inboxes | Powered by JetHome®