From: <Tudor.Ambarus@microchip.com>
To: <liu.xiang6@zte.com.cn>, <linux-mtd@lists.infradead.org>
Cc: <bbrezillon@kernel.org>, <richard@nod.at>,
<linux-kernel@vger.kernel.org>, <marek.vasut@gmail.com>,
<liuxiang_1999@126.com>, <computersforpeace@gmail.com>,
<dwmw2@infradead.org>, <nagasure@xilinx.com>, <vigneshr@ti.com>
Subject: Re: [PATCH v3] mtd: spi-nor: fix nor->addr_width when its value configured from SFDP does not match the actual width
Date: Sat, 22 Jun 2019 11:49:25 +0000 [thread overview]
Message-ID: <5ffc9e32-ff69-9819-7bfd-ad9f793bb629@microchip.com> (raw)
In-Reply-To: <1554018157-10860-1-git-send-email-liu.xiang6@zte.com.cn>
Hi, Liu,
On 03/31/2019 10:42 AM, Liu Xiang wrote:
> Some is25lp256 get BFPT_DWORD1_ADDRESS_BYTES_3_ONLY from BFPT table for
> address width. But in actual fact the flash can support 4-byte address.
> So we should fix it.
It's better to be imperative. Substitute "So we should fix it" with something
like "Use a post bfpt fixup hook to overwrite the address width advertised by
the BFPT".
>
We'll need a fixes tag here.> Suggested-by: Boris Brezillon <bbrezillon@kernel.org>
> Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
When? If they didn't explicitly suggested this approach, lets drop the S-b tags.
> Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
> ---
>
> Changes in v3:
> add a fixup for is25lp256 to solve the address width problem.
>
> drivers/mtd/spi-nor/spi-nor.c | 25 ++++++++++++++++++++++++-
> 1 file changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 6e13bbd..d252a66 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -1682,6 +1682,28 @@ static int sr2_bit7_quad_enable(struct spi_nor *nor)
> .flags = SPI_NOR_NO_FR | SPI_S3AN,
>
> static int
> +is25lp256_post_bfpt_fixups(struct spi_nor *nor,
> + const struct sfdp_parameter_header *bfpt_header,
> + const struct sfdp_bfpt *bfpt,
> + struct spi_nor_flash_parameter *params)
> +{
> + /*
> + * IS25LP256 supports 4B opcodes.
> + * Unfortunately, some devices get BFPT_DWORD1_ADDRESS_BYTES_3_ONLY
^ which devices, did you get a list from issi?
> + * from BFPT table for address width. We should fix it.
How about "IS25LP256 supports 4B opcodes, but the BFPT advertises a
BFPT_DWORD1_ADDRESS_BYTES_3_ONLY address width. Overwrite the address width
advertised by the BFPT."
> + */
> + if ((bfpt->dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) ==
> + BFPT_DWORD1_ADDRESS_BYTES_3_ONLY)
> + nor->addr_width = 4;
> +
> + return 0;
> +}
> +
> +static struct spi_nor_fixups is25lp256_fixups = {
Naga will use "is25lp256_fixups" for the is25wp256 too, but it's not the case to
change the name yet. All good here.
I really want to have this in next, can I have an update in the next few days?
Cheers,
ta
next parent reply other threads:[~2019-06-22 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1554018157-10860-1-git-send-email-liu.xiang6@zte.com.cn>
2019-06-22 11:49 ` Tudor.Ambarus [this message]
2019-06-24 10:59 ` Vignesh Raghavendra
2019-06-24 14:38 ` Liu Xiang
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=5ffc9e32-ff69-9819-7bfd-ad9f793bb629@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=bbrezillon@kernel.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=liu.xiang6@zte.com.cn \
--cc=liuxiang_1999@126.com \
--cc=marek.vasut@gmail.com \
--cc=nagasure@xilinx.com \
--cc=richard@nod.at \
--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
all inboxes | Powered by JetHome®