[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4767355d-e7b0-d38b-88f3-c070ed0b5e5b@acm.org>
Date: Fri, 30 Sep 2022 11:32:34 -0700
From: Bart Van Assche <bvanassche@....org>
To: Asutosh Das <quic_asutoshd@...cinc.com>, mani@...nel.org,
quic_nguyenb@...cinc.com, quic_xiaosenh@...cinc.com,
quic_cang@...cinc.com, quic_nitirawa@...cinc.com,
quic_rampraka@...cinc.com, quic_richardp@...cinc.com,
stanley.chu@...iatek.com, adrian.hunter@...el.com,
avri.altman@....com, beanhuo@...ron.com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Matthias Brugger <matthias.bgg@...il.com>,
open list <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v1 03/16] ufs: core: Defer adding host to scsi if mcq is
supported
On 9/22/22 18:05, Asutosh Das wrote:
> @@ -8218,6 +8219,14 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
> ret = ufshcd_device_params_init(hba);
> if (ret)
> goto out;
> +
> + if (is_mcq_supported(hba)) {
> + ret = scsi_add_host(host, hba->dev);
> + if (ret) {
> + dev_err(hba->dev, "scsi_add_host failed\n");
> + goto out;
> + }
> + }
> }
Calling scsi_add_host() from ufshcd_probe_hba() seems wrong to me since
that function is not only called when probing a host controller but also
when resetting a host controller. See also ufshcd_host_reset_and_restore().
>
> ufshcd_tune_unipro_params(hba);
> @@ -9764,10 +9773,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
> hba->is_irq_enabled = true;
> }
>
> - err = scsi_add_host(host, hba->dev);
> - if (err) {
> - dev_err(hba->dev, "scsi_add_host failed\n");
> - goto out_disable;
> + if (!is_mcq_supported(hba)) {
> + err = scsi_add_host(host, hba->dev);
> + if (err) {
> + dev_err(hba->dev, "scsi_add_host failed\n");
> + goto out_disable;
> + }
> }
>
> hba->tmf_tag_set = (struct blk_mq_tag_set) {
Please make sure there is only a single scsi_add_host() call in the UFS
host controller driver.
Thanks,
Bart.
Powered by blists - more mailing lists