Re: [PATCH v2 6/9] ufs: core: Move the ufshcd_device_init(hba, true) call

Bart Van Assche
2024-08-28T17:19:29Z

On 8/25/24 1:33 AM, Manivannan Sadhasivam wrote:
> On Thu, Aug 22, 2024 at 02:36:07PM -0700, Bart Van Assche wrote:
>> Move the ufshcd_device_init(hba, true) call from ufshcd_async_scan()
>> into ufshcd_init(). This patch prepares for moving both scsi_add_host()
>> calls into ufshcd_add_scsi_host(). Calling ufshcd_device_init() from
>> ufshcd_init() without holding hba->host_sem is safe because
>> hba->host_sem serializes core code with sysfs callback code and because
>> the ufshcd_device_init() is moved before the scsi_add_host() call.
>
> I think this last sentence is not complete.

It is complete but your feedback means to me that it is hard to
understand. I will reword it.

>> @@ -10632,6 +10629,11 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
>> */
>> ufshcd_set_ufs_dev_active(hba);
>>
>> + /* Initialize hba, detect and initialize UFS device */
>> + err = ufshcd_device_init(hba, /*init_dev_params=*/true);
>
> I think this inline comment is not really needed. It is rather decreasing code
> readability.

I will remove it.

Thanks,

Bart.