Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spi: dw-dma: Get the last DMA scoop out of the FIFO #5699

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drivers/spi/spi-dw-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ static void dw_spi_dma_tx_done(void *arg)
struct dw_spi *dws = arg;

clear_bit(DW_SPI_TX_BUSY, &dws->dma_chan_busy);
if (test_bit(DW_SPI_RX_BUSY, &dws->dma_chan_busy))
if (test_bit(DW_SPI_RX_BUSY, &dws->dma_chan_busy)) {
dw_writel(dws, DW_SPI_DMARDLR, 0);
return;
}

complete(&dws->dma_completion);
}
Expand Down Expand Up @@ -602,6 +604,8 @@ static int dw_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer)

nents = max(xfer->tx_sg.nents, xfer->rx_sg.nents);

dw_writel(dws, DW_SPI_DMARDLR, xfer->tx_buf ? (dws->rxburst - 1) : 0);

/*
* Execute normal DMA-based transfer (which submits the Rx and Tx SG
* lists directly to the DMA engine at once) if either full hardware
Expand Down