Skip to content

spi: spi-qpic-snand: fix the stale ECC context pointer

Johan Alvarado linux-arm-msm linux-mtd linux-spi lkml sashiko-reviews 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v11 patch 5 repliesApplied

Changes in v2 from the cover letter

- Add Gabor Juhos' Tested-by to patch 1.
- Add patch 2, dropping the now redundant assignment in qcom_spi_ecc_prepare_io_req_pipelined() and the unused zeroed struct qpic_ecc allocated in qcom_spi_probe(). Suggested by Gabor Juhos, kept separate so the stable backport stays minimal.
- Rebase onto spi/for-next, which carries commit 44d39535cd4f ("spi:
spi-qpic-snand: remove interim 'dev_data' variable from qcom_spi_probe()") touching the same probe lines as patch 2.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2spi: spi-qpic-snand: publish the ECC context to snandc->qspidrivers/spi/spi-qpic-snand.c+3 -00 replies
2/2spi: spi-qpic-snand: drop the redundant ECC context handlingdrivers/spi/spi-qpic-snand.c+0 -82 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchGabor Juhos
1/2T-b
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] spi: spi-qpic-snand: fix the stale ECC context pointer

qcom_spi_ecc_init_ctx_pipelined() installs the ooblayout but never publishes the ECC context it allocates, so qcom_spi_ooblayout_ecc() and qcom_spi_ooblayout_free() run against a pointer that describes something else - a zeroed struct on a first probe, the previous attempt's freed context on a retry. On IPQ5018 the qcom,smem-part parser makes that retry routine, and like half the boots on a Mercusys MR80X failed to mount the rootfs.

Patch 1 is the fix and is unchanged from v1. Patch 2 removes what becomes redundant once the context is published. It is a cleanup with no functional change, so it carries no Fixes: tag and is not marked for stable.

Patch 1 was applied to mtd/fixes as 93bc7c4d2f41 on 2026-09-04 and dropped the same day, so nothing from this series is queued.

v1: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Add Gabor Juhos' Tested-by to patch 1.
- Add patch 2, dropping the now redundant assignment in qcom_spi_ecc_prepare_io_req_pipelined() and the unused zeroed struct qpic_ecc allocated in qcom_spi_probe(). Suggested by Gabor Juhos, kept separate so the stable backport stays minimal.
- Rebase onto spi/for-next, which carries commit 44d39535cd4f ("spi:
spi-qpic-snand: remove interim 'dev_data' variable from qcom_spi_probe()") touching the same probe lines as patch 2.

Both patches build with W=1 and sparse without warnings, and each patch builds on its own.

Johan Alvarado (2):
spi: spi-qpic-snand: publish the ECC context to snandc->qspi
spi: spi-qpic-snand: drop the redundant ECC context handling

 drivers/spi/spi-qpic-snand.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

base-commit: 98100d83adc8e17606605d131e685b1fbedfe092

Signature · 1 line
2.55.0