[PATCH v3 6/7] spi: rockchip: Move to pm_runtime_resume_and_get
Heiko Stübner
heiko at sntech.de
Wed Nov 18 02:54:02 PST 2026
Am Mittwoch, 18. November 2026, 02:53:32 Mitteleuropäische Normalzeit schrieb Sebastian Reichel:
> Hi,
>
> On Wed, Nov 18, 2026 at 12:50:20AM +0100, Heiko Stuebner wrote:
> > From: Heiko Stuebner <heiko.stuebner at cherry.de>
> >
> > Currently pm_runtime_get_sync() is used, which increments the usage
> > count even if the resume was not successful.
> >
> > Move to the more modern pm_runtime_resume_and_get() which handles the
> > usage counter better.
> >
> > Signed-off-by: Heiko Stuebner <heiko.stuebner at cherry.de>
> > ---
>
> This only makes sense when combined with error handling. Keeping
> the use count increased makes more sense for the current code:
>
> pm_runtime_get_sync(); // keep use count increased on failure
> random_code();
> pm_runtime_put(); // always decrease the RPM use count
>
> Meanwhile your new code would result in double decrease on error:
darn, one should not go "eh, let's just use the same pm-runtime pattern,
should be easy" ;-) .
But I guess real error handling in those cases might actually desireable.
Heiko
More information about the Linux-rockchip
mailing list