Commit f8039ea5 authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown

spi: qcom: geni: handle timeout for gpi mode

We missed adding handle_err for gpi mode, so add a new function
spi_geni_handle_err() which would call handle_fifo_timeout() or newly
added handle_gpi_timeout() based on mode

Fixes: b59c1224 ("spi: spi-geni-qcom: Add support for GPI dma")
Reported-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220103071118.27220-2-vkoul@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 74b86d6a
...@@ -164,6 +164,30 @@ static void handle_fifo_timeout(struct spi_master *spi, ...@@ -164,6 +164,30 @@ static void handle_fifo_timeout(struct spi_master *spi,
} }
} }
static void handle_gpi_timeout(struct spi_master *spi, struct spi_message *msg)
{
struct spi_geni_master *mas = spi_master_get_devdata(spi);
dmaengine_terminate_sync(mas->tx);
dmaengine_terminate_sync(mas->rx);
}
static void spi_geni_handle_err(struct spi_master *spi, struct spi_message *msg)
{
struct spi_geni_master *mas = spi_master_get_devdata(spi);
switch (mas->cur_xfer_mode) {
case GENI_SE_FIFO:
handle_fifo_timeout(spi, msg);
break;
case GENI_GPI_DMA:
handle_gpi_timeout(spi, msg);
break;
default:
dev_err(mas->dev, "Abort on Mode:%d not supported", mas->cur_xfer_mode);
}
}
static bool spi_geni_is_abort_still_pending(struct spi_geni_master *mas) static bool spi_geni_is_abort_still_pending(struct spi_geni_master *mas)
{ {
struct geni_se *se = &mas->se; struct geni_se *se = &mas->se;
...@@ -922,7 +946,7 @@ static int spi_geni_probe(struct platform_device *pdev) ...@@ -922,7 +946,7 @@ static int spi_geni_probe(struct platform_device *pdev)
spi->can_dma = geni_can_dma; spi->can_dma = geni_can_dma;
spi->dma_map_dev = dev->parent; spi->dma_map_dev = dev->parent;
spi->auto_runtime_pm = true; spi->auto_runtime_pm = true;
spi->handle_err = handle_fifo_timeout; spi->handle_err = spi_geni_handle_err;
spi->use_gpio_descriptors = true; spi->use_gpio_descriptors = true;
init_completion(&mas->cs_done); init_completion(&mas->cs_done);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment