[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0i-6PBa=UuOkwZhmGvEpuUYkMeu9eubbvUNcGvc=DmDuA@mail.gmail.com>
Date: Fri, 5 Jun 2020 14:10:30 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linux PM <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM: runtime: add RPM_IDLE_SUSPEND / RPM_IDLE_NO_SUSPEND constants
On Sat, May 30, 2020 at 6:33 PM Heiner Kallweit <hkallweit1@...il.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!
Powered by blists - more mailing lists