Re: [PATCH v3 1/1] scsi: ufs: core: Add support to notify userspace of UniPro QoS events

From: Peter Wang (王信友)

Date: Wed Mar 04 2026 - 04:18:30 EST


On Sun, 2026-03-01 at 04:51 -0800, Can Guo wrote:
> @@ -1768,3 +1768,26 @@ Description:
>                 ====================   ===========================
>
>                 The attribute is read only.
> +
> +What:         
> /sys/bus/platform/drivers/ufshcd/*/dme_qos_notification
> +What:          /sys/bus/platform/devices/*.ufs/dme_qos_notification
> +Date:          February 2026

March 2026

> @@ -9097,6 +9106,12 @@ static int ufshcd_post_device_init(struct
> ufs_hba *hba)
>
>         /* UFS device is also active now */
>         ufshcd_set_ufs_dev_active(hba);
> +
> +       /* Indicate that DME QoS Monitor has been reset */
> +       atomic_set(&hba->dme_qos_notification, 0x1);
>

Reset value should be 0?

> @@ -1116,6 +1121,10 @@ struct ufs_hba {
>         int critical_health_count;
>         atomic_t dev_lvl_exception_count;
>         u64 dev_lvl_exception_id;
> +
> +       atomic_t dme_qos_notification;
> +       struct kernfs_node *dme_qos_sysfs_handle;

Why is dme_qos_sysfs_handle necessary?
Wouldn't it be sufficient to use
sysfs_notify(&hba->dev->kobj, NULL, "dme_qos_notification");
without checking whether dme_qos_sysfs_handle is NULL?

Thanks
Peter