Skip to contentSkip to conversation

be2iscsi: Remove unnecessary synchronize_irq() before free_irq()

PATCH RESEND New Lars-Peter Clausen 1 participant 2 messages Feb 3, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/2 be2iscsi: Remove unnecessary synchronize_irq() before free_irq()

Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed.

Patch was generated using the following semantic patch:
// <smpl>
@@
expression irq;
@@
-synchronize_irq(irq);
free_irq(irq, ...);
// </smpl>

---
 drivers/scsi/be2iscsi/be_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/scsi/be2iscsi/be_main.c +1 -4
index 70179e1..4b4d79d 100644
@@ -5308,15 +5308,12 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba,
 	if (phba->msix_enabled) {
 		for (i = 0; i <= phba->num_cpus; i++) {
 			msix_vec = phba->msix_entries[i].vector;
-			synchronize_irq(msix_vec);
 			free_irq(msix_vec, &phwi_context->be_eq[i]);
 			kfree(phba->msi_name[i]);
 		}
 	} else
-		if (phba->pcidev->irq) {
-			synchronize_irq(phba->pcidev->irq);
+		if (phba->pcidev->irq)
 			free_irq(phba->pcidev->irq, phba);
-		}
 	pci_disable_msix(phba->pcidev);
 	cancel_delayed_work_sync(&phba->beiscsi_hw_check_task);
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH RESEND 2/2 mpt3sas: Remove unnecessary synchronize_irq() before free_irq()

Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed.

Patch was generated using the following semantic patch:
// <smpl>
@@
expression irq;
@@
-synchronize_irq(irq);
free_irq(irq, ...);
// </smpl>

---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -1
index 83658ac..72f71e2 100644
@@ -1799,7 +1799,6 @@ _base_free_irq(struct MPT3SAS_ADAPTER *ioc)
 		list_del(&reply_q->list);
 		irq_set_affinity_hint(reply_q->vector, NULL);
 		free_cpumask_var(reply_q->affinity_hint);
-		synchronize_irq(reply_q->vector);
 		free_irq(reply_q->vector, reply_q);
 		kfree(reply_q);
 	}
Signature · 1 line
2.1.4