From patchwork Thu Apr 23 16:57:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 212237 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=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, USER_AGENT_GIT 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 4A164C55191 for ; Thu, 23 Apr 2020 16:57:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3211B20767 for ; Thu, 23 Apr 2020 16:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729721AbgDWQ5Q (ORCPT ); Thu, 23 Apr 2020 12:57:16 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59600 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729673AbgDWQ5Q (ORCPT ); Thu, 23 Apr 2020 12:57:16 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 303362A0661 From: Andrzej Pietrasiewicz To: linux-pm@vger.kernel.org Cc: 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 , Heiko Stuebner , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Andrzej Pietrasiewicz , Barlomiej Zolnierkiewicz Subject: [PATCH v3 0/2] Stop monitoring disabled devices Date: Thu, 23 Apr 2020 18:57:03 +0200 Message-Id: <20200423165705.13585-1-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This is the third iteration of this PATCH series (not counting RFCs). It addresses comments from Bartlomiej - thanks, Bartlomiej! The first patch makes all the drivers store their mode in struct thermal_zone_device. Such a move has consequences: driver-specific variables for storing mode are not necessary. Consequently get_mode() methods become obsolete. Then sysfs "mode" attribute stops depending on get_mode() being provided, because it is always provided from now on. The first patch also introduces the initial mode to be optionally passed to thermal_zone_device_register(). Given all the groundwork done in patch 1/2 patch 2/2 becomes very simple. I incorrectly named PATCH v2 a PATCH RESEND 1/2, so now I'm counting that as PATCH v2, hence this series is PATCH v3. PATCH v2..PATCH v3: - removed redundant regmap_write() in imx_thermal_suspend() and imx_thermal_resume() (Bartlomiej) - removed unnecessary call to soc_dts_enable() (now called indirectly from thermal_zone_device_register()->set_mode()) (Bartlomiej) - removed defensive-style checks for non-existent enum values in thermal_zone_device_set_mode() (Bartlomiej) - change mode only if driver's set_mode() succeeded in thermal_zone_device_set_mode() (Bartlomiej) - don't set tz->need_update in thermal_zone_device_register() - this was supposed to be part of PATCH v1, but was omitted (Bartlomiej) PATCH..PATCH v2: - fixed typo (missing semicolon in dummy thermal_zone_device_set_mode() implementation) (kbuild test robot) - fixed misspelled enum value in int3400_thermal_params.initial_mode RFCv3..this PATCH: - export thermal_zone_device_{enable|disable}() for drivers (Bartlomiej) - don't check provided enum values in acpi's thermal_zet_mode() and in int3400_thermal_set_mode() (Bartlomiej) - use thermal_zone_device_enable() in of_thermal instead of open coding it (Bartlomiej) - use thermal_zone_device_{enable|disable}() in hisi_thermal, rockchip_thermal and sprd_thermal (Bartlomiej) - assume THERMAL_DEVICE_ENABLED is thermal_zone_params not provided at tzd's register time (Bartlomiej) - eliminated tzp-s which contain only .initial_mode = THERMAL_DEVICE_ENABLED, (Bartlomiej) - don't set tz->need_update and don't call thermal_zone_device_update() at the end of thermal_zone_device_register() (Bartlomiej) - used .initial_mode in int340x_thermal_zone, x86_pkg_temp_thermal and int3400_thermal (Bartlomiej) Andrzej Pietrasiewicz (2): thermal: core: Let thermal zone device's mode be stored in its struct thermal: core: Stop polling DISABLED thermal devices drivers/acpi/thermal.c | 35 ++-------- .../ethernet/mellanox/mlxsw/core_thermal.c | 42 ------------ drivers/platform/x86/acerhdf.c | 17 +---- drivers/thermal/da9062-thermal.c | 11 ---- drivers/thermal/hisi_thermal.c | 6 +- drivers/thermal/imx_thermal.c | 36 ++-------- .../intel/int340x_thermal/int3400_thermal.c | 31 ++------- .../int340x_thermal/int340x_thermal_zone.c | 1 + .../thermal/intel/intel_quark_dts_thermal.c | 30 ++------- drivers/thermal/intel/x86_pkg_temp_thermal.c | 1 + drivers/thermal/of-thermal.c | 24 +------ drivers/thermal/rockchip_thermal.c | 6 +- drivers/thermal/sprd_thermal.c | 6 +- drivers/thermal/thermal_core.c | 65 +++++++++++++++---- drivers/thermal/thermal_core.h | 3 + drivers/thermal/thermal_sysfs.c | 29 +-------- include/linux/thermal.h | 22 ++++++- 17 files changed, 119 insertions(+), 246 deletions(-) base-commit: 79799562bf087b30d9dd0fddf5bed2d3b038be08