Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: geni-qcom: Fix abort sequence execution for serial engine errors

The driver currently skips the abort sequence for target mode when serial
engine errors occur. This leads to improper error recovery as the serial
engine may remain in an undefined state without proper cleanup, potentially
causing subsequent operations to fail or behave unpredictably.

Fix this by ensuring the abort sequence and DMA reset always execute during
error recovery, as both are required for proper serial engine error
handling.

Co-developed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260204162854.1206323-3-praveen.talari@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Praveen Talari and committed by
Mark Brown
96e04164 50464497

+11 -15
+11 -15
drivers/spi/spi-geni-qcom.c
··· 161 161 xfer = mas->cur_xfer; 162 162 mas->cur_xfer = NULL; 163 163 164 - if (spi->target) { 165 - /* 166 - * skip CMD Cancel sequnece since spi target 167 - * doesn`t support CMD Cancel sequnece 168 - */ 164 + /* The controller doesn't support the Cancel commnand in target mode */ 165 + if (!spi->target) { 166 + reinit_completion(&mas->cancel_done); 167 + geni_se_cancel_m_cmd(se); 168 + 169 169 spin_unlock_irq(&mas->lock); 170 - goto reset_if_dma; 170 + 171 + time_left = wait_for_completion_timeout(&mas->cancel_done, HZ); 172 + if (time_left) 173 + goto reset_if_dma; 174 + 175 + spin_lock_irq(&mas->lock); 171 176 } 172 177 173 - reinit_completion(&mas->cancel_done); 174 - geni_se_cancel_m_cmd(se); 175 - spin_unlock_irq(&mas->lock); 176 - 177 - time_left = wait_for_completion_timeout(&mas->cancel_done, HZ); 178 - if (time_left) 179 - goto reset_if_dma; 180 - 181 - spin_lock_irq(&mas->lock); 182 178 reinit_completion(&mas->abort_done); 183 179 geni_se_abort_m_cmd(se); 184 180 spin_unlock_irq(&mas->lock);