Skip to contentSkip to conversation

mpt3sas: Fix timeouts observed while reenabling IRQ

PATCH Applied Sreekanth Reddy 3 participants 3 messages Nov 2, 2020 – Nov 3, 2020

Subsystems (2)
lore
Share & tools
lore

Sreekanth Reddy

author maintainer
#0 lore raw

PATCH 1/1 mpt3sas: Fix timeouts observed while reenabling IRQ

While reenabling the IRQ after irq poll there may be small time window where HBA firmware has posted some replies and raise the interrupts but driver has not received the interrupts. So we may observe IO timeouts as the driver has not processed the replies as interrupts got missed while reenabling the IRQ.

So, to fix this issue, the driver has to go for one more round of processing the reply descriptors from reply descriptor post queue after enabling the IRQ.

---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/scsi/mpt3sas/mpt3sas_base.c +7 -0
index b096917..a0ab44d 100644
@@ -1740,6 +1740,13 @@ _base_irqpoll(struct irq_poll *irqpoll, int budget)
 		reply_q->irq_poll_scheduled = false;
 		reply_q->irq_line_enable = true;
 		enable_irq(reply_q->os_irq);
+		/*
+		 * Go for one more round of processing the
+		 * reply descriptor post queue incase if HBA
+		 * Firmware has posted some reply descriptors
+		 * while reenabling the IRQ.
+		 */
+		_base_process_reply_queue(reply_q);
 	}
 
 	return num_entries;
Signature · 1 line
2.18.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Sreekanth Reddy

While reenabling the IRQ after irq poll there may be small time window where HBA firmware has posted some replies and raise the interrupts but driver has not received the interrupts. So we may observe IO timeouts as the driver has not processed the replies as interrupts got missed while reenabling the IRQ.

So, to fix this issue, the driver has to go for one more round of processing the reply descriptors from reply descriptor post queue after enabling the IRQ.

---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -0
index b096917..a0ab44d 100644
@@ -1740,6 +1740,13 @@ _base_irqpoll(struct irq_poll *irqpoll, int budget)
 		reply_q->irq_poll_scheduled = false;
 		reply_q->irq_line_enable = true;
 		enable_irq(reply_q->os_irq);

drivers/scsi/mpt3sas/mpt3sas_base.c _base_irqpoll(struct irq_poll *irqpoll, int budget) · line 1752

Quoted 10 lines
drivers/scsi/mpt3sas/mpt3sas_base.c +7 -0
+		/*
+		 * Go for one more round of processing the
+		 * reply descriptor post queue incase if HBA
+		 * Firmware has posted some reply descriptors
+		 * while reenabling the IRQ.
+		 */
+		_base_process_reply_queue(reply_q);
 	}
 
 	return num_entries;

I've tested the fix and the system now works.

#2 lore raw
In reply to Sreekanth Reddy
Quoted 9 lines · Sreekanth Reddy

While reenabling the IRQ after irq poll there may be small time window where HBA firmware has posted some replies and raise the interrupts but driver has not received the interrupts. So we may observe IO timeouts as the driver has not processed the replies as interrupts got missed while reenabling the IRQ.

So, to fix this issue, the driver has to go for one more round of processing the reply descriptors from reply descriptor post queue after enabling the IRQ.

Applied to 5.10/scsi-fixes, thanks!

[1/1] scsi: mpt3sas: Fix timeouts observed while reenabling IRQ

      https://git.kernel.org/mkp/scsi/c/5feed64f9199
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering