Message ID | 1455715739-25161-2-git-send-email-s.hauer@pengutronix.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 390f0ffe92aea878b763c7fd8afd1dff62e0d20b |
Headers | show |
On Wed, Feb 17, 2016 at 02:28:47PM +0100, Sascha Hauer wrote: > Also removing change introduced in f6ee9b582d2db652497b73c1f117591dfb6d3a90 > since this change only fix usecases with transfer size from 33 to 128 bytes > and doesn't fix 129 bytes and bigger. Please include human readable descriptions of things like commits and issues being discussed in e-mail in your mails, this makes them much easier for humans to read especially when they have no internet access. I do frequently catch up on my mail on flights or while otherwise travelling so this is even more pressing for me than just being about making things a bit easier to read.
On Wed, Feb 17, 2016 at 02:16:19PM +0000, Mark Brown wrote: > On Wed, Feb 17, 2016 at 02:28:47PM +0100, Sascha Hauer wrote: > > > Also removing change introduced in f6ee9b582d2db652497b73c1f117591dfb6d3a90 > > since this change only fix usecases with transfer size from 33 to 128 bytes > > and doesn't fix 129 bytes and bigger. > > Please include human readable descriptions of things like commits and > issues being discussed in e-mail in your mails, this makes them much > easier for humans to read especially when they have no internet access. > I do frequently catch up on my mail on flights or while otherwise > travelling so this is even more pressing for me than just being about > making things a bit easier to read. You seem to have a template for this, I remember having read the same text before ;) Will fix this and add a signed-off-by. Sascha
On Wed, Feb 17, 2016 at 04:01:46PM +0100, Sascha Hauer wrote: > You seem to have a template for this, I remember having read the same > text before ;) I do, but even before I had a template I'd always end up typing the same thing by hand anyway.
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index d98c33c..08492d6 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -204,8 +204,8 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, { struct spi_imx_data *spi_imx = spi_master_get_devdata(master); - if (spi_imx->dma_is_inited && - transfer->len > spi_imx->wml * sizeof(u32)) + if (spi_imx->dma_is_inited && transfer->len >= spi_imx->wml && + (transfer->len % spi_imx->wml) == 0) return true; return false; } @@ -919,8 +919,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx, struct dma_async_tx_descriptor *desc_tx = NULL, *desc_rx = NULL; int ret; unsigned long timeout; - u32 dma; - int left; struct spi_master *master = spi_imx->bitbang.master; struct sg_table *tx = &transfer->tx_sg, *rx = &transfer->rx_sg; @@ -954,13 +952,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx, /* Trigger the cspi module. */ spi_imx->dma_finished = 0; - dma = readl(spi_imx->base + MX51_ECSPI_DMA); - dma = dma & (~MX51_ECSPI_DMA_RXT_WML_MASK); - /* Change RX_DMA_LENGTH trigger dma fetch tail data */ - left = transfer->len % spi_imx->wml; - if (left) - writel(dma | (left << MX51_ECSPI_DMA_RXT_WML_OFFSET), - spi_imx->base + MX51_ECSPI_DMA); /* * Set these order to avoid potential RX overflow. The overflow may * happen if we enable SPI HW before starting RX DMA due to rescheduling @@ -992,10 +983,6 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx, spi_imx->devtype_data->reset(spi_imx); dmaengine_terminate_all(master->dma_rx); } - dma &= ~MX51_ECSPI_DMA_RXT_WML_MASK; - writel(dma | - spi_imx->wml << MX51_ECSPI_DMA_RXT_WML_OFFSET, - spi_imx->base + MX51_ECSPI_DMA); } spi_imx->dma_finished = 1;