Re: [PATCH v2 2/2] spi: spi-qpic-snand: drop the redundant ECC context handling

From: Gabor Juhos

Date: Thu Sep 17 2026 - 03:19:13 EST


2026. 09. 11. 20:44 keltezéssel, Johan Alvarado írta:
> qcom_spi_ecc_init_ctx_pipelined() now publishes the ECC context to
> snandc->qspi->ecc, so the assignment in
> qcom_spi_ecc_prepare_io_req_pipelined() repeats what the pointer already
> holds, and the zeroed struct qpic_ecc that qcom_spi_probe() allocates is
> never read.
>
> The pointer is non-NULL only between context creation and destruction,
> and every reader runs inside that window. The ooblayout callbacks are
> installed by init_ctx. The page read, write and program helpers run only
> when prepare_io_req has set page_rw or oob_rw. qcom_spi_block_erase()
> runs only while the mtd is registered, which happens after init_ctx and
> ends before cleanup_ctx. The controller drives a single chip select, so
> the per-controller pointer and the per-chip context cannot disagree.
>
> Remove both. No functional change.
>
> Suggested-by: Gabor Juhos <j4g8y7@xxxxxxxxx>
> Signed-off-by: Johan Alvarado <contact@xxxxxxxx>
> ---
> Tested on a Mercusys MR80X (IPQ5018, ESMT F50D1G41LB) with both patches
> backported to 6.18.44. Five boots, rootfs mounted every time, mtd
> reported 0 ECC failures and 0 corrected bits, and a 4 MiB file on the
> UBIFS overlay kept its sha256 across the reboots. Overlay churn raised
> the UBI maximum erase counter from 13 to 15, so qcom_spi_block_erase()
> ran repeatedly. Build-tested on this base with W=1 and sparse, no
> warnings, patch 1 alone and both patches applied.

Tested on Tp-Link Archer AX55 v1 built on top of 98100d83adc8 ("Merge
remote-tracking branch 'spi/for-7.4' into spi-next"). No regressions observed.

Tested-by: Gabor Juhos <j4g8y7@xxxxxxxxx>