Re: [PATCH V3 2/7] dmaengine/dw_dmac: Replace spin_lock* with irqsavevariants
From: viresh kumar
Date: Fri Apr 29 2011 - 06:18:06 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/