From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Hector Palacios <hector.palacios@digi.com>
Cc: herve.codina@bootlin.com, linux-mtd@lists.infradead.org,
sashal@kernel.org
Subject: Re: [PATCH v5] mtd: rawnand: hynix: fix up bit 0 of sdr_timing_mode
Date: Fri, 10 Mar 2023 09:10:55 +0100 [thread overview]
Message-ID: <20230310091055.21296243@xps-13> (raw)
In-Reply-To: <20230310080609.1930869-1-hector.palacios@digi.com>
Hi Hector,
hector.palacios@digi.com wrote on Fri, 10 Mar 2023 09:06:09 +0100:
> According to the ONFI specification, bit 0 of 'SDR timing mode support'
> (bytes 129-130) "shall be 1". That means the NAND supports at least
> timing mode 0.
>
> NAND chip Hynix H27U4G8F2GDA-BI (at least) is reading a 0 on this field
> which makes nand_choose_best_sdr_timings() return with error and the
> probe function to eventually fail.
>
> Given that sdr_timing_modes bit 0 must be 1 by specification, force
> it in case the NAND reports it is not set. This is a safe assumption
> because the mode 0 is the minimum (safer) set of timings that the
> NAND can work with.
>
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Actually you should not add my Signed-off-by like that. I will add it
when I take your patch.
In order to credit me (and that is very kind to you) you could have
instead used Suggested-by. If I had done more than just suggesting
something, another solution could have been to add a Co-developed-by
tag (and this time, my Signed-off-by would have been required).
Anyway, no need to resend, I'll fix it up when applying.
> Link: https://lore.kernel.org/linux-mtd/20230223165104.525852-1-hector.palacios@digi.com
> ---
> v5:
> Simplify bitwise operation.
> v4:
> Fix bitwise operation on __le16 type, per sparse warning.
> v3:
> Forcibly set bit 0.
> v2:
> Move patch to Hynix specific fixup hook.
> Use BIT(0) macro.
> v1:
> Implement generic patch in nand_base.c.
>
> drivers/mtd/nand/raw/nand_hynix.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c
> index 0d4d4bbfdece..39076735a3fb 100644
> --- a/drivers/mtd/nand/raw/nand_hynix.c
> +++ b/drivers/mtd/nand/raw/nand_hynix.c
> @@ -728,8 +728,21 @@ static int hynix_nand_init(struct nand_chip *chip)
> return ret;
> }
>
> +static void hynix_fixup_onfi_param_page(struct nand_chip *chip,
> + struct nand_onfi_params *p)
> +{
> + /*
> + * Certain chips might report a 0 on sdr_timing_mode field
> + * (bytes 129-130). This has been seen on H27U4G8F2GDA-BI.
> + * According to ONFI specification, bit 0 of this field "shall be 1".
> + * Forcibly set this bit.
> + */
> + p->sdr_timing_modes |= cpu_to_le16(BIT(0));
> +}
> +
> const struct nand_manufacturer_ops hynix_nand_manuf_ops = {
> .detect = hynix_nand_decode_id,
> .init = hynix_nand_init,
> .cleanup = hynix_nand_cleanup,
> + .fixup_onfi_param_page = hynix_fixup_onfi_param_page,
> };
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-03-10 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 8:06 [PATCH v5] mtd: rawnand: hynix: fix up bit 0 of sdr_timing_mode Hector Palacios
2023-03-10 8:10 ` Miquel Raynal [this message]
2023-03-10 8:20 ` Hector Palacios
2023-03-22 16:08 ` 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=20230310091055.21296243@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=hector.palacios@digi.com \
--cc=herve.codina@bootlin.com \
--cc=linux-mtd@lists.infradead.org \
--cc=sashal@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 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.