RE: [PATCH resend 1/2] be2iscsi: Remove unnecessary synchronize_irq() before free_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: linux-scsi-owner@xxxxxxxxxxxxxxx [mailto:linux-scsi-
>owner@xxxxxxxxxxxxxxx] On Behalf Of Lars-Peter Clausen
>Sent: Friday, March 04, 2016 3:45 PM
>To: James E.J. Bottomley; Martin K. Petersen
>Cc: Sathya Prakash; Chaitra P B; Suganath Prabu Subramani; Jitendra
Bhivare;
>linux-scsi@xxxxxxxxxxxxxxx; MPT-FusionLinux.pdl@xxxxxxxxxxxx; Lars-Peter
>Clausen
>Subject: [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>
>
>Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
>---
> drivers/scsi/be2iscsi/be_main.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
>diff --git a/drivers/scsi/be2iscsi/be_main.c
b/drivers/scsi/be2iscsi/be_main.c
>index b51e726..e89a0f8d 100644
>--- a/drivers/scsi/be2iscsi/be_main.c
>+++ b/drivers/scsi/be2iscsi/be_main.c
>@@ -5303,15 +5303,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);
>
>--
>2.1.4

Reviewed-by: Jitendra Bhivare <jitendra.bhivare@xxxxxxxxxxxx>

Thanks,

JB
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux