lkml.org 
[lkml]   [2020]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v9 RESEND 01/13] spi: imx: add dma_sync_sg_for_device after fallback from dma
    On Sun, Jun 07, 2020 at 07:21:05AM +0800, Robin Gong wrote:
    > In case dma transfer failed and fallback to pio, tx_buf/rx_buf need to be
    > taken care cache since they have already been maintained by spi.c

    Is this needed as part of this series? This looks like an independent
    fix and it seems better to get this in independently.

    > Fixes: bcd8e7761ec9("spi: imx: fallback to PIO if dma setup failure")
    > Signed-off-by: Robin Gong <yibin.gong@nxp.com>
    > Reported-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
    > Link: https://lore.kernel.org/linux-arm-kernel/5d246dd81607bb6e5cb9af86ad4e53f7a7a99c50.camel@ew.tq-group.com/

    The Link is usually to the patch on the list.

    > --- a/drivers/spi/spi-imx.c
    > +++ b/drivers/spi/spi-imx.c
    > @@ -1456,6 +1456,13 @@ static int spi_imx_pio_transfer(struct spi_device *spi,
    > return -ETIMEDOUT;
    > }
    >
    > + if (transfer->rx_sg.sgl) {
    > + struct device *rx_dev = spi->controller->dma_rx->device->dev;
    > +
    > + dma_sync_sg_for_device(rx_dev, transfer->rx_sg.sgl,
    > + transfer->rx_sg.nents, DMA_TO_DEVICE);
    > + }
    > +
    > return transfer->len;
    > }

    This is confusing - why are we DMA mapping to the device after doing a
    PIO transfer?
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2020-06-08 16:35    [W:3.344 / U:1.916 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site