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: <9f6d7e29-71d2-4f1b-b672-46acc8de8b6f@kernel.org>
Date: Mon, 14 Jul 2025 15:26:58 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: rafael@...nel.org, ojeda@...nel.org, alex.gaynor@...il.com,
 boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
 lossin@...nel.org, a.hindborg@...nel.org, aliceryhl@...gle.com,
 tmgross@...ch.edu, daniel.almeida@...labora.com, m.wilczynski@...sung.com,
 rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] rust: device: implement Device::as_bound()

On 7/14/25 3:24 PM, Greg KH wrote:
> On Mon, Jul 14, 2025 at 11:49:44AM +0200, Danilo Krummrich wrote:
>> On Mon Jul 14, 2025 at 7:30 AM CEST, Greg KH wrote:
>>> On Sun, Jul 13, 2025 at 08:26:54PM +0200, Danilo Krummrich wrote:
>>>> Provide an unsafe functions for abstractions to convert a regular
>>>> &Device to a &Device<Bound>.
>>>>
>>>> This is useful for registrations that provide certain guarantees for the
>>>> scope of their callbacks, such as IRQs or certain class device
>>>> registrations (e.g. PWM, miscdevice).
>>>
>>> Do we have an example where this can be used today in the tree, or is
>>> this only for new stuff going forward that would use it?
>>
>> There's miscdevice in tree, but to be fair, miscdevice doesn't need it without
>> my patch series [1] adding driver support for the existing miscdevice
>> abstractions; the patch in [2] out of this series would use it within
>> args_from_registration().
>>
>> The PWM abstractions [3] need it in bound_parent_device(). The use-case is the
>> same as everywhere else, PWM chips never out-live driver unbind, hence they can
>> provide the corresponding bus device as &Device<Bound>.
>>
>> The same is true for IRQ registrations [4]. free_irq() is guaranteed to be
>> called before driver unbind, hence we can provide a &Device<Bound> in the IRQ
>> callbacks.
>>
>> Ultimately, we want to provide this "cookie" in any driver scope that can be
>> proven to be lifetime wise limited to device / driver unbind, so there'll be
>> much more users.
> 
> Ok, so we should probably merge it now for 6.17-rc1, no objection from
> me!

Yup, gonna pick it up soon (with the casts fixed up as noted in a previous
reply). :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ