From: b32955@freescale.com (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] IMX/SDMA : save the real count for one DMA transaction.
Date: Thu, 24 Nov 2011 10:42:42 +0800 [thread overview]
Message-ID: <4ECDAF22.6060308@freescale.com> (raw)
In-Reply-To: <1322048442.1516.274.camel@vkoul-udesk3>
? 2011?11?23? 19:40, Vinod Koul ??:
> On Wed, 2011-11-23 at 19:29 +0800, Huang Shijie wrote:
>>> On Wed, Nov 23, 2011 at 07:13:23PM +0800, Huang Shijie wrote:
>>>>>>>> + /* save the real count we received or transmitted. */
>>>>>>>> + chan->private = (void *)count;
>>>>>>> And if someone later needs another variable which is private?
>>>>>>>
>>>>>> I ever wanted to add an new parameter `void *` to dma_aync_tx_callback,
>>>>>> but it seemed i have
>>>>>> to change a lot of files.
>>>>>>
>>>>>> Do you have any better suggestion?
>>>>> Use a private struct and put count in there.
>>>>>
>>>> Where to put the private struct? in the imx-sdma.c ?
>>>> If i put it there, how can i get it in the UART driver with the current
>>>> DMA API?
>>> So, in the UART driver you assume that void* is an int? Or how do you
>>> currently use count?
>>>
>> In the UART driver, I use the following lines:
>> -------------------------------------------------------
>> + struct dma_chan *chan = sport->dma_chan_rx;
>> + unsigned int count = (unsigned int)chan->private;
>> -------------------------------------------------------
> Chan->private is a depreciated field, and will be removed soon...
> possibly 3.3, so obviosly any usage of it is incorrect
>
> Why dont you use .device_tx_status callback and return the number of
> bytes remaining to be transmitted in residue value of the struct
> dma_tx_state. That should be size - count.
>
Thanks a lot.
Huang Shijie
prev parent reply other threads:[~2011-11-24 2:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 9:13 [PATCH] IMX/SDMA : save the real count for one DMA transaction Huang Shijie
2011-11-23 10:58 ` Wolfram Sang
2011-11-23 11:04 ` Huang Shijie
2011-11-23 11:06 ` Wolfram Sang
2011-11-23 11:13 ` Huang Shijie
2011-11-23 11:18 ` Wolfram Sang
2011-11-23 11:29 ` Huang Shijie
2011-11-23 11:36 ` Wolfram Sang
2011-11-24 2:56 ` Huang Shijie
2011-11-23 11:40 ` Vinod Koul
2011-11-24 2:42 ` Huang Shijie [this message]
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=4ECDAF22.6060308@freescale.com \
--to=b32955@freescale.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.