Re: [PATCH v4 07/12] scsi: ufs: core: Add support to retrain TX Equalization via debugfs

From: Bean Huo

Date: Mon Mar 23 2026 - 05:38:15 EST


On Fri, 2026-03-20 at 20:10 -0700, Can Guo wrote:
> Drastic environmental changes, such as significant temperature shifts, can
> impact link signal integrity. In such cases, retraining TX Equalization is
> necessary to compensate for these environmental changes.
>
> Add a debugfs entry, 'tx_eq_ctrl', to allow userspace to manually trigger
> the TX Equalization training (EQTR) procedure and apply the identified
> optimal settings on the fly. These entries are created on a per-gear basis
> for High Speed Gear 4 (HS-G4) and above, as TX EQTR is not supported for
> lower gears.
>
> The 'tx_eq_ctrl' entry currently accepts the 'retrain' command to initiate
> the procedure. The interface is designed to be scalable to support
> additional commands in the future.
>
> Reading the 'tx_eq_ctrl' entry provides a usage hint to the user,
> ensuring the interface is self-documenting.
>
> The ufshcd's debugfs folder structure will look like below:
>
> /sys/kernel/debug/ufshcd/*ufs*/
> > --tx_eq_hs_gear1/
> >   |--device_tx_eq_params
> >   |--host_tx_eq_params
> > --tx_eq_hs_gear2/
> > --tx_eq_hs_gear3/
> > --tx_eq_hs_gear4/
> > --tx_eq_hs_gear5/
> > --tx_eq_hs_gear6/
>    |--device_tx_eq_params
>    |--device_tx_eqtr_record
>    |--host_tx_eq_params
>    |--host_tx_eqtr_record
>    |--tx_eq_ctrl
>
> Signed-off-by: Can Guo <can.guo@xxxxxxxxxxxxxxxx>

Looks good to me, happy to proceed.

Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>