The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Danilo Krummrich" <dakr@kernel.org>,
	<gregkh@linuxfoundation.org>, <rafael@kernel.org>,
	<ojeda@kernel.org>, <alex.gaynor@gmail.com>,
	<boqun.feng@gmail.com>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <benno.lossin@proton.me>,
	<a.hindborg@kernel.org>, <aliceryhl@google.com>
Cc: <rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rust: devres: do not dereference to the internal Revocable
Date: Thu, 12 Jun 2025 10:49:28 +0200	[thread overview]
Message-ID: <DAKFBPWTNSL4.28PA3G5BAIB8T@kernel.org> (raw)
In-Reply-To: <20250611174827.380555-1-dakr@kernel.org>

On Wed Jun 11, 2025 at 7:48 PM CEST, Danilo Krummrich wrote:
> We can't expose direct access to the internal Revocable, since this
> allows users to directly revoke the internal Revocable without Devres
> having the chance to synchronize with the devres callback -- we have to
> guarantee that the internal Revocable has been fully revoked before
> the device is fully unbound.
>
> Hence, remove the corresponding Deref implementation and, instead,
> provide indirect accessors for the internal Revocable.
>
> Note that we can still support Devres::revoke() by implementing the
> required synchronization (which would be almost identical to the
> synchronization in Devres::drop()).
>
> Fixes: 76c01ded724b ("rust: add devres abstraction")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>

Reviewed-by: Benno Lossin <lossin@kernel.org>

---
Cheers,
Benno

> ---
> This patch is based on [1].
>
> [1] https://lore.kernel.org/lkml/20250603205416.49281-1-dakr@kernel.org/
> ---
>  rust/kernel/devres.rs | 27 ++++++++++++++++-----------
>  1 file changed, 16 insertions(+), 11 deletions(-)

  reply	other threads:[~2025-06-12  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 17:48 [PATCH] rust: devres: do not dereference to the internal Revocable Danilo Krummrich
2025-06-12  8:49 ` Benno Lossin [this message]
2025-06-13 22:05 ` 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=DAKFBPWTNSL4.28PA3G5BAIB8T@kernel.org \
    --to=lossin@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /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