From patchwork Mon Feb 1 18:16:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 374427 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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 3E201C433E6 for ; Mon, 1 Feb 2021 18:25:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 055DF64EA0 for ; Mon, 1 Feb 2021 18:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbhBASZY (ORCPT ); Mon, 1 Feb 2021 13:25:24 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:45586 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232767AbhBASVv (ORCPT ); Mon, 1 Feb 2021 13:21:51 -0500 Received: from 89-64-80-124.dynamic.chello.pl (89.64.80.124) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.537) id dab7a9325be5469d; Mon, 1 Feb 2021 19:20:27 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , "Rafael J. Wysocki" , Zhang Rui , Hans de Goede , Erik Kaneda , Joe Perches Subject: [PATCH v1 2/5] ACPI: battery: Clean up printing messages Date: Mon, 01 Feb 2021 19:16:16 +0100 Message-ID: <1996712.1aSbzQgNOC@kreacher> In-Reply-To: <2367702.B5bJTmGzJm@kreacher> References: <2367702.B5bJTmGzJm@kreacher> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafael J. Wysocki Replace the ACPI_DEBUG_PRINT() and ACPI_EXCEPTION() instances in battery.c with acpi_handle_debug() and acpi_handle_info() calls, respectively, drop the _COMPONENT and ACPI_MODULE_NAME() definitions that are not used any more, drop the no longer needed ACPI_BATTERY_COMPONENT definition from the headers and update the documentation accordingly. While at it, update the pr_fmt() definition and drop the unneeded PREFIX sybmbol definition from battery.c. Signed-off-by: Rafael J. Wysocki --- Documentation/firmware-guide/acpi/debug.rst | 1 drivers/acpi/battery.c | 29 ++++++++++++++-------------- drivers/acpi/sysfs.c | 1 include/acpi/acpi_drivers.h | 1 4 files changed, 15 insertions(+), 17 deletions(-) Index: linux-pm/drivers/acpi/battery.c =================================================================== --- linux-pm.orig/drivers/acpi/battery.c +++ linux-pm/drivers/acpi/battery.c @@ -8,7 +8,7 @@ * Copyright (C) 2001, 2002 Paul Diefenbaugh */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#define pr_fmt(fmt) "ACPI: battery: " fmt #include #include @@ -29,8 +29,6 @@ #include -#define PREFIX "ACPI: " - #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF #define ACPI_BATTERY_CAPACITY_VALID(capacity) \ ((capacity) != 0 && (capacity) != ACPI_BATTERY_VALUE_UNKNOWN) @@ -44,10 +42,6 @@ #define ACPI_BATTERY_STATE_CHARGING 0x2 #define ACPI_BATTERY_STATE_CRITICAL 0x4 -#define _COMPONENT ACPI_BATTERY_COMPONENT - -ACPI_MODULE_NAME("battery"); - MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_AUTHOR("Alexey Starikovskiy "); MODULE_DESCRIPTION("ACPI Battery Driver"); @@ -466,7 +460,8 @@ static int extract_package(struct acpi_b static int acpi_battery_get_status(struct acpi_battery *battery) { if (acpi_bus_get_status(battery->device)) { - ACPI_EXCEPTION((AE_INFO, AE_ERROR, "Evaluating _STA")); + acpi_handle_info(battery->device->handle, + "_STA evaluation failed\n"); return -ENODEV; } return 0; @@ -535,8 +530,10 @@ static int acpi_battery_get_info(struct mutex_unlock(&battery->lock); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating %s", - use_bix ? "_BIX":"_BIF")); + acpi_handle_info(battery->device->handle, + "%s evaluation failed: %s\n", + use_bix ?"_BIX":"_BIF", + acpi_format_exception(status)); } else { result = extract_battery_info(use_bix, battery, @@ -573,7 +570,9 @@ static int acpi_battery_get_state(struct mutex_unlock(&battery->lock); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); + acpi_handle_info(battery->device->handle, + "_BST evaluation failed: %s", + acpi_format_exception(status)); return -ENODEV; } @@ -625,7 +624,9 @@ static int acpi_battery_set_alarm(struct if (ACPI_FAILURE(status)) return -ENODEV; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", battery->alarm)); + acpi_handle_debug(battery->device->handle, "Alarm set to %d\n", + battery->alarm); + return 0; } @@ -1201,7 +1202,7 @@ static int acpi_battery_add(struct acpi_ if (result) goto fail; - pr_info(PREFIX "%s Slot [%s] (battery %s)\n", + pr_info("%s Slot [%s] (battery %s)\n", ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), device->status.battery_present ? "present" : "absent"); @@ -1282,7 +1283,7 @@ static void __init acpi_battery_init_asy if (battery_check_pmic) { for (i = 0; i < ARRAY_SIZE(acpi_battery_blacklist); i++) if (acpi_dev_present(acpi_battery_blacklist[i], "1", -1)) { - pr_info(PREFIX ACPI_BATTERY_DEVICE_NAME + pr_info(ACPI_BATTERY_DEVICE_NAME ": found native %s PMIC, not loading\n", acpi_battery_blacklist[i]); return; Index: linux-pm/Documentation/firmware-guide/acpi/debug.rst =================================================================== --- linux-pm.orig/Documentation/firmware-guide/acpi/debug.rst +++ linux-pm/Documentation/firmware-guide/acpi/debug.rst @@ -52,7 +52,6 @@ shows the supported mask values, current ACPI_CA_DISASSEMBLER 0x00000800 ACPI_COMPILER 0x00001000 ACPI_TOOLS 0x00002000 - ACPI_BATTERY_COMPONENT 0x00040000 ACPI_BUTTON_COMPONENT 0x00080000 ACPI_SBS_COMPONENT 0x00100000 ACPI_FAN_COMPONENT 0x00200000 Index: linux-pm/drivers/acpi/sysfs.c =================================================================== --- linux-pm.orig/drivers/acpi/sysfs.c +++ linux-pm/drivers/acpi/sysfs.c @@ -52,7 +52,6 @@ static const struct acpi_dlayer acpi_deb ACPI_DEBUG_INIT(ACPI_COMPILER), ACPI_DEBUG_INIT(ACPI_TOOLS), - ACPI_DEBUG_INIT(ACPI_BATTERY_COMPONENT), ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT), ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), Index: linux-pm/include/acpi/acpi_drivers.h =================================================================== --- linux-pm.orig/include/acpi/acpi_drivers.h +++ linux-pm/include/acpi/acpi_drivers.h @@ -15,7 +15,6 @@ * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst * if you add to this list. */ -#define ACPI_BATTERY_COMPONENT 0x00040000 #define ACPI_BUTTON_COMPONENT 0x00080000 #define ACPI_SBS_COMPONENT 0x00100000 #define ACPI_FAN_COMPONENT 0x00200000 From patchwork Mon Feb 1 18:17:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 374429 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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham 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 0B1F6C43381 for ; Mon, 1 Feb 2021 18:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D47AA64EC2 for ; Mon, 1 Feb 2021 18:24:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232331AbhBASYR (ORCPT ); Mon, 1 Feb 2021 13:24:17 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:64980 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbhBASVw (ORCPT ); Mon, 1 Feb 2021 13:21:52 -0500 Received: from 89-64-80-124.dynamic.chello.pl (89.64.80.124) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.537) id 1bf23045069b3a30; Mon, 1 Feb 2021 19:20:25 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , "Rafael J. Wysocki" , Zhang Rui , Hans de Goede , Erik Kaneda , Joe Perches Subject: [PATCH v1 3/5] ACPI: button: Clean up printing messages Date: Mon, 01 Feb 2021 19:17:14 +0100 Message-ID: <1937980.yb3vrEXCsZ@kreacher> In-Reply-To: <2367702.B5bJTmGzJm@kreacher> References: <2367702.B5bJTmGzJm@kreacher> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafael J. Wysocki Replace the ACPI_DEBUG_PRINT() instance in button.c with an acpi_handle_debug() call, drop the _COMPONENT and ACPI_MODULE_NAME() definitions that are not used any more, drop the no longer needed ACPI_BUTTON_COMPONENT definition from the headers and update the documentation accordingly. While at it, replace the direct printk() invocations with pr_info() (that changes the excessive log level for some of them too) and drop the unneeded PREFIX sybmbol definition from battery.c. Signed-off-by: Rafael J. Wysocki --- Documentation/firmware-guide/acpi/debug.rst | 1 - drivers/acpi/button.c | 15 +++++---------- drivers/acpi/sysfs.c | 1 - include/acpi/acpi_drivers.h | 1 - 4 files changed, 5 insertions(+), 13 deletions(-) Index: linux-pm/drivers/acpi/button.c =================================================================== --- linux-pm.orig/drivers/acpi/button.c +++ linux-pm/drivers/acpi/button.c @@ -21,8 +21,6 @@ #include #include -#define PREFIX "ACPI: " - #define ACPI_BUTTON_CLASS "button" #define ACPI_BUTTON_FILE_STATE "state" #define ACPI_BUTTON_TYPE_UNKNOWN 0x00 @@ -54,9 +52,6 @@ static const char * const lid_init_state [ACPI_BUTTON_LID_INIT_DISABLED] = "disabled", }; -#define _COMPONENT ACPI_BUTTON_COMPONENT -ACPI_MODULE_NAME("button"); - MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Button Driver"); MODULE_LICENSE("GPL"); @@ -285,7 +280,7 @@ static int acpi_button_add_fs(struct acp return 0; if (acpi_button_dir || acpi_lid_dir) { - printk(KERN_ERR PREFIX "More than one Lid device found!\n"); + pr_info("More than one Lid device found!\n"); return -EEXIST; } @@ -434,8 +429,8 @@ static void acpi_button_notify(struct ac } break; default: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Unsupported event [0x%x]\n", event)); + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", + event); break; } } @@ -523,7 +518,7 @@ static int acpi_button_add(struct acpi_d ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); input->open = acpi_lid_input_open; } else { - printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid); + pr_info("Unsupported hid [%s]\n", hid); error = -ENODEV; goto err_free_input; } @@ -567,7 +562,7 @@ static int acpi_button_add(struct acpi_d } device_init_wakeup(&device->dev, true); - printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); + pr_info("%s [%s]\n", name, acpi_device_bid(device)); return 0; err_remove_fs: Index: linux-pm/Documentation/firmware-guide/acpi/debug.rst =================================================================== --- linux-pm.orig/Documentation/firmware-guide/acpi/debug.rst +++ linux-pm/Documentation/firmware-guide/acpi/debug.rst @@ -52,7 +52,6 @@ shows the supported mask values, current ACPI_CA_DISASSEMBLER 0x00000800 ACPI_COMPILER 0x00001000 ACPI_TOOLS 0x00002000 - ACPI_BUTTON_COMPONENT 0x00080000 ACPI_SBS_COMPONENT 0x00100000 ACPI_FAN_COMPONENT 0x00200000 ACPI_PCI_COMPONENT 0x00400000 Index: linux-pm/drivers/acpi/sysfs.c =================================================================== --- linux-pm.orig/drivers/acpi/sysfs.c +++ linux-pm/drivers/acpi/sysfs.c @@ -52,7 +52,6 @@ static const struct acpi_dlayer acpi_deb ACPI_DEBUG_INIT(ACPI_COMPILER), ACPI_DEBUG_INIT(ACPI_TOOLS), - ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT), ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT), Index: linux-pm/include/acpi/acpi_drivers.h =================================================================== --- linux-pm.orig/include/acpi/acpi_drivers.h +++ linux-pm/include/acpi/acpi_drivers.h @@ -15,7 +15,6 @@ * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst * if you add to this list. */ -#define ACPI_BUTTON_COMPONENT 0x00080000 #define ACPI_SBS_COMPONENT 0x00100000 #define ACPI_FAN_COMPONENT 0x00200000 #define ACPI_PCI_COMPONENT 0x00400000 From patchwork Mon Feb 1 18:19:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 374428 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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 47AEEC433DB for ; Mon, 1 Feb 2021 18:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1363664EA0 for ; Mon, 1 Feb 2021 18:25:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232733AbhBASZ3 (ORCPT ); Mon, 1 Feb 2021 13:25:29 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:52884 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232658AbhBASVX (ORCPT ); Mon, 1 Feb 2021 13:21:23 -0500 Received: from 89-64-80-124.dynamic.chello.pl (89.64.80.124) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.537) id 1442e88330b5154c; Mon, 1 Feb 2021 19:20:22 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , "Rafael J. Wysocki" , Zhang Rui , Hans de Goede , Erik Kaneda , Joe Perches Subject: [PATCH v1 5/5] ACPI: thermal: Clean up printing messages Date: Mon, 01 Feb 2021 19:19:21 +0100 Message-ID: <2844446.tJ1DJ623rE@kreacher> In-Reply-To: <2367702.B5bJTmGzJm@kreacher> References: <2367702.B5bJTmGzJm@kreacher> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Rafael J. Wysocki Replace the ACPI_DEBUG_PRINT() instances in thermal.c with acpi_handle_debug() calls and modify the ACPI_THERMAL_TRIPS_EXCEPTION() macro in there to use acpi_handle_info() internally. Drop the _COMPONENT and ACPI_MODULE_NAME() definitions that are not used any more from thermal.c, drop the no longer needed ACPI_THERMAL_COMPONENT definition from the headers and update the documentation accordingly. While at it, add a pr_fmt() definition to thermal.c, drop the PREFIX definition from there and replace some pr_warn() calls with pr_info() or acpi_handle_info(). Signed-off-by: Rafael J. Wysocki --- Documentation/firmware-guide/acpi/debug.rst | 1 drivers/acpi/sysfs.c | 1 drivers/acpi/thermal.c | 87 +++++++++++++--------------- include/acpi/acpi_drivers.h | 1 4 files changed, 43 insertions(+), 47 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -13,6 +13,8 @@ * concepts of 'multiple limiters', upper/lower limits, etc. */ +#define pr_fmt(fmt) "ACPI: thermal: " fmt + #include #include #include @@ -29,8 +31,6 @@ #include #include -#define PREFIX "ACPI: " - #define ACPI_THERMAL_CLASS "thermal_zone" #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" #define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 @@ -43,9 +43,6 @@ #define ACPI_THERMAL_MAX_ACTIVE 10 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 -#define _COMPONENT ACPI_THERMAL_COMPONENT -ACPI_MODULE_NAME("thermal"); - MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); MODULE_LICENSE("GPL"); @@ -197,8 +194,9 @@ static int acpi_thermal_get_temperature( return -ENODEV; tz->temperature = tmp; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", - tz->temperature)); + + acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n", + tz->temperature); return 0; } @@ -216,8 +214,8 @@ static int acpi_thermal_get_polling_freq return -ENODEV; tz->polling_frequency = tmp; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", - tz->polling_frequency)); + acpi_handle_debug(tz->device->handle, "Polling frequency is %lu dS\n", + tz->polling_frequency); return 0; } @@ -254,12 +252,12 @@ static int acpi_thermal_set_cooling_mode * 2.TODO: Devices listed in _PSL, _ALx, _TZD may change. * We need to re-bind the cooling devices of a thermal zone when this occurs. */ -#define ACPI_THERMAL_TRIPS_EXCEPTION(flags, str) \ +#define ACPI_THERMAL_TRIPS_EXCEPTION(flags, tz, str) \ do { \ if (flags != ACPI_TRIPS_INIT) \ - ACPI_EXCEPTION((AE_INFO, AE_ERROR, \ + acpi_handle_info(tz->device->handle, \ "ACPI thermal trip point %s changed\n" \ - "Please send acpidump to linux-acpi@vger.kernel.org", str)); \ + "Please report to linux-acpi@vger.kernel.org\n", str); \ } while (0) static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) @@ -283,17 +281,17 @@ static int acpi_thermal_trips_update(str */ if (ACPI_FAILURE(status)) { tz->trips.critical.flags.valid = 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "No critical threshold\n")); + acpi_handle_debug(tz->device->handle, + "No critical threshold\n"); } else if (tmp <= 2732) { - pr_warn(FW_BUG "Invalid critical threshold (%llu)\n", + pr_info(FW_BUG "Invalid critical threshold (%llu)\n", tmp); tz->trips.critical.flags.valid = 0; } else { tz->trips.critical.flags.valid = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, + acpi_handle_debug(tz->device->handle, "Found critical threshold [%lu]\n", - tz->trips.critical.temperature)); + tz->trips.critical.temperature); } if (tz->trips.critical.flags.valid == 1) { if (crt == -1) { @@ -305,8 +303,8 @@ static int acpi_thermal_trips_update(str * Allow override critical threshold */ if (crt_k > tz->trips.critical.temperature) - pr_warn(PREFIX "Critical threshold %d C\n", - crt); + pr_info("Critical threshold %d C\n", crt); + tz->trips.critical.temperature = crt_k; } } @@ -318,14 +316,14 @@ static int acpi_thermal_trips_update(str "_HOT", NULL, &tmp); if (ACPI_FAILURE(status)) { tz->trips.hot.flags.valid = 0; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "No hot threshold\n")); + acpi_handle_debug(tz->device->handle, + "No hot threshold\n"); } else { tz->trips.hot.temperature = tmp; tz->trips.hot.flags.valid = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Found hot threshold [%lu]\n", - tz->trips.hot.temperature)); + acpi_handle_debug(tz->device->handle, + "Found hot threshold [%lu]\n", + tz->trips.hot.temperature); } } @@ -378,7 +376,8 @@ static int acpi_thermal_trips_update(str status = acpi_evaluate_reference(tz->device->handle, "_PSL", NULL, &devices); if (ACPI_FAILURE(status)) { - pr_warn(PREFIX "Invalid passive threshold\n"); + acpi_handle_info(tz->device->handle, + "Invalid passive threshold\n"); tz->trips.passive.flags.valid = 0; } else @@ -388,12 +387,12 @@ static int acpi_thermal_trips_update(str sizeof(struct acpi_handle_list))) { memcpy(&tz->trips.passive.devices, &devices, sizeof(struct acpi_handle_list)); - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); } } if ((flag & ACPI_TRIPS_PASSIVE) || (flag & ACPI_TRIPS_DEVICES)) { if (valid != tz->trips.passive.flags.valid) - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "state"); + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "state"); } /* Active (optional) */ @@ -440,8 +439,8 @@ static int acpi_thermal_trips_update(str status = acpi_evaluate_reference(tz->device->handle, name, NULL, &devices); if (ACPI_FAILURE(status)) { - pr_warn(PREFIX "Invalid active%d threshold\n", - i); + acpi_handle_info(tz->device->handle, + "Invalid active%d threshold\n", i); tz->trips.active[i].flags.valid = 0; } else @@ -451,12 +450,12 @@ static int acpi_thermal_trips_update(str sizeof(struct acpi_handle_list))) { memcpy(&tz->trips.active[i].devices, &devices, sizeof(struct acpi_handle_list)); - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); } } if ((flag & ACPI_TRIPS_ACTIVE) || (flag & ACPI_TRIPS_DEVICES)) if (valid != tz->trips.active[i].flags.valid) - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "state"); + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "state"); if (!tz->trips.active[i].flags.valid) break; @@ -469,7 +468,7 @@ static int acpi_thermal_trips_update(str if (ACPI_SUCCESS(status) && memcmp(&tz->devices, &devices, sizeof(devices))) { tz->devices = devices; - ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); + ACPI_THERMAL_TRIPS_EXCEPTION(flag, tz, "device"); } } @@ -925,8 +924,8 @@ static void acpi_thermal_notify(struct a dev_name(&device->dev), event, 0); break; default: - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Unsupported event [0x%x]\n", event)); + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", + event); break; } } @@ -1074,7 +1073,7 @@ static int acpi_thermal_add(struct acpi_ mutex_init(&tz->thermal_check_lock); INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); - pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), + pr_info("%s [%s] (%ld C)\n", acpi_device_name(device), acpi_device_bid(device), deci_kelvin_to_celsius(tz->temperature)); goto end; @@ -1146,24 +1145,24 @@ static int acpi_thermal_resume(struct de static int thermal_act(const struct dmi_system_id *d) { if (act == 0) { - pr_notice(PREFIX "%s detected: " - "disabling all active thermal trip points\n", d->ident); + pr_notice("%s detected: disabling all active thermal trip points\n", + d->ident); act = -1; } return 0; } static int thermal_nocrt(const struct dmi_system_id *d) { - pr_notice(PREFIX "%s detected: " - "disabling all critical thermal trip point actions.\n", d->ident); + pr_notice("%s detected: disabling all critical thermal trip point actions.\n", + d->ident); nocrt = 1; return 0; } static int thermal_tzp(const struct dmi_system_id *d) { if (tzp == 0) { - pr_notice(PREFIX "%s detected: " - "enabling thermal zone polling\n", d->ident); + pr_notice("%s detected: enabling thermal zone polling\n", + d->ident); tzp = 300; /* 300 dS = 30 Seconds */ } return 0; @@ -1171,8 +1170,8 @@ static int thermal_tzp(const struct dmi_ static int thermal_psv(const struct dmi_system_id *d) { if (psv == 0) { - pr_notice(PREFIX "%s detected: " - "disabling all passive thermal trip points\n", d->ident); + pr_notice("%s detected: disabling all passive thermal trip points\n", + d->ident); psv = -1; } return 0; @@ -1225,7 +1224,7 @@ static int __init acpi_thermal_init(void dmi_check_system(thermal_dmi_table); if (off) { - pr_notice(PREFIX "thermal control disabled\n"); + pr_notice("thermal control disabled\n"); return -ENODEV; } Index: linux-pm/Documentation/firmware-guide/acpi/debug.rst =================================================================== --- linux-pm.orig/Documentation/firmware-guide/acpi/debug.rst +++ linux-pm/Documentation/firmware-guide/acpi/debug.rst @@ -57,7 +57,6 @@ shows the supported mask values, current ACPI_PCI_COMPONENT 0x00400000 ACPI_CONTAINER_COMPONENT 0x01000000 ACPI_SYSTEM_COMPONENT 0x02000000 - ACPI_THERMAL_COMPONENT 0x04000000 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 ACPI_PROCESSOR_COMPONENT 0x20000000 Index: linux-pm/drivers/acpi/sysfs.c =================================================================== --- linux-pm.orig/drivers/acpi/sysfs.c +++ linux-pm/drivers/acpi/sysfs.c @@ -57,7 +57,6 @@ static const struct acpi_dlayer acpi_deb ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT), ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), - ACPI_DEBUG_INIT(ACPI_THERMAL_COMPONENT), ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT), }; Index: linux-pm/include/acpi/acpi_drivers.h =================================================================== --- linux-pm.orig/include/acpi/acpi_drivers.h +++ linux-pm/include/acpi/acpi_drivers.h @@ -20,7 +20,6 @@ #define ACPI_PCI_COMPONENT 0x00400000 #define ACPI_CONTAINER_COMPONENT 0x01000000 #define ACPI_SYSTEM_COMPONENT 0x02000000 -#define ACPI_THERMAL_COMPONENT 0x04000000 #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 #define ACPI_PROCESSOR_COMPONENT 0x20000000