[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN2PR04MB699126C95F23E15BC778FD72FC3A0@MN2PR04MB6991.namprd04.prod.outlook.com>
Date: Sun, 12 Jan 2020 08:41:30 +0000
From: Avri Altman <Avri.Altman@....com>
To: Bart Van Assche <bvanassche@....org>, Bean Huo <huobean@...il.com>,
"alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
"pedrom.sousa@...opsys.com" <pedrom.sousa@...opsys.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
"beanhuo@...ron.com" <beanhuo@...ron.com>,
"tomas.winkler@...el.com" <tomas.winkler@...el.com>,
"cang@...eaurora.org" <cang@...eaurora.org>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 2/3] scsi: ufs: initialize max_lu_supported while booting
> > memset(&hba->dev_info, 0, sizeof(hba->dev_info));
> > + /* Init parameters according to UFS relevant descriptors */
> > + ret = ufshcd_init_device_param(hba);
> > + if (ret) {
> > + dev_err(hba->dev,
> > + "%s: Init of device param failed. err = %d\n",
> > + __func__, ret);
> > + goto out;
> > + }
> > +
> > if (!ufshcd_query_flag_retry(hba,
> UPIU_QUERY_OPCODE_READ_FLAG,
> > QUERY_FLAG_IDN_PWR_ON_WPE, &flag))
> > hba->dev_info.f_power_on_wp_en = flag;
>
> The context check in ufshcd_probe_hba() looks ugly to me. Has it been
> considered to move all code that is controlled by the if-statement with the
> context check into ufshcd_async_scan()?
As part of ufshcd_probe_hba we also read the device descriptor,
Which is, by spec, an optional stage of the boot process, right after the unipro boot sequence.
Might want to consider moving the call there, as an integral phase of obtaining device info.
Thanks,
Avri
>
> Thanks,
>
> Bart.
>
Powered by blists - more mailing lists