* [PATCH 0/2] scsi: ufs: Temperature notification fixes
@ 2025-01-14 9:35 Avri Altman
2025-01-14 9:35 ` [PATCH 1/2] scsi: ufs: core: Simplify temperature exception event handling Avri Altman
2025-01-14 9:35 ` [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation Avri Altman
0 siblings, 2 replies; 5+ messages in thread
From: Avri Altman @ 2025-01-14 9:35 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, linux-kernel, Guenter Roeck, Bart Van Assche, Avri Altman
Martin hi,
This series includes two changes to the UFS driver. The first patch
simplifies the temperature exception event handling, and the second
patch adds missing ABI documentation for the UFS hwmon driver.
Please consider this for the next merge window.
Thanks,
Avri
Avri Altman (2):
scsi: ufs: hwmon: Add missing ABI documentation
scsi: ufs: core: Simplify temperature exception event handling
.../ABI/testing/sysfs-driver-ufs-hwmon | 31 +++++++++++++++++++
MAINTAINERS | 2 ++
drivers/ufs/core/ufshcd.c | 20 +-----------
3 files changed, 34 insertions(+), 19 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs-hwmon
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] scsi: ufs: core: Simplify temperature exception event handling
2025-01-14 9:35 [PATCH 0/2] scsi: ufs: Temperature notification fixes Avri Altman
@ 2025-01-14 9:35 ` Avri Altman
2025-01-14 9:35 ` [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation Avri Altman
1 sibling, 0 replies; 5+ messages in thread
From: Avri Altman @ 2025-01-14 9:35 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, linux-kernel, Guenter Roeck, Bart Van Assche, Avri Altman
This commit simplifies the temperature exception event handling by
removing the `ufshcd_temp_exception_event_handler` function and directly
calling `ufs_hwmon_notify_event` in the `ufshcd_exception_event_handler`
function.
The `ufshcd_temp_exception_event_handler` function contained a
placeholder comment for platform vendors to add additional steps if
required. However, since its introduction a few years ago, no vendor has
added any additional steps. Therefore, the placeholder function is
removed to streamline the code.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
drivers/ufs/core/ufshcd.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 0920a443588c..f6c38cf10382 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5976,24 +5976,6 @@ static void ufshcd_bkops_exception_event_handler(struct ufs_hba *hba)
__func__, err);
}
-static void ufshcd_temp_exception_event_handler(struct ufs_hba *hba, u16 status)
-{
- u32 value;
-
- if (ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR,
- QUERY_ATTR_IDN_CASE_ROUGH_TEMP, 0, 0, &value))
- return;
-
- dev_info(hba->dev, "exception Tcase %d\n", value - 80);
-
- ufs_hwmon_notify_event(hba, status & MASK_EE_URGENT_TEMP);
-
- /*
- * A placeholder for the platform vendors to add whatever additional
- * steps required
- */
-}
-
static int __ufshcd_wb_toggle(struct ufs_hba *hba, bool set, enum flag_idn idn)
{
u8 index;
@@ -6214,7 +6196,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
ufshcd_bkops_exception_event_handler(hba);
if (status & hba->ee_drv_mask & MASK_EE_URGENT_TEMP)
- ufshcd_temp_exception_event_handler(hba, status);
+ ufs_hwmon_notify_event(hba, status & MASK_EE_URGENT_TEMP);
ufs_debugfs_exception_event(hba, status);
}
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation
2025-01-14 9:35 [PATCH 0/2] scsi: ufs: Temperature notification fixes Avri Altman
2025-01-14 9:35 ` [PATCH 1/2] scsi: ufs: core: Simplify temperature exception event handling Avri Altman
@ 2025-01-14 9:35 ` Avri Altman
2025-01-14 14:49 ` Guenter Roeck
1 sibling, 1 reply; 5+ messages in thread
From: Avri Altman @ 2025-01-14 9:35 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, linux-kernel, Guenter Roeck, Bart Van Assche, Avri Altman
This commit adds ABI documentation for the UFS hwmon driver, detailing
the sysfs attributes exposed by the driver. It includes the missing
temperature notification entries, that were added back in 2021.
The following sysfs attributes are documented:
- /sys/class/hwmon/hwmon*/temp*_input
- /sys/class/hwmon/hwmon*/temp*_crit
- /sys/class/hwmon/hwmon*/temp*_lcrit
- /sys/class/hwmon/hwmon*/temp*_enable
While at it, update a missing reference to the ufs ABI doc in the
MAINTAINERS file.
Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support")
Signed-off-by: Avri Altman <avri.altman@wdc.com>
---
.../ABI/testing/sysfs-driver-ufs-hwmon | 31 +++++++++++++++++++
MAINTAINERS | 2 ++
2 files changed, 33 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs-hwmon
diff --git a/Documentation/ABI/testing/sysfs-driver-ufs-hwmon b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
new file mode 100644
index 000000000000..a27a108ffd28
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
@@ -0,0 +1,31 @@
+What: /sys/class/hwmon/hwmon*/temp*_input
+Date: September 2021
+KernelVersion: 5.16
+Contact: avri.altman@wdc.com
+Description:
+ Temperature input value in millidegrees Celsius.
+ Read-only.
+
+What: /sys/class/hwmon/hwmon*/temp*_crit
+Date: September 2021
+KernelVersion: 5.16
+Contact: avri.altman@wdc.com
+Description:
+ Critical temperature value in millidegrees Celsius.
+ Read-only.
+
+What: /sys/class/hwmon/hwmon*/temp*_lcrit
+Date: September 2021
+KernelVersion: 5.16
+Contact: avri.altman@wdc.com
+Description:
+ Lower critical temperature value in millidegrees Celsius.
+ Read-only.
+
+What: /sys/class/hwmon/hwmon*/temp*_enable
+Date: September 2021
+KernelVersion: 5.16
+Contact: avri.altman@wdc.com
+Description:
+ Enable (1) or disable (0) this temperature sensor.
+ Read-write.
diff --git a/MAINTAINERS b/MAINTAINERS
index 838d3038e1ea..71a69551aee2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24070,6 +24070,8 @@ R: Avri Altman <avri.altman@wdc.com>
R: Bart Van Assche <bvanassche@acm.org>
L: linux-scsi@vger.kernel.org
S: Supported
+F: Documentation/ABI/testing/sysfs-driver-ufs
+F: Documentation/ABI/testing/sysfs-driver-ufs-hwmon
F: Documentation/devicetree/bindings/ufs/
F: Documentation/scsi/ufs.rst
F: drivers/ufs/core/
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation
2025-01-14 9:35 ` [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation Avri Altman
@ 2025-01-14 14:49 ` Guenter Roeck
2025-01-14 15:01 ` Avri Altman
0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2025-01-14 14:49 UTC (permalink / raw)
To: Avri Altman, Martin K . Petersen
Cc: linux-scsi, linux-kernel, Bart Van Assche
On 1/14/25 01:35, Avri Altman wrote:
> This commit adds ABI documentation for the UFS hwmon driver, detailing
> the sysfs attributes exposed by the driver. It includes the missing
> temperature notification entries, that were added back in 2021.
>
> The following sysfs attributes are documented:
> - /sys/class/hwmon/hwmon*/temp*_input
> - /sys/class/hwmon/hwmon*/temp*_crit
> - /sys/class/hwmon/hwmon*/temp*_lcrit
> - /sys/class/hwmon/hwmon*/temp*_enable
>
> While at it, update a missing reference to the ufs ABI doc in the
> MAINTAINERS file.
>
> Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support")
> Signed-off-by: Avri Altman <avri.altman@wdc.com>
> ---
> .../ABI/testing/sysfs-driver-ufs-hwmon | 31 +++++++++++++++++++
The hardware monitoring ABI is documented in ABI/testing/sysfs-class-hwmon.
It does not make sense to document hwmon driver sysfs attributes per driver
unless there are non-standard attributes.
Guenter
> MAINTAINERS | 2 ++
> 2 files changed, 33 insertions(+)
> create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs-hwmon
>
> diff --git a/Documentation/ABI/testing/sysfs-driver-ufs-hwmon b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> new file mode 100644
> index 000000000000..a27a108ffd28
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> @@ -0,0 +1,31 @@
> +What: /sys/class/hwmon/hwmon*/temp*_input
> +Date: September 2021
> +KernelVersion: 5.16
> +Contact: avri.altman@wdc.com
> +Description:
> + Temperature input value in millidegrees Celsius.
> + Read-only.
> +
> +What: /sys/class/hwmon/hwmon*/temp*_crit
> +Date: September 2021
> +KernelVersion: 5.16
> +Contact: avri.altman@wdc.com
> +Description:
> + Critical temperature value in millidegrees Celsius.
> + Read-only.
> +
> +What: /sys/class/hwmon/hwmon*/temp*_lcrit
> +Date: September 2021
> +KernelVersion: 5.16
> +Contact: avri.altman@wdc.com
> +Description:
> + Lower critical temperature value in millidegrees Celsius.
> + Read-only.
> +
> +What: /sys/class/hwmon/hwmon*/temp*_enable
> +Date: September 2021
> +KernelVersion: 5.16
> +Contact: avri.altman@wdc.com
> +Description:
> + Enable (1) or disable (0) this temperature sensor.
> + Read-write.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 838d3038e1ea..71a69551aee2 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -24070,6 +24070,8 @@ R: Avri Altman <avri.altman@wdc.com>
> R: Bart Van Assche <bvanassche@acm.org>
> L: linux-scsi@vger.kernel.org
> S: Supported
> +F: Documentation/ABI/testing/sysfs-driver-ufs
> +F: Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> F: Documentation/devicetree/bindings/ufs/
> F: Documentation/scsi/ufs.rst
> F: drivers/ufs/core/
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation
2025-01-14 14:49 ` Guenter Roeck
@ 2025-01-14 15:01 ` Avri Altman
0 siblings, 0 replies; 5+ messages in thread
From: Avri Altman @ 2025-01-14 15:01 UTC (permalink / raw)
To: Guenter Roeck, Martin K . Petersen
Cc: linux-scsi, linux-kernel, Bart Van Assche
> On 1/14/25 01:35, Avri Altman wrote:
> > This commit adds ABI documentation for the UFS hwmon driver, detailing
> > the sysfs attributes exposed by the driver. It includes the missing
> > temperature notification entries, that were added back in 2021.
> >
> > The following sysfs attributes are documented:
> > - /sys/class/hwmon/hwmon*/temp*_input
> > - /sys/class/hwmon/hwmon*/temp*_crit
> > - /sys/class/hwmon/hwmon*/temp*_lcrit
> > - /sys/class/hwmon/hwmon*/temp*_enable
> >
> > While at it, update a missing reference to the ufs ABI doc in the
> > MAINTAINERS file.
> >
> > Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature
> > notification support")
> > Signed-off-by: Avri Altman <avri.altman@wdc.com>
> > ---
> > .../ABI/testing/sysfs-driver-ufs-hwmon | 31 +++++++++++++++++++
>
> The hardware monitoring ABI is documented in ABI/testing/sysfs-class-
> hwmon.
> It does not make sense to document hwmon driver sysfs attributes per driver
> unless there are non-standard attributes.
Thanks. Will drop it.
Thanks,
Avri
>
> Guenter
>
> > MAINTAINERS | 2 ++
> > 2 files changed, 33 insertions(+)
> > create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> >
> > diff --git a/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> > b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> > new file mode 100644
> > index 000000000000..a27a108ffd28
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> > @@ -0,0 +1,31 @@
> > +What: /sys/class/hwmon/hwmon*/temp*_input
> > +Date: September 2021
> > +KernelVersion: 5.16
> > +Contact: avri.altman@wdc.com
> > +Description:
> > + Temperature input value in millidegrees Celsius.
> > + Read-only.
> > +
> > +What: /sys/class/hwmon/hwmon*/temp*_crit
> > +Date: September 2021
> > +KernelVersion: 5.16
> > +Contact: avri.altman@wdc.com
> > +Description:
> > + Critical temperature value in millidegrees Celsius.
> > + Read-only.
> > +
> > +What: /sys/class/hwmon/hwmon*/temp*_lcrit
> > +Date: September 2021
> > +KernelVersion: 5.16
> > +Contact: avri.altman@wdc.com
> > +Description:
> > + Lower critical temperature value in millidegrees Celsius.
> > + Read-only.
> > +
> > +What: /sys/class/hwmon/hwmon*/temp*_enable
> > +Date: September 2021
> > +KernelVersion: 5.16
> > +Contact: avri.altman@wdc.com
> > +Description:
> > + Enable (1) or disable (0) this temperature sensor.
> > + Read-write.
> > diff --git a/MAINTAINERS b/MAINTAINERS index
> > 838d3038e1ea..71a69551aee2 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -24070,6 +24070,8 @@ R: Avri Altman <avri.altman@wdc.com>
> > R: Bart Van Assche <bvanassche@acm.org>
> > L: linux-scsi@vger.kernel.org
> > S: Supported
> > +F: Documentation/ABI/testing/sysfs-driver-ufs
> > +F: Documentation/ABI/testing/sysfs-driver-ufs-hwmon
> > F: Documentation/devicetree/bindings/ufs/
> > F: Documentation/scsi/ufs.rst
> > F: drivers/ufs/core/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-14 15:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-14 9:35 [PATCH 0/2] scsi: ufs: Temperature notification fixes Avri Altman
2025-01-14 9:35 ` [PATCH 1/2] scsi: ufs: core: Simplify temperature exception event handling Avri Altman
2025-01-14 9:35 ` [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation Avri Altman
2025-01-14 14:49 ` Guenter Roeck
2025-01-14 15:01 ` Avri Altman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®