Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

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

Re: suspend/resume event



On Thu, 26 Jan 2006 11:16:43 -0800
Nate Lawson <nate@xxxxxxxx> wrote:

> Manfred Lotz wrote:
> > On Sat, 21 Jan 2006 20:50:23 -0800
> > Nate Lawson <nate@xxxxxxxx> wrote:
> > 
> > 
> >>Manfred Lotz wrote:
> >>
> >>>Hi there,
> >>>With my Samsung X20 1730 suspend /resume works fine when doing
> >>>acpiconf -s 3. I added /etc/rc.d/moused restart in /etc/rc.resume
> >>>and the touchpad mouse gets awake after resuming. That's great.
> >>>
> >>>However when closing the lid (I set hw.acpi.lid_switch_state=S3)
> >>>and then pressing the power button although suspend/resume works
> >>>fine the mouse won't get restarted. This means /etc/rc.resume and
> >>>presumably /etc/rc.suspend won't get called in this case.
> >>>
> >>>Same happen when pressing Fn-ESC the key for suspend.
> >>>
> >>>How can I make sure /etc/rc.suspend as well as /etc/rc.resuem gets
> >>>called in the "non-acpiconf" cases?
> >>
> >>Ok, I committed code to -current to provide a resume event and will
> >>mfc in a week or two.  You can catch it in devd.conf with:
> >>
> >>notify 10 {
> >>         match "system"          "kern";
> >>         match "subsystem"       "power";
> >>	match "type"		"resume";
> >>         action "SOME SCRIPT";
> >>};
> >>
> > 
> > 
> > Well, I had problems testing it. I actually have a 6.0 STABLE on my
> > Samsung and installed a small 7.0 current system. However, it didn
> > ´'t even boot with ACPI. It stumbles over acd0 where it is simply
> > hanging with timeout stuff or so.
> > 
> > Could I possible copy some src files to my 6.0 system and rebuild a
> > kernel in order to test it?
> 
> You can just download the patch and apply it to 6.0.  It's only one
> file:
> 
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/subr_bus.c.diff?r1=text&tr1=1.189&r2=text&tr2=1.190
> 

Hmmh. I got compile errors then. However with hw.ata.atapi_dma set to 0
I could boot the 7.0 system and test it.

First of all: Your code did work, i.e. the kern/power/resume event gets
triggered and I could call a script.

However, what confuses me is that the power button triggers
the /etc/rc.resume in some cases (2. and 3. below) without using your
code. 

Here's what I tested:

1. hw.acpi.sleep_button_state=S3 and no Button event in /etc/devd.conf

When suspending (Fn-ESC) and resuming (Power button)
neither /etc/rc.suspend nor /etc/rc.resume gets called.

Jan 31 21:20:57 hermes kernel: fwohci0: fwohci_pci_suspend
Jan 31 21:21:04 hermes kernel: fwohci0: Phy 1394a available S400, 2
ports. Jan 31 21:21:04 hermes kernel: fwohci0: Link S400, max_rec 2048
bytes. Jan 31 21:21:04 hermes kernel: fwohci0: Initiate bus reset
Jan 31 21:21:04 hermes kernel: wakeup from sleeping state (slept
00:00:09) Jan 31 21:21:04 hermes kernel: fwohci0: BUS reset
Jan 31 21:21:04 hermes kernel: fwohci0: node_id=0xc800ffc0, gen=1,
CYCLEMASTER m ode
Jan 31 21:21:04 hermes kernel: firewire0: 1 nodes, maxhop <= 0, cable
IRM = 0 (m e)
Jan 31 21:21:04 hermes kernel: firewire0: bus manager 0 (me)
Jan 31 21:21:04 hermes kernel: fwohci0: unrecoverable error



2. hw.acpi.sleep_button_state=S3 and Button event in /etc/devd.conf is
activated

Here both /etc/rc.suspend and /etc/rc.resume gets
called. /et/rc.suspend gets called via devd.conf action.


Jan 31 21:23:13 hermes kernel: fwohci0: fwohci_pci_suspend
Jan 31 21:23:21 hermes kernel: fwohci0: Phy 1394a available S400, 2
ports. Jan 31 21:23:21 hermes kernel: fwohci0: Link S400, max_rec 2048
bytes. Jan 31 21:23:21 hermes kernel: fwohci0: Initiate bus reset
Jan 31 21:23:21 hermes kernel: wakeup from sleeping state (slept
00:00:09) Jan 31 21:23:21 hermes kernel: fwohci0: BUS reset
Jan 31 21:23:21 hermes kernel: fwohci0: node_id=0xc800ffc0, gen=1,
CYCLEMASTER m ode
Jan 31 21:23:21 hermes kernel: firewire0: 1 nodes, maxhop <= 0, cable
IRM = 0 (m e)
Jan 31 21:23:21 hermes kernel: firewire0: bus manager 0 (me)
Jan 31 21:23:21 hermes kernel: fwohci0: unrecoverable error
Jan 31 21:23:13 hermes devd_event:: Button: 0x01
Jan 31 21:23:21 hermes dhclient[1333]: short write: wanted 20 got 0
bytes Jan 31 21:23:21 hermes dhclient[1333]: exiting.
Jan 31 21:23:21 hermes acpi: suspend at 20060131 21:23:21
Jan 31 21:23:21 hermes kernel: acpi: suspend request ignored (not ready
yet) Jan 31 21:23:21 hermes acpi: resumed at 20060131 21:23:21
Jan 31 21:23:27 hermes dhclient: New IP Address (iwi0): 192.168.1.142
Jan 31 21:23:27 hermes dhclient: New Subnet Mask (iwi0): 255.255.255.0
Jan 31 21:23:27 hermes dhclient: New Broadcast Address (iwi0):
192.168.1.255 Jan 31 21:23:27 hermes dhclient: New Routers (iwi0):
192.168.1.1




3.  hw.acpi.sleep_button_state=NONE and Button event in /etc/devd.conf
is activated

Also both /etc/rc.suspend and /etc/rc.resume gets
called. /et/rc.suspend gets called via devd.conf action.

Jan 31 21:27:42 hermes devd_event:: Button: 0x01
Jan 31 21:27:44 hermes dhclient[1470]: connection closed
Jan 31 21:27:44 hermes dhclient[1470]: exiting.
Jan 31 21:27:44 hermes acpi: suspend at 20060131 21:27:44
Jan 31 21:28:18 hermes kernel: fwohci0: fwohci_pci_suspend
Jan 31 21:28:18 hermes kernel: fwohci0: Phy 1394a available S400, 2
ports. Jan 31 21:28:18 hermes kernel: fwohci0: Link S400, max_rec 2048
bytes. Jan 31 21:28:18 hermes kernel: fwohci0: Initiate bus reset
Jan 31 21:28:18 hermes kernel: wakeup from sleeping state (slept
00:00:32) Jan 31 21:28:18 hermes kernel: fwohci0: BUS reset
Jan 31 21:28:18 hermes kernel: fwohci0: node_id=0xc800ffc0, gen=1,
CYCLEMASTER m ode
Jan 31 21:28:18 hermes kernel: firewire0: 1 nodes, maxhop <= 0, cable
IRM = 0 (m e)
Jan 31 21:28:18 hermes kernel: firewire0: bus manager 0 (me)
Jan 31 21:28:18 hermes kernel: fwohci0: unrecoverable error
Jan 31 21:28:18 hermes acpi: resumed at 20060131 21:28:18
Jan 31 21:28:28 hermes dhclient: New IP Address (iwi0): 192.168.1.142
Jan 31 21:28:28 hermes dhclient: New Subnet Mask (iwi0): 255.255.255.0
Jan 31 21:28:28 hermes dhclient: New Broadcast Address (iwi0):
192.168.1.255 Jan 31 21:28:28 hermes dhclient: New Routers (iwi0):
192.168.1.1



3. seems to be the best option.,



-- 
Manfred