mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: "Nick Dowsett" <nick42d@gmail.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2 3/4] rust: wmi: add Driver trait, Adapter and implement RegistrationOps
Date: Fri, 4 Dec 2026 21:41:01 +0100	[thread overview]
Message-ID: <89f8811d-e7ed-4c62-9e36-c31c00c7c1c9@gmx.de> (raw)
In-Reply-To: <DN7B2PKZDT3G.1I3G9XA75R5O0@gmail.com>

Am 29.11.26 um 02:32 schrieb Nick Dowsett:
> Hi Armin,
> 
> Thanks for taking a look.
> 
>>> +// SAFETY: It's always valid to unregister a registered `wmi_driver`.
>>> +unsafe impl<T: Driver> driver::RegistrationOps for Adapter<T> {
>>> +    unsafe fn register(
>>> +        reg: &Opaque<Self::DriverType>,
>>> +        name: &'static CStr,
>>> +        module: &'static ThisModule,
>>> +    ) -> Result {
>>> +        // SAFETY:
>>> +        // - It's safe to set the fields of `wmi_driver` on initialization.
>>> +        // - All set fields meet the invariants of `wmi_driver`.
>>> +        unsafe {
>>> +            // SAFETY: `name` is valid for the static lifetime.
>>> +            (*reg.get()).driver.name = name.as_char_ptr();
>>
>> Hi,
>>
>> can drivers set driver.probe_type = PROBE_PREFER_ASYNCHRONOUS? If no then please
>> set it here is possible.
>>
>> Thanks,
>> Armin Wolf
> 
> At the moment I didn't wrap `probe_type` from `driver.h` so drivers are
> not able to set this themselves. If I can confirm it's OK to use
> `PROBE_PREFER_ASYNCHRONOUS` for the reference Clevo driver are you OK if
> this is hardcoded here for now? If a future consumer of the binding has
> this requirement they could add a new associated const to `wmi::Driver`
> defaulting to 'prefer asynchronous' in line with the recommendation from
> the wmi subsystem docs.
> 
> Cheers Nick
> 

Hardcoding this is fine.

Thanks,
Armin Wolf


  reply	other threads:[~2026-12-04 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 11:02 [PATCH v2 0/4] rust: wmi: add ACPI WMI bus abstractions Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 1/4] rust: wmi: add basic WMI device abstraction Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 2/4] rust: wmi: add DeviceId and wmi_device_table! macro Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 3/4] rust: wmi: add Driver trait, Adapter and implement RegistrationOps Nick Dowsett via B4 Relay
2026-11-28 15:57   ` Armin Wolf
2026-11-29  1:32     ` Nick Dowsett
2026-12-04 20:41       ` Armin Wolf [this message]
2026-11-27 11:02 ` [PATCH v2 4/4] rust: wmi: add Buffer and Device::invoke_method() Nick Dowsett via B4 Relay
2026-11-28 16:05   ` Armin Wolf
2026-11-29  3:08     ` Nick Dowsett
2026-12-04 20:44       ` Armin Wolf

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=89f8811d-e7ed-4c62-9e36-c31c00c7c1c9@gmx.de \
    --to=w_armin@gmx.de \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nick42d@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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®