Re: [PATCH v19 1/3] scsi: ufs: Introduce HPB feature

From: Greg KH
Date: Tue Feb 02 2021 - 06:13:20 EST


On Tue, Feb 02, 2021 at 07:46:47AM +0000, Avri Altman wrote:
> Daejun,
>
> > static const struct attribute_group *ufshcd_driver_groups[] = {
> > &ufs_sysfs_unit_descriptor_group,
> > &ufs_sysfs_lun_attributes_group,
> > +#ifdef CONFIG_SCSI_UFS_HPB
> > + &ufs_sysfs_hpb_stat_group,
> > +#endif
> > NULL,
> > };
> Aren’t you creating a hpb_stats entries for every lun (even wlun)?
> This is confusing, even if safe (any non-hpb lun returns NODEV).
> Also user-space have no way to know which entry is valid.
>
> Can we group those under ufshpb_lu<lun id> for valid hpb luns only?

How do you determine a valid lun? If the kernel knows, then it should
just not create the files for any that is "invalid", which it can do by
setting the correct mode in the attribute group.

> Also need to document the stats? Maybe in a separate sysfs-driver-ufs-features?

Aren't they all documented in the
Documentation/ABI/testing/sysfs-driver-ufs file in this patch? What is
missing?

thanks,

greg k-h