From 4381c3443b1b4acdf04d35fa89e064940fff335a Mon Sep 17 00:00:00 2001 From: Sushmita Susheelendra Date: Tue, 15 Sep 2020 22:38:14 -0600 Subject: [PATCH] msm: kgsl: Fix message handling in hwsched hfi interrupt handler Do not process HFI messages on the message queue in the interrupt handler before interrupts are enabled on that queue. Otherwise, the interrupt handler will read it off the queue, and then the inline handler will not find any messages on the queue. Change-Id: I569f29250c27a1a74e206489ad8234b2be39d448 Signed-off-by: Sushmita Susheelendra --- drivers/gpu/msm/adreno_a6xx_hwsched_hfi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/msm/adreno_a6xx_hwsched_hfi.c b/drivers/gpu/msm/adreno_a6xx_hwsched_hfi.c index 2b965e5bb584..bb90c9178aa5 100644 --- a/drivers/gpu/msm/adreno_a6xx_hwsched_hfi.c +++ b/drivers/gpu/msm/adreno_a6xx_hwsched_hfi.c @@ -234,6 +234,14 @@ static irqreturn_t a6xx_hwsched_hfi_handler(int irq, void *data) gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status); gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, hfi->irq_mask); + /* + * If interrupts are not enabled on the HFI message queue, + * the inline message processing loop will process it, + * else, process it here. + */ + if (!(hfi->irq_mask & HFI_IRQ_MSGQ_MASK)) + status &= ~HFI_IRQ_MSGQ_MASK; + if (status & HFI_IRQ_MSGQ_MASK) process_msgq_irq(adreno_dev); if (status & HFI_IRQ_DBGQ_MASK)