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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 175FEC433DF for ; Mon, 1 Jun 2020 11:38:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5848207DF for ; Mon, 1 Jun 2020 11:38:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XVIhogi1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5848207DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=piie.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To:To:Subject: Message-ID:From:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=waekIE3m8ETRXYj62mPegO+A4jhwrPQrZph/wzHrmn4=; b=XVIhogi1ODL6An 6i1R1S3D9DavJi5LW0Wzbk8nxcXRmGkvN5KWl+IQJ22f4N1bcCzZOjVIhtHOxZuTvokYf/lylA09J UmKyjeyk/nPK6qXVFnktv6zfhS1wvcDqdPp0J/tXUyM9mNds8Q2l4o0xgQT75T6dmP2FhHSw3U93g hyvbEzeHKbgUHyj/qSxiI7vS1ienNCjl4dkHcF3Ku/HgcGUQ6IsvfIx8HWvRMhPtuhpwN1G73b+PQ xRPHwXKOFkxNd4haMj+lT+zwOmMxfJ5GAR+9VpLpM5nKRyv2OQeGAzSHpSxi7BDhkSqW0/ePe1xIv p51Lno7BGrmIyYB8oUwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfilU-0007IJ-Hw; Mon, 01 Jun 2020 11:38:00 +0000 Received: from piie.net ([80.82.223.85]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfilR-0007Gp-4a; Mon, 01 Jun 2020 11:37:58 +0000 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 2577E260F; Mon, 1 Jun 2020 13:37:52 +0200 (CEST) Mime-Version: 1.0 Date: Mon, 01 Jun 2020 11:37:52 +0000 X-Mailer: RainLoop/1.11.3 From: "=?utf-8?B?UGV0ZXIgS8Okc3RsZQ==?=" Message-ID: <05b890834efb5714a67a91afeabcd95d@piie.net> Subject: Re: [PATCH v4 07/11] thermal: Use mode helpers in drivers To: "Andrzej Pietrasiewicz" , linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org In-Reply-To: <20200528192051.28034-8-andrzej.p@collabora.com> References: <20200528192051.28034-8-andrzej.p@collabora.com> <20200528192051.28034-1-andrzej.p@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200601_043757_467441_467CBACE X-CRM114-Status: UNSURE ( 5.21 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Emmanuel Grumbach , Heiko Stuebner , Vishal Kulkarni , Luca Coelho , Miquel Raynal , kernel@collabora.com, Fabio Estevam , Amit Kucheria , Chunyan Zhang , Daniel Lezcano , Allison Randal , NXP Linux Team , Darren Hart , Zhang Rui , Gayatri Kammela , Len Brown , Johannes Berg , Intel Linux Wireless , Sascha Hauer , Ido Schimmel , Baolin Wang , Jiri Pirko , Orson Zhai , Thomas Gleixner , Kalle Valo , Support Opensource , Enrico Weigelt , "Rafael J . Wysocki" , Sebastian Reichel , Bartlomiej Zolnierkiewicz , Pengutronix Kernel Team , =?utf-8?B?TmlrbGFzIFPDtmRlcmx1bmQ=?= , Shawn Guo , "David S . Miller" , Andy Shevchenko Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 28. Mai 2020 21:22, "Andrzej Pietrasiewicz" schrieb: > Use thermal_zone_device_{en|dis}able() and thermal_zone_device_is_enabled(). > > Consequently, all set_mode() implementations in drivers: > > - can stop modifying tzd's "mode" member, > - shall stop taking tzd's lock, as it is taken in the helpers > - shall stop calling thermal_zone_device_update() as it is called in the > helpers > - can assume they are called when the mode truly changes, so checks to > verify that can be dropped > > Not providing set_mode() by a driver no longer prevents the core from > being able to set tzd's mode, so the relevant check in mode_store() is > removed. > > Other comments: > > - acpi/thermal.c: tz->thermal_zone->mode will be updated only after we > return from set_mode(), so use function parameter in thermal_set_mode() > instead, no need to call acpi_thermal_check() in set_mode() > - thermal/imx_thermal.c: regmap writes and mode assignment are done in > thermal_zone_device_{en|dis}able() and set_mode() callback > - thermal/intel/intel_quark_dts_thermal.c: soc_dts_{en|dis}able() are a > part of set_mode() callback, so they don't need to modify tzd->mode, and > don't need to fall back to the opposite mode if unsuccessful, as the return > value will be propagated to thermal_zone_device_{en|dis}able() and > ultimately tzd's member will not be changed in thermal_zone_device_set_mode(). > - thermal/of-thermal.c: no need to set zone->mode to DISABLED in > of_parse_thermal_zones() as a tzd is kzalloc'ed so mode is DISABLED anyway > > Signed-off-by: Andrzej Pietrasiewicz > --- [...] > drivers/platform/x86/acerhdf.c | 17 +++++---- Acked-by: Peter Kaestle _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel