Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp798838rdg; Fri, 13 Oct 2023 01:03:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4OFUJI5mg44R8Qmwk/Qoj1I4L3qv9TX9qXtkWenzls89yIrc7GLZyFDIfwaGCwklWVx/A X-Received: by 2002:a05:6870:d10c:b0:1e9:b62d:dc72 with SMTP id e12-20020a056870d10c00b001e9b62ddc72mr4679312oac.12.1697184206812; Fri, 13 Oct 2023 01:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697184206; cv=none; d=google.com; s=arc-20160816; b=xj34++jonQtrDByEwU70jJmZKoL0kGaV3AKRA6h23dfaMf+J4noEs+mdnKCR3NO0TV p6HoBC5DYYAe9bQeKP1FVT7BwE0C2LPuWrgpVwvIllSuWzDT+ZGxm89u3EQoPkA7zKBt /hcEgKjq5TGJLFbabPXyXAF86cmR8l6wJMzaYAHkzMhzXtKDO5iRRplbShcp7YMoOEsz oF1/KW6GQ6QssS5FsKS9v6N6bULTX/FcZTTbnbSgurh79e83LBuoxTMB2mdpoXmAhOSb nCWYGAKE1lsTvfVdzjjEpipNXsWjlNSEzPzCerR16CjEjPTFuS6rGJg70c6l5TMT9LKo nEhg== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=rqQ8VlEO5aNKl7eIFK7E0XznTRIXDcV295i+hokhLwE=; fh=/JQeV5KF4+qNelj2iSNwRnaXm5WwpYjHsiwQ2o+IQ0Y=; b=eKE9FmSVo1TDulwS+MmhwWmmkorc2RkiVQiHqi9vDHbPyWaYv3LmuLVDKgw3EPU77V YnW+CNh5k1ybl0AI586PVbt65lYlRo34vbbBzdVrxKO7dj9ZDd3MoFUztYiZRmIigsOo Gfy+ny96Q8jkHWKgJHgqRc0T57mO+JFV69LVH0SEJB4yrFpMMSV+Cn0i7CN9vgGVcqJJ ZRMS/izmzCQmRnfbCRiU9EBpACFmzcrixI74IJZvp48JGybq4ERO2/fJH4yHynDEH9Hv ehz7/kgm+wV0Cz2d6xei4H4kqZ1+8kzwL2QVGTEABYUS0bBMjLvlXScV70TjTOyDNXxR y1HA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 186-20020a6301c3000000b00578d460cd7esi3903489pgb.431.2023.10.13.01.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 01:03:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 08D028266486; Fri, 13 Oct 2023 01:03:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjJMIDP (ORCPT + 99 others); Fri, 13 Oct 2023 04:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjJMIDO (ORCPT ); Fri, 13 Oct 2023 04:03:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2CAAE83; Fri, 13 Oct 2023 01:03:12 -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 E6F8E11FB; Fri, 13 Oct 2023 01:03:51 -0700 (PDT) Received: from [10.57.80.116] (unknown [10.57.80.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C6C93F7A6; Fri, 13 Oct 2023 01:03:10 -0700 (PDT) Message-ID: Date: Fri, 13 Oct 2023 09:03:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] thermal/core: Hardening the self-encapsulation 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> Content-Language: en-US From: Lukasz Luba In-Reply-To: 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 01:03:24 -0700 (PDT) On 10/12/23 14:14, Daniel Lezcano wrote: > > 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 > > > > OK, so that should be good for possible distro configs IMO. The chicken egg problem should be addressed and we can start from this patch approach. Reviewed-by: Lukasz Luba