All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Alvarado <contact@c127.dev>
To: broonie@kernel.org, md.alam@oss.qualcomm.com
Cc: konradybcio@kernel.org, pengpeng@iscas.ac.cn,
	miquel.raynal@bootlin.com, j4g8y7@gmail.com,
	quic_varada@quicinc.com, quic_srichara@quicinc.com,
	linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Alvarado <contact@c127.dev>
Subject: [PATCH v2 0/2] spi: spi-qpic-snand: fix the stale ECC context pointer
Date: Fri, 11 Sep 2026 13:44:14 -0500	[thread overview]
Message-ID: <20260911184416.109790-1-contact@c127.dev> (raw)

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/20260825013848.1056946-1-contact@c127.dev/

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
-- 
2.55.0


WARNING: multiple messages have this Message-ID (diff)
From: Johan Alvarado <contact@c127.dev>
To: broonie@kernel.org, md.alam@oss.qualcomm.com
Cc: konradybcio@kernel.org, pengpeng@iscas.ac.cn,
	miquel.raynal@bootlin.com, j4g8y7@gmail.com,
	quic_varada@quicinc.com, quic_srichara@quicinc.com,
	linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Alvarado <contact@c127.dev>
Subject: [PATCH v2 0/2] spi: spi-qpic-snand: fix the stale ECC context pointer
Date: Fri, 11 Sep 2026 13:44:14 -0500	[thread overview]
Message-ID: <20260911184416.109790-1-contact@c127.dev> (raw)

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/20260825013848.1056946-1-contact@c127.dev/

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
-- 
2.55.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

             reply	other threads:[~2026-09-11 18:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 18:44 Johan Alvarado [this message]
2026-09-11 18:44 ` [PATCH v2 0/2] spi: spi-qpic-snand: fix the stale ECC context pointer Johan Alvarado
2026-09-11 18:44 ` [PATCH v2 1/2] spi: spi-qpic-snand: publish the ECC context to snandc->qspi Johan Alvarado
2026-09-11 18:44   ` Johan Alvarado
2026-09-11 18:44 ` [PATCH v2 2/2] spi: spi-qpic-snand: drop the redundant ECC context handling Johan Alvarado
2026-09-11 18:44   ` Johan Alvarado
2026-09-11 19:10   ` sashiko-bot
2026-09-11 19:10     ` sashiko-bot
2026-09-12  0:05     ` Johan Alvarado
2026-09-12  0:05       ` Johan Alvarado
2026-09-17  7:17   ` Gabor Juhos
2026-09-17  7:17     ` Gabor Juhos
2026-09-17 15:25 ` [PATCH v2 0/2] spi: spi-qpic-snand: fix the stale ECC context pointer Mark Brown
2026-09-17 15:25   ` Mark Brown

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=20260911184416.109790-1-contact@c127.dev \
    --to=contact@c127.dev \
    --cc=broonie@kernel.org \
    --cc=j4g8y7@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=md.alam@oss.qualcomm.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pengpeng@iscas.ac.cn \
    --cc=quic_srichara@quicinc.com \
    --cc=quic_varada@quicinc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.