DMA Engine API performance issues

Dan Williams dan.j.williams at intel.com
Thu Apr 15 11:58:47 EDT 2010


On Thu, Apr 15, 2010 at 2:13 AM, melwyn lobo <linux.melwyn at gmail.com> wrote:
> Thanks so much for your explanation.
> OK..Looking at IPU implementation, irq handling is enrtirely in the
> interrupt routine, therefore no need for spin_lock_bh stuff.
> But for lower interrupt latency reasons we need to stick with the
> tasklet handling for processing interrupts.
>
> We were contemplating another solution for locking at our end for DMA
> implementation
> For locking
> if(irqs_disabled())
>    spin_lock(&chan->lock);
> else
>    spin_lock_bh(&chan->lock);
>
> for unlocking:
> if(irqs_disabled())
>    spin_unlock(&chan->lock);
> else
>    spin_unlock_bh(&chan->lock);
>
> Although this works  fine, but will this be OK when we submit the driver.
>

This won't work and lockdep should complain about this situation.  The
minute you need to take the lock in the interrupt handler then all
other occurrences of the lock need to be promoted to _irq or
_irqsave() [1].

--
Dan

[1]: http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html



More information about the linux-arm-kernel mailing list