NetBSD-Bugs archive

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

Re: kern/42051: lid switch works only once



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

From: Makoto Fujiwara <makoto%ki.nu@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/42051: lid switch works only once
Date: Mon, 09 Mar 2015 14:16:26 +0900

 I sent the very much similar PR, which is  closed (duplication).
   http://gnats.netbsd.org/49024
 
 ( And I did further testing, too.)
 | - suspending the machine by setting machdep.sleep_state=3
 |   from command line does not break lid switch. After suspending,
 |   and resuming, the lid switch works, but only once again.
 As is written in following URL,
 I'm observing differrently.
    sysctl -w hw.acpi.sleep.state=3
 is the point not to sleep by lid_close.
 
 http://www.ki.nu/software/acpi/lid_sw.html
 ------------------------------------------
 @ lid_sw
   1. Stop powerd (see /etc/defaults/rc.conf, powerd may be "YES" by following
      lines)
         if /sbin/sysctl -q hw.acpi.root; then
                 powerd=YES
         fi
      To disable powerd on boot, you need to say following in /etc/rc.conf
         powerd= NO
 
   2. Build kernel with following debug print:
 
      Index: sys/dev/acpi/acpi_lid.c
      ===================================================================
      RCS file: /cvs/cvsroot/src/sys/dev/acpi/acpi_lid.c,v
      retrieving revision 1.43
      diff -u -r1.43 acpi_lid.c
      --- sys/dev/acpi/acpi_lid.c     16 Feb 2011 08:35:51 -0000      1.43
      +++ sys/dev/acpi/acpi_lid.c     8 Mar 2015 13:52:53 -0000
      @@ -158,7 +158,7 @@
       {
              static const int handler = OSL_NOTIFY_HANDLER;
              device_t dv = context;
      -
      +       aprint_normal("notify 0x%02X\n", notify);
              switch (notify) {
 
              case ACPI_NOTIFY_LID:
 
   3. above line is any times active whenever open and close lid.
      (Assuming powerd is not running).
   4. Then start powerd.
      It will get sleep only once.
      Another open/close lid won't give item 2 debug print anymore.
 
 @ powerd or script
 
  powerd invokes /etc/powerd/scripts/lid_switch
  Let me decide which is harmfull, powerd itself or script invoked.
  Try disabling sleep line in script. just not to issue following line
  (Have # char in the beginning the line)
 
    #       sysctl -w hw.acpi.sleep.state=3
 
  Then repeating lid open/close anytimes. Every time you do you may have
  following print out:
  (If kernel is configured with 'options ACPI_DEBUG')
 
  $dhcpd is not enabled - see rc.conf(5).
  Use the following if you wish to perform the operation:
    /etc/rc.d/dhcpd onestart
  err: /etc/powerd/scripts/lid_switch exited with status 1dispatch_dev_power: even
  t type 0
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.
  com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
          <key>driver-name</key>
          <string>acpilid0</string>
          <key>power-type</key>
          <string>pswitch</string>
          <key>powerd-event-name</key>
          <string>released</string>
          <key>powerd-script-name</key>
          <string>lid_switch</string>
  </dict>
  </plist>
  running script: /etc/powerd/scripts/lid_switch acpilid0 released
  wsconsctl: WSDISPLAYIO_PARAM_BACKLIGHT: Inappropriate ioctl for device
 
 
 @ sysctl -w is the point of problem
   1. reboot
   2. make sure powerd is not running
   3. issue following command
        sysctl -w hw.acpi.sleep.state=3
   4. run powerd
   5. close lid
 
  This procedure won't give sleep. Step 3. above is the harmful point.
 
  Last Update: Mon, 09 Mar 2015 04:51:47 GMT
 


Home | Main Index | Thread Index | Old Index