lkml.org 
[lkml]   [2020]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PM: runtime: add RPM_IDLE_SUSPEND / RPM_IDLE_NO_SUSPEND constants
On Sat, May 30, 2020 at 6:33 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> runtime_idle() callback implementations have to return a non-zero value
> if they don't intend to suspend now. Several drivers use an errno like
> -EBUSY for this purpose. This can be problematic because the return
> value is propagated up the call chain, from rpm_idle() to
> __pm_runtime_idle(), and from there to callers like
> pm_runtime_put_sync(). A driver author checking the return value of
> e.g. pm_runtime_put_sync() may as usual check for retval < 0 and
> bail out.

Which would be a bug anyway, because rpm_idle() may return -EAGAIN or
-EINPROGRESS due to concurrency and -EBUSY should be treated
similarly.

> Therefore a positive value should be returned.

While it is recommended to return a positive value then, returning
-EBUSY or -EAGAIN should still work if the callers are careful enough
(and they should be).

Thanks!

\
 
 \ /
  Last update: 2020-06-05 14:11    [W:0.034 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site