Re: [PATCH v3] scsi: ufs: core: Fix data race in CPU latency PM QoS request handling

From: Peter Wang (王信友)
Date: Wed Sep 17 2025 - 23:16:26 EST


On Wed, 2025-09-17 at 17:41 +0800, Zhongqiu Han wrote:
>
>         ufshcd_init_clk_gating(hba);
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
> index ea0021f067c9..277dda606f4d 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -938,6 +938,7 @@ enum ufshcd_mcq_opr {
>   * @ufs_rtc_update_work: A work for UFS RTC periodic update
>   * @pm_qos_req: PM QoS request handle
>   * @pm_qos_enabled: flag to check if pm qos is enabled
> + * @pm_qos_mutex: synchronizes PM QoS request and status updates
>   * @critical_health_count: count of critical health exceptions
>   * @dev_lvl_exception_count: count of device level exceptions since
> last reset
>   * @dev_lvl_exception_id: vendor specific information about the
> @@ -1110,6 +1111,8 @@ struct ufs_hba {
>         struct delayed_work ufs_rtc_update_work;
>         struct pm_qos_request pm_qos_req;
>         bool pm_qos_enabled;
> +       /* synchronizes PM QoS request and status updates */
>

Hi Zhongqiu,

I think this line can be removed to make the code cleaner,
since you’ve already explained the purpose of each parameter above.

Thanks.
Peter



> +       struct mutex pm_qos_mutex;
>
>         int critical_health_count;
>         atomic_t dev_lvl_exception_count;
> --
> 2.43.0
>