]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: sas: move scsi_remove_host call into sas_remove_host
authorJohannes Thumshirn <jthumshirn@suse.de>
Fri, 21 Apr 2017 12:11:41 +0000 (14:11 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Apr 2017 14:34:29 +0000 (10:34 -0400)
Move scsi_remove_host call into sas_remove_host and remove it from SAS
HBA drivers, so we don't mess up the ordering. This solves an issue with
double deleting sysfs entries that was introduced by the change of sysfs
behaviour from commit bcdde7e221a8 ("sysfs: make __sysfs_remove_dir()
recursive").

[mkp: addressed checkpatch complaints]

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Suggested-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <jejb@linux.vnet.ibm.com>
Cc: Jinpu Wang <jinpu.wang@profitbricks.com>
Cc: John Garry <john.garry@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jinpu Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/isci/init.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/mvsas/mv_init.c
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/scsi_transport_sas.c

index 662b2321d1b0f40e73bf401925e23b81d377462a..a14ba7a6b81e9150a55b36aecf3e93d0f85f1d66 100644 (file)
@@ -703,7 +703,6 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
 {
        int err;
 
-       scsi_remove_host(asd_ha->sas_ha.core.shost);
        err = sas_unregister_ha(&asd_ha->sas_ha);
 
        sas_remove_host(asd_ha->sas_ha.core.shost);
index 7e6e8823a5c762d6f82f8fd58341cf4e9c21873d..d622db502ec98b4b2d2599d2fad9d5c05641ac4b 100644 (file)
@@ -1787,7 +1787,6 @@ int hisi_sas_remove(struct platform_device *pdev)
        struct hisi_hba *hisi_hba = sha->lldd_ha;
        struct Scsi_Host *shost = sha->core.shost;
 
-       scsi_remove_host(sha->core.shost);
        sas_unregister_ha(sha);
        sas_remove_host(sha->core.shost);
 
index 0b5b5db0d0f85ece4368e46fa171ff73ea8bda41..45371179ab872d53f433a62e5d0e6ed80dfdb674 100644 (file)
@@ -272,7 +272,6 @@ static void isci_unregister(struct isci_host *isci_host)
                return;
 
        shost = to_shost(isci_host);
-       scsi_remove_host(shost);
        sas_unregister_ha(&isci_host->sas_ha);
 
        sas_remove_host(shost);
index 46e866c36c8a884a98588a8d7a81272aed0ce400..1a268a68581594850c452e15f8889356eade71b1 100644 (file)
@@ -8298,7 +8298,6 @@ static void scsih_remove(struct pci_dev *pdev)
        }
 
        sas_remove_host(shost);
-       scsi_remove_host(shost);
        mpt3sas_base_detach(ioc);
        spin_lock(&gioc_lock);
        list_del(&ioc->list);
index 8280046fd1f0d7d9b2882d5aa6c689a11eab53c7..4e047b5001a670ce8038c3b2df2a72ef592b9c74 100644 (file)
@@ -642,7 +642,6 @@ static void mvs_pci_remove(struct pci_dev *pdev)
        tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);
 #endif
 
-       scsi_remove_host(mvi->shost);
        sas_unregister_ha(sha);
        sas_remove_host(mvi->shost);
 
index 417368ccb686883ee31d078def5f663d5deef114..034b2f7d113586d58292dce0e7129368b2fc14ae 100644 (file)
@@ -1088,7 +1088,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
        struct pm8001_hba_info *pm8001_ha;
        int i, j;
        pm8001_ha = sha->lldd_ha;
-       scsi_remove_host(pm8001_ha->shost);
        sas_unregister_ha(sha);
        sas_remove_host(pm8001_ha->shost);
        list_del(&pm8001_ha->list);
index cdbb293aca08fd3b386b9c03ca02c6f27fe2056e..ca0e5a9a17f834823a956dce53b50c119a032257 100644 (file)
@@ -370,12 +370,16 @@ EXPORT_SYMBOL(sas_remove_children);
  * sas_remove_host  -  tear down a Scsi_Host's SAS data structures
  * @shost:     Scsi Host that is torn down
  *
- * Removes all SAS PHYs and remote PHYs for a given Scsi_Host.
- * Must be called just before scsi_remove_host for SAS HBAs.
+ * Removes all SAS PHYs and remote PHYs for a given Scsi_Host and remove the
+ * Scsi_Host as well.
+ *
+ * Note: Do not call scsi_remove_host() on the Scsi_Host any more, as it is
+ * already removed.
  */
 void sas_remove_host(struct Scsi_Host *shost)
 {
        sas_remove_children(&shost->shost_gendev);
+       scsi_remove_host(shost);
 }
 EXPORT_SYMBOL(sas_remove_host);