All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Pratyush Yadav <pratyush@kernel.org>,
	Michael Walle <michael@walle.cc>,
	linux-mtd@lists.infradead.org, Alexander Dahl <ada@thorsis.com>,
	Steven Seeger <steven.seeger@flightsystems.net>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mtd: rawnand: Bypass a couple of sanity checks during NAND identification
Date: Thu, 16 May 2024 16:45:16 +0200	[thread overview]
Message-ID: <20240516164516.4e5ad1cb@xps-13> (raw)
In-Reply-To: <ZkYPdbspX5tc0WRf@pengutronix.de>

Hi Sascha,

s.hauer@pengutronix.de wrote on Thu, 16 May 2024 15:51:49 +0200:

> On Thu, May 16, 2024 at 03:13:20PM +0200, Miquel Raynal wrote:
> > Early during NAND identification, mtd_info fields have not yet been
> > initialized (namely, writesize and oobsize) and thus cannot be used for
> > sanity checks yet. Of course if there is a misuse of
> > nand_change_read_column_op() so early we won't be warned, but there is
> > anyway no actual check to perform at this stage as we do not yet know
> > the NAND geometry.
> > 
> > So, if the fields are empty, especially mtd->writesize which is *always*
> > set quite rapidly after identification, let's skip the sanity checks.
> > 
> > nand_change_read_column_op() is subject to be used early for ONFI/JEDEC
> > identification in the very unlikely case of:
> > - bitflips appearing in the parameter page,
> > - the controller driver not supporting simple DATA_IN cycles.
> > 
> > As nand_change_read_column_op() uses nand_fill_column_cycles() the logic
> > explaind above also applies in this secondary helper.
> > 
> > Fixes: c27842e7e11f ("mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers")
> > Fixes: daca31765e8b ("mtd: rawnand: jedec: Adapt the parameter page read to constraint controllers")
> > Cc: stable@vger.kernel.org
> > Reported-by: Alexander Dahl <ada@thorsis.com>
> > Closes: https://lore.kernel.org/linux-mtd/20240306-shaky-bunion-d28b65ea97d7@thorsis.com/
> > Reported-by: Steven Seeger <steven.seeger@flightsystems.net>
> > Closes: https://lore.kernel.org/linux-mtd/DM6PR05MB4506554457CF95191A670BDEF7062@DM6PR05MB4506.namprd05.prod.outlook.com/
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
> 
> With the attached debug patch applied I can confirm that I can now read
> all three ONFI parameter pages successfully using
> nand_change_read_column_op(), so:
> 
> Tested-by: Sascha Hauer <s.hauer@pengutronix.de>

Excellent!

Thanks,
Miquèl

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

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Pratyush Yadav <pratyush@kernel.org>,
	Michael Walle <michael@walle.cc>,
	linux-mtd@lists.infradead.org, Alexander Dahl <ada@thorsis.com>,
	Steven Seeger <steven.seeger@flightsystems.net>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mtd: rawnand: Bypass a couple of sanity checks during NAND identification
Date: Thu, 16 May 2024 16:45:16 +0200	[thread overview]
Message-ID: <20240516164516.4e5ad1cb@xps-13> (raw)
In-Reply-To: <ZkYPdbspX5tc0WRf@pengutronix.de>

Hi Sascha,

s.hauer@pengutronix.de wrote on Thu, 16 May 2024 15:51:49 +0200:

> On Thu, May 16, 2024 at 03:13:20PM +0200, Miquel Raynal wrote:
> > Early during NAND identification, mtd_info fields have not yet been
> > initialized (namely, writesize and oobsize) and thus cannot be used for
> > sanity checks yet. Of course if there is a misuse of
> > nand_change_read_column_op() so early we won't be warned, but there is
> > anyway no actual check to perform at this stage as we do not yet know
> > the NAND geometry.
> > 
> > So, if the fields are empty, especially mtd->writesize which is *always*
> > set quite rapidly after identification, let's skip the sanity checks.
> > 
> > nand_change_read_column_op() is subject to be used early for ONFI/JEDEC
> > identification in the very unlikely case of:
> > - bitflips appearing in the parameter page,
> > - the controller driver not supporting simple DATA_IN cycles.
> > 
> > As nand_change_read_column_op() uses nand_fill_column_cycles() the logic
> > explaind above also applies in this secondary helper.
> > 
> > Fixes: c27842e7e11f ("mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers")
> > Fixes: daca31765e8b ("mtd: rawnand: jedec: Adapt the parameter page read to constraint controllers")
> > Cc: stable@vger.kernel.org
> > Reported-by: Alexander Dahl <ada@thorsis.com>
> > Closes: https://lore.kernel.org/linux-mtd/20240306-shaky-bunion-d28b65ea97d7@thorsis.com/
> > Reported-by: Steven Seeger <steven.seeger@flightsystems.net>
> > Closes: https://lore.kernel.org/linux-mtd/DM6PR05MB4506554457CF95191A670BDEF7062@DM6PR05MB4506.namprd05.prod.outlook.com/
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
> 
> With the attached debug patch applied I can confirm that I can now read
> all three ONFI parameter pages successfully using
> nand_change_read_column_op(), so:
> 
> Tested-by: Sascha Hauer <s.hauer@pengutronix.de>

Excellent!

Thanks,
Miquèl

  reply	other threads:[~2024-05-16 14:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 13:13 [PATCH v2 0/2] mtd: rawnand: NAND early identification fixes Miquel Raynal
2024-05-16 13:13 ` [PATCH v2 1/2] mtd: rawnand: Fix the nand_read_data_op() early check Miquel Raynal
2024-05-16 13:13   ` Miquel Raynal
2024-05-27 12:15   ` Miquel Raynal
2024-05-27 12:15     ` Miquel Raynal
2024-05-16 13:13 ` [PATCH v2 2/2] mtd: rawnand: Bypass a couple of sanity checks during NAND identification Miquel Raynal
2024-05-16 13:13   ` Miquel Raynal
2024-05-16 13:51   ` Sascha Hauer
2024-05-16 13:51     ` Sascha Hauer
2024-05-16 14:45     ` Miquel Raynal [this message]
2024-05-16 14:45       ` Miquel Raynal
2024-05-27 12:14   ` Miquel Raynal
2024-05-27 12:14     ` 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=20240516164516.4e5ad1cb@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=ada@thorsis.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=stable@vger.kernel.org \
    --cc=steven.seeger@flightsystems.net \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tudor.ambarus@linaro.org \
    --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.