[PATCH v3 0/7] Fix use of Hamming helpers

Miquel Raynal miquel.raynal at bootlin.com
Tue Apr 13 17:18:33 BST 2021


In one of my previous code reorganization I broke several
drivers. Recently spotted by Trevor on the lpc32xx_slc driver, I updated
several other drivers to benefit from this change.

Basically, I did a rename of the software Hamming ECC helpers, creating
this way a proper ECC engine and also rawnand helpers. The problem is,
using the raw NAND helpers from the various raw NAND drivers only works
now if the ECC engine has been properly initialized and the necessary
buffers allocated and pointers initialized. But in most cases of these
cases, the actual engine is a on host hardware ECC engine which lacks
correctness support. Using the bare helpers (which only do the
calculations) on provided buffers is enough. So switch to use these bare
helpers instead of the rawnand_* helpers which currently lead to a NULL
pointer dereference.

Changes since v2:
- Fix all drivers suffering from the same issue.
- Update the Fixes line to point to the real commit which introduce the
  problem.
- Added Trevor's Tested-by tag on the lpc32xx_slc fix.

Miquel Raynal (7):
  mtd: rawnand: cs553x: Fix external use of SW Hamming ECC helper
  mtd: rawnand: fsmc: Fix external use of SW Hamming ECC helper
  mtd: rawnand: lpc32xx_slc: Fix external use of SW Hamming ECC helper
  mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper
  mtd: rawnand: sharpsl: Fix external use of SW Hamming ECC helper
  mtd: rawnand: tmio: Fix external use of SW Hamming ECC helper
  mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper

 drivers/mtd/nand/raw/cs553x_nand.c | 11 ++++++++++-
 drivers/mtd/nand/raw/fsmc_nand.c   | 12 +++++++++++-
 drivers/mtd/nand/raw/lpc32xx_slc.c | 15 ++++++++++++++-
 drivers/mtd/nand/raw/ndfc.c        | 12 +++++++++++-
 drivers/mtd/nand/raw/sharpsl.c     | 12 +++++++++++-
 drivers/mtd/nand/raw/tmio_nand.c   |  8 +++++---
 drivers/mtd/nand/raw/txx9ndfmc.c   |  5 +++--
 7 files changed, 65 insertions(+), 10 deletions(-)

-- 
2.27.0




More information about the linux-mtd mailing list