Re: [PATCH v1 1/2] ACPI: PM: Do not turn off power resources in unknown state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

My NVME drive was affected by the "turn off in unknown state" feature,
preventing my system from booting on 5.13 and above, while everything
worked fine on 5.12 and below.  BTW, I'm really grateful that 5.13 used
`dev_info` intstead of `dev_dbg`, otherwise I wouldn't have had a chance
to track this down from comparing plain `dmesg` output alone.

I cooked up a different patch (before checking here), which takes the
comment removed by the patch in
    https://marc.info/?l=linux-acpi&m=163431826227166
that _some system_ may truly need this at face value, and introduces
a command-line parameter that allows the current behavior by setting
'acpi=unknown_off', but allows my system to boot when that's omitted.

I have no idea if using a kernel parameter for such is OK or a no-no,
but I'll surely learn soon enough...

Regards,

--andrás


Alternative patch against 5.14.14 follows
==========================================================
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -30,6 +30,7 @@
 extern int acpi_use_timer_override;
 extern int acpi_fix_pin2_polarity;
 extern int acpi_disable_cmcff;
+extern int acpi_unknown_off;
 
 extern u8 acpi_sci_flags;
 extern u32 acpi_sci_override_gsi;
@@ -138,6 +139,7 @@
 #define acpi_lapic 0
 #define acpi_ioapic 0
 #define acpi_disable_cmcff 0
+#define acpi_unknown_off 0
 static inline void acpi_noirq_set(void) { }
 static inline void acpi_disable_pci(void) { }
 static inline void disable_acpi(void) { }
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -52,6 +52,7 @@
 int acpi_ioapic;
 int acpi_strict;
 int acpi_disable_cmcff;
+int acpi_unknown_off;
 
 /* ACPI SCI override configuration */
 u8 acpi_sci_flags __initdata;
@@ -1641,6 +1642,10 @@
 	/* "acpi=nocmcff" disables FF mode for corrected errors */
 	else if (strcmp(arg, "nocmcff") == 0) {
 		acpi_disable_cmcff = 1;
+	}
+	/* "acpi=unknown_off" turns off unused devices in unknown state */
+	else if (strcmp(arg, "unknown_off") == 0) {
+		acpi_unknown_off = 1;
 	} else {
 		/* Core will printk when we return error. */
 		return -EINVAL;
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -1033,6 +1033,7 @@
 		 * power resources without any users unconditionally.
 		 */
 		if (!resource->ref_count &&
+		    (acpi_unknown_off || resource->state != ACPI_POWER_RESOURCE_STATE_UNKNOWN) &&
 		    resource->state != ACPI_POWER_RESOURCE_STATE_OFF) {
 			dev_dbg(&resource->device.dev, "Turning OFF\n");
 			__acpi_power_off(resource);



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux