Commit 38680bc6 authored by Sinan Kaya's avatar Sinan Kaya Committed by Vinod Koul

dmaengine: qcom_hidma: check pending interrupts

Driver is missing the interrupts if two requests are queued up at the same
time as the interrupt handler is servicing a request that was just
delivered.

The ISR clears the interrupt at the end but it could be clearing the
interrupt for an outstanding event. Therefore, second interrupt never
arrives.

Clear the interrupt first and then check for completions.

Also, make sure that request start and interrupt clear do not overlap in
time by using a spinlock.
Signed-off-by: default avatarSinan Kaya <okaya@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 4fbd8d19
...@@ -393,6 +393,8 @@ static int hidma_ll_reset(struct hidma_lldev *lldev) ...@@ -393,6 +393,8 @@ static int hidma_ll_reset(struct hidma_lldev *lldev)
*/ */
static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause) static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause)
{ {
unsigned long irqflags;
if (cause & HIDMA_ERR_INT_MASK) { if (cause & HIDMA_ERR_INT_MASK) {
dev_err(lldev->dev, "error 0x%x, disabling...\n", dev_err(lldev->dev, "error 0x%x, disabling...\n",
cause); cause);
...@@ -410,6 +412,10 @@ static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause) ...@@ -410,6 +412,10 @@ static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause)
return; return;
} }
spin_lock_irqsave(&lldev->lock, irqflags);
writel_relaxed(cause, lldev->evca + HIDMA_EVCA_IRQ_CLR_REG);
spin_unlock_irqrestore(&lldev->lock, irqflags);
/* /*
* Fine tuned for this HW... * Fine tuned for this HW...
* *
...@@ -421,9 +427,6 @@ static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause) ...@@ -421,9 +427,6 @@ static void hidma_ll_int_handler_internal(struct hidma_lldev *lldev, int cause)
* Try to consume as many EVREs as possible. * Try to consume as many EVREs as possible.
*/ */
hidma_handle_tre_completion(lldev); hidma_handle_tre_completion(lldev);
/* We consumed TREs or there are pending TREs or EVREs. */
writel_relaxed(cause, lldev->evca + HIDMA_EVCA_IRQ_CLR_REG);
} }
irqreturn_t hidma_ll_inthandler(int chirq, void *arg) irqreturn_t hidma_ll_inthandler(int chirq, void *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment