NetBSD-Bugs archive

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

Re: kern/44366: poweroff doesn't work



The following reply was made to PR kern/44366; it has been noted by GNATS.

From: Jukka Ruohonen <jruohonen%iki.fi@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: mihai.chelaru%ngnetworks.ro@localhost
Subject: Re: kern/44366: poweroff doesn't work
Date: Tue, 11 Jan 2011 22:30:37 +0200

 On Tue, Jan 11, 2011 at 07:50:05PM +0000, Mihai Chelaru wrote:
 >  Same behaviour.
 
 Okay, can you please try the next attached patch?
 
 (The acpi_enter_sleep_state() function must be called with interrupts enabled.)
 
 - Jukka.
 
 Index: sys/arch/i386/i386/machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v
 retrieving revision 1.698
 diff -u -p -r1.698 machdep.c
 --- sys/arch/i386/i386/machdep.c       12 Nov 2010 13:18:57 -0000      1.698
 +++ sys/arch/i386/i386/machdep.c       11 Jan 2011 20:27:41 -0000
 @@ -864,6 +864,7 @@ cpu_reboot(int howto, char *bootstr)
  {
        static bool syncdone = false;
        struct lwp *l;
 +      int s;
  
        l = (curlwp == NULL) ? &lwp0 : curlwp;
  
 @@ -908,7 +909,7 @@ cpu_reboot(int howto, char *bootstr)
  
        pmf_system_shutdown(boothowto);
  
 -      splhigh();
 +      s = splhigh();
  haltsys:
  
        if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
 @@ -923,6 +924,7 @@ haltsys:
                }
  #endif
  #if NACPICA > 0
 +              splx(s);
                acpi_enter_sleep_state(ACPI_STATE_S5);
  #endif
  #if NAPMBIOS > 0 && !defined(APM_NO_POWEROFF)
 Index: sys/arch/amd64/amd64/machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/amd64/amd64/machdep.c,v
 retrieving revision 1.157
 diff -u -p -r1.157 machdep.c
 --- sys/arch/amd64/amd64/machdep.c     15 Nov 2010 06:12:28 -0000      1.157
 +++ sys/arch/amd64/amd64/machdep.c     11 Jan 2011 20:27:41 -0000
 @@ -669,6 +669,7 @@ struct pcb dumppcb;
  void
  cpu_reboot(int howto, char *bootstr)
  {
 +      int s;
  
        if (cold) {
                howto |= RB_HALT;
 @@ -687,7 +688,7 @@ cpu_reboot(int howto, char *bootstr)
        }
  
        /* Disable interrupts. */
 -      splhigh();
 +      s = splhigh();
  
        /* Do a dump if requested. */
        if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
 @@ -701,6 +702,7 @@ haltsys:
          if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
  #ifndef XEN
  #if NACPICA > 0
 +              splx(s);
                acpi_enter_sleep_state(ACPI_STATE_S5);
  #endif
  #else /* XEN */
 


Home | Main Index | Thread Index | Old Index