Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2006 21:42:10 +0100
From:      Manfred Lotz <manfred.lotz@arcor.de>
To:        Nate Lawson <nate@root.org>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: suspend/resume event
Message-ID:  <20060131214210.81c53b6e.manfred.lotz@arcor.de>
In-Reply-To: <43D9201B.3010403@root.org>
References:  <20060120200410.a05870c1.manfred.lotz@arcor.de> <43D30F0F.3090703@root.org> <20060126143040.a6b1f796.manfred.lotz@arcor.de> <43D9201B.3010403@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26 Jan 2006 11:16:43 -0800
Nate Lawson <nate@root.org> wrote:

> Manfred Lotz wrote:
> > On Sat, 21 Jan 2006 20:50:23 -0800
> > Nate Lawson <nate@root.org> wrote:
> >=20
> >=20
> >>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=3DS3)
> >>>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";
> >>};
> >>
> >=20
> >=20
> > 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
> > =B4't even boot with ACPI. It stumbles over acd0 where it is simply
> > hanging with timeout stuff or so.
> >=20
> > Could I possible copy some src files to my 6.0 system and rebuild a
> > kernel in order to test it?
>=20
> You can just download the patch and apply it to 6.0.  It's only one
> file:
>=20
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/subr_bus.c.diff?r1=3Dt=
ext&tr1=3D1.189&r2=3Dtext&tr2=3D1.190
>=20

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.=20

Here's what I tested:

1. hw.acpi.sleep_button_state=3DS3 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=3D0xc800ffc0, gen=3D1,
CYCLEMASTER m ode
Jan 31 21:21:04 hermes kernel: firewire0: 1 nodes, maxhop <=3D 0, cable
IRM =3D 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=3DS3 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=3D0xc800ffc0, gen=3D1,
CYCLEMASTER m ode
Jan 31 21:23:21 hermes kernel: firewire0: 1 nodes, maxhop <=3D 0, cable
IRM =3D 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=3DNONE 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=3D0xc800ffc0, gen=3D1,
CYCLEMASTER m ode
Jan 31 21:28:18 hermes kernel: firewire0: 1 nodes, maxhop <=3D 0, cable
IRM =3D 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.,



--=20
Manfred



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060131214210.81c53b6e.manfred.lotz>