[PATCH V3 2/7] dmaengine/dw_dmac: Replace spin_lock* with irqsave variants

viresh kumar viresh.kumar at st.com
Fri Apr 29 06:17:19 EDT 2011


On 04/29/2011 02:45 PM, Russell King - ARM Linux wrote:
> BTW, how this gets handled in other drivers is basically as follows in
> the tasklet:
> 
> tasklet()
> {
> 	LIST_HEAD(completed);
> 
> 	spin_lock_irqsave(lock, flags);
> 	for each txd(txd) {
> 		if (completed(txd))
> 			list_move_tail(&txd->node, &completed);
> 	}
> 	try to start new txd();
> 	spin_unlock_irqrestore(lock, flags);
> 
> 	for each list entry safe(txd, &completed) {
> 		void (*callback)(void *) = txd->callback;
> 		void *param = txd->callback_param;
> 
> 		free_txd(txd);
> 
> 		if (callback)
> 			callback(param);
> 	}
> }
> 
> I'm not sure how easy it is to move dw_dmac to that kind of structure,

I will check that.

-- 
viresh



More information about the linux-arm-kernel mailing list