Skip to content
Permalink
Browse files
megaraid_sas: Handle missing interrupts while re-enabling IRQs
While reenabling the IRQ after irq poll there may be a small window for
the firmware to post the replies with interrupts raised. In that case,
driver will not see the interrupts which lead to IOs timeout.

This issue hits only when there is a high IOs completion on a single reply
queue, which forces the driver to switch between the interrupt and IRQ
context.

To fix this, driver will process the reply queue one more time after
enabling the IRQ.

Link: https://lore.kernel.org/linux-scsi/20201102072746.27410-1-sreekanth.reddy@broadcom.com/
Cc: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
  • Loading branch information
cp890582 authored and intel-lab-lkp committed May 22, 2021
1 parent f8abd26 commit 14f4c308962448ba3ff062098bed88de6acda8ab
Showing 1 changed file with 6 additions and 1 deletion.
@@ -3745,6 +3745,7 @@ static void megasas_sync_irqs(unsigned long instance_addr)
if (irq_ctx->irq_poll_scheduled) {
irq_ctx->irq_poll_scheduled = false;
enable_irq(irq_ctx->os_irq);
complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
}
}
}
@@ -3776,6 +3777,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget)
irq_poll_complete(irqpoll);
irq_ctx->irq_poll_scheduled = false;
enable_irq(irq_ctx->os_irq);
complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx);
}

return num_entries;
@@ -3792,6 +3794,7 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
{
struct megasas_instance *instance =
(struct megasas_instance *)instance_addr;
struct megasas_irq_context *irq_ctx = NULL;
u32 count, MSIxIndex;

count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
@@ -3800,8 +3803,10 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
return;

for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++)
for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) {
irq_ctx = &instance->irq_context[MSIxIndex];
complete_cmd_fusion(instance, MSIxIndex, NULL);
}
}

/**

0 comments on commit 14f4c30

Please sign in to comment.