Re: [PATCH v2 1/3] scsi: ufs: Put SCSI host after remove it
Date: Wed Dec 11 2019 - 06:06:55 EST
On 2019-12-11 18:37, Avri Altman wrote:
In ufshcd_remove(), after SCSI host is removed, put it once so that
can be released.
Signed-off-by: Can Guo <cang@xxxxxxxxxxxxxx>
This is not really part of this patchset, is it?
I put this change in the same patchset due to
#1. The main patch has dependency on it
#2. Consider a scenario where platform driver is also compiled as a
module, say ufs_qcom.ko.
In this case, we have two modules, ufs-qcom.ko and ufs-bsg.ko. If do
then rmmod ufs-qcom.ko and do insmod ufs-qcom.ko again, without this
change, because scsi
host was not release, the new scsi host will have a different host
hba->host->host_no will be 1, but not 0. Now if do insmod ufs-bsg.ko
now, the ufs-bsg dev
created in /dev/bsg/ will be ufs-bsg1, but not ufs-bsg0. If keep
trying these operations,
the ufs-bsg device's name will be messed up. This change make sure
after ufs-qcom.ko is removed
and installed back, its hba->host->host_no stays 0, so that ufs-bsg
device name stays same.
drivers/scsi/ufs/ufshcd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
@@ -8251,6 +8251,7 @@ void ufshcd_remove(struct ufs_hba *hba)
/* disable interrupts */
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
a Linux Foundation Collaborative Project