All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>
Subject: Re: [PATCH 1/6] mtd: rawnand: marvell: Fix the condition on a return code
Date: Wed, 22 Apr 2020 09:06:31 +0200	[thread overview]
Message-ID: <20200422090631.479deaed@collabora.com> (raw)
In-Reply-To: <20200421164857.8255-2-miquel.raynal@bootlin.com>

On Tue, 21 Apr 2020 18:48:52 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> In a previous fix, I changed the condition on which the timeout of an
> IRQ is reached from:
> 
>     if (!ret)
> 
> into:
> 
>     if (ret && !pending)
> 
> While having a non-zero return code is usual in the Linux kernel, here
> ret comes from a wait_for_completion_timeout() which returns 0 when
> the waiting period is too long.
> 
> Hence, the revised condition should be:
> 
>     if (!ret && !pending)
> 
> The faulty patch did not produce any error because of the !pending
> condition so this change is finally purely cosmetic and does not
> change the actual driver behavior.
> 
> Fixes: cafb56dd741e ("mtd: rawnand: marvell: prevent timeouts on a loaded machine")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/mtd/nand/raw/marvell_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 179f0ca585f8..f2bf88336326 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -707,7 +707,7 @@ static int marvell_nfc_wait_op(struct nand_chip *chip, unsigned int timeout_ms)
>  	 * In case the interrupt was not served in the required time frame,
>  	 * check if the ISR was not served or if something went actually wrong.
>  	 */
> -	if (ret && !pending) {
> +	if (!ret && !pending) {
>  		dev_err(nfc->dev, "Timeout waiting for RB signal\n");
>  		return -ETIMEDOUT;
>  	}


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-04-22  7:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 16:48 [PATCH 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
2020-04-21 16:48 ` [PATCH 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
2020-04-22  7:06   ` Boris Brezillon [this message]
2020-04-21 16:48 ` [PATCH 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res() Miquel Raynal
2020-04-22  7:06   ` Boris Brezillon
2020-04-21 16:48 ` [PATCH 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Miquel Raynal
2020-04-22  7:08   ` Boris Brezillon
2020-04-21 16:48 ` [PATCH 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
2020-04-22  7:10   ` Boris Brezillon
2020-04-21 16:48 ` [PATCH 5/6] mtd: rawnand: marvell: Rename a function to clarify Miquel Raynal
2020-04-22  7:10   ` Boris Brezillon
2020-04-21 16:48 ` [PATCH 6/6] mtd: rawnand: marvell: Rename the ->correct() function Miquel Raynal
2020-04-22  7:11   ` Boris Brezillon

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=20200422090631.479deaed@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.