From nobody Wed Feb 11 18:12:51 2026 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 B4B8BC77B6F for ; Mon, 10 Apr 2023 20:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbjDJUxt (ORCPT ); Mon, 10 Apr 2023 16:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjDJUxn (ORCPT ); Mon, 10 Apr 2023 16:53:43 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E6EDAB for ; Mon, 10 Apr 2023 13:53:40 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id o18so5548364wro.12 for ; Mon, 10 Apr 2023 13:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160019; x=1683752019; 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=mIjogzcbB9NbNQDtYcUOxd5sO+Lh6rQ2yVngUMiZyBg=; b=xyL9hMXg0TC02Yn0shvpreWa/MOZ4/qCU40KHDFzbPk+etV+QUJO8sEhYs7Mh+qN5n z5TJ456A6E4aXcNG8guYtLeuTgnNIZoQrAPuWXDhMxF2qi2tDteBqX8XUVWYuxZ4+Z5E zsG/hJcbj7+u8aPTR1PtZFNSRLLs0zNP0atsamdIbWdaqZqX4IQVevcLtf4QYIhoGi+o YeoxsZSweg1dEovNzju9QRZDjaNuqJiRtCXFiv0nGrlYeBNnuLe+HMJtSW7TnZVXIh6C zeqOndIytiIiRGgysHB/uOZiZs+x6LIceOoxamu3W5w2n2avV2dp59Wf9kXToT4NWx57 cA8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160019; x=1683752019; 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=mIjogzcbB9NbNQDtYcUOxd5sO+Lh6rQ2yVngUMiZyBg=; b=h90rkVsOQbx8G1yPvqdQKwycdcorN1DIFpRZG+rrngJ4KnrV15kBg9vxCyLTGsUy6j 13SnfI0CkN79BtJskBmCvTQyf9K8aOyGnrQQVL0QN27SboDAofn4vzXjBbo8apBMdOCv 2t069HwDylpjfQ26885q3GQSnB4kl0NEvj0TBw1hYaj49ntlgVBKqRKmO1wDtVK5lsWQ r1G1PvYD94DKDs0Cw82WZBvii4ek6PQOP0euoLBgKm5QS+SDts7EGsirzOC0SYlTQQay /LokJXJE0UBhdDCIYRxW1TlsTUC1KV2SLgWB2ZNeX7t1Qc35fuUzdqWWznlav0uO4t5K lkzA== X-Gm-Message-State: AAQBX9cLg5fApgyz8DZz0qgw6Ze/WmtPc0i4wtiFqMEeTZ9FZh3v9EFX WOqRQCSy2d8lHyqEuZVysUD+BCelap4LYD5JVVA= X-Google-Smtp-Source: AKy350ZOay8K6RxDMjsDBpOYzrC/EljA9SFrUCAJHArSZtc+GmQNbptL513VsrXmsJ2ZzssVX6SmDQ== X-Received: by 2002:a05:6000:1b0c:b0:2ce:ada5:325d with SMTP id f12-20020a0560001b0c00b002ceada5325dmr7589428wrz.37.1681160018690; Mon, 10 Apr 2023 13:53:38 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:38 -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 , Kunihiko Hayashi , Tim Zimmermann Subject: [PATCH v2 1/7] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace Date: Mon, 10 Apr 2023 22:52:59 +0200 Message-Id: <20230410205305.1649678-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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'. For the former, the driver related device should be use instead and for the latter an accessor already exists. Use them instead of accessing the internals. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/intel_pch_thermal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/in= tel/intel_pch_thermal.c index dce50d239357..0de46057db2a 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -127,7 +127,10 @@ static int pch_thermal_get_temp(struct thermal_zone_de= vice *tzd, int *temp) =20 static void pch_critical(struct thermal_zone_device *tzd) { - dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); + struct pch_thermal_device *ptd =3D thermal_zone_device_priv(tzd); + + dev_dbg(&ptd->pdev->dev, "%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 Wed Feb 11 18:12:51 2026 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 2E1A8C77B71 for ; Mon, 10 Apr 2023 20:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjDJUxw (ORCPT ); Mon, 10 Apr 2023 16:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbjDJUxo (ORCPT ); Mon, 10 Apr 2023 16:53:44 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2625C2105 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id j11so9189186wrd.2 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160019; x=1683752019; 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=c/sUNls5odRG1ROzcXK2u7tbJwmZU1qshXeSsb4erJk=; b=ImG0P6ozhsBNn2wIjXrzV3X3+4UFaj69tjUiqut6D5oEacUyt77fF1/z7QsFadCFKb sj+zrnaINyC/6hK37e/jfrNS2KxcuKodwPNwUAn/B+8Akkxk+PqF4fZMo4iyy4cC6IIg MOfHE4ZDYTsL75qlt0hHpDuq/tQV+d2hwHE5NLOK0SJZ9KbpPpxZwZSzFDIeyM7xUoIC 5g5wpbsopEZA9PZOG8Zf/mQB26B0RbHXXwqzRoxQjTzwjcXf49+nUQWxTb8k3e09n+KX 7tizEJmJSj1XjpfaXM0AYw+l8fDd5WkqVRb0n5o4ySXkON7M3ZK6URKcwl/qL+WkHuNP Ab9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160019; x=1683752019; 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=c/sUNls5odRG1ROzcXK2u7tbJwmZU1qshXeSsb4erJk=; b=x8r8H8oHAfTKWEDGNSumojuEypBBVmH3/1sEiFNRvXcm0LRO5ju84I/cOdYSK6+WlT 4+saBJNHCoJmaPIqDfwoLwOi8SBp0nfcVEtZ3nFblTvoTrK8VWoYpoZCA1sCgO7kwKAn tSgxl2lvmkITY3Gu4zxuljOIphtgq59h+rY/2u7ete3tLloeEu+AiVy6NpTgX9GdjgXt MnfitjX0BqbRnc0TX0gHGFf6lXqc2p8ALvp+7afGE74iaP0NMTW5utLsiEju0AbdYhv5 3DWnDdajAYOdRH17LOqb3Hdif11V5lfKt0jy8xN/u1nzTz5HZr4JnyB8eUagdGlZ1sx4 MA0Q== X-Gm-Message-State: AAQBX9cePVnxqwA1A68cEgUdyOiDBH7RQbB+3mmFIX/bgS/CtwN5U4JN rmQ/1TDKYS1sGQFnwfj0laiAKA== X-Google-Smtp-Source: AKy350YFFh/N8fpXptFhx3m4y5KXU6kRPBlm2AH6RBwnHndz3BDlMa+TtqEZuxsNnxAxXFCPqyyfKg== X-Received: by 2002:adf:e3c5:0:b0:2f0:2154:761 with SMTP id k5-20020adfe3c5000000b002f021540761mr3895233wrm.37.1681160019534; Mon, 10 Apr 2023 13:53:39 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:39 -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 v2 2/7] thermal/core: Encapsulate tz->device field Date: Mon, 10 Apr 2023 22:53:00 +0200 Message-Id: <20230410205305.1649678-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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. 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 Wed Feb 11 18:12:51 2026 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 6C468C76196 for ; Mon, 10 Apr 2023 20:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjDJUxy (ORCPT ); Mon, 10 Apr 2023 16:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjDJUxo (ORCPT ); Mon, 10 Apr 2023 16:53:44 -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 DA5361986 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so1272276wmb.3 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160020; x=1683752020; 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=FxLeg2sTLVYKL6SFHQGx1FS/5j5eNFIakBq/wmiT/7z73ycZpRJOGN+zVK4lR2cyyC wIBkdAHRc+p5/f9InR3Q7uSswONpKuDg0e55ZkON7Efl7JAQhwTXV5ExsDMUlTHgcatG dox8L7LfD1XszOKEVApR/6iS6vIl3Cs8z15bNYqPgc+vw+YiRfQ7F9jTKm+FyP+sWfcx mdTngflLgrvi+IZw7iCa30iJrdCHbr5luYlbDMiS5P4iOxWhCTu+0v7uzlnXejf3ewPv 8iSNvewqgw+hmJjaW2OnBwLuC97r80s9WDZm5i0QvZt1n4xpcCEzNiaF4ldhzyLPiVa0 BT2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160020; x=1683752020; 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=qUmPu336AzO2s/9oJRUSswuI4+IEQA7gTUu1G1otlx9n7uA92mVON57jOPX97NHGSl GnovMqNwlPaDu+mD/CgqCCzvTKKYRS8xdTSEze3ZvVFfvxancGoPWJm9rAOxIQH+1VcO ddCm7ycVaJXcYOEA1FrvuRlL9V4HQ0vdr19gZdNLKFJX4qa+pFJlkqbez8fD6aU8knNb fvYmQ0GtZie3WVG3YjfTMej/poocO1hPnzUBs4nT6r6eiGDg39gTcapweLQnrFCh2yGt cS4tMmlLcKJiMFe1OrSO9QeWjSuePWIhWIFpbIUIe1/FPfpcabmk1BCelEYiB2eIr9aW 9EPQ== X-Gm-Message-State: AAQBX9ev5kiOzKi9blvw1w0kvWttODrj1X7yrP/4u8icdzdjEfRphdfE jdDs2l81+e3YgEDV/1QHPzorWw== X-Google-Smtp-Source: AKy350ZAg2sXku/us3SLa/ABKLmYyW0fS/CTYnxWdO5C7YlSREmAzH6R6thKVE6yeBcN/q2cJ/AASw== X-Received: by 2002:a05:600c:ce:b0:3f0:39ab:347c with SMTP id u14-20020a05600c00ce00b003f039ab347cmr5368542wmm.23.1681160020330; Mon, 10 Apr 2023 13:53:40 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:40 -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 v2 3/7] thermal/drivers/acpi: Use thermal_zone_device() Date: Mon, 10 Apr 2023 22:53:01 +0200 Message-Id: <20230410205305.1649678-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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 Wed Feb 11 18:12:51 2026 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 C838BC76196 for ; Mon, 10 Apr 2023 20:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbjDJUx6 (ORCPT ); Mon, 10 Apr 2023 16:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjDJUxp (ORCPT ); Mon, 10 Apr 2023 16:53:45 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B312114 for ; Mon, 10 Apr 2023 13:53:42 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id w21so5438189wra.4 for ; Mon, 10 Apr 2023 13:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160021; x=1683752021; 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=CNbSdHE8n1zV1HPzRdLK08lEvmMz/Kid8qJ/8adULTAra3QhdAdgSk4eHGV9zO7TmW oWjrs4f3ETu6O+96aPhnZ6Q61+FIGxTq7P2q1LMH6BuLH1tGqL7J5m8hL2EJwYcfVPmB 6L3TFCl3sAP7+8wmSXHvX8cyCl6JXV+DnepvXSz7J7ts3uSUoAbB7roDO477PeGjZBrq B6UhPUI7bSVGwpPMPNawVS5xr9xsTzHINTVbnfJfS+KYyCjmqQiqKMa7/B+XTVzindJW i0Ly4fqWapIN5RdJQ67GyRLwIeA+K2atzBMK38N3Fu6RJZJUsMNs+X50dxpI0knuK8pN hU1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160021; x=1683752021; 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=2YBPzWWz+CDxc751Mas52FM2ik8luHgXMLqDChLCHNoM0qIzhkZOI1O2IFkiZGQbLf uBYJvC1oYje/YdC2lI7feoXJPtBHj1YX4AsECESXxCUo6fee0GdnCtSORMeTsJfYBtYw PSH7ZGBoiKud0Uj1vBc3zKgDWrFPQprPRznfjUd7uWfLrlVPcbFppNWipO/GtjEOisTy r79Uw+7dKQ/+veCcmh0QmeA9CjWc+1Igjr60w3C8yPsU9D4ura5iGX0WR+Xew01faarL DzQeHIEQRCvHWMPzuoHhFjMqs9vxeM7sM1W3TvtwPxt/96j3ZoueFd3yNv9/eHLy9/S/ jvTQ== X-Gm-Message-State: AAQBX9eMGcqJfaiaPfrTqUGc1jWcE0HdAATVf4Ge+ovFtXsi5RjZj8ie nNt2pN0dM80y7AUUropjGBOHHRVI6mftw3MZs4k= X-Google-Smtp-Source: AKy350aFfGmqz5nU83qM1fv+sU7tCyVxJ496+1K9KVy1xzlKLKyU5K5Dr7MTMmRg3cXmeAr5FguKsQ== X-Received: by 2002:adf:dec2:0:b0:2ca:175b:d850 with SMTP id i2-20020adfdec2000000b002ca175bd850mr5111363wrn.11.1681160021173; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:40 -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 v2 4/7] thermal/drivers/menlow: Use thermal_zone_device() Date: Mon, 10 Apr 2023 22:53:02 +0200 Message-Id: <20230410205305.1649678-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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 Wed Feb 11 18:12:51 2026 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 92858C77B61 for ; Mon, 10 Apr 2023 20:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjDJUyA (ORCPT ); Mon, 10 Apr 2023 16:54:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjDJUxp (ORCPT ); Mon, 10 Apr 2023 16:53:45 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE2F2118 for ; Mon, 10 Apr 2023 13:53:43 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id e22so5442694wra.6 for ; Mon, 10 Apr 2023 13:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160022; x=1683752022; 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=6mEz7s6yXlIw25RW3QnKrwFn+iq3xNtUieG1OCq5dPk=; b=NlLccR0KaN5Ll/7MrXFcv0iaJaQMvc9Kqagpb1at2P4U852rFGmVf2y2OQE9s2mL5k ytRuSnPFYurJpACKpwJOfhDci6BllshkGnz2eDgHc5RwR47dC3sbKK2WmUeKJ6EPqHHJ 6cHrV9pUVWno3115aq5NNQzMfO4QRmn6Ai03OZtl7HSJ79QuCJPU3zwkRgWA3Zvuqnby o3te8dPJz9quPZ3ADWRglYk1/brpRGN272ndnRdq1x2zlK7AcUuZOk5cUXFdx1ykUBOy IXI7+P+t+rBBJEmulk3yKZFoj+cOj743k7aEr7D1mOAThuQjfCxiWu3vgT2S4cmZL0Xf fcEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160022; x=1683752022; 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=6mEz7s6yXlIw25RW3QnKrwFn+iq3xNtUieG1OCq5dPk=; b=DhnZvHfy5rgYfXw3BdBIumNbcxC8XB/M4L++WaBVoBABirCWBCjDSMOsMZCTR+YLFL dzCwrAHSg3ZGbk/Hnzjey+kUx/OgPSYZbYunI7bty/e4k2OlouQ0OObEaXs3bhXFksAi 6pOj+9IpNCfStCZOfJqBkgDeEJavnghlMkTlU7S4DczTYgufythlS54HUsph5kA8gSTs jv9FwIi8fbwW9tsDWdZPxd788TGIPDvt5FC9gzPkeER6pYlKZie6cWUTe7qNVVraLbJ0 Buk7DqJU73Mf6YPt5laAIvdFd1EJWD397BzdNQ7X6InTkSLbFEMFs1dQPrsBNtkCvg9E z0Qw== X-Gm-Message-State: AAQBX9fnSd7m22bQ1LSWLj1GKsBraK0DfvfSlR+aPmpeK5/YwBraIEbH x4DUcWo/FkOhqXg7kIqej+8muA== X-Google-Smtp-Source: AKy350aNGX6fjxWMXUkHK1m5zFHBH9TADms1ks0RD+DYVYGB/clRzrNGq0INQ7lPmE1ZHchKlEnxNw== X-Received: by 2002:a5d:6588:0:b0:2d1:53f5:900c with SMTP id q8-20020a5d6588000000b002d153f5900cmr7843051wru.20.1681160021960; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:41 -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 v2 5/7] thermal/core: Prepare sanitizing thermal class sysfs content Date: Mon, 10 Apr 2023 22:53:03 +0200 Message-Id: <20230410205305.1649678-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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" Some drivers are accessing the thermal zone device structure to create specific entries in /sys/class/thermal regardless the documentation. It is questionable as the specific information should be in the driver's sysfs directory, not the framework it is dealing with. It has been long time these specific attributes were added in the thermal sysfs directory and are limited to the ACPI thermal driver and the Menlon driver. It is probable those are not really needed, so in order to figure out if that is the case, let's create a default option disabling the attribute in order to prepare a definitive removal. Signed-off-by: Daniel Lezcano --- drivers/thermal/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 4cd7ab707315..cca4e5cf6f30 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -33,6 +33,18 @@ config THERMAL_STATISTICS =20 If in doubt, say N. =20 +config THERMAL_SYSFS_OBSOLETE_SINGULARITY + bool "Enable obsolete and undocumented sysfs extra information" + 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 THERMAL_EMERGENCY_POWEROFF_DELAY_MS int "Emergency poweroff delay in milli-seconds" default 0 --=20 2.34.1 From nobody Wed Feb 11 18:12:51 2026 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 B6E54C77B61 for ; Mon, 10 Apr 2023 20:54:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjDJUyE (ORCPT ); Mon, 10 Apr 2023 16:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbjDJUxq (ORCPT ); Mon, 10 Apr 2023 16:53:46 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D7A1FF1 for ; Mon, 10 Apr 2023 13:53:44 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id e2so5482780wrc.10 for ; Mon, 10 Apr 2023 13:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160023; x=1683752023; 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=zP0ai9WWz0txuIScl5+cGxEFfYcMtPVS0xCm4H0j7Sc=; b=SwtFaLlLUJ8uK7PCs+p+9q2jmdDGcKVwq2VZsU/IWs58GUENqqElwlgMGZ8UaUJnBN qhClHoISI+1Q+k54FGd0ILwM0AaILv4BEY6f6wGumB1/QaMe/E5yzf2QwGCRg6g0V+J4 +SYHG056WUkzc76xWr+JpQPIc/4TNc7EClWhBAgWxYnzci8x+cqaeyBmNSJNUt4jS7jr yvw4SLUl/EV/lpVNbcPESPb+bwTB7k6RzUalSe2TW6D0WZyh1U5cf5ZMFO1caNcX3zop nlJjUg9bm+RA2xIL2wNZGtGgntUmwIkGnHtrzTmATfu2Wit7szggjPGQqw28k1jsyxi0 il1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160023; x=1683752023; 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=zP0ai9WWz0txuIScl5+cGxEFfYcMtPVS0xCm4H0j7Sc=; b=PaYxR6/a8Ah8QzOSYcEzoYe5vA0XJwe8ILn3RmxTHtdSiTF7KjtsNs0dw43cIQX1X5 6ianYvua4oLrIhUeTc/xs7TdCmQ02b5UL0z/rFY/aaLXt5Dc6BkGd450IVM81xvHzj6b 5T4o4NS6wtpWBmpOqB76xXhS5nkaBRap0Lj2SoViogYMm49cZtYEsQokCCpEcDW7Hnjy pOo+AIYW/7Yii6G4RT7eCdXr+h8YlUwBpOV1dpdU7Tl4U7BMyLTqTOFYcXUy0b9CJfy/ h8riGab1R9m7E+FOZL7jO3e+C7sQeqMippdC5FuHTSl2a9ucU3/QnXOF8A5mPu/nxyVD eKYw== X-Gm-Message-State: AAQBX9dH3RoaONbNe33jQAb+xpiXX7EPGjZywg08XvKgYNMyyC2CMGav GFuazUGpAHKotDDHNVf5yHz/mA== X-Google-Smtp-Source: AKy350ZlNr1Ggj7t/rY1NAQx6q6DjJGKetJtVt34ctysK9zRe75QqXeVNlKWq//6kKmGhE+P5XLt2w== X-Received: by 2002:a5d:544b:0:b0:2c5:3cd2:b8e with SMTP id w11-20020a5d544b000000b002c53cd20b8emr5478341wrv.1.1681160022744; Mon, 10 Apr 2023 13:53:42 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:42 -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 v2 6/7] thermal/drivers/acpi: Make cross dev link optional by configuration Date: Mon, 10 Apr 2023 22:53:04 +0200 Message-Id: <20230410205305.1649678-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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. Signed-off-by: Daniel Lezcano --- drivers/acpi/thermal.c | 62 ++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 5763db4528b8..70f1d28810f2 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_THERMAL_SYSFS_OBSOLETE_SINGULARITY +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 Wed Feb 11 18:12:51 2026 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 2BD9DC77B61 for ; Mon, 10 Apr 2023 20:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjDJUyI (ORCPT ); Mon, 10 Apr 2023 16:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbjDJUxq (ORCPT ); Mon, 10 Apr 2023 16:53:46 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0128DE6F for ; Mon, 10 Apr 2023 13:53:44 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id g5so8916390wrb.5 for ; Mon, 10 Apr 2023 13:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160023; x=1683752023; 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=bkQUnOWLA+V2iTlaapxkS0DuXVJow8vrvqyKzHmwuBE=; b=mSw0zD5otsKK5tmRq1nzEby61f1faooSdycceSRUQVSbqwQtQ3QNrRcjZiruaVhTX1 01z0EFsycSofwCc38R6wZMtBEmoO7U5lrSgky/sBpvvget+6owZTp3TaT9grVrgYEJxe 3IFHUkU/yH0MnYIux9ZZElCzeEEF7gId0w05Qshto+uJElSmGN/miERwnchMIKeSSDwb 2jADe8x34PHeZfU50+CCeeCYv5rTqPxvMnpPmPgrgFsO8MFdU9hSujx45zKX+kMvCVrE dcJO2yuj8TD54nLGr8CpsZU02rvzY812iXt2q1vbZ4uCsX8NNW9mJ0zqF7mtQnfBiooT jKyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160023; x=1683752023; 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=bkQUnOWLA+V2iTlaapxkS0DuXVJow8vrvqyKzHmwuBE=; b=HW7W5ZREAbd8B9U/OJ4auLwe1kKfvh+xOMU3jk100mbo01HHNHVNM2ekQQfu6KrLBc KiIjl7wznfjuAvGgY5ZWw6AQ/rBSnkztUqWvJtiVD1ND8rH35iQEZwADtCU0qaukYi8J zrZnlcc9k683y1sI23lG7FHL/OPw/2EmrYlicBLIkQ7jrMpm0D5xzL9xr///giBjz3+l tZ1KVLka7O2s7AsyHd+tkLwUrb3AKaNMn54yjeoajwyE9zxGvMvFs+FktngjuVukK25a h/x1ppl4a8schioFRvqMdm8NZYoGC9GV9uX48Qs0iyYUyhGMuVlBqbxDPpe46ommtdpJ Z0zg== X-Gm-Message-State: AAQBX9frshONTzKMPM2a5RJQnhEbrXSzUJZnkG86MTZGLpi7AX5hsweq +LDRdXiVjBBIQZ4COS55H3uEPw== X-Google-Smtp-Source: AKy350bg2a4lxEjB/SUZECrf0UoKpqThrQonwo7vjEvFnpkEwzrg+Jh/9wFjd/+2RSeBjkpV2n70Tg== X-Received: by 2002:adf:e885:0:b0:2e4:506c:6483 with SMTP id d5-20020adfe885000000b002e4506c6483mr343276wrm.48.1681160023519; Mon, 10 Apr 2023 13:53:43 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:43 -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 v2 7/7] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Date: Mon, 10 Apr 2023 22:53:05 +0200 Message-Id: <20230410205305.1649678-8-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-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/intel_menlow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/i= ntel_menlow.c index d720add918ff..d46dacea1b4d 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_THERMAL_SYSFS_OBSOLETE_SINGULARITY)) + return 0; +=09 attr =3D kzalloc(sizeof(struct intel_menlow_attribute), GFP_KERNEL); if (!attr) return -ENOMEM; --=20 2.34.1