Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d46f5e4a authored by Robert Jarzmik's avatar Robert Jarzmik Committed by Eric Miao
Browse files

[ARM] pxa/dma: optimize irq handler loop



Reduce loop for dma irq handler callbacks to the minimum
required.

Since V1: included suggestion from Nicolas Pitre to improve
even further the loop.

Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 43c6342b
Loading
Loading
Loading
Loading
+15 −14
Original line number Original line Diff line number Diff line
@@ -94,10 +94,12 @@ EXPORT_SYMBOL(pxa_free_dma);
static irqreturn_t dma_irq_handler(int irq, void *dev_id)
static irqreturn_t dma_irq_handler(int irq, void *dev_id)
{
{
	int i, dint = DINT;
	int i, dint = DINT;
	struct dma_channel *channel;


	for (i = 0; i < num_dma_channels; i++) {
	while (dint) {
		if (dint & (1 << i)) {
		i = __ffs(dint);
			struct dma_channel *channel = &dma_channels[i];
		dint &= (dint - 1);
		channel = &dma_channels[i];
		if (channel->name && channel->irq_handler) {
		if (channel->name && channel->irq_handler) {
			channel->irq_handler(i, channel->data);
			channel->irq_handler(i, channel->data);
		} else {
		} else {
@@ -109,7 +111,6 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
			DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
			DCSR(i) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
		}
		}
	}
	}
	}
	return IRQ_HANDLED;
	return IRQ_HANDLED;
}
}