Index | Thread | Search

From:
Mark Kettenis <mark.kettenis@xs4all.nl>
Subject:
Re: Thinkpad t410 does not reboot properly
To:
Abel Abraham Camarillo Ojeda <acamari@verlet.org>
Cc:
wai@roquesor.com, tech@openbsd.org
Date:
Sun, 09 Jun 2024 20:02:11 +0200

Download raw body.

Thread
> From: Abel Abraham Camarillo Ojeda <acamari@verlet.org>
> Date: Sun, 9 Jun 2024 05:42:32 -0600

> revision 1.430
> date: 2024/06/02 11:08:41;  author: kettenis;  state: Exp;  lines: +9 -1; 
> commitid: McNWbgdeepOyZIw5;
> Power down PCI devices in S0 as well.  Needed for suspend-to-idle.
> 
> ok mglocker@

That may very well be the diff that broke things.

Possible fix below.


Index: dev/acpi/acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.430
diff -u -p -r1.430 acpi.c
--- dev/acpi/acpi.c	2 Jun 2024 11:08:41 -0000	1.430
+++ dev/acpi/acpi.c	9 Jun 2024 18:00:48 -0000
@@ -726,8 +726,10 @@ acpi_pci_min_powerstate(pci_chipset_tag_
 		if (pdev->bus == bus && pdev->dev == dev && pdev->fun == fun) {
 			switch (acpi_softc->sc_state) {
 			case ACPI_STATE_S0:
-				defaultstate = PCI_PMCSR_STATE_D3;
-				state = pdev->_s0w;
+				if (boothowto & RB_POWRDOWN) {
+					defaultstate = PCI_PMCSR_STATE_D3;
+					state = pdev->_s0w;
+				}
 				break;
 			case ACPI_STATE_S3:
 				defaultstate = PCI_PMCSR_STATE_D3;