All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com,
	Chandrakanth Patil <chandrakanth.patil@broadcom.com>,
	Tomas Henzl <thenzl@redhat.com>
Subject: [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs
Date: Fri, 21 May 2021 15:55:47 +0530	[thread overview]
Message-ID: <20210521102548.11156-5-chandrakanth.patil@broadcom.com> (raw)
In-Reply-To: <20210521102548.11156-1-chandrakanth.patil@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 2314 bytes --]

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>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f79c19010c92..8b8d68e75318 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -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);
+	}
 }
 
 /**
-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4227 bytes --]

  parent reply	other threads:[~2021-05-21 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 10:25 [PATCH v2 0/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 1/5] megaraid_sas: Send all non-RW IOs for TYPE_ENCLOSURE device through firmware Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 2/5] megaraid_sas: Fix the resource leak in case of probe failure Chandrakanth Patil
2021-05-21 10:25 ` [PATCH v2 3/5] megaraid_sas: Early detection of VD deletion through RaidMap update Chandrakanth Patil
2021-05-21 10:25 ` Chandrakanth Patil [this message]
2021-05-22 16:01   ` [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs kernel test robot
2021-05-22 16:01     ` kernel test robot
2021-05-21 10:25 ` [PATCH v2 5/5] megaraid_sas: Update driver version to 07.717.02.00-rc1 Chandrakanth Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210521102548.11156-5-chandrakanth.patil@broadcom.com \
    --to=chandrakanth.patil@broadcom.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sumit.saxena@broadcom.com \
    --cc=thenzl@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.