From: Avri Altman <Avri.Altman@wdc.com>
To: "cang@codeaurora.org" <cang@codeaurora.org>
Cc: "asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
"nguyenb@codeaurora.org" <nguyenb@codeaurora.org>,
"rnayak@codeaurora.org" <rnayak@codeaurora.org>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"kernel-team@android.com" <kernel-team@android.com>,
"saravanak@google.com" <saravanak@google.com>,
"salyzyn@google.com" <salyzyn@google.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Pedro Sousa <pedrom.sousa@synopsys.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Bean Huo <beanhuo@micron.com>,
Venkat Gopalakrishnan <venkatg@codeaurora.org>,
Tomas Winkler <tomas.winkler@intel.com>,
open list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 1/3] scsi: ufs: Put SCSI host after remove it
Date: Wed, 11 Dec 2019 11:22:16 +0000 [thread overview]
Message-ID: <MN2PR04MB6991754758E2840B6D529112FC5A0@MN2PR04MB6991.namprd04.prod.outlook.com> (raw)
In-Reply-To: <0101016ef4a3e5f5-915372c8-5e1e-4db5-b3da-f97f7ca963e4-000000@us-west-2.amazonses.com>
>
>
> On 2019-12-11 18:37, Avri Altman wrote:
> >>
> >> In ufshcd_remove(), after SCSI host is removed, put it once so that
> >> its resources can be released.
> >>
> >> Signed-off-by: Can Guo <cang@codeaurora.org>
> >
> > This is not really part of this patchset, is it?
> >
>
> Hi Avri,
>
> 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 insmod
> ufs-qcom.ko
> 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 number,
> meaning
> 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.
Looks like we needed to manage the ufs-bsg nodes using an IDA, instead of host_no?
>
> Thanks,
>
> Can Guo.
>
> >> ---
> >> 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
> >> index b5966fa..a86b0fd 100644
> >> --- a/drivers/scsi/ufs/ufshcd.c
> >> +++ b/drivers/scsi/ufs/ufshcd.c
> >> @@ -8251,6 +8251,7 @@ void ufshcd_remove(struct ufs_hba *hba)
> >> ufs_bsg_remove(hba);
> >> ufs_sysfs_remove_nodes(hba->dev);
> >> scsi_remove_host(hba->host);
> >> + scsi_host_put(hba->host);
> >> /* disable interrupts */
> >> ufshcd_disable_intr(hba, hba->intr_mask);
> >> ufshcd_hba_stop(hba, true);
> >> --
> >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> >> Forum, a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2019-12-11 11:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1576054123-16417-1-git-send-email-cang@codeaurora.org>
2019-12-11 8:48 ` [PATCH v2 1/3] scsi: ufs: Put SCSI host after remove it Can Guo
2019-12-11 10:37 ` Avri Altman
2019-12-11 11:06 ` cang
[not found] ` <0101016ef4a3e5f5-915372c8-5e1e-4db5-b3da-f97f7ca963e4-000000@us-west-2.amazonses.com>
2019-12-11 11:22 ` Avri Altman [this message]
2019-12-11 11:44 ` cang
[not found] ` <0101016ef4c6065b-3e4428fc-71f8-40cf-a7fa-bc633a2b9fda-000000@us-west-2.amazonses.com>
2019-12-11 13:44 ` Avri Altman
2019-12-11 8:49 ` [PATCH v2 2/3] scsi: ufs: Modulize ufs-bsg Can Guo
2019-12-12 4:53 ` Bjorn Andersson
2019-12-12 6:01 ` cang
[not found] ` <0101016ef8b2e2f8-72260b08-e6ad-42fc-bd4b-4a0a72c5c9b3-000000@us-west-2.amazonses.com>
2019-12-12 6:37 ` Bjorn Andersson
2019-12-12 7:00 ` Avri Altman
2019-12-12 16:53 ` cang
[not found] ` <0101016efb07efac-32cf270a-68dd-455a-b037-9fac2f3834cd-000000@us-west-2.amazonses.com>
2019-12-12 18:24 ` Bjorn Andersson
2019-12-14 12:30 ` cang
2019-12-15 7:38 ` Avri Altman
2019-12-12 16:45 ` cang
2019-12-15 21:49 ` Bart Van Assche
2019-12-16 4:36 ` cang
2019-12-16 17:22 ` Bart Van Assche
2019-12-16 18:06 ` Greg KH
2019-12-17 8:56 ` cang
2019-12-17 18:19 ` Bart Van Assche
2019-12-17 18:47 ` cang
[not found] ` <0101016ef425ed74-071c2ec2-5aeb-44fa-8889-d9ec60192d44-000000@us-west-2.amazonses.com>
2019-12-12 5:40 ` Vignesh Raghavendra
[not found] ` <0101016ef425e749-1808e138-740e-4036-922f-7a49ec02c2b8-000000@us-west-2.amazonses.com>
2019-12-13 20:59 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR04MB6991754758E2840B6D529112FC5A0@MN2PR04MB6991.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=beanhuo@micron.com \
--cc=cang@codeaurora.org \
--cc=jejb@linux.ibm.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nguyenb@codeaurora.org \
--cc=pedrom.sousa@synopsys.com \
--cc=rnayak@codeaurora.org \
--cc=salyzyn@google.com \
--cc=saravanak@google.com \
--cc=stanley.chu@mediatek.com \
--cc=tomas.winkler@intel.com \
--cc=venkatg@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).