Index | Thread | Search

From:
Marcus Glocker <marcus@nazgul.ch>
Subject:
Re: Thinkpad t410 does not reboot properly
To:
Mark Kettenis <mark.kettenis@xs4all.nl>
Cc:
acamari@verlet.org, wai@roquesor.com, tech@openbsd.org
Date:
Sun, 9 Jun 2024 23:33:49 +0200

Download raw body.

Thread
On Sun, Jun 09, 2024 at 08:12:21PM +0200, Mark Kettenis wrote:

> > Date: Sun, 09 Jun 2024 20:02:11 +0200
> > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > 
> > > 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.
> 
> Wrong diff.  This one actually builds:
> 
> 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:04:01 -0000
> @@ -26,6 +26,7 @@
>  #include <sys/signalvar.h>
>  #include <sys/proc.h>
>  #include <sys/kthread.h>
> +#include <sys/reboot.h>
>  #include <sys/sched.h>
>  
>  #include <machine/conf.h>
> @@ -726,8 +727,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_POWERDOWN) {
> +					defaultstate = PCI_PMCSR_STATE_D3;
> +					state = pdev->_s0w;
> +				}
>  				break;
>  			case ACPI_STATE_S3:
>  				defaultstate = PCI_PMCSR_STATE_D3;
> 

I have regression tested the diff on my go4.  Works for me.

ok mglocker@