From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 9F5E73176E7 for ; Mon, 8 Dec 2025 07:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765178409; cv=none; b=c+nXZQGW/nxoKU+VphJfjPm/cWrNjEiFepQMCv5VKr3Wx5j//XCDda+NjLuP1gn9RGHYRo9GFLNWCNMsabvjX2Uie+9RcT36uoQXcQviCCaYW4l7kBwYo7Hp9rqLGSeSlMjZwEoKW1XNit5RjM/+y0Oedf57k/jeuY3p0AiE6t8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765178409; c=relaxed/simple; bh=G2ydOBXIsgrCi9GOTge/kQi7St4VlBJ/LD3MeqIFgeI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ddJ0muC5Yts2wrhM/jPk3b4jMojXwO5oQdGKC4uaJBwi2x/OvEwaMHSlAG3E8KMk93r23gIAaQ7LBddrlQlWpYsfBfm9Y5a2fUiFKEf+9HBk99XMfO9m5MpqlY+IXI7GN9+/HoMpjHtEQzqYWDhimX+bDJNV1TCkr9ehH5qnp48= 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=RELWu6zl; arc=none smtp.client-ip=209.85.210.169 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="RELWu6zl" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7ade456b6abso3334676b3a.3 for ; Sun, 07 Dec 2025 23:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765178404; x=1765783204; 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=G2GFn+qaf7JROxyUHN2tFYlg0931mXfThboEl/PA02I=; b=RELWu6zl6YIOueQziLaIUEI558lmMOoAffL3cmsUOY6acZKb/1/7lSkTZ2kmFmiCfL pJQJIpP0VhbZjD2OlVGAUQgbDQFfP96eKAcS1ljRuuXbm8LNZ/2FeNfFocA72MTuMm4t NUy5YcdqTuU+/su4dNMg2nKOOuaV9e+woeiN1rTjROTVLDdL+Tw2evnu3l6W4EwEG5Oa mf6e53xT55dX0bSQP8rIqMIWh47j7FOzazTNs/KDlrGZXVb0JtHhLuca3Vkstv19obUn FBk0JksynQvgPpu1xyKncPoDVZHWAC6Cjt5fXRLFgTpEgsX1HPNpiijTjNQYxdtJsPSk 4bpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765178404; x=1765783204; 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=G2GFn+qaf7JROxyUHN2tFYlg0931mXfThboEl/PA02I=; b=B6XEyNYLmOLFc4FGyyBiD+nzet9RMRC+u5X7QtU6ijUSvQCL/6IotbhZ+ZoU9yvpxa 0RMb1LMazMO9K6ghSoDtgjBheOk1JlznRpR3JCL0GgT3Xo58t+5o0eNfg5b8dPm+k6kz LwtY+HpTOQnDYh3jHmNYf0DDxn72OYGaxp5D3TLT1GvEJdeEYMrbqjFpsHI6x6Q8g9tW nCpbBC1knvAd8WkuhHR+j+tcwccpKGXEVL9vRSahuYPujuKqTCbkydjt2ivkhfWzg/Fk NiTof1ajCuczcD75ae2gjEDG5BHcg/bjYfk2jE/1RXsR7VIl7evtYvyj1pVwR9xHST3P cm+w== X-Forwarded-Encrypted: i=1; AJvYcCW2NxqxwYZVb1AMvOYWWl2sn6kSAESSWG3OZS2Xmjc+ZXILIk6RJuT5ltxQqV6W5MQwsxaEk5KbayiazpM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyof/4MtXrZBRnnYG71fiq8SAOP7/imlFpzsvAmjlnvH9lP8fzf gP+axa2b9Hl1tqlVTDTx0mXJjuD5Rrk5GD2z0lFyWW16P0ZOoOfNCjua X-Gm-Gg: ASbGnct2fOOHDFH3t7FM2twiwM4iTcxHx+WY4P3OkxtT14QUc4dEwSsZH2A1PZYKJ9C XO4wfZvXpJRwcl8SsKDK3mQ5/Y8Y2XtA6OKFCVZsckTskOIS4BFxW4GoVL9/Ep4rVxlGx6GFsMM 9BhxxV0hkDKriECISSa9T5El3fw8fX2RB1m8ok+YtLI3Ua5VFLbCgA0eSUY9oHLpJY38LiuX36p 8iM5K5pveA+fQqgIIlE33VdcBLfPioYecWQzqvNzzYl/59gx+sHIgtqItTGtt2a5SkPAboMH9C6 TijJ0vyhMPdkLye1ladOPiChDVUqYxsO1yUxCCwpeTEyML6Zye1HaejNRfdKxz+AE5W8rlOhaJ7 oT0evNp0mEd3B8vyWR0NXVAEeDh3avpuDxRBOxS2mRY25NoYQX3ZxERVl1Dq7nTMg22le6eBv5S EzjO6g8ZJFhxJzEjFjA26EaZrrjOl1F7bGptMOWGUtFCeMnI5ek4GAYoka6BrGzS459cs= X-Google-Smtp-Source: AGHT+IEVKjRPfpWmz0pcAQmm/JfRACi5Mf+MRdEk29dAwVQIYVJ83mtPVTN6043KjitYmganidcQ/g== X-Received: by 2002:a05:6a20:1581:b0:364:1339:9fdd with SMTP id adf61e73a8af0-3661802a100mr7076406637.59.1765178402497; Sun, 07 Dec 2025 23:20:02 -0800 (PST) Received: from [10.131.179.186] (zz20234032476F6CA7C6.userreverse.dion.ne.jp. [111.108.167.198]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-bf6a14f40f5sm11683712a12.21.2025.12.07.23.20.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Dec 2025 23:20:02 -0800 (PST) Message-ID: <3b785a80-73e6-4def-ae4b-39ccb30dd1b7@gmail.com> Date: Mon, 8 Dec 2025 16:19:58 +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: Mark Pearson , Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: "platform-driver-x86@vger.kernel.org" , linux-kernel@vger.kernel.org, Nitin Joshi1 References: <20251203034032.6018-1-nitjoshi@gmail.com> <5f295577-ab67-4164-a718-f6fbc8911e67@gmail.com> Content-Language: en-US From: Nitin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/3/25 22:16, Mark Pearson wrote: > On Wed, Dec 3, 2025, at 5:18 AM, Nitin wrote: >> 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. >> > I'd not considered it from this perspective. > > One concern is that it could be multiple devices in multiple location - so breaking it up into too many pieces becomes difficult. > > What if we did: > hwdd_status - 1 or 0 if damage detected > hwdd_detail - list of damaged items with their location (could be multiple). e.g. > TYPE-C: Base, Right side, Center port > If hwdd_status is 0 then hwdd_detail would display "No damage detected" Thank you, Mark ! I am OK with this suggestion. Hans / Ilpo - Any comment on this ? Thanks > Mark Thank you ! Nitin Joshi