All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Nitin Joshi <nitjoshi@gmail.com>, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, njoshi1@lenovo.com,
	Mark Pearson <mpearson-lenovo@squebb.ca>
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.
Date: Wed, 3 Dec 2025 08:52:01 +0100	[thread overview]
Message-ID: <c8e4a0d2-0641-4e4b-b62a-9c92ec43b3cf@kernel.org> (raw)
In-Reply-To: <20251203034032.6018-1-nitjoshi@gmail.com>

Hi,

Interesting new feature. A few small remarks on the proposed
sysfs API below.

On 3-Dec-25 4:40 AM, Nitin Joshi wrote:
> Thinkpads are adding the ability to detect and report hardware damage
> status. Add new sysfs interface to identify the impacted component
> with status.
> Initial support is available for the USB-C replaceable connector.
> 
> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> Signed-off-by: Nitin Joshi<nitjoshi@gmail.com>
> ---
>  .../admin-guide/laptops/thinkpad-acpi.rst     |  26 +++
>  drivers/platform/x86/lenovo/thinkpad_acpi.c   | 179 ++++++++++++++++++
>  2 files changed, 205 insertions(+)
> 
> diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> index 4ab0fef7d440..4a3220529489 100644
> --- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> +++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> @@ -54,6 +54,7 @@ detailed description):
>  	- Setting keyboard language
>  	- WWAN Antenna type
>  	- Auxmac
> +	- Hardware damage detection capability
>  
>  A compatibility table by model and feature is maintained on the web
>  site, http://ibm-acpi.sf.net/. I appreciate any success or failure
> @@ -1576,6 +1577,31 @@ percentage level, above which charging will stop.
>  The exact semantics of the attributes may be found in
>  Documentation/ABI/testing/sysfs-class-power.
>  
> +Hardware damage detection capability
> +-----------------
> +
> +sysfs attributes: hwdd_status
> +
> +Thinkpads are adding the ability to detect and report hardware damage.
> +Add new sysfs interface to identify the impacted component.
> +Initial support is available for the USB-C replaceable connector.
> +
> +The available commands are::
> +
> +        cat /sys/devices/platform/thinkpad_acpi/hwdd_status
> +
> +This value displays device type and location of device with damage status.
> +For example:
> +if no damage is detected:
> +  No damage detected
> +if damage detected:
> +  Damage detected:
> +  Device: TYPE-C
> +  Location: Base, Right side, Center port
> +
> +The property is read-only. If feature is not supported then sysfs
> +class is not created.

Nitpick: s/class/attribute/ classes are standardized sysfs
interfaces living under /sys/class/ which this is not.

Besides the nitpick I'm wondering if we do not want to make
this a little bit more friendly / easy for software to parse ?

ATM this seems focused on a human directly reading
the output but what if we want some sort of automation,
like e.g. a Linux version of the Lenovo Vantage sw parsing
this in the future?

Note I've no specific suggestions for how to make this
easier to parse, this is just an observation.

Regards,

Hans



  reply	other threads:[~2025-12-03  7:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  3:40 [PATCH] platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability Nitin Joshi
2025-12-03  7:52 ` Hans de Goede [this message]
2025-12-03 10:18   ` Nitin
2025-12-03 13:16     ` Mark Pearson
2025-12-08  7:19       ` Nitin
2025-12-08  9:32         ` Hans de Goede
2025-12-08 12:04           ` Nitin
2025-12-03  9:44 ` Ilpo Järvinen
2025-12-03 10:34   ` Nitin
2025-12-03 10:39     ` Ilpo Järvinen
2025-12-03 10:53       ` Nitin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8e4a0d2-0641-4e4b-b62a-9c92ec43b3cf@kernel.org \
    --to=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=nitjoshi@gmail.com \
    --cc=njoshi1@lenovo.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.