lkml.org 
[lkml]   [2013]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] dma:of: Use a mutex to protect the of_dma_list
On 04/20/2013 12:45 AM, Jon Hunter wrote:
[...]
>> @@ -219,15 +183,15 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
>> if (of_dma_match_channel(np, name, i, &dma_spec))
>> continue;
>>
>> - ofdma = of_dma_get_controller(&dma_spec);
>> + mutex_lock(&of_dma_lock);
>> + ofdma = of_dma_find_controller(&dma_spec);
>>
>> - if (ofdma) {
>> + if (ofdma)
>> chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
>
> I think that there is a problem here. For controllers using the
> of_dma_simple_xlate(), this will call dma_request_channel() which also
> uses a mutex.

That would only be a problem if it'd use the same mutex. Holding two mutexes at
the same time is not a problem per se.

- Lars


\
 
 \ /
  Last update: 2013-04-20 11:41    [W:0.075 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site