From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941201AbcIHPtS (ORCPT ); Thu, 8 Sep 2016 11:49:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:46829 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbcIHPtR (ORCPT ); Thu, 8 Sep 2016 11:49:17 -0400 MIME-Version: 1.0 In-Reply-To: References: <1473237908-20989-1-git-send-email-wagi@monom.org> <1473237908-20989-3-git-send-email-wagi@monom.org> From: Ming Lei Date: Thu, 8 Sep 2016 23:49:13 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 2/4] firmware: encapsulate firmware loading status To: Daniel Wagner Cc: Linux Kernel Mailing List , Daniel Wagner , "Luis R . Rodriguez" , Greg Kroah-Hartman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 8, 2016 at 8:26 PM, Daniel Wagner wrote: > Hi Ming, > > On 09/08/2016 01:26 PM, Ming Lei wrote: >> >> On Wed, Sep 7, 2016 at 4:45 PM, Daniel Wagner wrote: >>> >>> From: Daniel Wagner >>> +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