From aa07b770157b1f024c807b938a6f8225f73dff04 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 9 Jun 2019 11:27:02 +0200 Subject: [PATCH] 4.19-stable patches added patches: mtd-spinand-macronix-fix-ecc-status-read.patch --- ...spinand-macronix-fix-ecc-status-read.patch | 46 +++++++++++++++++++ queue-4.19/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 queue-4.19/mtd-spinand-macronix-fix-ecc-status-read.patch diff --git a/queue-4.19/mtd-spinand-macronix-fix-ecc-status-read.patch b/queue-4.19/mtd-spinand-macronix-fix-ecc-status-read.patch new file mode 100644 index 00000000000..26f0bf4974f --- /dev/null +++ b/queue-4.19/mtd-spinand-macronix-fix-ecc-status-read.patch @@ -0,0 +1,46 @@ +From f4cb4d7b46f6409382fd981eec9556e1f3c1dc5d Mon Sep 17 00:00:00 2001 +From: Emil Lenngren +Date: Thu, 20 Dec 2018 13:46:58 +0100 +Subject: mtd: spinand: macronix: Fix ECC Status Read + +From: Emil Lenngren + +commit f4cb4d7b46f6409382fd981eec9556e1f3c1dc5d upstream. + +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 +Reviewed-by: Boris Brezillon +Signed-off-by: Miquel Raynal +Cc: Christian Lamparter +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mtd/nand/spi/macronix.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/nand/spi/macronix.c ++++ b/drivers/mtd/nand/spi/macronix.c +@@ -10,6 +10,7 @@ + #include + + #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 + 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, diff --git a/queue-4.19/series b/queue-4.19/series index 7e623b43229..55cb19b6990 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -15,3 +15,4 @@ pktgen-do-not-sleep-with-the-thread-lock-held.patch revert-fib_rules-return-0-directly-if-an-exactly-same-rule-exists-when-nlm_f_excl-not-supplied.patch ipv6-use-read_once-for-inet-hdrincl-as-in-ipv4.patch ipv6-fix-efault-on-sendto-with-icmpv6-and-hdrincl.patch +mtd-spinand-macronix-fix-ecc-status-read.patch -- 2.47.2