lkml.org 
[lkml]   [2020]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 08/16] spi: dw: Fix Rx-only DMA transfers
    Date
    Tx-only DMA transfers are working perfectly fine since in this case
    the code just ignores the Rx FIFO overflow interrupts. But it turns
    out the SPI Rx-only transfers are broken since nothing pushing any
    data to the shift registers, so the Rx FIFO is left empty and the
    SPI core subsystems just returns a timeout error. Since DW DMAC
    driver doesn't support something like cyclic write operations of
    a single byte to a device register, the only way to support the
    Rx-only SPI transfers is to fake it by using a dummy Tx-buffer.
    This is what we intend to fix in this commit by setting the
    SPI_CONTROLLER_MUST_TX flag for DMA-capable platform.

    Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Cc: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
    Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
    Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
    Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Feng Tang <feng.tang@intel.com>
    Cc: Rob Herring <robh+dt@kernel.org>
    Cc: linux-mips@vger.kernel.org
    Cc: devicetree@vger.kernel.org
    ---
    drivers/spi/spi-dw.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
    index 6939e003e3e9..4d1849699a12 100644
    --- a/drivers/spi/spi-dw.c
    +++ b/drivers/spi/spi-dw.c
    @@ -515,6 +515,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
    dev_warn(dev, "DMA init failed\n");
    } else {
    master->can_dma = dws->dma_ops->can_dma;
    + master->flags |= SPI_CONTROLLER_MUST_TX;
    }
    }

    --
    2.26.2
    \
     
     \ /
      Last update: 2020-05-29 06:01    [W:3.412 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site