From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: boris.brezillon@bootlin.com, dwmw2@infradead.org,
computersforpeace@gmail.com, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org, Richard Weinberger <richard@nod.at>,
Marek Vasut <marek.vasut@gmail.com>
Subject: Re: [RFC PATCH 1/2] mtd: rawnand: handle ONFI revision number field being 0
Date: Mon, 18 Jun 2018 15:05:21 +0200 [thread overview]
Message-ID: <20180618150521.067ef156@xps13> (raw)
In-Reply-To: <20180618045255.8015-2-chris.packham@alliedtelesis.co.nz>
Hi Chris,
On Mon, 18 Jun 2018 16:52:54 +1200, Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
> Some Micron NAND chips (MT29F1G08ABAFAWP-ITE:F) report 00 00 for the
> revision number field of the ONFI parameter page. Rather than rejecting
> these outright assume ONFI version 1.0 if the revision number is 00 00.
>
Thanks for getting your hands into this.
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> At the moment I haven't qualified this check on anything, I should
> probably at least include vendor == MICRON.
The more I think about it the more I convince myself that this is not
needed. If the 4 first bytes are "ONFI", then the chip is ONFI...
Then what you do below is simple and readable and (sadly) probably
right.
>
> As far as I can tell revision number == 0 is not permitted by the ONFI
> spec but this wouldn't be the first time a vendor has ignored a spec. On
> the other hand maybe I'm reading the spec wrong and someone here will
> say "oh 0 means ...".
>
> drivers/mtd/nand/raw/nand_base.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index 0cd3e216b95c..1691c7005ae4 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -5184,6 +5184,8 @@ static int nand_flash_detect_onfi(struct nand_chip *chip)
> chip->parameters.onfi.version = 20;
> else if (val & (1 << 1))
> chip->parameters.onfi.version = 10;
> + else if (val == 0)
> + chip->parameters.onfi.version = 10;
>
> if (!chip->parameters.onfi.version) {
> pr_info("unsupported ONFI version: %d\n", val);
Regards,
Miquèl
next prev parent reply other threads:[~2018-06-18 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 4:52 [RFC PATCH 0/2] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Chris Packham
2018-06-18 4:52 ` [RFC PATCH 1/2] mtd: rawnand: handle ONFI revision number field being 0 Chris Packham
2018-06-18 13:05 ` Miquel Raynal [this message]
2018-06-18 13:17 ` Boris Brezillon
2018-06-18 4:52 ` [RFC PATCH 2/2] mtd: rawnand: marvell: Support page size of 2048 with 8-bit ECC Chris Packham
2018-06-18 13:37 ` Miquel Raynal
2018-06-18 13:14 ` [RFC PATCH 0/2] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Miquel Raynal
2018-06-19 0:35 ` Chris Packham
2018-06-19 1:44 ` Chris Packham
2018-06-19 4:55 ` Boris Brezillon
2018-06-19 23:56 ` Chris Packham
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=20180618150521.067ef156@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=boris.brezillon@bootlin.com \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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.