Re: [PATCH v3 2/3] scsi: ufs: Keep device active mode only fWriteBoosterBufferFlushDuringHibernate == 1

From: Bean Huo
Date: Thu Dec 10 2020 - 15:14:38 EST


On Thu, 2020-12-10 at 07:46 +0000, Avri Altman wrote:
> >
>
> Right.
> But it is a small price, and you no longer need to worry about rare
> error event.
> Also adding an if (fWriteBoosterBufferFlushDuringHibernate == 1) will
> allow some more flexibility,
> e.g. shutting it off from user-space (ufs-utils), unlike today,
> that it is categorically on for all platforms / devices.
>
> Anyway, if you decided to add new capability,
> Preferable to do it in a different series.
>
> Thanks,
> Avri

Hi Avri
Thanks. This reminds me that ufs-bsg is a latent defect. Currently,
userspace can pass any raw UPIU commands to the UFS through ufs-bsg,
ufs-bsg is a pass-through channel. So,
fWriteBoosterBufferFlushDuringHibernate is not the only one in the
ufshcd.c can be changed by ufs-utils. any flags in the UFS can be
changed by user-space tool after UFS finishing its initialization.


This modification after the fact (Linux initialization/probe itself) is
not legal. I remembered we discussed this on the eMMC case, the same
with here that, user can change some parameters in the eMMC through
eMMC Ioctl, the user feels great, but they did a wrong thing.


Ulf Hansson: "I don't think it's worth to compensate and try
to act accordingly to cover cases when userspace has messed up."



thanks,
Bean