Subject: Re: 'shutdown -p now' power down broken on i386/-current (?)
To: Jared D. McNeill <jmcneill@invisible.ca>
From: Markus W Kilbinger <mk@kilbi.de>
List: current-users
Date: 09/03/2007 11:29:22
>>>>> "Jared" == Jared D McNeill <jmcneill@invisible.ca> writes:

    >> Current -current kernels are no capable to power down my dual
    >> cpu i386 box. Last message displayed after syncing disks is:
    >>
    >> acpi: Entering state 5
    >>
    >> Then the machine hangs and stays powered on.
    >>
    >> Does anybody else see this?

    Jared> Has this always been a case? Can you try a kernel from the
    Jared> jmcneill-pm branch?

I tried (with todays sources):

  ACPI: kenter: 0x00003000
  Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
      2006, 2007
      The NetBSD Foundation, Inc.  All rights reserved.
  Copyright (c) 1982, 1986, 1989, 1991, 1993
      The Regents of the University of California.  All rights reserved.
  
  NetBSD 4.99.29 (QIE.MP) #1: Mon Sep  3 12:04:44 MEST 2007
          kilbi@qie:/usr/src/sys/arch/i386/compile/QIE.MP
  total memory = 1023 MB
  avail memory = 999 MB
  SMBIOS rev. 2.3 @ 0xf3ba0 (49 entries)
  System Manufacturer System Name (System Version)
  mainbus0 (root)
  cpu0 at mainbus0 apid 0: (boot processor)
  cpu0: AMD Athlon MP 2000+ (686-class), 1666.88 MHz, id 0x662
  cpu0: "AMD Athlon(TM) MP 2000+"
  cpu0: generic device class power management enabled
  cpu0: supported states: D0 D3
  cpu1 at mainbus0 apid 1: (application processor)
  cpu1: AMD Athlon MP 2000+ (686-class), 1666.73 MHz, id 0x662
  cpu1: "AMD Athlon(TM) MP 2000+"
  cpu1: generic device class power management enabled
  cpu1: supported states: D0 D3
  ioapic0 at mainbus0 apid 2
  ioapic0: generic device class power management enabled
  ioapic0: supported states: D0 D3
  acpi0 at mainbus0: Advanced Configuration and Power Interface
  acpi0: generic device class power management enabled
  acpi0: supported states: D0 D3
  [...]

, but it panics during 'shutdown -p now':

  Sep  3 12:11:50 qie shutdown: halt by root: 
  Sep  3 12:12:02 qie syslogd: Exiting on signal 15
  syncing disks... 2 done
  unmounting file systems... done
  Suspending devices: wsmouse0 uhub3 audio1 audio0 wsdisplay0 ohci2 uhub2 uhub1 uhub0 vga1 wskbd0 isa0 pci2 atabus1 atabus0 pci1 agp0 pckbd0uhidev0: at uhub3 port 2 (addr 2) disconnected
  wsmouse0 detached
  ums0 detached
  uhidev0 detached
   ppb1 ehci0 ohci1 ohci0 pcib0 ppb0 pchb0 pckbc0 npx0 pcppi0 attimer0 acpibut0 pci0 acpi0 ioapic0 cpu1panic: kernel diagnostic assertion "mutex_owned(&cpu_lock)" failed: file "../../../../kern/kern_cpu.c", line 216
  Stopped in pid 263.1 (halt) at  netbsd:cpu_Debugger+0x4:        leave
  db{1}> bt
  cpu_Debugger(c057598c,cc62da68,cc62da4c,c0433f88,0) at netbsd:cpu_Debugger+0x4
  panic(c05b5ae8,c05490d7,c055544f,c0555466,d8) at netbsd:panic+0x155
  __assert(c05490d7,c0555466,d8,c055544f,cc62daf4) at netbsd:__assert+0x39
  cpu_setonline(c1818000,0,9,1,c181fb00) at netbsd:cpu_setonline+0x13c
  cpu_power(c181fb00,1,cc62db28,c037ffc4,d) at netbsd:cpu_power+0xe1
  pnp_set_state(c181fb00,8,cc62db3c,808,cc62dc48) at netbsd:pnp_set_state+0x7f
  pnp_global_transition(8,808,cc62db6c,c0405cab,d) at netbsd:pnp_global_transition
  +0xa5
  doshutdownhooks(d,0,0,cc253000,c06332e0) at netbsd:doshutdownhooks+0x40
  cpu_reboot(808,0,0,0,0) at netbsd:cpu_reboot+0x1b
  sys_reboot(cc5ef700,cc62dc48,cc62dc68,0,cb4d076c) at netbsd:sys_reboot+0x6d
  syscall_plain() at netbsd:syscall_plain+0x156
  --- syscall (number 208) ---
  0xbbae2927:
  db{1}> reboot
  Suspending devices: uhub3 audio1 audio0 wsdisplay0 ohci2 uhub2 uhub1 uhub0 vga1 wskbd0 isa0 pci2 atabus1 atabus0 pci1 agp0 pckbd0 ppb1 ehci0 ohci1 ohci0 pcib0 ppb0 pchb0 pckbc0 npx0 pcppi0 attimer0 acpibut0 pci0 acpi0 ioapic0 cpu1 cpu0 mainbus0.
  rebooting...

-> Your branch misses some of HEAD's proceedings?

Further kernel mods/branches I can/should test?

Markus.