mpt3sas: fix sync irqs
Subsystems (2)
PATCH 1/1 mpt3sas: fix sync irqs
- _base_process_reply_queue called from _base_interrupt may schedule a new irq poll, fix this by calling synchronize_irq first
- a fix for "Unbalanced enable for IRQ..." enable_irq should be called only when necessary
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 14 +++++++++----- drivers/scsi/scsi_scan.c | 8 ++++++++ 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +9 -5
@@ -1808,18 +1808,22 @@ mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc)/* TMs are on msix_index == 0 */ if (reply_q->msix_index ==0 )continue ; +synchronize_irq (pci_irq_vector (ioc->pdev, reply_q->msix_index));if (reply_q->irq_poll_scheduled) {/* Calling irq_poll_disable will wait for any pending * callbacks to have completed. */ irq_poll_disable (&reply_q->irqpoll);irq_poll_enable (&reply_q->irqpoll); - reply_q->irq_poll_scheduled = false; - reply_q->irq_line_enable = true; -enable_irq (reply_q->os_irq); -continue ; +/* check how the scheduled poll has ended, +* clean up only if necessary +*/ +if (reply_q->irq_poll_scheduled) { + reply_q->irq_poll_scheduled = false; + reply_q->irq_line_enable = true; +enable_irq (reply_q->os_irq); + } } -synchronize_irq (pci_irq_vector (ioc->pdev, reply_q->msix_index)); } }
Signature · 1 line
2.25.4
Quoted 9 lines · Tomas Henzl
-
_base_process_reply_queuecalled from_base_interruptmay schedule a new irq poll, fix this by callingsynchronize_irqfirst
- a fix for "Unbalanced enable for IRQ..."enable_irqshould be called only when necessaryFixes 320e77acb327 ("scsi: mpt3sas: Irq poll to avoid CPU hard lockups")Signed-off-by Tomas Henzl <[email protected]>
Thanks,
Sreekanth
Quoted 40 lines
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 14 +++++++++----- drivers/scsi/scsi_scan.c | 8 ++++++++ 2 files changed, 17 insertions(+), 5 deletions(-)drivers/scsi/mpt3sas/mpt3sas_base.c +9
-6@@ -1808,18 +1808,22 @@ mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc)/* TMs are on msix_index == 0 */ if (reply_q->msix_index ==0 )continue ; +synchronize_irq (pci_irq_vector (ioc->pdev, reply_q->msix_index));if (reply_q->irq_poll_scheduled) {/* Calling irq_poll_disable will wait for any pending * callbacks to have completed. */ irq_poll_disable (&reply_q->irqpoll);irq_poll_enable (&reply_q->irqpoll); - reply_q->irq_poll_scheduled = false; - reply_q->irq_line_enable = true; -enable_irq (reply_q->os_irq); -continue ; +/* check how the scheduled poll has ended, +* clean up only if necessary +*/ +if (reply_q->irq_poll_scheduled) { + reply_q->irq_poll_scheduled = false; + reply_q->irq_line_enable = true; +enable_irq (reply_q->os_irq); + } } -synchronize_irq (pci_irq_vector (ioc->pdev, reply_q->msix_index)); } } --2.25.4
Martin K. Petersen
AppliedTomas,
Quoted 2 lines
-
_base_process_reply_queuecalled from_base_interruptmay schedule a new irq poll, fix this by callingsynchronize_irqfirst
Applied to 5.10/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 5 lines · Tomas Henzl
-
_base_process_reply_queuecalled from_base_interruptmay schedule a new irq poll, fix this by callingsynchronize_irqfirst
- a fix for "Unbalanced enable for IRQ..."enable_irqshould be called only when necessary
Applied to 5.10/scsi-queue, thanks!
[1/1] scsi: mpt3sas: Fix sync irqs
https://git.kernel.org/mkp/scsi/c/45181eab8ba7
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering