Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4603216rwl; Mon, 10 Apr 2023 13:54:18 -0700 (PDT) X-Google-Smtp-Source: AKy350bNMoDXEtmcyN/mfcFuroU3lmbIg+ym4t0Ddlsihtr+BeeOorMcgM8ffWJQIig86CBo6Xzd X-Received: by 2002:a17:90b:4b91:b0:246:cee3:681e with SMTP id lr17-20020a17090b4b9100b00246cee3681emr1966007pjb.7.1681160057992; Mon, 10 Apr 2023 13:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681160057; cv=none; d=google.com; s=arc-20160816; b=wyxcdahGR46mHyAwFtjMEQnfZ38HEiCa8c9kU+JeBofe+Har9sI8YBk3q9avKZKRJ0 WgAmkX887gMNefDvykx8G3XX/7huSg1I+DlKtV07TwvrjrjMTwAenBKiutd/sEcoFkgW KnXMBiUhOSrHFUQ8m2/zAYGnALsCcOmHCm/K41Y7DgiAuAn1E4tB83Q/kqz9+SQE6jQC lfeHrN/iMAHlIPytDKrFjuEGcZIFRcJ6gmtjyEcl9nw9F5kueDcVFdPoP5jgOF5iv8rS sgqi6bncX2l+sLCTflpHO72OBgR5PSFPxlPPA0HeAEgK9yK0/CyRzRnPzycbS87QCAcq MEGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wgjQsE1Hdvwl1NpUaWmvVlqrPBksB4aMkQUF06EbqG0=; b=s2ormr/+EnC1pKDOxixlDSY8ioe+I5mttWqkWdLDJvB/hy5IYjCkRg9H1RCjrCySlq COPO3bTansVlDL+0Hro6T16kD2FlJJCYWIeju6GOsWkhs2PSS3V14FhkYzWN2Xv8sv6G TMEmH3mLNNKQ/SiLtPNYGnWsvRUaz28Ho5d33OARrTGKLKYJ6s3104dJ5QV1MAdQ/kmQ HKrho4a7C06xr/Y4Ki+tPmlJDOiHjDTUXOga7egKf5lo49c/rDP/vmI9T3kZXClT/Qf9 XFQvJRnnrVVp06YxqcTbpgwKCMGRowlBgvHDhLRtyVKIrVAA+Rg7jzws/0bqTNSlYuS2 FFFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GMbkVC5O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a17090ab94a00b00240d313b97dsi5769441pjw.90.2023.04.10.13.54.06; Mon, 10 Apr 2023 13:54:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GMbkVC5O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbjDJUxp (ORCPT + 99 others); Mon, 10 Apr 2023 16:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjDJUxn (ORCPT ); Mon, 10 Apr 2023 16:53:43 -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 276C12129 for ; Mon, 10 Apr 2023 13:53:38 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id s2so2270414wra.7 for ; Mon, 10 Apr 2023 13:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160017; x=1683752017; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wgjQsE1Hdvwl1NpUaWmvVlqrPBksB4aMkQUF06EbqG0=; b=GMbkVC5Odhohp4FRso5dq41lhdBBmwA0cCsSv1a/9GCDi+dGlj1xq07iL7kn4n0TDF jMzdfCAvDiEBAbWfWTOJ28/rnuViok0d2ohjI6x3Zarbg/Q6qJFMOPy0b6wlmFPGeK+C CUfQ3kR3yY03IQnrTOhxrvhYoyV9OKoyBqvvtfJJPjbDzSzTJOM7SQT28mIVUxyb3EZp g/wy70BBo/Rhg2Gn8Uy19Xu2Tddy6CZE5DcSPdcZPT39MtdYE0jUqBczrVMxREVIxqPR kxWKjRGAeJsOvmZOwKPXzRC0bP36mbDB6rVmh6WviMJ8nkDIg+qTqRNGHkwreBtp8N6+ 3VlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160017; x=1683752017; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wgjQsE1Hdvwl1NpUaWmvVlqrPBksB4aMkQUF06EbqG0=; b=CDyUQyAKz2lPfEJPDh7zgmhGbxp17JAHDOfVLdrfg2oxYYTf+r0tISI6vZtYwRMHGS P1l6xi0XpvRB6/mWL50P/wXIzMdejZObHQlGjaeNSVUj31uUE9BWydITxJcL7Qrp1V2H ORhqnsi9iohkXSXNPJyEy5hADCgRnzOzbpBQHnzqdwuYB50aoGoEAjdRPzR9+Txgu02Q iHiLuqKP+QhRXsOTGDmStCA+ORiRPc1cg5Hl09TebGwCSEGnuFWBnP7rElKa1+KHP+lX 0cfpMybcGPjdiH7jDJd21e2mUP40MoFElgncIpO/qxwiw58JrcGSPmJoQbPLkWuyhJ25 CBEw== X-Gm-Message-State: AAQBX9cZqKm4QqEdJs/ClG29H5qh9UsmPgpxR0frsOCXupC8U9dndnOn dqzNo4h5ERZgW6tX5zAu5Vh7mA== X-Received: by 2002:a5d:5510:0:b0:2ce:9877:84ae with SMTP id b16-20020a5d5510000000b002ce987784aemr8705347wrv.16.1681160017218; Mon, 10 Apr 2023 13:53:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:36 -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 Subject: [PATCH v2 0/7] Thermal zone device structure encapsulation Date: Mon, 10 Apr 2023 22:52:58 +0200 Message-Id: <20230410205305.1649678-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The thermal zone device structure is defined in the exported thermal header include/linux/thermal.h Given the definition being public, the structure is exposed to the external components other than the thermal framework core code. It results the drivers are tampering the structure internals like taking the lock or changing the field values. Obviously that is bad for several reasons as the drivers can hook the thermal framework behavior and makes very difficult the changes in the core code as external components depend on it directly. Moreover, the thermal trip points being reworked, we don't want the drivers to access the trips array directly in the thermal zone structure and doing assumptions on how they are organized. This series provides a second set of changes moving to the thermal zone device structure self-encapsulation. The ACPI and the Menlon drivers are using the thermal zone's device fields to create symlinks and new attributes in the sysfs thermal zone directory. These changes provide a hopefully temporary wrapper to access it in order to allow moving forward in the thermal zone device self-encapsulation and a Kconfig option to disable by default such a extra sysfs information. Changelog: v2: - Add the Kconfig option to remove specific attributes - Add a thermal_zone_device() wrapper to access tz->device Daniel Lezcano (7): thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace thermal/core: Encapsulate tz->device field thermal/drivers/acpi: Use thermal_zone_device() thermal/drivers/menlow: Use thermal_zone_device() thermal/core: Prepare sanitizing thermal class sysfs content thermal/drivers/acpi: Make cross dev link optional by configuration thermal/drivers/intel_menlow: Make additionnal sysfs information optional drivers/acpi/thermal.c | 57 +++++++++++++++++------ drivers/thermal/Kconfig | 12 +++++ drivers/thermal/intel/intel_menlow.c | 12 +++-- drivers/thermal/intel/intel_pch_thermal.c | 5 +- drivers/thermal/thermal_core.c | 6 +++ include/linux/thermal.h | 1 + 6 files changed, 74 insertions(+), 19 deletions(-) -- 2.34.1