Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gabor Juhos" <j4g8y7@gmail.com>, "Mark Brown" <broonie@kernel.org>
Cc: "Md Sadre Alam" <md.alam@oss.qualcomm.com>,
	"Sricharan Ramabadhran" <quic_srichara@quicinc.com>,
	"Varadarajan Narayanan" <varadarajan.narayanan@oss.qualcomm.com>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/7] spi: spi-qpic-snand: use the common qcom_nandc_config_page_read() function
Date: Tue, 10 Nov 2026 23:20:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-207882@kernel.org> (raw)
In-Reply-To: <20261109-qpic-snand-use-common-functions-v1-2-1e8601e2db84@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] spi: spi-qpic: unhandled DMA descriptor preparation
  failures [1]
--

commit 05d954fd8faf497964c92778fc951ed3a1d8862c
Author: Gabor Juhos <j4g8y7@gmail.com>

spi: spi-qpic-snand: use the common qcom_nandc_config_page_read() function

This commit removes the local qcom_spi_config_page_read() helper and replaces
its callers with the common qcom_nandc_config_page_read() function from
qpic_common.

> diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
> index 981e16221b59e..cf75c142303f8 100644
> --- a/drivers/spi/spi-qpic-snand.c
> +++ b/drivers/spi/spi-qpic-snand.c

[ ... ]

> @@ -588,7 +577,7 @@ static int qcom_spi_block_erase(struct qcom_nand_controller *snandc)
>  static void qcom_spi_config_single_cw_page_read(struct qcom_nand_controller *snandc,
>  						bool use_ecc, int cw)
>  {
> -	qcom_spi_config_page_read(snandc);
> +	qcom_nandc_config_page_read(snandc);
>  	qcom_spi_config_cw_read(snandc, use_ecc, cw);
>  }

[Severity: Critical]
This problem wasn't introduced by this patch, but can
qcom_spi_config_single_cw_page_read() and qcom_nandc_config_page_read()
silently drop DMA descriptor preparation errors [1] and submit a
truncated BAM command sequence?

Both helpers are void and ignore the return value of qcom_write_reg_dma() ->
qcom_prep_bam_dma_desc_cmd(), which can fail with -ENOMEM under memory
pressure or -EINVAL if the BAM command element array is full.  The caller
then runs qcom_submit_descs() on the partially constructed descriptor list,
which can leave the QPIC SPI NAND controller in an undefined state or corrupt
flash I/O.

[1] https://sashiko.dev/#/bug/linux-28d007e2-6585-44cc-ae82-b3da2495b9ab

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-qpic-snand-use-common-functions-v1-0-1e8601e2db84@gmail.com?part=2

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

  reply	other threads:[~2026-11-10 23:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 19:41 [PATCH 0/7] spi: spi-qpic-snand: use generic code from the 'qpic_common' module Gabor Juhos
2026-11-09 19:41 ` [PATCH 1/7] spi: spi-qpic-snand: use the common qcom_nandc_check_flash_errors() function Gabor Juhos
2026-11-10 23:16   ` sashiko-bot
2026-11-09 19:41 ` [PATCH 2/7] spi: spi-qpic-snand: use the common qcom_nandc_config_page_read() function Gabor Juhos
2026-11-10 23:20   ` sashiko-bot [this message]
2026-11-09 19:41 ` [PATCH 3/7] spi: spi-qpic-snand: use the common qcom_nandc_config_page_write() function Gabor Juhos
2026-11-10 23:24   ` sashiko-bot
2026-11-09 19:41 ` [PATCH 4/7] spi: spi-qpic-snand: use the common qcom_nandc_config_cw_write() function Gabor Juhos
2026-11-09 19:45   ` sashiko-bot
2026-11-09 19:41 ` [PATCH 5/7] spi: spi-qpic-snand: use the common qcom_nandc_set_read_loc_first() function Gabor Juhos
2026-11-09 19:41 ` [PATCH 6/7] spi: spi-qpic-snand: use the common qcom_nandc_set_read_loc_last() function Gabor Juhos
2026-11-09 19:41 ` [PATCH 7/7] spi: spi-qpic-snand: use the common 'qcom_nandc_read_stats' structure Gabor Juhos
2026-11-10 18:46 ` [PATCH 0/7] spi: spi-qpic-snand: use generic code from the 'qpic_common' module Mark Brown
2026-11-10 21:18   ` Gabor Juhos
2026-11-10 23:50     ` 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=sashiko-outbox-207882@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=broonie@kernel.org \
    --cc=j4g8y7@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=md.alam@oss.qualcomm.com \
    --cc=quic_srichara@quicinc.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=varadarajan.narayanan@oss.qualcomm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox