lkml.org 
[lkml]   [2013]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] dma:of: Use a mutex to protect the of_dma_list
Date
On Friday 19 April 2013, Lars-Peter Clausen wrote:

> This is rather ugly and unnecessary and non of the current users of
> of_dma_controller_free() check it's return value anyway. Instead protect the
> list by a mutex. The mutex will be held as long as a request operation is in
> progress. So if of_dma_controller_free() is called while a request operation is
> in progress it will be put to sleep and only wake up once the request operation
> has finished.
>
> This means that it is no longer possible to register or unregister OF DMA
> controllers from a context where it's not possible to sleep. But I doubt that
> we'll ever need this.
>
> Also rename of_dma_get_controller back to of_dma_find_controller.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

I guess we could also fix it by turning the reference count into a proper
kref with kref_put calling the destructor, but your solution seems to solve
the problem just as well.

Acked-by: Arnd Bergmann <arnd@arndb.de>


\
 
 \ /
  Last update: 2013-04-19 13:01    [W:0.613 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site