Skip to contentSkip to conversation

vmw_pvscsi: Don't call free_irq twice on remove adapter

PATCH In review Jim Gill 2 participants 3 messages Oct 4, 2017 – Oct 5, 2017

Subsystems (2)
lore
Share & tools
lore

Jim Gill

author
#0 lore raw

PATCH 1/1 vmw_pvscsi: Don't call free_irq twice on remove adapter

Remove redundant call to pvscsi_shutdown_intr from pvscsi_remove_resources. Add calls to pvscsi_shutdown_intr in the failure cases for pvscsi_probe.

---
 drivers/scsi/vmw_pvscsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/vmw_pvscsi.c +2 -2
index c374e3b..c7e74ac 100644
@@ -1197,8 +1197,6 @@ static void pvscsi_shutdown_intr(struct pvscsi_adapter *adapter)
 
 static void pvscsi_release_resources(struct pvscsi_adapter *adapter)
 {
-	pvscsi_shutdown_intr(adapter);
-
 	if (adapter->workqueue)
 		destroy_workqueue(adapter->workqueue);
 
@@ -1530,6 +1528,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 out_reset_adapter:
 	ll_adapter_reset(adapter);
 out_release_resources:
+	pvscsi_shutdown_intr(adapter);
 	pvscsi_release_resources(adapter);
 	scsi_host_put(host);
 out_disable_device:
@@ -1538,6 +1537,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	return error;
 
 out_release_resources_and_disable:
+	pvscsi_shutdown_intr(adapter);
 	pvscsi_release_resources(adapter);
 	goto out_disable_device;
 }
Signature · 1 line
2.7.4
#1 lore raw

Hi Jim,

Quoted 26 lines · Jim Gill

Remove redundant call to pvscsi_shutdown_intr from pvscsi_remove_resources. Add calls to pvscsi_shutdown_intr in the failure cases for pvscsi_probe.

---
drivers/scsi/vmw_pvscsi.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/vmw_pvscsi.c +0 -2
index c374e3b..c7e74ac 100644
@@ -1197,8 +1197,6 @@ static void pvscsi_shutdown_intr(struct pvscsi_adapter *adapter)
 
 static void pvscsi_release_resources(struct pvscsi_adapter *adapter)
 {
-	pvscsi_shutdown_intr(adapter);
-
 	if (adapter->workqueue)
 		destroy_workqueue(adapter->workqueue);
 
@@ -1530,6 +1528,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)

out_reset_adapter:

Quoted 1 line

From what I understand the irq(s) are not allocated until the pci_alloc_irq_vectors call. After, all breakout jumps are to out_reset_adapter.

Could it be simplified to just adding pvscsi_shutdown_intr before ll_adapter_reset() here? Then you don’t need the other two pvscsi_shutdown_intr() calls below.

Quoted 11 lines
	ll_adapter_reset(adapter);

out_release_resources:

drivers/scsi/vmw_pvscsi.c +1 -0
+	pvscsi_shutdown_intr(adapter);
	pvscsi_release_resources(adapter);
	scsi_host_put(host);

out_disable_device:

drivers/scsi/vmw_pvscsi.c +0 -0
@@ -1538,6 +1537,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	return error;
 

out_release_resources_and_disable:

drivers/scsi/vmw_pvscsi.c +1 -0
+	pvscsi_shutdown_intr(adapter);
Quoted 5 lines
	pvscsi_release_resources(adapter);
	goto out_disable_device;
}
Signature · 1 line
2.7.4

--
Kyle Fortin - Oracle Linux Engineering

#2 lore raw

Correction.

Quoted 27 lines · Kyle Fortin

Hi Jim,

Quoted 23 lines · Jim Gill

Remove redundant call to pvscsi_shutdown_intr from pvscsi_remove_resources. Add calls to pvscsi_shutdown_intr in the failure cases for pvscsi_probe.

---
drivers/scsi/vmw_pvscsi.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/vmw_pvscsi.c +0 -2
index c374e3b..c7e74ac 100644
@@ -1197,8 +1197,6 @@ static void pvscsi_shutdown_intr(struct pvscsi_adapter *adapter)
 
 static void pvscsi_release_resources(struct pvscsi_adapter *adapter)
 {
-	pvscsi_shutdown_intr(adapter);
-
 	if (adapter->workqueue)
 		destroy_workqueue(adapter->workqueue);
 
Quoted 6 lines
Quoted 2 lines
drivers/scsi/vmw_pvscsi.c +0 -0
@@ -1530,6 +1528,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)

out_reset_adapter:

From what I understand the irq(s) are not allocated until the pci_alloc_irq_vectors call. After, all breakout jumps are to out_reset_adapter.

Could it be simplified to just adding pvscsi_shutdown_intr before ll_adapter_reset() here? Then you don’t need the other two pvscsi_shutdown_intr() calls below.

Add pvscsi_shutdown_intr after adapter reset instead.

Quoted 19 lines
Quoted 11 lines
	ll_adapter_reset(adapter);

out_release_resources:

drivers/scsi/vmw_pvscsi.c +1 -0
+	pvscsi_shutdown_intr(adapter);
	pvscsi_release_resources(adapter);
	scsi_host_put(host);

out_disable_device:

drivers/scsi/vmw_pvscsi.c +0 -0
@@ -1538,6 +1537,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	return error;
 

out_release_resources_and_disable:

drivers/scsi/vmw_pvscsi.c +1 -0
+	pvscsi_shutdown_intr(adapter);
Quoted 5 lines
	pvscsi_release_resources(adapter);
	goto out_disable_device;
}
Signature · 1 line
2.7.4

--
Kyle Fortin - Oracle Linux Engineering