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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 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 05C4EC54FD0 for ; Mon, 20 Apr 2020 18:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E089B206B8 for ; Mon, 20 Apr 2020 18:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbgDTSTv (ORCPT ); Mon, 20 Apr 2020 14:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbgDTSTv (ORCPT ); Mon, 20 Apr 2020 14:19:51 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E9DC061A0C; Mon, 20 Apr 2020 11:19:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 313602A0FEB Subject: Re: [RFC v3 1/2] thermal: core: Let thermal zone device's mode be stored in its struct From: Andrzej Pietrasiewicz To: Bartlomiej Zolnierkiewicz Cc: linux-pm@vger.kernel.org, Zhang Rui , "Rafael J . Wysocki" , Len Brown , Jiri Pirko , Ido Schimmel , "David S . Miller" , Peter Kaestle , 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 References: <9ac3b37a-8746-b8ee-70e1-9c876830ac83@linaro.org> <20200417162020.19980-1-andrzej.p@collabora.com> <20200417162020.19980-2-andrzej.p@collabora.com> <4b97e46a-e7ef-ee22-227e-d35ebef458b0@samsung.com> <4cda3e11-7bea-8445-cd51-4b25dcafc741@collabora.com> Message-ID: <920f8285-1b49-d088-64b4-98bce8d23e39@collabora.com> Date: Mon, 20 Apr 2020 20:19:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <4cda3e11-7bea-8445-cd51-4b25dcafc741@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org @Daniel please see below W dniu 20.04.2020 o 13:03, Andrzej Pietrasiewicz pisze: > Hi Barlomiej, > > Thanks for looking into the series. > > @Daniel can you see below? > > W dniu 19.04.2020 o 13:38, Bartlomiej Zolnierkiewicz pisze: >> >> Hi Andrzej, >> >> On 4/17/20 6:20 PM, Andrzej Pietrasiewicz wrote: >>> 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 >> >> This should be true only for thermal_zone_device_{get,set}_mode(). >> >> thermal_zone_device_{en,dis}able() should be available for device drivers: >> >> * of/thermal device drivers need to enable thermal device itself >>    (please refer to my patchset for details) >> >> * device drivers need to call them on ->suspend and ->resume operations >> > > @Daniel: > > How does this compare to > > "Just: > > thermal_zone_device_get_mode() > thermal_zone_device_set_mode() > thermal_zone_device_disable() > thermal_zone_device_enable() > > And all of them in drivers/thermal/thermal_core.h". Did I understand > you correctly? > I sent a PATCH series (rather than next iteration of RFC) addressing Bartlomiej's comments. They make sense to me. Regards, Andrzej