RE: [PATCH 2/3] scsi: ufs: initialize max_lu_supported while booting
From: Avri Altman
Date: Sun Jan 12 2020 - 03:42:38 EST
> > 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.
>