Re: [PATCH v3] scsi: ufs: critical health condition

From: Bart Van Assche
Date: Mon Feb 10 2025 - 13:30:50 EST


On 2/10/25 5:58 AM, Avri Altman wrote:
To handle this new `sysfs` entry, either `udev` rules or some other
polling code can be configured to monitor changes in the
`critical_health` attribute.

Hmm ... I'm not aware of any support in udevd to poll on sysfs
attributes? I think that calling select(), poll() or epoll() is required
to wait for a sysfs_notify() call.

+Description: Report the number of times a critical health event has been
+ reported by a UFS device. further insight into the specific

further -> Further?

+static ssize_t critical_health_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct ufs_hba *hba = dev_get_drvdata(dev);
+
+ return sysfs_emit(buf, "%d\n", hba->critical_health);
+}

Now that the data type of hba->critical_health has been changed from
boolean into integer, should its name perhaps be changed into
hba->critical_health_count?

@@ -1130,6 +1131,9 @@ struct ufs_hba {
struct delayed_work ufs_rtc_update_work;
struct pm_qos_request pm_qos_req;
bool pm_qos_enabled;
+
+ /* HEALTH_CRITICAL exception reported */
+ int critical_health;
};

Please leave out the inline comment since @critical_health already
has a kernel-doc comment.

Thanks,

Bart.