spi: Fixes for v7.1

A couple of driver specific fixes for v7.1, a small targetted fix for
 hardware error handling on DesignWare controllers and another for
 handling of custom chip select managmenet on Qualcomm GENI controllers.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmosRy4ACgkQJNaLcl1U
 h9DIigf8CYkVGrJ/PRXvWUcF4xwiwyO1GsM15cDN3LVUC6dD2P2DzHjxVvr5KvzI
 J+ZS7Dyh/TDTZxdCS1foHsQWALtwNfLMqVQHk/YdJDH7ELVQkHzyxUwVa9RJtexM
 d7HHtCoYivANp3CQugJVXux11cRinRCU8aCBvcj7/o26tRxFmvoRT9U7jsAJULyG
 7Mb03RCsOlxi2cOGRSTq3a4b2GanoxD+z7zKde99jTI5haA7oWR3XLEgLSBf5REl
 PUEwTkrPopTqESELOZe+YinGwLhVljAkSX+f6yAAVbk33aW2hSmveNpb5wK40dRF
 E3NmCpAxjcAxo0iIBfVjUHGXIK8now==
 =8A3s
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v7.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of driver specific fixes: a small targeted fix for hardware
  error handling on DesignWare controllers and another for handling of
  custom chip select management on Qualcomm GENI controllers"

* tag 'spi-fix-v7.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: dw: fix race between IRQ handler and error handler on SMP
  spi: qcom-geni: Fix cs_change handling on the last transfer
This commit is contained in:
Linus Torvalds 2026-06-12 11:06:16 -07:00
commit 2860828361
2 changed files with 21 additions and 8 deletions

View File

@ -472,7 +472,9 @@ static inline void dw_spi_abort(struct spi_controller *ctlr)
if (dws->dma_mapped)
dws->dma_ops->dma_stop(dws);
disable_irq(dws->irq);
dw_spi_reset_chip(dws);
enable_irq(dws->irq);
}
static void dw_spi_handle_err(struct spi_controller *ctlr,

View File

@ -440,10 +440,15 @@ static int setup_gsi_xfer(struct spi_transfer *xfer, struct spi_geni_master *mas
return ret;
}
if (!xfer->cs_change) {
if (!list_is_last(&xfer->transfer_list, &spi->cur_msg->transfers))
peripheral.fragmentation = FRAGMENTATION;
}
/*
* Set fragmentation to keep CS asserted after this transfer when:
* - non-last transfer with cs_change=0: keep CS asserted between chained transfers
* - last transfer with cs_change=1: keep CS asserted after the message
* (e.g. TPM TIS SPI uses cs_change=1 on single-transfer messages to
* keep CS asserted across header, wait-state and data phases)
*/
peripheral.fragmentation = list_is_last(&xfer->transfer_list, &spi->cur_msg->transfers) ?
xfer->cs_change : !xfer->cs_change;
if (peripheral.cmd & SPI_RX) {
dmaengine_slave_config(mas->rx, &config);
@ -849,10 +854,16 @@ static int setup_se_xfer(struct spi_transfer *xfer,
mas->cur_xfer_mode = GENI_SE_DMA;
geni_se_select_mode(se, mas->cur_xfer_mode);
if (!xfer->cs_change) {
if (!list_is_last(&xfer->transfer_list, &spi->cur_msg->transfers))
m_params = FRAGMENTATION;
}
/*
* Set FRAGMENTATION to keep CS asserted after this transfer when:
* - non-last transfer with cs_change=0: keep CS asserted between chained transfers
* - last transfer with cs_change=1: keep CS asserted after the message
* (e.g. TPM TIS SPI uses cs_change=1 on single-transfer messages to
* keep CS asserted across header, wait-state and data phases)
*/
if (list_is_last(&xfer->transfer_list, &spi->cur_msg->transfers) ?
xfer->cs_change : !xfer->cs_change)
m_params = FRAGMENTATION;
/*
* Lock around right before we start the transfer since our