Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp301268rdg; Thu, 12 Oct 2023 06:14:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYzfDgsMdBwFNFlcT/1K0Qg06u3Y7s1cNeOlaMpWrwrwmMuP2WpvSyW61nb0R9ETjGMaiL X-Received: by 2002:a05:6358:7e49:b0:142:d0dc:a3ce with SMTP id p9-20020a0563587e4900b00142d0dca3cemr26288206rwm.2.1697116488439; Thu, 12 Oct 2023 06:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697116488; cv=none; d=google.com; s=arc-20160816; b=c+VYhbM0xAq9MOnkL6oPSc00LepL81BmlHa5wLFrKd1tFRfY2mSYaKM1hU24TWc1Zg Y+raE+6tc9y5AKkxBsTyXpmc7uRHtjE01bmt8FaclGABqkqu0goZ5Cs6EweAd2RRcvvC RaEdixAtxL+4rdx9AfEJwZpcegCtM+avmNCa5pn5VqDgU7J0bobwnABuje8XtWZ4+0vb XLI47cTAu8cUwgWwcVRbUYTf2fvnx2buy0U07V9FLMh5XRegZOGsOsuOoWWy0J3KC7Sj ILsFx68Nmy9gJWS2QQ5ABSThBNyLcdo4UIF1m0qTQfob70T21Z3rRmEQ1DtFEaXU4+bw ctng== 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:dkim-signature; bh=CGxpG5sySkyzmI8OEkqZujhsy1RfTOcPN5J5Y4xsLqQ=; fh=zKyPlO7p9Gbq8dyoggUoJUXdUNcIZEuaXyUwPvm1UQk=; b=tTGyh1Me9j0Ah56cH1PH1tlQb9qjlkEYhAxjrh7yyM8ETTwx+eY6FqM0vfIHdgC+vh RSThJDAky6CKJ+bmJWf4rgCl/72/eZ1EkwzVTZ+zJ5sbG5ieMIdsZMDbo+phy6vgjg5j XS3vrvwtt5dK+pmg7tBVByINJAue+CnqfsEhKJGoTej1tHUgzXnhmCPVbfIhS1CX6E92 kEluoYJQUzexg6mKTPRvTeiGkEA0VOHQnmGNR2XPLhpsksSFnN3k8o0aKe3CFeAE7jyi 6mJn11Qb3Wp4ujD962fRmquURnKMsb7pl60NjjtZEXQg4naZpIIcnBbXQT4MuJ4MTcTa 6Ggw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wg0ipS7f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w8-20020a056a0014c800b0068fac3509a9si14738365pfu.350.2023.10.12.06.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 06:14:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wg0ipS7f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4709B80DD34D; Thu, 12 Oct 2023 06:14:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378842AbjJLNOa (ORCPT + 99 others); Thu, 12 Oct 2023 09:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378791AbjJLNO2 (ORCPT ); Thu, 12 Oct 2023 09:14:28 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5595CCA for ; Thu, 12 Oct 2023 06:14:26 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4054496bde3so9747545e9.1 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=V2Eoaq5w87Ibso6AugU26hiUXgfcSE4Rb7nxTURBZTnVZShMZ7zbpwXy8NCK8G5MF/ 0OMfR08r2GuukzJnzf+GPIw7byzLklj44rSaov6yqo69rAnRya7W8by+NRUdtaqg8hbv 0YtPHK/7w8qQgmPHgpJgZ8HnKJ3vXl/vFWScdszV9x5XrRIIPG7n27hOTwAjGfwPSE2J bwVjmFgogWCjc2m0MKriV58Rao7CDaWqlRF7d4MVm3fzvId4ETSE9c6Gw3FJm/N1r4Bx pwnw3FJZem6tcunGKuD+K/HkWYOMJNfIWsO5fGHKy0spZda4tOr/TSyH+wj4UQxXeksi wU6Q== X-Gm-Message-State: AOJu0YzeZo6sgLYcuHic8u6Ewsqsd2yF3kE9ClwNV9HvKR5rnplohEO2 HSAThYdAFsMTARmBUUB5TXxGvIUQZ3aDnAHQHU0= 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 06:14:45 -0700 (PDT) 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