lkml.org 
[lkml]   [2016]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] firwmare: Correct handling of fw_state_wait() return value
On Thu, Dec 08, 2016 at 03:47:22PM +0100, Daniel Wagner wrote:
> On 12/07/2016 02:01 AM, Bjorn Andersson wrote:
> > When request_firmware() finds an already open firmware object it will
> > wait for that object to become fully loaded and then check the status.
> > As __fw_state_wait_common() succeeds the timeout value returned will be
> > truncated in _request_firmware_prepare() and interpreted as -EPERM.
> >
> > Prior to "firmware: do not use fw_lock for fw_state protection" the code
> > did test if we where in the "done" state before sleeping, causing this
> > particular code path to succeed, in some cases.
> >
> > As the callers are interested in the result of the wait and not the
> > remaining timeout the return value of __fw_state_wait_common() is
> > changed to signal "done" or "error", which simplifies the logic in
> > _request_firmware_load() as well.
>
> Oops, sorry about that one. With your fix the code starts to make sense.
>
> > Fixes: 5b029624948d ("firmware: do not use fw_lock for fw_state protection")
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>
> Reviewed-by: Daniel Wagner <daniel.wagner@bmw-carit.de>

Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>

Luis

\
 
 \ /
  Last update: 2016-12-08 16:28    [W:0.053 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site