Re: [PATCH V6 01/15] PM / OPP: Expose refcounting helpers for the Rust implementation
From: Greg KH
Date: Wed Jan 08 2025 - 06:55:56 EST
On Wed, Jan 08, 2025 at 02:41:24PM +0530, Viresh Kumar wrote:
> On 07-01-25, 12:58, Greg KH wrote:
> > On Tue, Jan 07, 2025 at 04:51:34PM +0530, Viresh Kumar wrote:
> > > The Rust implementation needs these APIs for its working. Expose them.
> >
> > Why is the rust code unique here? Why does C code not need these
> > exported?
> >
> > And that first sentance isn't really good grammer :)
> >
> > Also, you created a new function here and didn't document it anywhere,
> > nor do you mention it here in the changelog text, making this a
> > non-starter right off :(
>
> How about this ?
>
> PM / OPP: Add reference counting helpers for Rust implementation
>
> To ensure that resources such as OPP tables or OPP nodes are not freed
> while in use by the Rust implementation, it is necessary to increment
> their reference count from Rust code.
>
> This commit introduces a new helper function,
> `dev_pm_opp_get_opp_table_ref()`, to increment the reference count of an
> OPP table and declares the existing helper `dev_pm_opp_get()` in
> `pm_opp.h`.
That works, if you drop the `` stuff, not needed :)
thanks,
greg k-h