Skip to contentSkip to conversation

mpt: Move scsi_remove_host() out of mptscsih_remove_host()

PATCH Applied Hannes Reinecke 3 participants 3 messages Apr 24, 2017

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

PATCH 1/1 mpt: Move scsi_remove_host() out of mptscsih_remove_host()

Commit c5ce0ab ("scsi: sas: move scsi_remove_host call...") moved the call to scsi_remove_host() into sas_remove_host(), but forgot to modify the mpt drivers.

Fixes c5ce0ab ("scsi: sas: move scsi_remove_host call into sas_remove_host")
---
 drivers/message/fusion/mptfc.c    |  7 ++++++-
 drivers/message/fusion/mptscsih.c |  2 --
 drivers/message/fusion/mptspi.c   | 10 +++++++++-
 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/message/fusion/mptfc.c +6 -1
index 98eafae..d065062 100644
@@ -1329,7 +1329,7 @@
 					WQ_MEM_RECLAIM);
 	if (!ioc->fc_rescan_work_q) {
 		error = -ENOMEM;
-		goto out_mptfc_probe;
+		goto out_mptfc_host;
 	}
 
 	/*
@@ -1351,6 +1351,9 @@
 
 	return 0;
 
+out_mptfc_host:
+	scsi_remove_host(sh);
+
 out_mptfc_probe:
 
 	mptscsih_remove(pdev);
@@ -1530,6 +1533,8 @@ static void mptfc_remove(struct pci_dev *pdev)
 		}
 	}
 
+	scsi_remove_host(ioc->sh);
+
 	mptscsih_remove(pdev);
 }
 
drivers/message/fusion/mptscsih.c +0 -2
index 08a807d..6ba07c7 100644
@@ -1176,8 +1176,6 @@ static int	mptscsih_get_completion_code(MPT_ADAPTER *ioc,
 	MPT_SCSI_HOST		*hd;
 	int sz1;
 
-	scsi_remove_host(host);
-
 	if((hd = shost_priv(host)) == NULL)
 		return;
 
drivers/message/fusion/mptspi.c +9 -1
index 031e088..9a336a1 100644
@@ -1548,11 +1548,19 @@ static void mpt_dv_raid(struct _MPT_SCSI_HOST *hd, int disk)
 	return error;
 }
 
+static void mptspi_remove(struct pci_dev *pdev)
+{
+	MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+
+	scsi_remove_host(ioc->sh);
+	mptscsih_remove(pdev);
+}
+
 static struct pci_driver mptspi_driver = {
 	.name		= "mptspi",
 	.id_table	= mptspi_pci_table,
 	.probe		= mptspi_probe,
-	.remove		= mptscsih_remove,
+	.remove		= mptspi_remove,
 	.shutdown	= mptscsih_shutdown,
 #ifdef CONFIG_PM
 	.suspend	= mptscsih_suspend,
Signature · 1 line
1.8.5.6
#2 lore raw
In reply to Hannes Reinecke

Hannes,

Quoted 3 lines

Commit c5ce0ab ("scsi: sas: move scsi_remove_host call...") moved the call to scsi_remove_host() into sas_remove_host(), but forgot to modify the mpt drivers.

Applied to 4.12/scsi-queue.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering