From mboxrd@z Thu Jan 1 00:00:00 1970 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 453B2CDB46E for ; Thu, 12 Oct 2023 13:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378780AbjJLNO3 (ORCPT ); Thu, 12 Oct 2023 09:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378792AbjJLNO2 (ORCPT ); Thu, 12 Oct 2023 09:14:28 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAEFD8 for ; Thu, 12 Oct 2023 06:14:26 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-405497850dbso9881125e9.0 for ; Thu, 12 Oct 2023 06:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697116465; x=1697721265; darn=vger.kernel.org; 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=CGxpG5sySkyzmI8OEkqZujhsy1RfTOcPN5J5Y4xsLqQ=; b=Wg0ipS7f1tkM3aoNIkur9kiLjZrxXqocPDT2dcG457X237ER/rzkf3SYCVLLUVeUie 0l5sG3DcjaAzGpX10MDnIuWWQiE9r5IhG9dwaygJWtd5TragV4MLPKN33wMS1AgtElvo rZUuedOwhg9YEaFEtFrW3KAMpScGE2t9v4JYhpHZpaWUpVTMWLmBavoMM/NT5vHrcZzu kOz7l7eFKgJrNW1VwKhYXJuUenk6kUWh2yjE1O6ZJgbazB35HhlhwX1IbGXItDsRQZaV 9lhQYBpYIzHvHO8IhdgVYLvgJNFjgUkFOKeP9rc9bL7D6l2KwLXtCVaV2QVl9+dKZtKm X4/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697116465; x=1697721265; 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=CGxpG5sySkyzmI8OEkqZujhsy1RfTOcPN5J5Y4xsLqQ=; b=sh66RyNNPnZBjfnJT+aYWQkrK4F0t/mbTB9QUQ0Z7K60eY1PnVvo4dm+YIv/eyLc7z z6rIfcZkDv13wJQLY7rPCAlEJUyKgtjhp2W+JAEu6hBugB5+r+kqRdTpkrKZd6oHEW36 g97gQvdxMkuPcv0svA2WYYv+dwjbzH0hsIKn8oAUnQf25IA2+HqJfIZah7316rwWiew7 3AWLmsXQUKv1apS203NPwyTQurE4eOtB+ovTIyKRS5VeLMjVbQPVYmRam1BAV2nUrhMj Wvj1xefAROL2OYJUWLGmsGT65TgneNHg02L0k14WvZ4aiswbvsQRxboufoR6OS4sdRZa aa3A== X-Gm-Message-State: AOJu0YwbUciWHfOxApWinCU3eyDxt5NJuvLevByq24b1WV6LFeFLMGic +RtfJ4wwFvw3no33xQXRymRauw== X-Google-Smtp-Source: AGHT+IG5FBvx6h3rweF+lc3pX+7wrDJo3+bueRZ5ZXPOGUr0QjJSlkyXomBlJX8IQEp5yOQntjegGg== X-Received: by 2002:a7b:ce89:0:b0:402:f07c:4b48 with SMTP id q9-20020a7bce89000000b00402f07c4b48mr20417716wmj.28.1697116464566; Thu, 12 Oct 2023 06:14:24 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0? ([2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0]) by smtp.googlemail.com with ESMTPSA id i14-20020a05600c354e00b004068de50c64sm19851900wmq.46.2023.10.12.06.14.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 06:14:24 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2023 15:14:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] thermal/core: Hardening the self-encapsulation Content-Language: en-US To: Lukasz Luba Cc: Thierry Reding , rafael@kernel.org, Amit Kucheria , Zhang Rui , "open list:THERMAL" , open list References: <20231012102700.2858952-1-daniel.lezcano@linaro.org> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Lukasz, On 12/10/2023 14:01, Lukasz Luba wrote: > Hi Daniel, > > On 10/12/23 11:26, Daniel Lezcano wrote: >> The thermal private header has leaked all around the drivers which >> interacted with the core internals. The thermal zone structure which >> was part of the exported header led also to a leakage of the fields >> into the different drivers, making very difficult to improve the core >> code without having to change the drivers. >> >> Now we mostly fixed how the thermal drivers were interacting with the >> thermal zones (actually fixed how they should not interact). The >> thermal zone structure will be moved to the private thermal core >> header. This header has been removed from the different drivers and >> must belong to the core code only. In order to prevent this private >> header to be included again in the drivers, make explicit only the >> core code can include this header by defining a THERMAL_CORE_SUBSYS >> macro. The private header will contain a check against this macro. >> >> The Tegra SoCtherm driver needs to access thermal_core.h to have the >> get_thermal_instance() function definition. It is the only one >> remaining driver which need to access the thermal_core.h header, so >> the check will emit a warning at compilation time. >> >> Thierry Reding is reworking the driver to get rid of this function [1] >> and thus when the changes will be merged, the compilation warning will >> be converted to a compilation error, closing definitively the door to >> the drivers willing to play with the thermal zone device internals. > > That looks like a good idea. Although, shouldn't we avoid the > compilation warnings and just first merge the fixes for drivers? Yes, we should but there is the series for nvidia (pointed in the changelog) which need a slight refresh for the bindings AFAIR. That series is since March 2023 and Thierry seems busy [1]. I'm holding the hardening since then. So I don't know how to make progress on this? I was assuming we can merge this series and let the compiler recall what has to be fixed. [1] https://lore.kernel.org/all/ZK14edZUih1kH_sZ@orome/ and as soon as it is fixed, we convert the WARNING to ERROR :P -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog