Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp404569ybg; Mon, 1 Jun 2020 04:38:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU7S1SDulIhocSrFKnWwpEpkJ64iTetO9EBp8dV6wgFhG10cWIU+D2rw4Kl1ZzPjZhe6MO X-Received: by 2002:a50:e60b:: with SMTP id y11mr6020305edm.323.1591011510644; Mon, 01 Jun 2020 04:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591011510; cv=none; d=google.com; s=arc-20160816; b=XwcE9KnBY9CHjxJUAey4lXDX3sxHalXI6S8NNCxpmwiO3p8mAHvPlXYstq3KrDzd0q wcs/CHOzzgC1C7cn8qEyvM5Fn520Q+Fx2rkOxB7UJTKL4FK7sdCdLDdJhpSEYeRezj/k uUJXvE36uPC6j3wpcoTuu742pfxcriNDP/qHAs4a1BW2Ya1F5c+lzu3bii0IX4cmaRS7 dUthOirDUQLrkzOt7cTRzf7sK6jF7QZlt4g4ITbLmTxhi1UiaKzpBoheF93n5O6gdd1O fP9Ws7vHgrY/Ak8L9zO/zbUx81wmcicpGRMCuTArNJW3xFgGdGLzSp18ehqi91XpUYhj LIag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:cc:to:subject :message-id:from:content-transfer-encoding:date:mime-version; bh=FhJzuwL+oRBJscCeMDOXCNwUGpl/mE/jUO0TzHSXDoI=; b=lCvIg9R3wnT3pAkNz/9wKxlTsiERJs+5DaLzoqh2wCySO7NhlSlpt3zIRyBM+/HSyk 05K+XxndgmuNnyJfxyqRNK9WTabAZZTlRzh2t4rgVM1dsf2bw70LhwbB1YEHxrEucY9s 4Bdun2qeEJOvoha2KDmhw67M94J9xZ3f2eM2ynQh1ZuUFvbwcMEn966Sxk9UwrlyMK6B qw1jJS2TLOCU29swZxluQvu1/GjS+4S4CmRZApDjdvkYTS1oogWJf2q3aEbg0YeJVQwZ VdCy6h57DnhSqVm3ew5drZ2+lak0AJLHCTkzGWx1ibGyM6RWq1UFxn2q+Agpq9Zssbr8 8irQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar23si8042398ejc.169.2020.06.01.04.38.06; Mon, 01 Jun 2020 04:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726102AbgFALh6 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 1 Jun 2020 07:37:58 -0400 Received: from piie.net ([80.82.223.85]:41364 "EHLO piie.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgFALh5 (ORCPT ); Mon, 1 Jun 2020 07:37:57 -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 2577E260F; Mon, 1 Jun 2020 13:37:52 +0200 (CEST) Mime-Version: 1.0 Date: Mon, 01 Jun 2020 11:37:52 +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: <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 Cc: "Rafael J . Wysocki" , "Len Brown" , "Vishal Kulkarni" , "David S . Miller" , "Jiri Pirko" , "Ido Schimmel" , "Johannes Berg" , "Emmanuel Grumbach" , "Luca Coelho" , "Intel Linux Wireless" , "Kalle Valo" , "Darren Hart" , "Andy Shevchenko" , "Sebastian Reichel" , "Miquel Raynal" , "Daniel Lezcano" , "Amit Kucheria" , "Support Opensource" , "Shawn Guo" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "NXP Linux Team" , "=?utf-8?B?TmlrbGFzIFPDtmRlcmx1bmQ=?=" , "Heiko Stuebner" , "Orson Zhai" , "Baolin Wang" , "Chunyan Zhang" , "Zhang Rui" , "Allison Randal" , "Enrico Weigelt" , "Gayatri Kammela" , "Thomas Gleixner" , "Bartlomiej Zolnierkiewicz" , kernel@collabora.com 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> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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