lkml.org 
[lkml]   [2016]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 2/4] firmware: encapsulate firmware loading status
On Thu, Sep 8, 2016 at 8:26 PM, Daniel Wagner <wagi@monom.org> wrote:
> Hi Ming,
>
> On 09/08/2016 01:26 PM, Ming Lei wrote:
>>
>> On Wed, Sep 7, 2016 at 4:45 PM, Daniel Wagner <wagi@monom.org> wrote:
>>>
>>> From: Daniel Wagner <daniel.wagner@bmw-carit.de>
>>> +static int fw_status_wait_timeout(struct fw_status *fw_st, long timeout)
>>> +{
>>> + int ret;
>>> +
>>> + ret =
>>> wait_for_completion_interruptible_timeout(&fw_st->completion,
>>> + timeout);
>>> + if (ret == 0 && test_bit(FW_STATUS_ABORTED, &fw_st->status))
>>> + return -ENOENT;
>>
>>
>> I guess the check should have been OR instead of AND, right?
>
>
>
> Good catch. It should be
>
> if (ret != 0 && test_bit(...))
> return -ENOENT;

Another question, why do you want to return -ENOENT when
userspace aborts the load? And looks it will always be override as
-EAGAIN.

>
> in case where we abort the operation instead of timing out.
>
> cheers,
> daniel

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.081 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site