From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
To: Yicong Yang <yangyicong@hisilicon.com>,
tudor.ambarus@microchip.com, linux-mtd@lists.infradead.org
Cc: vigneshr@ti.com, sergei.shtylyov@cogentembedded.com,
richard@nod.at, john.garry@huawei.com, linuxarm@huawei.com,
miquel.raynal@bootlin.com
Subject: Re: [PATCH] mtd: spi-nor: sfdp: Fix wrong addr length and dummy when perform SMPT detection command
Date: Tue, 21 Apr 2020 09:54:45 +0200 [thread overview]
Message-ID: <f893b8d4-03e8-bce8-b14e-1584802c6d53@nokia.com> (raw)
In-Reply-To: <1587439812-49387-1-git-send-email-yangyicong@hisilicon.com>
Hi!
On 21/04/2020 05:30, Yicong Yang wrote:
> As per SFDP(JESD216D, Section 6.5.3) says of SMPT 1st DWORD, 11b of
> bit[23:22] and 1111b of bit[19:16] represent variable
> {address length, read latency}, which means "the {address length,
> read latency} last set in memory device and this same value is used in the
> configuration dectection command". Currently we use address length
> and dummy byte of struct spi_nor in such conditions. But the value
> are 0 as they are not set at the time, which will lead to
> wrong perform of the dectection command.
>
> As the last command is read SFDP(1S-1S-1S, the only mode we use in kernel),
> with 3-byte address and 8 dummy cycles, use the same values in
> variable situations to perform correct dectection command.
Well this will work and as the maintainers ignore the proper and even recommended by them solution,
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> Fixes: b038e8e3be72 ("mtd: spi-nor: parse SFDP Sector Map Parameter Table")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
> drivers/mtd/spi-nor/sfdp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c
> index f6038d3..27a8faa 100644
> --- a/drivers/mtd/spi-nor/sfdp.c
> +++ b/drivers/mtd/spi-nor/sfdp.c
> @@ -624,7 +624,7 @@ static u8 spi_nor_smpt_addr_width(const struct spi_nor *nor, const u32 settings)
> return 4;
> case SMPT_CMD_ADDRESS_LEN_USE_CURRENT:
> default:
> - return nor->addr_width;
> + return 3;
> }
> }
>
> @@ -641,7 +641,7 @@ static u8 spi_nor_smpt_read_dummy(const struct spi_nor *nor, const u32 settings)
> u8 read_dummy = SMPT_CMD_READ_DUMMY(settings);
>
> if (read_dummy == SMPT_CMD_READ_DUMMY_IS_VARIABLE)
> - return nor->read_dummy;
> + return 8;
> return read_dummy;
> }
--
Best regards,
Alexander Sverdlin.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-04-21 7:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 3:30 [PATCH] mtd: spi-nor: sfdp: Fix wrong addr length and dummy when perform SMPT detection command Yicong Yang
2020-04-21 7:54 ` Alexander Sverdlin [this message]
2020-04-21 9:58 ` Tudor.Ambarus
2020-04-21 10:39 ` Alexander Sverdlin
2020-04-21 11:14 ` Tudor.Ambarus
2020-04-21 11:44 ` Pratyush Yadav
2020-04-21 12:25 ` Yicong Yang
2020-04-22 13:51 ` Pratyush Yadav
2020-04-23 11:09 ` Yicong Yang
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=f893b8d4-03e8-bce8-b14e-1584802c6d53@nokia.com \
--to=alexander.sverdlin@nokia.com \
--cc=john.garry@huawei.com \
--cc=linux-mtd@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
--cc=yangyicong@hisilicon.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