Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp254967rdg; Thu, 12 Oct 2023 05:02:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYOrxwhhzPvwGeo1RKgTZqLs7GBV72b+kNGFaGyRiekuDvmI+P8lFW5BDZHFql0IWpVVG9 X-Received: by 2002:a05:6a20:734a:b0:15d:641b:57b6 with SMTP id v10-20020a056a20734a00b0015d641b57b6mr23952629pzc.5.1697112146340; Thu, 12 Oct 2023 05:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697112146; cv=none; d=google.com; s=arc-20160816; b=R9gt+98C9Dw6rdVOIzgRbwBtxBR1r75OfPTrLFJxiwKbTxfsT24G0SxYE2swWFtKlZ HpCTR1v6djR1F0WWPrHjPD92GPwrMEk00dPvmbLWScVkjc8U23891NrhWAXOtKd3q25J ZnoGkodGIrE65cF+4NjRBrYi7wGN3tbQenYM0KcMtWsWSClk5gkOQjVb5AJpcb091R3Y Ax5TvYECP74feUOyr5XlH8SJSWs2XLxSxifBw3LYCpomrMLi0viOwCfJo4g8pBBxy1fB 5CYT4N45DYgol0GN0wrPgiJSgtrcjuk+Nacobn6lLSBmHeOOiKIuMuHnW0ydy2jkBxaP VZyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=nV0t+cyT34KG4RzMoqnQ12hCqLc5WULND/JSgYZ5CBI=; fh=/JQeV5KF4+qNelj2iSNwRnaXm5WwpYjHsiwQ2o+IQ0Y=; b=t5vhLADKbcfBb8DNJJsXDxp5GblAzlfDgp0/j7Tp42Sm/pSgd+2r2KZjh/cyhTVKZd u3KY4EkH7iUCsob8L6SFcRerOo/NxUW+40bjcJTbFlleqFLSMaoIZSfkM69tjTp2QnQr AfNdm4nBp1l7sAwknKII3lBg710soBq9Pbohyt9XI27UyUyelhQZ0+Vqv6I32PK8nP/m OIm8WFSMGEURBTpzEzI0D99a1Q2zTDuAbnY3kTYhcq2mxaqpDR59680/3hnclwZ4BCCV KYPxR1rkNXSpuFis84PLFQS8kry/JxIox4T37aFlVsM3TuGuJdMsQ/Jh70eJjzWiSCsp fejw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m9-20020a654389000000b00565e42df278si1908010pgp.759.2023.10.12.05.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 05:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 75A4280784DD; Thu, 12 Oct 2023 05:01:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347190AbjJLMBF (ORCPT + 99 others); Thu, 12 Oct 2023 08:01:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235738AbjJLMAu (ORCPT ); Thu, 12 Oct 2023 08:00:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B094CE4; Thu, 12 Oct 2023 05:00:16 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CFBBD13D5; Thu, 12 Oct 2023 05:00:56 -0700 (PDT) Received: from [10.57.81.19] (unknown [10.57.81.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFE323F5A1; Thu, 12 Oct 2023 05:00:14 -0700 (PDT) Message-ID: Date: Thu, 12 Oct 2023 13:01:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] thermal/core: Hardening the self-encapsulation Content-Language: en-US To: Daniel Lezcano Cc: Thierry Reding , rafael@kernel.org, Amit Kucheria , Zhang Rui , "open list:THERMAL" , open list References: <20231012102700.2858952-1-daniel.lezcano@linaro.org> From: Lukasz Luba In-Reply-To: <20231012102700.2858952-1-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 05:01:25 -0700 (PDT) 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? Regards, Lukasz