All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend 1/2] be2iscsi: Remove unnecessary synchronize_irq() before free_irq()
@ 2016-02-02 20:02 Lars-Peter Clausen
  2016-02-02 20:02 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
  0 siblings, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2016-02-02 20:02 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Jayamohan Kallickal, Ketan Mukadam, John Soni Jose,
	Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, linux-scsi, MPT-FusionLinux.pdl,
	Lars-Peter Clausen

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@metafoo.de>
---
 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 70179e1..4b4d79d 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -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);
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-02-02 20:02 [PATCH resend 1/2] be2iscsi: Remove unnecessary synchronize_irq() before free_irq() Lars-Peter Clausen
@ 2016-02-02 20:02 ` Lars-Peter Clausen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2016-02-02 20:02 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Jayamohan Kallickal, Ketan Mukadam, John Soni Jose,
	Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, linux-scsi, MPT-FusionLinux.pdl,
	Lars-Peter Clausen

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@metafoo.de>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 83658ac..72f71e2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -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);
 	}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-03-04 10:15 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
  2016-03-08  2:05   ` Martin K. Petersen
  2016-03-09  1:52   ` Martin K. Petersen
@ 2016-03-10  1:43   ` Martin K. Petersen
  2 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2016-03-10  1:43 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: James E.J. Bottomley, Martin K. Petersen, Sathya Prakash,
	Chaitra P B, Suganath Prabu Subramani, Jitendra Bhivare,
	linux-scsi, MPT-FusionLinux.pdl

>>>>> "Lars-Peter" == Lars-Peter Clausen <lars@metafoo.de> writes:

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

Applied to 4.6/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-03-09  1:52   ` Martin K. Petersen
@ 2016-03-09 13:26     ` Sreekanth Reddy
  0 siblings, 0 replies; 7+ messages in thread
From: Sreekanth Reddy @ 2016-03-09 13:26 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Lars-Peter Clausen, James E.J. Bottomley, Sathya Prakash,
	Chaitra P B, Suganath Prabu Subramani, Jitendra Bhivare,
	linux-scsi, MPT-FusionLinux.pdl

On Wed, Mar 9, 2016 at 7:22 AM, Martin K. Petersen
<martin.petersen@oracle.com> wrote:
>>>>>> "Lars-Peter" == Lars-Peter Clausen <lars@metafoo.de> writes:
>
> Lars-Peter> Calling synchronize_irq() right before free_irq() is quite
> Lars-Peter> useless. On one hand the IRQ can easily fire again before
> Lars-Peter> free_irq() is entered, on the other hand free_irq() itself
> Lars-Peter> calls synchronize_irq() internally (in a race condition free
> Lars-Peter> way), before any state associated with the IRQ is freed.
>
> Broadcom folks, please review.

Martin,

Please consider this patch as Ack-by: Sreekanth Reddy
<sreekanth.reddy@broadcom.com>

Thanks,
Sreekanth

>
> --
> Martin K. Petersen      Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-03-04 10:15 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
  2016-03-08  2:05   ` Martin K. Petersen
@ 2016-03-09  1:52   ` Martin K. Petersen
  2016-03-09 13:26     ` Sreekanth Reddy
  2016-03-10  1:43   ` Martin K. Petersen
  2 siblings, 1 reply; 7+ messages in thread
From: Martin K. Petersen @ 2016-03-09  1:52 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: James E.J. Bottomley, Martin K. Petersen, Sathya Prakash,
	Chaitra P B, Suganath Prabu Subramani, Jitendra Bhivare,
	linux-scsi, MPT-FusionLinux.pdl

>>>>> "Lars-Peter" == Lars-Peter Clausen <lars@metafoo.de> writes:

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

Broadcom folks, please review.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-03-04 10:15 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
@ 2016-03-08  2:05   ` Martin K. Petersen
  2016-03-09  1:52   ` Martin K. Petersen
  2016-03-10  1:43   ` Martin K. Petersen
  2 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2016-03-08  2:05 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Martin K. Petersen, Sathya Prakash, Chaitra P B,
	Suganath Prabu Subramani, Jitendra Bhivare, linux-scsi,
	MPT-FusionLinux.pdl

>>>>> "Lars-Peter" == Lars-Peter Clausen <lars@metafoo.de> writes:

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

Applied to 4.6/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH resend 2/2] mpt3sas: Remove unnecessary synchronize_irq() before free_irq()
  2016-03-04 10:15 [PATCH resend 1/2] be2iscsi: " Lars-Peter Clausen
@ 2016-03-04 10:15 ` Lars-Peter Clausen
  2016-03-08  2:05   ` Martin K. Petersen
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2016-03-04 10:15 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Sathya Prakash, Chaitra P B, Suganath Prabu Subramani,
	Jitendra Bhivare, linux-scsi, MPT-FusionLinux.pdl,
	Lars-Peter Clausen

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@metafoo.de>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 5bbbbf2..e4db5fb 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1820,7 +1820,6 @@ _base_free_irq(struct MPT3SAS_ADAPTER *ioc)
 			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);
 	}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-10  1:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02 20:02 [PATCH resend 1/2] be2iscsi: Remove unnecessary synchronize_irq() before free_irq() Lars-Peter Clausen
2016-02-02 20:02 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
2016-03-04 10:15 [PATCH resend 1/2] be2iscsi: " Lars-Peter Clausen
2016-03-04 10:15 ` [PATCH resend 2/2] mpt3sas: " Lars-Peter Clausen
2016-03-08  2:05   ` Martin K. Petersen
2016-03-09  1:52   ` Martin K. Petersen
2016-03-09 13:26     ` Sreekanth Reddy
2016-03-10  1:43   ` Martin K. Petersen

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.