Re: [PATCH v3 04/12] scsi: ufs: core: Add support for TX Equalization

From: Bart Van Assche

Date: Fri Mar 13 2026 - 18:19:48 EST


On 3/8/26 8:14 AM, Can Guo wrote:
+static int txeq_gear_set(const char *val, const struct kernel_param *kp)
+{
+ return param_set_uint_minmax(val, kp, UFS_HS_G1, UFS_HS_G6);
+}

Why UFS_HS_G6 instead of UFS_HS_GEAR_MAX?

@@ -955,6 +1045,11 @@ enum ufshcd_mcq_opr {
+ * @host_preshoot_cap: host TX PreShoot capability
+ * @host_deemphasis_cap: host TX DeEmphasis capability
+ * @device_preshoot_cap: device TX PreShoot capability
+ * @device_deemphasis_cap: device TX DeEmphasis capability

Please either explain the meaning of the bits in the above four new
member variables or add a reference to the standard that defines the
meaning of the bits in these member variables.

+#define UFS_HS_RATE_STRING(rate) \
+ ((rate) == PA_HS_MODE_A ? "A" : \
+ (rate) == PA_HS_MODE_B ? "B" : \
+ "Unknown")

Why a #define instead of an inline function? Aren't inline functions
preferred over preprocessor macros?

Thanks,

Bart.