Re: [PATCH v2 1/2] scsi: ufs: core: Remove unnecessary if statement

From: Bean Huo
Date: Tue Oct 11 2022 - 05:39:53 EST


On Tue, 2022-10-11 at 11:21 +0900, Daejun Park wrote:
> Hi Bean Huo,
>
> I think ufs_is_valid_unit_desc_lun() is also used for
> wb_buf_alloc_units_show() in ufs-sysfs.c.
> So just removing this if-checkup will make different result when
> check lun value.
>

Hi Daejun,

Thanks for your review on the patch. Yes, I understood what you mean.
But I don't think that's the problem. Without this patch, access on
sysfs node "wb_shared_alloc_units" would get "invalid argument", while
with this patch sysfs would return 00. According to the UFS
specification:

"If this value is ‘0’, then the WriteBooster is not supported for this
LU. The Logical unit among LU0 ~ LU7 can be configured for WriteBooster
Buffer. Otherwise, whole WriteBooster Buffer configuration in this
device is invalid."

Per my understanding, with this patch, there is still no miss-
explanation of this sysfs node. The key purpose of this patch is to
remove any nonsense logical during the booting stage.

please have a think my comments. thanks.


Kind regards,
Bean


> Thanks,
> Daejun
>
> > From: Bean Huo <beanhuo@xxxxxxxxxx>
> >
> > LUs with WB potential support are properly checked in ufshcd_wb_pro
> > be()
> > before calling ufshcd_read_unit_desc_param(), so remove this unnece
> > ssary
> > if-
> > checkup in ufs_is_valid_unit_desc_lun() to match its function defin
> > ition.