Commit c5ce0abe authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen

scsi: sas: move scsi_remove_host call into sas_remove_host

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 bcdde7e2 ("sysfs: make __sysfs_remove_dir()
recursive").

[mkp: addressed checkpatch complaints]
Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Suggested-by: default avatarChristoph 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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJinpu Wang <jinpu.wang@profitbricks.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 20961065
...@@ -703,7 +703,6 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha) ...@@ -703,7 +703,6 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
{ {
int err; int err;
scsi_remove_host(asd_ha->sas_ha.core.shost);
err = sas_unregister_ha(&asd_ha->sas_ha); err = sas_unregister_ha(&asd_ha->sas_ha);
sas_remove_host(asd_ha->sas_ha.core.shost); sas_remove_host(asd_ha->sas_ha.core.shost);
......
...@@ -1787,7 +1787,6 @@ int hisi_sas_remove(struct platform_device *pdev) ...@@ -1787,7 +1787,6 @@ int hisi_sas_remove(struct platform_device *pdev)
struct hisi_hba *hisi_hba = sha->lldd_ha; struct hisi_hba *hisi_hba = sha->lldd_ha;
struct Scsi_Host *shost = sha->core.shost; struct Scsi_Host *shost = sha->core.shost;
scsi_remove_host(sha->core.shost);
sas_unregister_ha(sha); sas_unregister_ha(sha);
sas_remove_host(sha->core.shost); sas_remove_host(sha->core.shost);
......
...@@ -272,7 +272,6 @@ static void isci_unregister(struct isci_host *isci_host) ...@@ -272,7 +272,6 @@ static void isci_unregister(struct isci_host *isci_host)
return; return;
shost = to_shost(isci_host); shost = to_shost(isci_host);
scsi_remove_host(shost);
sas_unregister_ha(&isci_host->sas_ha); sas_unregister_ha(&isci_host->sas_ha);
sas_remove_host(shost); sas_remove_host(shost);
......
...@@ -8298,7 +8298,6 @@ static void scsih_remove(struct pci_dev *pdev) ...@@ -8298,7 +8298,6 @@ static void scsih_remove(struct pci_dev *pdev)
} }
sas_remove_host(shost); sas_remove_host(shost);
scsi_remove_host(shost);
mpt3sas_base_detach(ioc); mpt3sas_base_detach(ioc);
spin_lock(&gioc_lock); spin_lock(&gioc_lock);
list_del(&ioc->list); list_del(&ioc->list);
......
...@@ -642,7 +642,6 @@ static void mvs_pci_remove(struct pci_dev *pdev) ...@@ -642,7 +642,6 @@ static void mvs_pci_remove(struct pci_dev *pdev)
tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet); tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);
#endif #endif
scsi_remove_host(mvi->shost);
sas_unregister_ha(sha); sas_unregister_ha(sha);
sas_remove_host(mvi->shost); sas_remove_host(mvi->shost);
......
...@@ -1088,7 +1088,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev) ...@@ -1088,7 +1088,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
struct pm8001_hba_info *pm8001_ha; struct pm8001_hba_info *pm8001_ha;
int i, j; int i, j;
pm8001_ha = sha->lldd_ha; pm8001_ha = sha->lldd_ha;
scsi_remove_host(pm8001_ha->shost);
sas_unregister_ha(sha); sas_unregister_ha(sha);
sas_remove_host(pm8001_ha->shost); sas_remove_host(pm8001_ha->shost);
list_del(&pm8001_ha->list); list_del(&pm8001_ha->list);
......
...@@ -370,12 +370,16 @@ EXPORT_SYMBOL(sas_remove_children); ...@@ -370,12 +370,16 @@ EXPORT_SYMBOL(sas_remove_children);
* sas_remove_host - tear down a Scsi_Host's SAS data structures * sas_remove_host - tear down a Scsi_Host's SAS data structures
* @shost: Scsi Host that is torn down * @shost: Scsi Host that is torn down
* *
* Removes all SAS PHYs and remote PHYs for a given Scsi_Host. * Removes all SAS PHYs and remote PHYs for a given Scsi_Host and remove the
* Must be called just before scsi_remove_host for SAS HBAs. * 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) void sas_remove_host(struct Scsi_Host *shost)
{ {
sas_remove_children(&shost->shost_gendev); sas_remove_children(&shost->shost_gendev);
scsi_remove_host(shost);
} }
EXPORT_SYMBOL(sas_remove_host); EXPORT_SYMBOL(sas_remove_host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment