Adventure into S3 state and back

Garrett Cooper yanegomi at gmail.com
Sun Nov 13 20:10:25 UTC 2011


On Sun, Nov 13, 2011 at 5:29 AM,  <rank1seeker at gmail.com> wrote:
> ----- Original Message -----
> From: Lars Engels <lars.engels at 0x20.net>
> To: rank1seeker at gmail.com
> Cc: pyunyh at gmail.com, hackers at freebsd.org, freebsd-acpi at freebsd.org
> Date: Sun, 13 Nov 2011 10:48:10 +0100
> Subject: Re: Adventure into S3 state and back
>
>> On Sat, Nov 12, 2011 at 03:41:49PM +0100, rank1seeker at gmail.com wrote:
>> > ----- Original Message -----
>> > From: YongHyeon PYUN <pyunyh at gmail.com>
>> > To: rank1seeker at gmail.com
>> > Cc: hackers at freebsd.org, freebsd-acpi at freebsd.org
>> > Date: Fri, 11 Nov 2011 16:27:27 -0800
>> > Subject: Re: Adventure into S3 state and back
>> >
>> > > On Thu, Nov 10, 2011 at 07:29:48PM +0100, rank1seeker at gmail.com wrote:
>> > > > 8.2-p4 RELEASE amd64
>> > > >
>> > > > I've built a custom kernel, only with drivers, that I need
>> > > > After resuming from S3 ...
>> > > >
>> > > > I hit:
>> > > > # ifconfig
>> > > > and all hells breaks loose:
>> > > > ----
>> > > > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff)
>> > > >         media: Ethernet autoselect
>> > > >         status: no carrier
>> > > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 0, val 0xffffffff)
>> > > > ugen3.2: <Logitech> at usbus3 (disconnected)
>> > > > ukbd0: at uhub3, port 1, addr 2 (disconnected)
>> > > > ums0: at uhub3, port 1, addr 2 (disconnected)
>> > > > uhid0: at uhub3, port 1, addr 2 (disconnected)
>> > > > bge0: PHY read timed out (phy 1, reg 4, val 0xffffffff)
>> > > > ugen3.2: <Logitech> at usbus3
>> > > > ukbd0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 2>
> on
>> > usbus3
>> > > > kbd2 at ukbd0
>> > > > ums0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 2> on
>> > usbus3
>> > > > ums0: 16 buttons and [XYZT] coordinates ID=2
>> > > > uhid0: <Logitech USB Receiver, class 0/0, rev 2.00/12.01, addr 2>
> on
>> > usbus3
>> > > > bge0: PHY read timed out (phy 1, reg 5, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 10, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 25, val 0xffffffff)
>> > > > pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33152
>> > > > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>> > > >         options=3<RXCSUM,TXCSUM>
>> > > >         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
>> > > >         inet6 ::1 prefixlen 128
>> > > >         inet 127.0.0.1 netmask 0xff000000
>> > > >         nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
>> > > > cruiser# ifconfig
>> > > > bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>> > > >
>> >
> options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
>> > > >         ether 00:21:70:70:01:df
>> > > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff)
>> > > > bge0: PHY read timed out (phy 1, reg 1, val 0xffffffff)
>> > > >
>> > > > ... ... ... <You get the point>
>> > >
>> > > Known issue. kern/136876.
>> > > Mobile bge(4) controllers seem to have this issue.
>> >
>> > I can see this has been reported, when 8.0-BETA1 was released.
>> > Now is almost 8.3 out and problem is still present
>> >
>> > > > ----
>> > > >
>> > > > So, taking into account:
>> > > > "A common problem with suspend/resume is that many device drivers
> do
>> > not save, restore, or reinitialize their firmware, registers, or device
>> > memory properly."
>> > > >
>> > > > Next step was to get rid of 'bge' device from my KERNCONF and
> recompile
>> > it.
>> > > > Voila! S3 works!
>> > > >
>> > > > But another, mouse problem, didn't go away!
>> > > > In 9 out of 10 cases, mouse doesn't resume.
>> > > > As it is USB mouse, I've did:
>> > > >
>> > > > # camcontrol rescan all
>> > > >     didn't help
>> > > >
>> > > > I've also tried adding into loader.conf and nada:
>> > > > ---
>> > > > hint.psm.0.flags="0x3000"
>> > > > ---
>> > > > But i think it is PS/2 related
>> > > >
>> > > > What works 100% for a mouse is to unplug and then plug back it's
> USB
>> > receiver
>> > > >
>> > > > This is Dell D830 laptop
>> > > >
>> >
>> > How do I solve mouse issue?
>> > It is annoying to unplug and then plug back it's USB receiver, each
> time.
>>
>> stop moused in rc.suspend and start it in rc.resume.
>>
>
> Thanks, but it isn't that.
> Even with it, mouse works on random, after resume from S3.
>
> But what I did figured out, looking kernel msgs on console, just after
> resume, is that IF I see >1 of this:
> --
> uhub_reattach_port: port 1 reset failed, error=USB_ERR_TIMEOUT
> uhub_reattach_port: device problem (USB_ERR_TIMEOUT), disabling port 1
> --
>
> Mouse won't work unless I unplug/plug it's USB receiver

You may need to kldunload and kldload ums(4) in order to get things to
work (which suggests a driver bug in the newbus suspend and resume
functions).

FWIW I only need to do /etc/rc.d/moused restart in rc.resume to get
things to work, but I'm using psm(4). The mouse pointer is kind of
braindead for a second, but then it comes to life and does the right
thing.

So, bottom line is that there's something that gets out of sync with
some mice drivers and moused, and mice driver bugs or bugs with moused
might be involved.

HTH,
-Garrett


More information about the freebsd-hackers mailing list