From: anton.bondarenko.sama@gmail.com (Anton Bondarenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/8] spi: imx: Fix DMA transfer
Date: Wed, 21 Oct 2015 01:03:55 +0200 [thread overview]
Message-ID: <5626C85B.2090707@gmail.com> (raw)
In-Reply-To: <20151008091951.GA6101@shlinux2>
On 08.10.2015 11:19, Robin Gong wrote:
> On Thu, Oct 01, 2015 at 12:02:41AM +0000, Bondarenko, Anton wrote:
>>>> @@ -201,9 +202,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->rx_wml * sizeof(u32)
>>>> - && transfer->len > spi_imx->tx_wml * sizeof(u32))
>>>> + if (spi_imx->dma_is_inited &&
>>>> + (transfer->len > spi_imx->wml * sizeof(u32)))
>>> Add Sascha in the loop. I don't think "* sizeof(u32)", since even 1 byte data
>>> will consume one position of 32bit FIFO Thus if here
>>> spi_imx->wml = spi_imx_get_fifosize(spi_imx) / 2 = 32, the threshold value
>>> which judge DMA mode used or not should be 32 not 32 * 4.
>>> Of course, it will not cause any function break since both DMA and PIO can work
>>> ,but I think we'd better correct it.
>> I agree, in case of 1 byte SPI word we do not need to multiply by 4.
>> But for 16 bit and 32 bit SPI words it's necessary. This part is
>> addressed in patch 3.
>> I could remove "* sizeof(u32)" for now.
> I still think don't need *sizeof(u32) even for 16bit and 32bit, whatever bits
> used as one spi word(<32bits), one spi word consume one position of SPI FIFO
> (32bit).
Will be removed in V3 for this patch.
>>>> return true;
>>>> return false;
>>>> }
Regards,
Anton
next prev parent reply other threads:[~2015-10-20 23:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 17:57 [PATCH v2 0/8] Improvements for SPI IMX driver for Freescale IMX53 and IMX6 families Anton Bondarenko
2015-09-25 17:57 ` [PATCH v2 1/8] spi: imx: Fix DMA transfer Anton Bondarenko
2015-09-28 3:48 ` kbuild test robot
2015-09-30 8:23 ` Robin Gong
2015-10-01 0:02 ` Bondarenko, Anton
2015-10-08 9:19 ` Robin Gong
2015-10-20 23:03 ` Anton Bondarenko [this message]
2015-09-25 17:57 ` [PATCH v2 2/8] spi: imx: replace fixed timeout with calculated one Anton Bondarenko
2015-09-30 8:31 ` Robin Gong
2015-10-01 0:08 ` Bondarenko, Anton
2015-09-25 17:57 ` [PATCH v2 3/8] spi: imx: add support for all SPI word width for DMA transfer Anton Bondarenko
2015-09-30 8:35 ` Robin Gong
2015-10-01 0:34 ` Bondarenko, Anton
2015-10-08 9:51 ` Robin Gong
2015-10-20 23:28 ` Anton Bondarenko
2015-09-25 17:57 ` [PATCH v2 4/8] spi: imx: add selection for iMX53 and iMX6 controller type Anton Bondarenko
2015-09-25 17:57 ` [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers Anton Bondarenko
2015-09-30 8:42 ` Robin Gong
2015-10-01 0:16 ` Bondarenko, Anton
2015-10-08 9:28 ` Robin Gong
2015-10-20 23:08 ` Anton Bondarenko
2015-09-25 17:57 ` [PATCH v2 6/8] spi: imx: return error from dma channel request Anton Bondarenko
2015-09-30 8:51 ` Robin Gong
2015-09-25 17:57 ` [PATCH v2 7/8] spi: imx: defer spi initialization, if DMA engine is pending Anton Bondarenko
2015-09-30 8:54 ` Robin Gong
2015-09-25 17:57 ` [PATCH v2 8/8] spi: imx: Add support for SPI Slave mode for imx53 and imx6 chips Anton Bondarenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5626C85B.2090707@gmail.com \
--to=anton.bondarenko.sama@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).