All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	vigneshr@ti.com, miquel.raynal@bootlin.com,
	Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>,
	richard@nod.at, Stoll Eberhard <Eberhard.Stoll@kontron.de>
Subject: Re: [PATCH v2 1/2] Fix corner case in bad block table handling.
Date: Tue, 11 Jan 2022 16:33:26 +0100	[thread overview]
Message-ID: <9af5a4ae-e919-a545-809d-451217cf40f5@kontron.de> (raw)
In-Reply-To: <774a92693f311e7de01e5935e720a179fb1b2468.1616635406.git.ytc-mb-yfuruyama7@kioxia.com>

Hi stable maintainers,

On 06.04.21 03:47, Yoshio Furuyama wrote:
> From: "Doyle, Patrick" <pdoyle@irobot.com>
> 
> In the unlikely event that both blocks 10 and 11 are marked as bad (on a
> 32 bit machine), then the process of marking block 10 as bad stomps on
> cached entry for block 11.  There are (of course) other examples.
> 
> Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
> Reviewed-by: Richard Weinberger <richard@nod.at>

We have systems on which this patch fixes real failures. Could you
please add the upstream patch fd0d8d85f723 ("mtd: nand: bbt: Fix corner
case in bad block table handling") to the stable queues for 4.19, 5.4, 5.10?

Thanks!

Cc: stable@vger.kernel.org
Fixes: 9c3736a3de21 ("mtd: nand: Add core infrastructure to deal with
NAND devices")

> ---
>  drivers/mtd/nand/bbt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/bbt.c b/drivers/mtd/nand/bbt.c
> index 044adf913854..64af6898131d 100644
> --- a/drivers/mtd/nand/bbt.c
> +++ b/drivers/mtd/nand/bbt.c
> @@ -123,7 +123,7 @@ int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry,
>  		unsigned int rbits = bits_per_block + offs - BITS_PER_LONG;
>  
>  		pos[1] &= ~GENMASK(rbits - 1, 0);
> -		pos[1] |= val >> rbits;
> +		pos[1] |= val >> (bits_per_block - rbits);
>  	}
>  
>  	return 0;

WARNING: multiple messages have this Message-ID (diff)
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	vigneshr@ti.com, miquel.raynal@bootlin.com,
	Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>,
	richard@nod.at, Stoll Eberhard <Eberhard.Stoll@kontron.de>
Subject: Re: [PATCH v2 1/2] Fix corner case in bad block table handling.
Date: Tue, 11 Jan 2022 16:33:26 +0100	[thread overview]
Message-ID: <9af5a4ae-e919-a545-809d-451217cf40f5@kontron.de> (raw)
In-Reply-To: <774a92693f311e7de01e5935e720a179fb1b2468.1616635406.git.ytc-mb-yfuruyama7@kioxia.com>

Hi stable maintainers,

On 06.04.21 03:47, Yoshio Furuyama wrote:
> From: "Doyle, Patrick" <pdoyle@irobot.com>
> 
> In the unlikely event that both blocks 10 and 11 are marked as bad (on a
> 32 bit machine), then the process of marking block 10 as bad stomps on
> cached entry for block 11.  There are (of course) other examples.
> 
> Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
> Reviewed-by: Richard Weinberger <richard@nod.at>

We have systems on which this patch fixes real failures. Could you
please add the upstream patch fd0d8d85f723 ("mtd: nand: bbt: Fix corner
case in bad block table handling") to the stable queues for 4.19, 5.4, 5.10?

Thanks!

Cc: stable@vger.kernel.org
Fixes: 9c3736a3de21 ("mtd: nand: Add core infrastructure to deal with
NAND devices")

> ---
>  drivers/mtd/nand/bbt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/bbt.c b/drivers/mtd/nand/bbt.c
> index 044adf913854..64af6898131d 100644
> --- a/drivers/mtd/nand/bbt.c
> +++ b/drivers/mtd/nand/bbt.c
> @@ -123,7 +123,7 @@ int nanddev_bbt_set_block_status(struct nand_device *nand, unsigned int entry,
>  		unsigned int rbits = bits_per_block + offs - BITS_PER_LONG;
>  
>  		pos[1] &= ~GENMASK(rbits - 1, 0);
> -		pos[1] |= val >> rbits;
> +		pos[1] |= val >> (bits_per_block - rbits);
>  	}
>  
>  	return 0;

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

  parent reply	other threads:[~2022-01-11 15:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06  1:46 [PATCH v2 0/2] Fix corner case in bad block table handling Yoshio Furuyama
2021-04-06  1:46 ` Yoshio Furuyama
2021-04-06  1:47 ` [PATCH v2 1/2] " Yoshio Furuyama
2021-04-06  1:47   ` Yoshio Furuyama
2021-05-10 10:52   ` Miquel Raynal
2021-05-10 10:52     ` Miquel Raynal
2022-01-11 15:33   ` Frieder Schrempf [this message]
2022-01-11 15:33     ` Frieder Schrempf
2022-01-24 14:11     ` Frieder Schrempf
2022-01-24 14:11       ` Frieder Schrempf
2022-01-24 14:29       ` Greg Kroah-Hartman
2022-01-24 14:29         ` Greg Kroah-Hartman
2021-04-06  1:47 ` [PATCH v2 2/2] Fix the issue for clearing status process Yoshio Furuyama
2021-04-06  1:47   ` Yoshio Furuyama
2021-04-07  9:04   ` Miquel Raynal
2021-04-07  9:04     ` Miquel Raynal

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=9af5a4ae-e919-a545-809d-451217cf40f5@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=Eberhard.Stoll@kontron.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.com \
    --cc=ytc-mb-yfuruyama7@kioxia.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.