[PATCH 01/10] spi: fsl-cpm: Map the zero page's address, not its struct page
From: Lee Jones
Date: Thu Nov 19 2026 - 04:18:33 EST
fsl_spi_cpm_init() maps a dummy TX buffer which is used for transfers
that have no tx_buf. Since the conversion from empty_zero_page to
ZERO_PAGE(0), the struct page pointer returned by ZERO_PAGE() has been
handed directly to dma_map_single(), which expects a kernel virtual
address.
As a result the mapping covers a PAGE_SIZE window of the memory map
rather than a page of zeroes, and that struct page metadata is then
clocked out onto the SPI bus for every RX-only transfer.
Pass page_address(ZERO_PAGE(0)) instead, so that the zero page itself is
mapped.
Fixes: 3be6acda8241 ("spi: fsl-cpm: substitute empty_zero_page with helper ZERO_PAGE(0)")
Closes: https://sashiko.dev/#/bug/linux-8dbfe527-3ba3-488a-a6fb-d4ee650b8ca7
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/spi/spi-fsl-cpm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c
index 23ad1249f121..ccdd62f3c74b 100644
--- a/drivers/spi/spi-fsl-cpm.c
+++ b/drivers/spi/spi-fsl-cpm.c
@@ -350,7 +350,8 @@ int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi)
goto err_bds;
}
- mspi->dma_dummy_tx = dma_map_single(dev, ZERO_PAGE(0), PAGE_SIZE,
+ mspi->dma_dummy_tx = dma_map_single(dev, page_address(ZERO_PAGE(0)),
+ PAGE_SIZE,
DMA_TO_DEVICE);
if (dma_mapping_error(dev, mspi->dma_dummy_tx)) {
dev_err(dev, "unable to map dummy tx buffer\n");
--
2.56.1.708.g77570a6a1d-goog