From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 349A62DE707 for ; Wed, 3 Dec 2025 10:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764757140; cv=none; b=HLMrSSjJ3v+Q3fkof+LHwmV0o9PpiuzdhjmA8xE0k0rKRjHtOdNhd6jFwZp8D4S6/JSSGMLvEoNanSR1fhwFZv5GAeCM37CNahT/tCOtTRFbgXJm5sSX/nU8rgcVy0j2i3mH2aewYW6e9uLrguWr3rZRYU6QQLnQUn5s3qggER0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764757140; c=relaxed/simple; bh=mn6Me5cszWpyIDRgjrsb+w5xzO+oeHNnSMmAUORhfbo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YSxzFyObO1DOfBehLLuVfuyBCIISgLc0ajBGwH9z34sQ8w04V+V+YWBKDUHe4dTxlUdPL4DiiFx97IOjvpuVCiVIUDVkPJHrJBrsAOwvsE2clz18U8DcAxIJ8K5jHzUtYf3t6u3W7whEiEKDIFoRtBreIpkWnAzsxRMfJJ6t3e0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BaHaX7kB; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BaHaX7kB" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-297dc3e299bso62069175ad.1 for ; Wed, 03 Dec 2025 02:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764757138; x=1765361938; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H+lpkZ96SLXYvBL/jMuA66r6fzhm9f66vdhL3fP0Fk4=; b=BaHaX7kBXs+2+8LW68yljxswYUXcR7MNwPPOrVPfHG1c9bYZ7ydxuhSKIoKEoZQONA xxLGsBw0nLT0LRY7scCfQ88CBETQfOaePHDcFLVYby8IZazO0B5HEmBfI7oa8b+cP/0a 6K4EjfMQilwdPBz7Ep5/RMAewStriEG2rct4BffPClDDN+3AmVPTgP3qo7ojvVd9j3wd 8Rh+Y61sL4YSiiodqzKWkYSFmOjTBseyec48v5GLFX3PSxJizb76V1rZsNgq5XKjyIBm jUTZodfbuSwq7cNynpjo9yvzXmxCxvs7WKIP715bGToflC4Hvbg2NyDuYt53NqBiNaoG wIzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764757138; x=1765361938; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H+lpkZ96SLXYvBL/jMuA66r6fzhm9f66vdhL3fP0Fk4=; b=aom+wtj7h87u52D6fcTjS4NCvU7/TKMxbbiZPo2DKrE3lEgMjHvQHeYqb+qZ4+6V/D cIK+x4Wzl4+3StGNGP9DfW+4u0FfKLSIoRBa9a/CMmR3nTDLk0DCIjQdOwLRLACEEbAZ 4aBtUYL9pPhoSwh3/USwiMYEVxvbMnQ4vFG4IUKKtEt7JbJncAY9928V6/hECuB0dGdf Gxq8hth3xOuwOxvNwJ0GjJbwAizjVQ+QcZhlEW7FxHqA9jZnIR2JfzOP4wfaRPIRCOU3 B7Ytrfz9ps4WMri4tW5wvaTOJXELittzZNJTpumNWoLBxWZu5MP1NdL5MU6viK+OLsPs 2u4g== X-Forwarded-Encrypted: i=1; AJvYcCVbRnQiSNoBo4G32xKCl4OVO2o0GDDTDr5LPyAKK7VfYjI7A5I5DiulxnOB2+G0F+2ZOn2HloxIZzQnHwk=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/XWBA0ZQyMFl+tP4eevZhjxOUAKEmGfAyZbL6h0AQPMuELbDW BlJl1hgEqFYYdsjcetoa8oxdatVBDzPEei1BT8xck6WOCPPopPYp1DuQthtyQ7kV3fg= X-Gm-Gg: ASbGncuinsjw4XipH1ePK/xaO/CKww2hU4JTvStYYrv7UW0Xn7IVGAWdK6gxRAikmGE EoMxnbUfMLRgX/WjGAGAUCiH4UlGhE+y0+tyP/kP2FE5Se2ClkJ+EFaFti+auEWINlVxJyvaqoP ToIA2fJ/FqUswxdyW+wUMtR5biuIgL/KdydRuFqk5w32cM68zQLrx9oIa5XTTSXUlmpwGG7hxiQ ORkX9ZnTL4+dU45bpAmwcrt0KvZdxFwgOoEoD1pyTNVq60TqGo3QpBRfSLAjDM6kNlde1oLMeGT tMtUAAq7y4PV/A98NOtotbuac4ykCVKRawxR7CNFJKovS/oTrXlVkUNk7oLXrNQ11YdRoA9PxkA euZRl1H/o/JJMNRSgwSMPdzMptNxy9f5d+8kNPO0jBSrm61LrVyWZ+j6RvXZLWR60xaw+Qj61qE +u/9WUMnxawb34BWXdbUxJwvEKHF9ApFqQD7lbGAq7ZRkPbzoDJ/v3BrNS67XvsvPIdMo= X-Google-Smtp-Source: AGHT+IGFtGp/W7MhnATeuv6ArbwvWS1pdfKGoa7HumtTqFw8h2SoQddvraq/EytOdnnD13P5wTxMAw== X-Received: by 2002:a17:903:987:b0:298:33c9:eda1 with SMTP id d9443c01a7336-29d683f42f2mr17630875ad.43.1764757138231; Wed, 03 Dec 2025 02:18:58 -0800 (PST) Received: from [10.131.179.186] (zz20234032476F6CA7C6.userreverse.dion.ne.jp. [111.108.167.198]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb40ac4sm180936075ad.77.2025.12.03.02.18.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Dec 2025 02:18:57 -0800 (PST) Message-ID: <5f295577-ab67-4164-a718-f6fbc8911e67@gmail.com> Date: Wed, 3 Dec 2025 19:18:54 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability. To: Hans de Goede , ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, njoshi1@lenovo.com, Mark Pearson References: <20251203034032.6018-1-nitjoshi@gmail.com> Content-Language: en-US From: Nitin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Hans, Thank you for reviewing this patch. On 12/3/25 16:52, Hans de Goede wrote: > 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 >> Signed-off-by: Nitin Joshi >> --- >> .../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. Ack, I will modify it. > > 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. Thank you for pointing this out.  I am open for suggestions and will re-check regarding its use case in lenovo vantage in future. > > Regards, > > Hans > >