From: Boris Brezillon <bbrezillon@kernel.org>
To: Emil Lenngren <emil.lenngren@gmail.com>
Cc: linux-mtd@lists.infradead.org, Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH] mtd: spinand: Fix Macronix ECC Status Read
Date: Thu, 20 Dec 2018 14:03:48 +0100 [thread overview]
Message-ID: <20181220140341.16e7c518@bbrezillon> (raw)
In-Reply-To: <20181220124658.11565-1-emil.lenngren@gmail.com>
+Miquel
Hi Emil,
Can you please Cc the NAND and MTD maintainers next time?
On Thu, 20 Dec 2018 13:46:58 +0100
Emil Lenngren <emil.lenngren@gmail.com> wrote:
> The datasheet specifies the upper four bits are reserved.
> Testing on real hardware shows that these bits can indeed be nonzero.
>
> Signed-off-by: Emil Lenngren <emil.lenngren@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> drivers/mtd/nand/spi/macronix.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
> index 98f6b9c4b6..d16b57081c 100644
> --- a/drivers/mtd/nand/spi/macronix.c
> +++ b/drivers/mtd/nand/spi/macronix.c
> @@ -10,6 +10,7 @@
> #include <linux/mtd/spinand.h>
>
> #define SPINAND_MFR_MACRONIX 0xC2
> +#define MACRONIX_ECCSR_MASK 0x0F
>
> static SPINAND_OP_VARIANTS(read_cache_variants,
> SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
> @@ -55,7 +56,12 @@ static int mx35lf1ge4ab_get_eccsr(struct spinand_device *spinand, u8 *eccsr)
> SPI_MEM_OP_DUMMY(1, 1),
> SPI_MEM_OP_DATA_IN(1, eccsr, 1));
>
> - return spi_mem_exec_op(spinand->spimem, &op);
> + int ret = spi_mem_exec_op(spinand->spimem, &op);
> + if (ret)
> + return ret;
> +
> + *eccsr &= MACRONIX_ECCSR_MASK;
> + return 0;
> }
>
> static int mx35lf1ge4ab_ecc_get_status(struct spinand_device *spinand,
next prev parent reply other threads:[~2018-12-20 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 12:46 [PATCH] mtd: spinand: Fix Macronix ECC Status Read Emil Lenngren
2018-12-20 13:03 ` Boris Brezillon [this message]
2018-12-20 13:20 ` Emil Lenngren
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=20181220140341.16e7c518@bbrezillon \
--to=bbrezillon@kernel.org \
--cc=emil.lenngren@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.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