lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <2623493.mvXUDI8C0e@kreacher>
Date:   Wed, 10 Nov 2021 20:53:54 +0100
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Linux ACPI <linux-acpi@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Mario Limonciello <mario.limonciello@....com>,
        "Kyle D. Pelton" <kyle.d.pelton@...el.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Subject: [PATCH] ACPI: PM: Avoid removing power from unused hardware too early

From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

Commit c10383e8ddf4 ("ACPI: scan: Release PM resources blocked by
unused objects") causes power to be removed from some hardware
resources that appear to be unused too early, which leads to boot
issues on some systems.

To address this, move putting the unused ACPI device objects into
D3cold to a late initcall.

Fixes: c10383e8ddf4 ("ACPI: scan: Release PM resources blocked by unused objects")
Reported-by: Kyle D. Pelton <kyle.d.pelton@...el.com>
Tested-by: Kyle D. Pelton <kyle.d.pelton@...el.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
 drivers/acpi/scan.c |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -2559,12 +2559,6 @@ int __init acpi_scan_init(void)
 		}
 	}
 
-	/*
-	 * Make sure that power management resources are not blocked by ACPI
-	 * device objects with no users.
-	 */
-	bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused);
-
 	acpi_turn_off_unused_power_resources();
 
 	acpi_scan_initialized = true;
@@ -2574,6 +2568,22 @@ int __init acpi_scan_init(void)
 	return result;
 }
 
+static int acpi_turn_off_unused_devices(void)
+{
+	mutex_lock(&acpi_scan_lock);
+
+	/*
+	 * Make sure that power management resources are not blocked by ACPI
+	 * device objects with no users.
+	 */
+	bus_for_each_dev(&acpi_bus_type, NULL, NULL, acpi_dev_turn_off_if_unused);
+
+	mutex_unlock(&acpi_scan_lock);
+
+	return 0;
+}
+late_initcall(acpi_turn_off_unused_devices);
+
 static struct acpi_probe_entry *ape;
 static int acpi_probe_count;
 static DEFINE_MUTEX(acpi_probe_mutex);



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ