From: "Danilo Krummrich" <dakr@kernel.org>
To: "Gary Guo" <gary@garyguo.net>
Cc: "Alice Ryhl" <aliceryhl@google.com>, <gregkh@linuxfoundation.org>,
<rafael@kernel.org>, <acourbot@nvidia.com>,
<david.m.ertman@intel.com>, <ira.weiny@intel.com>,
<leon@kernel.org>, <ojeda@kernel.org>, <boqun@kernel.org>,
<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
<a.hindborg@kernel.org>, <tmgross@umich.edu>,
<driver-core@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] rust: auxiliary: add registration data to auxiliary devices
Date: Mon, 11 May 2026 16:53:47 +0200 [thread overview]
Message-ID: <DIFXM2N21Q5J.2RIYLU11C5FR6@kernel.org> (raw)
In-Reply-To: <DIFBME3GXDC0.14UHJTPD6TTAE@kernel.org>
On Sun May 10, 2026 at 11:39 PM CEST, Danilo Krummrich wrote:
> Technically, this would be an additional driver match criteria, i.e. the name
> string in struct auxiliary_device_id *and* the asserted type of the parent's
> registration data must match.
>
> Given that drivers can match against multiple entries in the auxiliary_device_id
> table, we must consider that they can have different registration data types
> (depending on the specific parent driver that exposed the auxiliary device).
>
> Thus, I don't think we can solve this without a runtime dispatch (over all types
> that would need to be listed in the ID table) anyway; and having this dispatch
> in the child driver - essentially leaking an implementation detail of each of
> the parents into the child - does not seem to add any value; quite the opposite
> unfortunately.
>
> (OOC, I hacked up the statically typed version -- I think it turns out OK,
> despite the fact that it still leaks the parent's registration private data type
> to the child, which I dislike, plus a few hiccups with the generic device
> context infrastructure. But as mentioned, I don't think that's an option in the
> first place.)
One additional note: It would however be possible to support this as an
additional special case (it is special implementation wise, but usage wise it is
the common case) when there's only a single entry in the match table, and
otherwise provide the option to fall back on the existing runtime dispatch.
That said, I'm still not convinced about exposing the type and whether it is
worth the extra complexity on the child driver side, but I'd also like to
further consider it as a potential subsequent improvement.
The draft implementation I mentioned previously can be found in [1]; it is based
on top of the HRT rework, as it provides a much better picture of how it turns
out eventually.
For now, I'll pick this up as is.
Thanks,
Danilo
[1] https://git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/log/?h=poc/aux-typed
next prev parent reply other threads:[~2026-05-11 14:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 15:23 [PATCH v2 0/3] rust: auxiliary: replace drvdata() with registration data Danilo Krummrich
2026-05-05 15:23 ` [PATCH v2 1/3] rust: alloc: add Box::zeroed() Danilo Krummrich
2026-05-05 15:48 ` Alice Ryhl
2026-05-05 20:04 ` Danilo Krummrich
2026-05-05 20:06 ` Gary Guo
2026-05-05 20:10 ` Danilo Krummrich
2026-05-05 15:23 ` [PATCH v2 2/3] rust: auxiliary: add registration data to auxiliary devices Danilo Krummrich
2026-05-06 12:42 ` Alice Ryhl
2026-05-06 13:41 ` Gary Guo
2026-05-10 21:39 ` Danilo Krummrich
2026-05-11 14:53 ` Danilo Krummrich [this message]
2026-05-05 15:23 ` [PATCH v2 3/3] rust: driver core: remove drvdata() and driver_type Danilo Krummrich
2026-05-11 15:36 ` [PATCH v2 0/3] rust: auxiliary: replace drvdata() with registration data Danilo Krummrich
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=DIFXM2N21Q5J.2RIYLU11C5FR6@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=david.m.ertman@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=driver-core@lists.linux.dev \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nova-gpu@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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