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 8E8BAC64ED6 for ; Thu, 23 Feb 2023 22:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjBWW5A (ORCPT ); Thu, 23 Feb 2023 17:57:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjBWW44 (ORCPT ); Thu, 23 Feb 2023 17:56:56 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BDB5DCE5 for ; Thu, 23 Feb 2023 14:56:51 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id m25-20020a7bcb99000000b003e7842b75f2so605587wmi.3 for ; Thu, 23 Feb 2023 14:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cikNiAl3CsaUVzCtk0AInA3PwE1/TMQnMlzjF1gGdG0=; b=DRN7VfySjUL0rYZq24bKTqYo1a7eMqo07ygSwMFUqHzuTKP65b9sTMEH8VZt0hxwu1 dmHGRYaPf3ggH9KZmEyIo+flPWm4zpT9CAN4fb3bb2UwUttx3rmo4vx8zo6F2tPiEUOK kQWqn6QOgf2ZhhgOZ653j1GAMDb6AMca6ljq3tiMi06NSCiMzWp0EPnd6Uvs6JK9LOIe r43kHvJdLLA9VFyPJO6M+KZDTGdMEFaMKztCR+nTATohFgvC9r80+cCMQ12KHZsj+SUY jwwZvlnmtS9kLRvR3sEhulVIN5kRwRQDmQ/AX297OlmgtRWEUsWG1kh7J/OLhfLYqjHy 599w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cikNiAl3CsaUVzCtk0AInA3PwE1/TMQnMlzjF1gGdG0=; b=2llLIJ5UJYX2K5rQN5iZJ5QNFZ4APhMQLVy72h6mH/2OxHDBHhqkH1rEu10txE0+Zp M0P3wJNYleOg54Lv9qbZw5O3RlR6wynz6IFefP4XL6OX0uyvsfHors+icYRK9pFKDwOR NU7cl/RNsI5TgjqkbbhAAYAhVixZrO3TEHfTQ1ESJbipL6dPZEAz8xAR/9as0fMgzEMo kOldRVE4Pd9EDFIaAvwfX4KCOym/GZrFnTJWj9VTzu9zwFxC8W1DuPUaFQfibCTmFlXK dbXEn4biUHYBhb/32lmqB3QEqN+GHAwiXid/rKdO1gZ5TEaUKxFjS1cqECocej3wbwxF EcgA== X-Gm-Message-State: AO0yUKXBTME3psi3NqC+4DnWc+Q4q1JMfMPZuIlejdvF5Nw9/IgY2BrU 9kzJPwv0mHKfa9XL3iQWpVKeEQ== X-Google-Smtp-Source: AK7set9Z52yxWv52zRMDow6DF+DTZQX7KbVMepo+DRQCwOeMkXAXaJBNJ2zYwaSnuLVGEj/k1hBdjw== X-Received: by 2002:a05:600c:a695:b0:3e2:2f9:b8e2 with SMTP id ip21-20020a05600ca69500b003e202f9b8e2mr10908094wmb.35.1677193009641; Thu, 23 Feb 2023 14:56:49 -0800 (PST) Received: from ?IPV6:2a05:6e02:1041:c10:3e6f:e90a:1fc9:3708? ([2a05:6e02:1041:c10:3e6f:e90a:1fc9:3708]) by smtp.googlemail.com with ESMTPSA id d21-20020a1c7315000000b003b47b80cec3sm662936wmb.42.2023.02.23.14.56.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Feb 2023 14:56:49 -0800 (PST) Message-ID: <37b3b835-e992-0090-56e5-bd4d58e547a7@linaro.org> Date: Thu, 23 Feb 2023 23:56:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 00/17] Self-encapsulate the thermal zone device structure Content-Language: en-US To: rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui , Len Brown , Damien Le Moal , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jean Delvare , Guenter Roeck , Jonathan Cameron , Lars-Peter Clausen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Dmitry Torokhov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ido Schimmel , Petr Machata , Gregory Greenman , Kalle Valo , Sebastian Reichel , Liam Girdwood , Mark Brown , Miquel Raynal , Amit Kucheria , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Markus Mayer , Support Opensource , Andy Gross , Bjorn Andersson , Konrad Dybcio , Thara Gopinath , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Heiko Stuebner , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Orson Zhai , Baolin Wang , Chunyan Zhang , Vasily Khoruzhick , Yangtao Li , Thierry Reding , Jonathan Hunter , Talel Shenhar , Eduardo Valentin , Keerthy , Kunihiko Hayashi , Masami Hiramatsu , Matthias Brugger , AngeloGioacchino Del Regno , Stefan Wahren , Zheng Yongjun , Yang Li , Srinivas Pandruvada , Daniel Golle , Balsam CHIHI , Mikko Perttunen , linux-acpi@vger.kernel.org, linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20230223224844.3491251-1-daniel.lezcano@linaro.org> From: Daniel Lezcano In-Reply-To: <20230223224844.3491251-1-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/2023 23:48, Daniel Lezcano wrote: > The exported thermal headers expose the thermal core structure while those > should be private to the framework. The initial idea was the thermal sensor > drivers use the thermal zone device structure pointer to pass it around from > the ops to the thermal framework API like a handler. > > Unfortunately, different drivers are using and abusing the internals of this > structure to hook the associated struct device, read the internals values, take > the lock, etc ... > > rn order to fix this situation, let's encapsulate the structure leaking the > more in the different drivers: the thermal_zone_device structure. > > This series revisit the existing drivers using the thermal zone private > structure internals to change the access to something else. For instance, the > get_temp() ops is using the tz->dev to write a debug trace. Despite the trace > is not helpful, we can check the return value for the get_temp() ops in the > call site and show the message in this place. > > With this set of changes, the thermal_zone_device is almost self-encapsulated. > As usual, the acpi driver needs a more complex changes, so that will come in a > separate series along with the structure moved the private core headers. > > Changelog: > - V3: > - Collected more tags > - Added missing changes for ->devdata in some drivers > - Added a 'type' accessor > - Replaced the 'type' to 'id' changes by the 'type' accessor > - Used the 'type' accessor in the drivers > - V2: > - Collected tags > - Added missing changes for ->devdata for the tsens driver > - Renamed thermal_zone_device_get_data() to thermal_zone_priv() > - Added stubs when CONFIG_THERMAL is not set > - Dropped hwmon change where we remove the tz->lock usage > > Thank you all for your comments The series has been blocked by gsmtp because the next patch has too many Cc. I'll sort out this and resend. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog