Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 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>

authored by

Johannes Thumshirn and committed by
Martin K. Petersen
c5ce0abe 20961065

+6 -8
-1
drivers/scsi/aic94xx/aic94xx_init.c
··· 703 703 { 704 704 int err; 705 705 706 - scsi_remove_host(asd_ha->sas_ha.core.shost); 707 706 err = sas_unregister_ha(&asd_ha->sas_ha); 708 707 709 708 sas_remove_host(asd_ha->sas_ha.core.shost);
-1
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 1787 1787 struct hisi_hba *hisi_hba = sha->lldd_ha; 1788 1788 struct Scsi_Host *shost = sha->core.shost; 1789 1789 1790 - scsi_remove_host(sha->core.shost); 1791 1790 sas_unregister_ha(sha); 1792 1791 sas_remove_host(sha->core.shost); 1793 1792
-1
drivers/scsi/isci/init.c
··· 272 272 return; 273 273 274 274 shost = to_shost(isci_host); 275 - scsi_remove_host(shost); 276 275 sas_unregister_ha(&isci_host->sas_ha); 277 276 278 277 sas_remove_host(shost);
-1
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 8298 8298 } 8299 8299 8300 8300 sas_remove_host(shost); 8301 - scsi_remove_host(shost); 8302 8301 mpt3sas_base_detach(ioc); 8303 8302 spin_lock(&gioc_lock); 8304 8303 list_del(&ioc->list);
-1
drivers/scsi/mvsas/mv_init.c
··· 642 642 tasklet_kill(&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet); 643 643 #endif 644 644 645 - scsi_remove_host(mvi->shost); 646 645 sas_unregister_ha(sha); 647 646 sas_remove_host(mvi->shost); 648 647
-1
drivers/scsi/pm8001/pm8001_init.c
··· 1088 1088 struct pm8001_hba_info *pm8001_ha; 1089 1089 int i, j; 1090 1090 pm8001_ha = sha->lldd_ha; 1091 - scsi_remove_host(pm8001_ha->shost); 1092 1091 sas_unregister_ha(sha); 1093 1092 sas_remove_host(pm8001_ha->shost); 1094 1093 list_del(&pm8001_ha->list);
+6 -2
drivers/scsi/scsi_transport_sas.c
··· 370 370 * sas_remove_host - tear down a Scsi_Host's SAS data structures 371 371 * @shost: Scsi Host that is torn down 372 372 * 373 - * Removes all SAS PHYs and remote PHYs for a given Scsi_Host. 374 - * Must be called just before scsi_remove_host for SAS HBAs. 373 + * Removes all SAS PHYs and remote PHYs for a given Scsi_Host and remove the 374 + * Scsi_Host as well. 375 + * 376 + * Note: Do not call scsi_remove_host() on the Scsi_Host any more, as it is 377 + * already removed. 375 378 */ 376 379 void sas_remove_host(struct Scsi_Host *shost) 377 380 { 378 381 sas_remove_children(&shost->shost_gendev); 382 + scsi_remove_host(shost); 379 383 } 380 384 EXPORT_SYMBOL(sas_remove_host); 381 385