Skip to content

Commit 301c894

Browse files
committed
Merge tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A few more small driver specific fixes" * tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-rspi: Fix PIO fallback on RZ platforms spi: spi-cadence: Fix SPI NO Slave Select macro definition spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
2 parents 70664fc + b620aa3 commit 301c894

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

drivers/spi/spi-bcm2835.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,14 @@ static void bcm2835_spi_handle_err(struct spi_controller *ctlr,
11381138
struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
11391139

11401140
/* if an error occurred and we have an active dma, then terminate */
1141-
dmaengine_terminate_sync(ctlr->dma_tx);
1142-
bs->tx_dma_active = false;
1143-
dmaengine_terminate_sync(ctlr->dma_rx);
1144-
bs->rx_dma_active = false;
1141+
if (ctlr->dma_tx) {
1142+
dmaengine_terminate_sync(ctlr->dma_tx);
1143+
bs->tx_dma_active = false;
1144+
}
1145+
if (ctlr->dma_rx) {
1146+
dmaengine_terminate_sync(ctlr->dma_rx);
1147+
bs->rx_dma_active = false;
1148+
}
11451149
bcm2835_spi_undo_prologue(bs);
11461150

11471151
/* and reset */

drivers/spi/spi-cadence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#define CDNS_SPI_BAUD_DIV_SHIFT 3 /* Baud rate divisor shift in CR */
7070
#define CDNS_SPI_SS_SHIFT 10 /* Slave Select field shift in CR */
7171
#define CDNS_SPI_SS0 0x1 /* Slave Select zero */
72-
#define CDNS_SPI_NOSS 0x3C /* No Slave select */
72+
#define CDNS_SPI_NOSS 0xF /* No Slave select */
7373

7474
/*
7575
* SPI Interrupt Registers bit Masks

drivers/spi/spi-rspi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,10 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
613613
rspi->dma_callbacked, HZ);
614614
if (ret > 0 && rspi->dma_callbacked) {
615615
ret = 0;
616+
if (tx)
617+
dmaengine_synchronize(rspi->ctlr->dma_tx);
618+
if (rx)
619+
dmaengine_synchronize(rspi->ctlr->dma_rx);
616620
} else {
617621
if (!ret) {
618622
dev_err(&rspi->ctlr->dev, "DMA timeout\n");

0 commit comments

Comments
 (0)