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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0FEDC38A30 for ; Sun, 19 Apr 2020 13:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8432322244 for ; Sun, 19 Apr 2020 13:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbgDSNu5 convert rfc822-to-8bit (ORCPT ); Sun, 19 Apr 2020 09:50:57 -0400 Received: from piie.net ([80.82.223.85]:49180 "EHLO piie.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgDSNu4 (ORCPT ); Sun, 19 Apr 2020 09:50:56 -0400 Received: from mail.piie.net (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by piie.net (Postfix) with ESMTPSA id BC23C1613; Sun, 19 Apr 2020 15:50:35 +0200 (CEST) Mime-Version: 1.0 Date: Sun, 19 Apr 2020 13:50:35 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Mailer: RainLoop/1.11.3 From: "=?utf-8?B?UGV0ZXIgS8Okc3RsZQ==?=" Message-ID: Subject: Re: [RFC v3 1/2] thermal: core: Let thermal zone device's mode be stored in its struct To: "Andrzej Pietrasiewicz" , linux-pm@vger.kernel.org Cc: "Zhang Rui" , "Rafael J . Wysocki" , "Len Brown" , "Jiri Pirko" , "Ido Schimmel" , "David S . Miller" , "Darren Hart" , "Andy Shevchenko" , "Support Opensource" , "Daniel Lezcano" , "Amit Kucheria" , "Shawn Guo" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "NXP Linux Team" , "Allison Randal" , "Enrico Weigelt" , "Gayatri Kammela" , "Thomas Gleixner" , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, "Barlomiej Zolnierkiewicz" In-Reply-To: <20200417162020.19980-2-andrzej.p@collabora.com> References: <20200417162020.19980-2-andrzej.p@collabora.com> <9ac3b37a-8746-b8ee-70e1-9c876830ac83@linaro.org> <20200417162020.19980-1-andrzej.p@collabora.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 17. April 2020 18:20, "Andrzej Pietrasiewicz" schrieb: > Thermal zone devices' mode is stored in individual drivers. This patch > changes it so that mode is stored in struct thermal_zone_device instead. > > As a result all driver-specific variables storing the mode are not needed > and are removed. Consequently, the get_mode() implementations have nothing > to operate on and need to be removed, too. > > Some thermal framework specific functions are introduced: > > thermal_zone_device_get_mode() > thermal_zone_device_set_mode() > thermal_zone_device_enable() > thermal_zone_device_disable() > > thermal_zone_device_get_mode() and its "set" counterpart take tzd's lock > and the "set" calls driver's set_mode() if provided, so the latter must > not take this lock again. At the end of the "set" > thermal_zone_device_update() is called so drivers don't need to repeat this > invocation in their specific set_mode() implementations. > > The scope of the above 4 functions is purposedly limited to the thermal > framework and drivers are not supposed to call them. This encapsulation > does not fully work at the moment for some drivers, though: > > - platform/x86/acerhdf.c Acked-by: Peter Kaestle [...] -- --peter;