public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: <tkuw584924@gmail.com>, <u-boot@lists.denx.de>
Cc: <jagan@amarulasolutions.com>, <vigneshr@ti.com>,
	<pratyush@kernel.org>, <Bacem.Daassi@infineon.com>,
	Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Subject: Re: [PATCH] mtd: spi-nor: Keep CFR5V[6] as 1 in Octal DTR enable
Date: Fri, 6 Jan 2023 15:47:58 +0530	[thread overview]
Message-ID: <043a2b5c-e885-c857-c46a-e92285ac18cc@ti.com> (raw)
In-Reply-To: <20230106033452.9635-1-Takahiro.Kuwano@infineon.com>

Hi Takahiro,

On 06/01/23 09:04, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> 
> CFR5V[6] is reserved bit and must always be 1.
> 
> Fixes: ea9a22f7e79c ("mtd: spi-nor-core: Add support for Cypress Semper flash")
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> ---
>   include/linux/mtd/spi-nor.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
> index 30f15452aa68..181eb6710d7e 100644
> --- a/include/linux/mtd/spi-nor.h
> +++ b/include/linux/mtd/spi-nor.h
> @@ -194,7 +194,7 @@
>   #define SPINOR_REG_CYPRESS_CFR3V_PGSZ		BIT(4) /* Page size. */
>   #define SPINOR_REG_CYPRESS_CFR3V_UNISECT	BIT(3) /* Uniform sector mode */
>   #define SPINOR_REG_CYPRESS_CFR5V		0x00800006
> -#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN	0x3
> +#define SPINOR_REG_CYPRESS_CFR5V_OCT_DTR_EN	0x43

I second Tudor's review on the linux-mtd mailing list here as well,

(<493d9a10-aaf3-70f6-36c3-9a2cf39f0759@linaro.org>)

This looks bad. Instead of overwriting CFR5V with whatever value, we
should instead first read it and then update only the bit that we're
interested in. If it happens to write CFR5V before octal enable/disable,
you'll overwrite the previous set values.

>   #define SPINOR_OP_CYPRESS_RD_FAST		0xee
>   
>   /* Supported SPI protocols */

-- 
Thanks and Regards,
Dhruva Gole

      reply	other threads:[~2023-01-06 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  3:34 [PATCH] mtd: spi-nor: Keep CFR5V[6] as 1 in Octal DTR enable tkuw584924
2023-01-06 10:17 ` Dhruva Gole [this message]

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=043a2b5c-e885-c857-c46a-e92285ac18cc@ti.com \
    --to=d-gole@ti.com \
    --cc=Bacem.Daassi@infineon.com \
    --cc=Takahiro.Kuwano@infineon.com \
    --cc=jagan@amarulasolutions.com \
    --cc=pratyush@kernel.org \
    --cc=tkuw584924@gmail.com \
    --cc=u-boot@lists.denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox