mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: "Marek Behún" <kabel@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] firmware: turris-mox-rwtm: Fix an error handling path in mox_get_board_info()
Date: Tue, 11 Jul 2023 18:44:36 +0200	[thread overview]
Message-ID: <95bd5686-1ed9-63ef-e91f-30aa54c09cd6@wanadoo.fr> (raw)
In-Reply-To: <20230217122108.4a93667f@dellmb>

Le 17/02/2023 à 12:21, Marek Behún a écrit :
> On Wed, 15 Feb 2023 10:30:02 +0100
> Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 
>> wait_for_completion_timeout() returns 0 if timed out, and positive (at
>> least 1, or number of jiffies left till timeout) if completed.
>>
>> In case of timeout, return -ETIMEDOUT.
>>
>> Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>> Compile tested only.
>>
>> v2:
>>     - Fix some other wait_for_completion_timeout() calls
>>
>> ---
>>   drivers/firmware/turris-mox-rwtm.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
>> index 6ea5789a89e2..d6fc37ba897d 100644
>> --- a/drivers/firmware/turris-mox-rwtm.c
>> +++ b/drivers/firmware/turris-mox-rwtm.c
>> @@ -200,8 +200,8 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
>>   		return ret;
>>   
>>   	ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2);
>> -	if (ret < 0)
>> -		return ret;
>> +	if (ret == 0)
>> +		return -ETIMEDOUT;
>>   
>>   	ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval);
>>   	if (ret == -ENODATA) {
>> @@ -236,8 +236,8 @@ static int mox_get_board_info(struct mox_rwtm *rwtm)
>>   		return ret;
>>   
>>   	ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2);
>> -	if (ret < 0)
>> -		return ret;
>> +	if (ret == 0)
>> +		return -ETIMEDOUT;
>>   
>>   	ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval);
>>   	if (ret == -ENODATA) {
>> @@ -275,8 +275,8 @@ static int check_get_random_support(struct mox_rwtm *rwtm)
>>   		return ret;
>>   
>>   	ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2);
>> -	if (ret < 0)
>> -		return ret;
>> +	if (ret == 0)
>> +		return -ETIMEDOUT;
>>   
>>   	return mox_get_status(MBOX_CMD_GET_RANDOM, rwtm->reply.retval);
>>   }
> 
> Reviewed-by: Marek Behún <kabel@kernel.org>
> 

Hi,
polite reminder.

CJ

  reply	other threads:[~2023-07-11 16:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  9:30 Christophe JAILLET
2023-02-17 11:21 ` Marek Behún
2023-07-11 16:44   ` Christophe JAILLET [this message]
2023-07-12 11:16     ` Marek Behún
2023-07-13  8:56       ` Gregory CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95bd5686-1ed9-63ef-e91f-30aa54c09cd6@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=arnd@arndb.de \
    --cc=kabel@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®