From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A00C77B78 for ; Thu, 13 Apr 2023 11:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjDMLrC (ORCPT ); Thu, 13 Apr 2023 07:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbjDMLq6 (ORCPT ); Thu, 13 Apr 2023 07:46:58 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAED19EC3 for ; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id k27-20020a05600c1c9b00b003f0a9f022beso520201wms.1 for ; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386413; x=1683978413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qMszukETqZzqN2APgbL3HkGY76Y4/3+HTAH7iHHTbjs=; b=fDLj+JhZmQaUGryXvgdjQCNDXdoqFgTkTrHXpJgBrIO+p8SEHrKWCOHuePGBH6lck4 paIoa1H/oXCczGAfsP8VvFRSCqEEwb3SwOT9gSeMAo+2byYd9eNfTJfBrEk83D7kbqPc f1vscaOxgXDndIy4Npotz5zwdqKJpzFKkww2+i5LWp4m3hamd24pZgzN0laa/kQVt9l+ cerLSDekVJlHYWVHFsGIl2xLZ8P1GQEU/itW2/OwhgGEb29RJkiJSOakmy9bB4Wz2TbO ntOebgJ8AM22I6IzdstG5HmQWIwc4RLxHlyPTWJvLcYfmhSBpLIPmueQyxoYxnwnKXQz tdhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386413; x=1683978413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qMszukETqZzqN2APgbL3HkGY76Y4/3+HTAH7iHHTbjs=; b=h4/KE1hVYi3ftrCTt72ouAKwjhorlB/nF9Gdf4gkipgZAZceajSEmdJMFw8+VL2naY pNVCe/T96u/+rk/4sMQV9hZ1Rs4pfFb4hLD4Jl8iFTiMlvTi0ca5xqSWbmIc1o5utqP+ SfZiaNmfKYMTw5P0dVOavv3BXRX4TKSiQpJcmXr3DlApJ74h2mFFnclCGsvo163ydhzr dTCoRiazlz7KMXX1Sa3uFJE6z6ijUA7INz01xwZYhDHpiKVvypPD1yX/9NyS0XUROKhY 3/46uuHBUKiqV0j6PmL8tQxW7Z+NX9NxYZYTt7byz6m5xv8d1ezfuEm8rm1TnAwjDxNV EgWw== X-Gm-Message-State: AAQBX9c/fmXZAWZG3BXPIiS5ViwbvRlSDBOolkJCbsCBHOwTTGMRIBaL kBOAz8EdZST1dhw+izrRDKHfHA== X-Google-Smtp-Source: AKy350anACfJBHQh2ByzrA7WOF3l20/Yr3nEHUhgh97H5ghL2sDsePIl7V7m9RXXj6uMY8O9qq+XKw== X-Received: by 2002:a7b:ca4c:0:b0:3f0:7147:2ecd with SMTP id m12-20020a7bca4c000000b003f071472ecdmr1626553wml.7.1681386413209; Thu, 13 Apr 2023 04:46:53 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:52 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria Subject: [PATCH v3 1/6] thermal/core: Encapsulate tz->device field Date: Thu, 13 Apr 2023 13:46:42 +0200 Message-Id: <20230413114647.3878792-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There are still some drivers needing to play with the thermal zone device internals. That is not the best but until we can figure out if the information is really needed, let's encapsulate the field used in the thermal zone device structure, so we can move forward relocating the thermal zone device structure definition in the thermal framework private headers. Some drivers are accessing tz->device, that implies they need to have the knowledge of the thermal_zone_device structure but we want to self-encapsulate this structure and reduce the scope of the structure to the thermal core only. By adding this wrapper, these drivers won't need the thermal zone device structure definition and are no longer an obstacle to its relocation to the private thermal core headers. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 6 ++++++ include/linux/thermal.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index c5025aca22ee..842f678c1c3e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1398,6 +1398,12 @@ int thermal_zone_device_id(struct thermal_zone_devic= e *tzd) } EXPORT_SYMBOL_GPL(thermal_zone_device_id); =20 +struct device *thermal_zone_device(struct thermal_zone_device *tzd) +{ + return &tzd->device; +} +EXPORT_SYMBOL_GPL(thermal_zone_device); + /** * thermal_zone_device_unregister - removes the registered thermal zone de= vice * @tz: the thermal zone device to remove diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 82ddb32f9876..87837094d549 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -313,6 +313,7 @@ thermal_zone_device_register_with_trips(const char *, s= truct thermal_trip *, int void *thermal_zone_device_priv(struct thermal_zone_device *tzd); const char *thermal_zone_device_type(struct thermal_zone_device *tzd); int thermal_zone_device_id(struct thermal_zone_device *tzd); +struct device *thermal_zone_device(struct thermal_zone_device *tzd); =20 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *, --=20 2.34.1 From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1809C77B6F for ; Thu, 13 Apr 2023 11:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230463AbjDMLrE (ORCPT ); Thu, 13 Apr 2023 07:47:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbjDMLq7 (ORCPT ); Thu, 13 Apr 2023 07:46:59 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 672AC93C5 for ; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so6158385wmb.3 for ; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386415; x=1683978415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3AD5Mv81x1OfSGYx8Typ89SsCtnJrhePS3JykvPhl6k=; b=R+IWqIXQjMrTORnXHQ/dbbWc/32x3W0LfqaNkiqXhr0Wti8JO4WnUrnFok8jp0nLsd OjkTjLPKbFSnra9XHlHWb1vLwnzPrxgk0kIoI97S35LTdHFD2zLLISaWc5B43q3T+QRe PkWCFNR4YpOTAUA4GRrw2BPL6A/YnWefg4uhb9s4ukBh5jpsKaUxVltnaE90lrnl6/bH nCeD7nb6MkKcxry5iir+1zIlXK6zw4V+SfBEm2DOvBRpYamqaSOy+Sq/0qxWs+BQKbxR 7hBPYVEpTI2ueafA/Gs2hqipcOrp9WIroOdpzuvRx8OucrA2Fi2xBa9MkhjHaN4cr+iw DKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386415; x=1683978415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3AD5Mv81x1OfSGYx8Typ89SsCtnJrhePS3JykvPhl6k=; b=ks5vdX98bK4BMRVBmwPtatqer2LmafsEnEvmaMNuBHXTma7Fygg8r680ewv2ISpQ4s 80TMtsdYL0J+N0ksBrjKcJRzPV9tKHj6stZ+HBH+M0cktBSiAF20IoObqe03eSEIQObM UDYopVdxqqe0zs4Iua+SA1ugwQuEj+pbPGcVry86+XtHlWbirGNSQLYaX2uDe93chi7L 41dgmSegAjVI45BmOcLMOvvAy05GijxT1gsfLmPca11HKC4RUs6piNWdtRDZbO4uDNeS nRgtxLse9syTONPi/zBk5hcpyUcjeCDDqHfKj4Mo29tq1Db6JpuNiQ+j+DoZvaGeZgwE /wlg== X-Gm-Message-State: AAQBX9d/VM+ocz3vfAGr+mkpNS8xzzkCPiLUn+VsFJuLxGef+jumpgoe w0tCvqE54C4xAy8y/np51GMsaQ== X-Google-Smtp-Source: AKy350aOOadYVPk63yq/w3nSCo+Rg2v8bVsrk3UMItD3+T8OjNao8Q+lCMMWTIvNuR+9JpAZ3dYy0Q== X-Received: by 2002:a05:600c:c5:b0:3ed:8780:f265 with SMTP id u5-20020a05600c00c500b003ed8780f265mr1519565wmm.21.1681386414778; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:54 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Heiko Stuebner , Kunihiko Hayashi , Tim Zimmermann Subject: [PATCH v3 2/6] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace Date: Thu, 13 Apr 2023 13:46:43 +0200 Message-Id: <20230413114647.3878792-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The pch_critical() callback accesses the thermal zone device structure internals, it dereferences the thermal zone struct device and the 'type'. Use the available accessors instead of accessing the structure directly. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/intel_pch_thermal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/in= tel/intel_pch_thermal.c index dce50d239357..b3905e34c507 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -127,7 +127,8 @@ static int pch_thermal_get_temp(struct thermal_zone_dev= ice *tzd, int *temp) =20 static void pch_critical(struct thermal_zone_device *tzd) { - dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); + dev_dbg(thermal_zone_device(tzd), "%s: critical temperature reached\n", + thermal_zone_device_type(tzd)); } =20 static struct thermal_zone_device_ops tzd_ops =3D { --=20 2.34.1 From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF51C77B6F for ; Thu, 13 Apr 2023 11:47:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbjDMLrI (ORCPT ); Thu, 13 Apr 2023 07:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjDMLrA (ORCPT ); Thu, 13 Apr 2023 07:47:00 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A2079EC6 for ; Thu, 13 Apr 2023 04:46:57 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so6158408wmb.3 for ; Thu, 13 Apr 2023 04:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386415; x=1683978415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+VZk/Xuf/BecNwwdsFB/838vQVCvaje2TQnFopmd7IM=; b=gESRsna9XWyk/KwQX0XbxJviRAtaQKcmohShrQT1B9JAbemafdpAFiajo6uaJgXmVQ kxxRmTB5tyvFwBhkyuwwnM80F1Y38VkgRr+JbOVFoEvedQtsdX6INun5wSS3kQREpXG8 CDuc/Zb6XtHVaGQumBYbJU7BeRv13BB3l8IbswZmSLih6IuGtu4oogjkww4bO+CLOpas TevDdIeetR3MSi20N0cErhAwGW+xYJm/orRNAkT40mj14IPZ7XqRGqQ3WPA+n97OgG9g 3iCuE/n8cT0j95rF/bu4Ma49lJtzpcOqae/Yi9oVnlk22k3/sh3Fb4K3dy6hmc6awB3L 07Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386415; x=1683978415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+VZk/Xuf/BecNwwdsFB/838vQVCvaje2TQnFopmd7IM=; b=MwrZPqm0HOddcGD34u5EyHOBAMJpu1I+6ayHAMkr7fd5n7l0P/sOxV6agr6NovS0dQ jM6TM81cumUu0lRJbrDGKBvuh/yZT7YFIg8G4/+CqRfe9DIEGsvH13yfVz/CJjNn945Z 3Of9jAEoPjepwESCgA1KZe4ASwO3jRjM06obv9z6Wau2mtz2Fj2o2UL9I62jxUJ0X+oW SejS16Mi1F8ouvBPNL4sAD42ajCX0zonc8E2P1TJhnGw3+bcW/k02/stXH0ZkCzP9T0g zNoN+ghELGZreczYOYks8jmVByKudL8P9c5bcnas2iAH/NFvJBzVejsSOcS+SrbTY/Ly tYkQ== X-Gm-Message-State: AAQBX9dGkHVk+lJdfaaLTHPVyOoiw3696sfIGLNKXJ8hgpzyoLQjb3Sk 3RcGfPEKabp0+Pdyn2l+V7JebQ== X-Google-Smtp-Source: AKy350YxZp+fPhGbbaN0y386+hnQogP+/sUyBMs69Hoj71y1o/R0i2nrWldz/jrTXhMhX8Q46B9McQ== X-Received: by 2002:a1c:f302:0:b0:3ed:b048:73f4 with SMTP id q2-20020a1cf302000000b003edb04873f4mr1626368wmq.5.1681386415664; Thu, 13 Apr 2023 04:46:55 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:55 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER) Subject: [PATCH v3 3/6] thermal/drivers/acpi: Use thermal_zone_device() Date: Thu, 13 Apr 2023 13:46:44 +0200 Message-Id: <20230413114647.3878792-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In order to get the device associated with the thermal zone, let's use the wrapper thermal_zone_device() instead of accessing directly the content of the thermal zone device structure. Signed-off-by: Daniel Lezcano --- drivers/acpi/thermal.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 255efa73ed70..5763db4528b8 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -789,6 +789,7 @@ static struct thermal_zone_device_ops acpi_thermal_zone= _ops =3D { =20 static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) { + struct device *tzdev; int trips =3D 0; int result; acpi_status status; @@ -820,12 +821,14 @@ static int acpi_thermal_register_thermal_zone(struct = acpi_thermal *tz) if (IS_ERR(tz->thermal_zone)) return -ENODEV; =20 + tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 result =3D sysfs_create_link(&tz->device->dev.kobj, - &tz->thermal_zone->device.kobj, "thermal_zone"); + &tzdev->kobj, "thermal_zone"); if (result) goto unregister_tzd; =20 - result =3D sysfs_create_link(&tz->thermal_zone->device.kobj, + result =3D sysfs_create_link(&tzdev->kobj, &tz->device->dev.kobj, "device"); if (result) goto remove_tz_link; @@ -849,7 +852,7 @@ static int acpi_thermal_register_thermal_zone(struct ac= pi_thermal *tz) acpi_bus_detach: acpi_bus_detach_private_data(tz->device->handle); remove_dev_link: - sysfs_remove_link(&tz->thermal_zone->device.kobj, "device"); + sysfs_remove_link(&tzdev->kobj, "device"); remove_tz_link: sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); unregister_tzd: @@ -860,8 +863,10 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) { + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); - sysfs_remove_link(&tz->thermal_zone->device.kobj, "device"); + sysfs_remove_link(&tzdev->kobj, "device"); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone =3D NULL; acpi_bus_detach_private_data(tz->device->handle); --=20 2.34.1 From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C9B4C77B6F for ; Thu, 13 Apr 2023 11:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjDMLrQ (ORCPT ); Thu, 13 Apr 2023 07:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjDMLrC (ORCPT ); Thu, 13 Apr 2023 07:47:02 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 189AA9EDE for ; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id s12so5460239wrb.1 for ; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386416; x=1683978416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jPfklvntaSAZNSstWZb9c9xIuh7wy5gv7laC1WOc6HM=; b=mDbWDIMrs80Dg1X3n8qgHhFGUOe6N65/cxnaPkXu8L/u0v2gXFy4o5AYBOPULELYrf EIiwVZSyOUpakBCyW+PfJfDJRoIrIL2F6ljEw7xeELo5D7NHqckJy5HFn3qcalkjGpwz sXwV6Wrx03D6MMqcJyOE4kpFdXoIv55w1u0+MmI3TOfc6Fz1DgDs6HLtH9D5LWy24M/M iPRCZdLZx0SW20t1P+QRyt3eMRDLMxcnNk6s8lzavrgwyTWeFgrC1R1kdK6WIsB9pY2z ro/Opp0IWV4twEI73qiVgQOCbcht/Rv0tykmsjSP8GlMz691Wf6L//VRJO0+pJfrysgB rXBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386416; x=1683978416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jPfklvntaSAZNSstWZb9c9xIuh7wy5gv7laC1WOc6HM=; b=P3Luvda/f8LgulqoLjugyK8O/RDOlTS8Aneo1arhANQiTeQPsfEDCjFAraxvQN7JV7 ZuIzKd2zgFbcPM59AeELOmtDHz3FAIIWzZf+Bpz218eJXcQSpYAclrMUktJ81jHxXNfE hV0dPAy3/rvtD4xbcfk94BoHIBbsdfN1rixqYPELjwM9/J56ou5oVj/3ga9r1YM8D7mN xP3ZvyaVi1s0P+Ha03E7CqgZwokLYQENDH1J++MwPIi4Wvzhs27EcymNdmv07KEU39Gy taV6ajIT3YutnxYmJLGqa3lTNB349Onq1YZYodAVFCEOVOMsNEwjhio08edobB4CuYoF FV+A== X-Gm-Message-State: AAQBX9dFh417rsicy3284K3a0fgzcek9OYBT6pZtXsDDdzj4IyOKFvPH jpIorM+IIrBKCy8UW/n7ecsQ7w== X-Google-Smtp-Source: AKy350YoZHt4D4EMrgZOQ9wXahuXlD/QN0ullKssM3+oVI64zUdHVMOgcxKjDjSNsfBySge+BjF4yw== X-Received: by 2002:adf:dc45:0:b0:2f6:44fb:a7f2 with SMTP id m5-20020adfdc45000000b002f644fba7f2mr625230wrj.24.1681386416496; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:56 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Sujith Thomas , Amit Kucheria Subject: [PATCH v3 4/6] thermal/drivers/menlow: Use thermal_zone_device() Date: Thu, 13 Apr 2023 13:46:45 +0200 Message-Id: <20230413114647.3878792-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In order to get the device associated with the thermal zone, let's use the wrapper thermal_zone_device() instead of accessing directly the content of the thermal zone device structure. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/intel_menlow.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/i= ntel_menlow.c index 5a6ad0552311..d720add918ff 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -422,7 +422,8 @@ static acpi_status intel_menlow_register_sensor(acpi_ha= ndle handle, u32 lvl, =20 result =3D intel_menlow_add_one_attribute("aux0", 0644, aux0_show, aux0_store, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) return AE_ERROR; =20 @@ -436,7 +437,8 @@ static acpi_status intel_menlow_register_sensor(acpi_ha= ndle handle, u32 lvl, =20 result =3D intel_menlow_add_one_attribute("aux1", 0644, aux1_show, aux1_store, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) { intel_menlow_unregister_sensor(); return AE_ERROR; @@ -449,7 +451,8 @@ static acpi_status intel_menlow_register_sensor(acpi_ha= ndle handle, u32 lvl, =20 result =3D intel_menlow_add_one_attribute("bios_enabled", 0444, bios_enabled_show, NULL, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) { intel_menlow_unregister_sensor(); return AE_ERROR; --=20 2.34.1 From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71512C77B61 for ; Thu, 13 Apr 2023 11:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230507AbjDMLrS (ORCPT ); Thu, 13 Apr 2023 07:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbjDMLrE (ORCPT ); Thu, 13 Apr 2023 07:47:04 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 071299762 for ; Thu, 13 Apr 2023 04:46:59 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id gw13so8291362wmb.3 for ; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386417; x=1683978417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qbml5Nrapy5QlhDSKkv8bYmTatCmq94onluE6T97zsI=; b=oUIsocyL2eyfnEeDvSc9kP3wwycSa02zBdAcFMEkP/t0DZN9lw5k6CW9PCJNHY+nsc Yf8BlS6E3qC63VRrIcs7fY6N5QxIYG4QDW3GxIxROJ7WDVEkUnbvp+s+b4mjgPFwjRHc AYgzoBLIpFoOtunYrxgbZCrl0ebWWqzZrqlw0/BFPaX7rTYzQlboPUAejctfBGcJpQ3s YKqCShVRSa73RDqO8GXZDQAxcT7teUem1aD8t7kz84AxySvwiMcsl/LY/MnVsdX+KP4v wFL2a0ES9TgYKi0+4nnh+AzU+DbB+r/uHYFOJqY2nr+hB2ydVpM2RpW2jC5rJCNg593s ymEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386417; x=1683978417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qbml5Nrapy5QlhDSKkv8bYmTatCmq94onluE6T97zsI=; b=CAllIfq9TV2OuelXTD9+Akz1EqJT830m0e0xYd5LKi57ZkQKFd0UycFyOuo0KUARV0 OV7aljKuDqTwfzgvas47/NbEAX95tgf6XYpIlqCCfGephl+dbCd/vyb1q3RJ3PQ+qiGJ q1XB9/3FeY7q2j/L07UZGuC9/ECD0R3Ub0+Hz7TnUqZlC/leoheplQY7xXlw/vyn+h4H GEHja+Tz1owqGQd2TYQw9qTuOssC0AJ9e3D1CPEhDnjMEDGhmzTHwwLPz6/F+zLs9Bdf ltD/y/g6tBIjkMnl+AU9iQQ/i3SPX8g8JCctizzBDfZWp/b5gnSvXhZQPDnq5PRg5yO/ /iqA== X-Gm-Message-State: AAQBX9eRirVWtwNSzDBTBIudP8JFBPnqdOjrTC7/LnEP2HsMW31WFDM4 xoXOG9CAeX6WsLZysxl6+5CRDQ== X-Google-Smtp-Source: AKy350bIGUoozacl+l+8gvBRdFdOz3o88Qdy24W8pggqTU9BDd8RDdYNFJ6KeFxbEwXg7xB1OL3lCw== X-Received: by 2002:a1c:6a14:0:b0:3f0:3ce6:9b0e with SMTP id f20-20020a1c6a14000000b003f03ce69b0emr1683021wmc.13.1681386417430; Thu, 13 Apr 2023 04:46:57 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:57 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org (open list:ACPI) Subject: [PATCH v3 5/6] thermal/drivers/acpi: Make cross dev link optional by configuration Date: Thu, 13 Apr 2023 13:46:46 +0200 Message-Id: <20230413114647.3878792-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The ACPI thermal driver creates a link in the thermal zone device sysfs directory pointing to the device sysfs directory. At the same time, it creates a back pointer link from the device to the thermal zone device sysfs directory. From a generic perspective, having a device pointer in the sysfs thermal zone directory may make sense. But the opposite is not true as the same driver can be related to multiple thermal zones. The usage of these information is very specific to ACPI and it is questionable if they are really needed. Let's make the code optional and disable it by default. If it hurts, we will revert this change. Signed-off-by: Daniel Lezcano --- drivers/acpi/Kconfig | 13 +++++++++ drivers/acpi/thermal.c | 62 ++++++++++++++++++++++++++++-------------- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ccbeab9500ec..7df4e18f06ef 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -336,6 +336,19 @@ config ACPI_THERMAL To compile this driver as a module, choose M here: the module will be called thermal. =20 +config ACPI_THERMAL_SYSFS_ADDON + bool "Enable thermal sysfs addon" + depends on ACPI_THERMAL + def_bool n + help + Enable sysfs extra information added in the thermal zone and + the driver specific sysfs directories. That could be a link + to the associated thermal zone as well as a link pointing to + the device from the thermal zone. By default those are + disabled and are candidate for removal, if you need these + information anyway, enable the option or upgrade the + userspace program using them. + config ACPI_PLATFORM_PROFILE tristate =20 diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 5763db4528b8..30fe189d04f8 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -787,9 +787,44 @@ static struct thermal_zone_device_ops acpi_thermal_zon= e_ops =3D { .critical =3D acpi_thermal_zone_device_critical, }; =20 +#ifdef CONFIG_ACPI_THERMAL_SYSFS_ADDON +static int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz) +{ + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); + int ret; +=09 + ret =3D sysfs_create_link(&tz->device->dev.kobj, + &tzdev->kobj, "thermal_zone"); + if (ret) + return ret; + + ret =3D sysfs_create_link(&tzdev->kobj, + &tz->device->dev.kobj, "device"); + if (ret) + sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); + + return ret; +} + +static void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz) +{ + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 + sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); + sysfs_remove_link(&tzdev->kobj, "device"); +} +#else +static inline int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz) +{ + return 0; +} +static inline void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz) +{ +} +#endif + static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) { - struct device *tzdev; int trips =3D 0; int result; acpi_status status; @@ -821,23 +856,15 @@ static int acpi_thermal_register_thermal_zone(struct = acpi_thermal *tz) if (IS_ERR(tz->thermal_zone)) return -ENODEV; =20 - tzdev =3D thermal_zone_device(tz->thermal_zone); -=09 - result =3D sysfs_create_link(&tz->device->dev.kobj, - &tzdev->kobj, "thermal_zone"); + result =3D acpi_thermal_zone_sysfs_add(tz); if (result) goto unregister_tzd; - - result =3D sysfs_create_link(&tzdev->kobj, - &tz->device->dev.kobj, "device"); - if (result) - goto remove_tz_link; - +=09 status =3D acpi_bus_attach_private_data(tz->device->handle, tz->thermal_zone); if (ACPI_FAILURE(status)) { result =3D -ENODEV; - goto remove_dev_link; + goto remove_links; } =20 result =3D thermal_zone_device_enable(tz->thermal_zone); @@ -851,10 +878,8 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 acpi_bus_detach: acpi_bus_detach_private_data(tz->device->handle); -remove_dev_link: - sysfs_remove_link(&tzdev->kobj, "device"); -remove_tz_link: - sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); +remove_links: + acpi_thermal_zone_sysfs_remove(tz); unregister_tzd: thermal_zone_device_unregister(tz->thermal_zone); =20 @@ -863,10 +888,7 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) { - struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); -=09 - sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); - sysfs_remove_link(&tzdev->kobj, "device"); + acpi_thermal_zone_sysfs_remove(tz); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone =3D NULL; acpi_bus_detach_private_data(tz->device->handle); --=20 2.34.1 From nobody Tue Dec 16 09:09:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7157FC77B61 for ; Thu, 13 Apr 2023 11:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbjDMLrV (ORCPT ); Thu, 13 Apr 2023 07:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230484AbjDMLrO (ORCPT ); Thu, 13 Apr 2023 07:47:14 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61139EF7 for ; Thu, 13 Apr 2023 04:47:00 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id he13so13295380wmb.2 for ; Thu, 13 Apr 2023 04:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386419; x=1683978419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kgd1bKrI7tjr//X7ubfNjfbEbuKleNxuvfM0dDIe1Gc=; b=fOZw2vqXmpMsIvnANbpE6Yf0UWMjh2+up+0Wd8okyz6mfc2Bl9M7WildNt1NGyW0JT qSPskNbOIEslrEeROi/kg/eh7FGlagAmjJmCor9ZbZ/wkzTEvAKJGJ0tI1k9/TmkoXSH he/jtW3euAItBayzBXMvBhuIpd4/HQ+9d9AH4QbTbjT+jWq4Z4TcydkuOjps/4yDFZuE eJmAlbo6cEFE0H2ob+b6ftMp4lbR6F49Whzq+vvW5O83Fi6h2HKb5bcHGFYuIqi70vhP 0Afg4Z2E8+JYUCLS2UX6DibdUYyLZKG6OPrvoHxNvSiE083G3lxsVDmGb+J7c4eaWH1G 03KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386419; x=1683978419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kgd1bKrI7tjr//X7ubfNjfbEbuKleNxuvfM0dDIe1Gc=; b=ZEHDxVFVjPk4GnUlb3bC+BFt+wGBp0UeNAcmoVOUmOOVNhtPzxF9s1PRevqjFwVcCh iQrnROa98prqO/IJUmufisOC8Z3ghyVETUJmOyXkV1iBD0gBJJ4tK0z3gD3DZb5vLQSn bzuHrNEfsxBm8zMTUgeT1lPM2ggMt16rQVxeGpDfYrH0u9/QpoXb3GlyyFxoVZsfnvDy tqc2Cx6E5NmAMoo9vZjlbpyqtQe4vbRl+t4sw09BhMTBWy2QHH5bWO8jVKKDT7MSfIUG 8VDpfShT1Oka3GtdpmqgFSV41VP8YsmWCH8/9UNRd1JPBIfa2HH87ubgp/qj+dvDPtVN Jw6w== X-Gm-Message-State: AAQBX9c5utbezgXGdzADQEOtYBN3mDUSGmbLu67+VBwRfbs8kSjcxNUQ s7o6OB+os54XcUWSSI3NUS9QOw== X-Google-Smtp-Source: AKy350bTPiuIJ0i8zSXeUqnj7IbwFV93lyOjz6TbBVxB+THSMry1udKD8Mb5YuFclDDP83+MpZkaFA== X-Received: by 2002:a7b:c8c7:0:b0:3ed:301c:375c with SMTP id f7-20020a7bc8c7000000b003ed301c375cmr1532709wml.21.1681386418943; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:58 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Sujith Thomas , Srinivas Pandruvada , Randy Dunlap Subject: [PATCH v3 6/6] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Date: Thu, 13 Apr 2023 13:46:47 +0200 Message-Id: <20230413114647.3878792-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The Menlon thermal driver creates specific files in the thermal zone sysfs class. It is specific to Menlon and these entries look debug code. It is probable these are not needed. Let's make the code optional and disable it by default. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/Kconfig | 11 +++++++++++ drivers/thermal/intel/intel_menlow.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig index cb7e7697cf1e..1405d9cd2bab 100644 --- a/drivers/thermal/intel/Kconfig +++ b/drivers/thermal/intel/Kconfig @@ -112,6 +112,17 @@ config INTEL_MENLOW =20 If unsure, say N. =20 +config INTEL_MENLOW_SYSFS_ADDON + bool "Enable thermal sysfs addon" + depends on INTEL_MENLOW + def_bool n + help + Enable sysfs extra information added in the thermal + zone. This is specific to this driver. By default those are + disabled and are candidate for removal, if you need these + information anyway, enable the option or upgrade the + userspace program using them. + config INTEL_HFI_THERMAL bool "Intel Hardware Feedback Interface" depends on NET diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/i= ntel_menlow.c index d720add918ff..a169d7e4f537 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -374,6 +374,9 @@ static int intel_menlow_add_one_attribute(char *name, u= mode_t mode, void *show, struct intel_menlow_attribute *attr; int result; =20 + if (!IS_ENABLED(CONFIG_INTEL_MENLOW_SYSFS_ADDON)) + return 0; +=09 attr =3D kzalloc(sizeof(struct intel_menlow_attribute), GFP_KERNEL); if (!attr) return -ENOMEM; --=20 2.34.1