From patchwork Mon Feb 26 14:41:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 10242479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8708F60208 for ; Mon, 26 Feb 2018 14:41:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76CE22A033 for ; Mon, 26 Feb 2018 14:41:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B4F52A06A; Mon, 26 Feb 2018 14:41:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3BA82A033 for ; Mon, 26 Feb 2018 14:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753727AbeBZOl2 (ORCPT ); Mon, 26 Feb 2018 09:41:28 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51082 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753546AbeBZOl2 (ORCPT ); Mon, 26 Feb 2018 09:41:28 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 79FD526047F From: Enric Balletbo i Serra To: rui.zhang@intel.com, rjw@rjwysocki.net Cc: groeck@chromium.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, snanda@chromium.org, lenb@kernel.org Subject: [RESEND PATCH v3 1/2] acpi: thermal: initialize tz_enabled to 1 Date: Mon, 26 Feb 2018 15:41:17 +0100 Message-Id: <20180226144118.24693-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sameer Nanda In the acpi_thermal_add path, acpi_thermal_get_info gets called before acpi_thermal_register_thermal_zone. Since tz_enabled was getting set to 1 only in acpi_thermal_register_thermal_zone, acpi_thermal_get_info ended up disabling thermal polling. Moved setting of tz_enabled to 1 into acpi_thermal_add itself. Signed-off-by: Sameer Nanda Signed-off-by: Enric Balletbo i Serra --- That's another attempt to land these to patches that were sent long time ago but never got merged, although, apparently, there is no issue with it. Latest discussion about these here: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1436081.html Changes in v3: - [1/2] Make sure tz->tz_enabled is set properly before registering the zone (Zhang Rui) Changes in v2: - [1/2] This patch is new from v1 (https://patchwork.kernel.org/patch/9804229/) drivers/acpi/thermal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 551b71a24b85..1d8f185e96c6 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -930,8 +930,6 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) if (ACPI_FAILURE(status)) return -ENODEV; - tz->tz_enabled = 1; - dev_info(&tz->device->dev, "registered as thermal_zone%d\n", tz->thermal_zone->id); return 0; @@ -1088,6 +1086,7 @@ static int acpi_thermal_add(struct acpi_device *device) return -ENOMEM; tz->device = device; + tz->tz_enabled = 1; strcpy(tz->name, device->pnp.bus_id); strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);