lkml.org 
[lkml]   [2013]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 09/12] tegra20-apb-dma: remove useless use of lock
From
On Wed, May 29, 2013 at 1:56 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> On Monday 27 May 2013 05:44 PM, Andy Shevchenko wrote:
>>
>> Accordingly to dma_cookie_status() description locking is not required.
>>
> I think we need lock here:
> From isr handler, we call dma_cookie_complete() which is in spin-locked.
> This function updates tx->chan->completed_cookie = tx->cookie;
> In tegra_dma_tx_status(), we check for dma_cookie_status() which access the
> chan->completed_cookie; and it decides status based on this
>
> As the access of chan->completed_cookie are from different context, we
> need this locking.

You need to have a consistent data in the cookies. This is guaranteed
by memory barrier if I got it correctly.

--
With Best Regards,
Andy Shevchenko


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