Skip to content

Commit 4c329f5

Browse files
Vijaya Krishna Nivarthibroonie
authored andcommitted
spi: spi-geni-qcom: Select FIFO mode for chip select
Spi geni driver switches between FIFO and DMA modes based on xfer length. FIFO mode relies on M_CMD_DONE_EN interrupt for completion while DMA mode relies on XX_DMA_DONE. During dynamic switching, if FIFO mode is chosen, FIFO related interrupts are enabled and DMA related interrupts are disabled. And viceversa. Chip select shares M_CMD_DONE_EN interrupt with FIFO to check completion. Now, if a chip select operation is preceded by a DMA xfer, M_CMD_DONE_EN interrupt would have been disabled and hence it will never receive one resulting in timeout. For chip select, in addition to setting the xfer mode to FIFO, select_mode() to FIFO so that required interrupts are enabled. Fixes: e5f0dfa ("spi: spi-geni-qcom: Add support for SE DMA mode") Suggested-by: Praveen Talari <[email protected] Signed-off-by: Vijaya Krishna Nivarthi <[email protected] Reviewed-by: Douglas Anderson <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent ac9a786 commit 4c329f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi-geni-qcom.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
294294
mas->cs_flag = set_flag;
295295
/* set xfer_mode to FIFO to complete cs_done in isr */
296296
mas->cur_xfer_mode = GENI_SE_FIFO;
297+
geni_se_select_mode(se, mas->cur_xfer_mode);
298+
297299
reinit_completion(&mas->cs_done);
298300
if (set_flag)
299301
geni_se_setup_m_cmd(se, SPI_CS_ASSERT, 0);

0 commit comments

Comments
 (0)