[PATCH 2/7] spi: spi-qpic-snand: use the common qcom_nandc_config_page_read() function

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Nov 10 15:20:15 PST 2026


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



More information about the linux-mtd mailing list