[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db5fd836-6fa2-41eb-841c-98cd54f21687@sirena.org.uk>
Date: Mon, 16 Jun 2025 15:05:11 +0100
From: Mark Brown <broonie@...nel.org>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Daniel Almeida <daniel.almeida@...labora.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Boris Brezillon <boris.brezillon@...labora.com>,
Sebastian Reichel <sebastian.reichel@...labora.com>,
Liam Girdwood <lgirdwood@...il.com>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v4] rust: regulator: add a bare minimum regulator
abstraction
On Sun, Jun 15, 2025 at 10:31:59PM +0900, Alexandre Courbot wrote:
> On Tue Jun 10, 2025 at 12:32 AM JST, Daniel Almeida wrote:
> > +impl<T: RegulatorState + 'static> Drop for Regulator<T> {
> > + fn drop(&mut self) {
> > + if core::any::TypeId::of::<T>() == core::any::TypeId::of::<Enabled>() {
> > + // SAFETY: By the type invariants, we know that `self` owns a
> > + // reference on the enabled refcount, so it is safe to relinquish it
> > + // now.
> > + unsafe { bindings::regulator_disable(self.inner.as_ptr()) };
> > + }
> Do we want to keep enabled dynamic regulators enabled? IIUC that's what
> the C API does, so doing the same is ok, but let's at least mention that
> fact in the documentation.
I'm not sure what you mean by a "dynamic regulator" here but as
previously outlined we currently take a very conservative approach and
don't do things without being explicitly told to do so since getting
things wrong can result in physical damage to the system.
Please delete unneeded context from mails when replying. Doing this
makes it much easier to find your reply in the message, helping ensure
it won't be missed by people scrolling through the irrelevant quoted
material.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists