Re: [gentoo-user] pm-suspend problem

2015-10-14 Thread Philip Webb
151013 Daniel Frey wrote:
> On 10/13/2015 09:00 PM, Philip Webb wrote:
>> 151013 Daniel Frey wrote:
>>> On 10/13/2015 05:39 PM, Philip Webb wrote:
 but doesn't wake up when the power button or a key is pressed ;
>>> There was a kernel change some time back
>>> that disabled usb wake-up on all USB hubs.
>>> Userspace needs to explicitly enable them or device wakeup will not work.
>>> I wrote a script some time back to do that,
>>> but it can probably be done with a udev rule.
>> Don't be coy ! -- can you post your script here ?
>> what would such a udev rule look like ?
> Hah - sorry about that. Most people apparently use udev to do that.
> I wrote my script first and used it instead. I never really looked
> into udev as my script [kludge?] still works, I just tried it.
> I posted it in the Docs, Tips & Tricks forum [1] some time back
> & it's also on pastebin [2].  Use at your own risk !
> I've attached it here as well.  The forum post lists how to use it.
> Wow, 18,000 views to the forum post. I wonder if that's good or bad ?
> It requires root, so you may want to put it in /sbin/.
> Run it with no options and it'll display a usage page.
> All it does is do some searching in the /sys/devices tree
> and tries to find appropriate items to show.
> [1] https://forums.gentoo.org/viewtopic-t-933934-highlight-usbwakeup.html
> [2] http://pastebin.com/cYstsSSa

-- script snipped --

Thanks lots ! -- I looked up [1], which has useful extra advice.

However, it occurs to me that my keyboard (Sanyo 1989) is PS/2 ,
so the script will help only to enable restart via the mouse.
There's a PS/2 setting on the mobo, which I've enabled,
but might there also be something in the kernel which needs enabling ?

Lots of people seem to have problems with suspend/restart
& it seems to be somewhat random & vary with different makes of mobo,
so any further suggestions here may help others in future too.

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] pm-suspend problem

2015-10-14 Thread Mick
On Wednesday 14 Oct 2015 18:09:04 Philip Webb wrote:

> -- script snipped --
> 
> Thanks lots ! -- I looked up [1], which has useful extra advice.
> 
> However, it occurs to me that my keyboard (Sanyo 1989) is PS/2 ,
> so the script will help only to enable restart via the mouse.
> There's a PS/2 setting on the mobo, which I've enabled,
> but might there also be something in the kernel which needs enabling ?

PS/2 should just work™.  It plugs straight into the MoBo chipset IRQs (via 
LAPIC these days) and does not rely on userspace applications.


> Lots of people seem to have problems with suspend/restart
> & it seems to be somewhat random & vary with different makes of mobo,
> so any further suggestions here may help others in future too.

Yes, I've had my fair share depending on MoBos, especially older builds.  I 
even had laptops with dodgy suspend to RAM performance:  it wouldn't suspend 
at all, or it would and then not wake up properly (screen wouldn't come on 
again).

In my experience suspend to RAM could break from one kernel to another on 
buggy MoBos, or between different video card kernel drivers (for radeon at 
least).

Note: some modern MoBos have S4 disabled at the BIOS by default, to make sure 
that USB ports continue to charge mobile phones and tablets.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] pm-suspend problem

2015-10-14 Thread Daniel Frey
On 10/14/2015 11:11 AM, Mick wrote:
> 
> PS/2 should just work™.  It plugs straight into the MoBo chipset IRQs (via 
> LAPIC these days) and does not rely on userspace applications.
> 

It should but on some boards it doesn't. I specifically remember an
older ASUS board that had a jumper by the PS2 port that was defaulted to
NOT wake. You had to move that jumper, then go into the BIOS under power
options and set wake from keyboard to "space bar" in order for it to work.

I haven't had a PS2 keyboard in ages now - I don't think the motherboard
on the Intel board I have even has a PS2 port, so I didn't think of the
possibility of the PS2 keyboard not working. :-)

Dan



Re: [gentoo-user] pm-suspend problem

2015-10-13 Thread Daniel Frey
On 10/13/2015 09:00 PM, Philip Webb wrote:
> 151013 Daniel Frey wrote:
>> On 10/13/2015 05:39 PM, Philip Webb wrote:
>>> but doesn't wake up when the power button or a key is pressed ;
>>> I can power off & restart normally afterwards.
>>> 'dmesg' + 'syslog' simply show an immediate restart after the suspend.
>> There was a kernel change some time back
>> that disabled usb wake-up on all USB hubs.
>> Userspace needs to explicitly enable them or device wakeup will not work.
>> I wrote a script some time back to do that,
>> but it can probably be done with a udev rule.
> 
> Don't be coy ! -- can you post your script here ?
> what would such a udev rule look like ?
> 

Hah - sorry about that. Most people apparently use udev to do that. I
wrote my script first and used it instead. I never really looked into
udev as my script [kludge?] still works, I just tried it.

I posted it in the Docs, Tips & Tricks forum [1] some time back & it's
also on pastebin [2]. Use at your own risk! I've attached it here as
well, hopefully we're allowed to do that on this list. The forum post
lists how to use it.

Wow, 18,000 views to the forum post. I wonder if that's good or bad?

It requires root, so you may want to put it in /sbin/. Run it with no
options and it'll display a usage page. All it does is do some searching
in the /sys/devices tree and tries to find appropriate items to show.


Dan

[1] https://forums.gentoo.org/viewtopic-t-933934-highlight-usbwakeup.html

[2] http://pastebin.com/cYstsSSa




#!/bin/bash

# This script attempts to read /sys/devices/ and identify usb ports and devices
# that can be toggled to enable wakeup from sleep.
# 
# Version: 2.0
# Date written: August 20, 2012
# 
# Copyright (C) 2012  danomac @ gentoo forums
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.

# Return code documentation
#
#  1: No parameter / unknown parameter specified
#  2: Multiple actions requested, can only process one at a time
#  3: Effective user ID not root (root is required)
#
#  7: No action requested
#  8: Quiet and verbose requested at the same time! Use one or the other.
#  9: Kernel Dmesg` option requested with action other than list
#
# Internal errors:
#
# 10: toggleall() - first parameter missing (internal error)
# 11: toggleusbdevice() - first parameter not specified (internal error)
# 12: toggleusbdevice() - second parameter not specified (internal error)
# 13: toggleusbdevice() - third parameter needed but not specified! (internal 
error)


function listusbwakeup () {
# If quiet option is set, notify user it's being ignored
if $QUIET; then echo "Quiet option set; ignoring..."; echo ""; fi

# Initialize counter (to total items found later)
COUNT=0

echo "Listing USB hubs/devices and their wakeup status..."

# If verbose output is requested, switch to full detail view
if $VERBOSE
then
echo "
USB ID :: Device* :: Status
 Device full path
 Vendor :: Device Description
-"
else
echo "
USB ID:: Device* :: Status :: Device Description
"
fi

# Search for all wakeup files under /sys/devices
for i in `find /sys/devices -type f -name wakeup`;
do
# Extract the directory name where wakeup file resides
DEVDIRNAME=`dirname $i`

# Extract the actual device name (remove the power directory)
DEVNAME=`dirname $DEVDIRNAME`

# Now remove the directory path, leaving only the device's 
proper name (usb4, 4-1, etc)
DEVPROPERNAME=`basename $DEVNAME`

# Check for a product name. If none is found we most likely 
aren't interested in it.
if [ -e $DEVDIRNAME/../product ]
then
# We found one! Find other relevant information, if 
none found use a placeholder.
if [ -e $DEVDIRNAME/../product ]; then PRODUCT=`cat 
$DEVDIRNAME/../product`; else PRODUCT="No product name"; fi
if [ -e $DEVDIRNAME/../manufacturer ]; then VENDOR=`cat 
$DEVDIRNAME/../manufacturer`; else VENDOR="No vendor name"; fi
if [ -e $DEVDIRNAME/../idVendor ]; then IDVENDOR=`cat 
$DEVDIRNAME/../idVendor`; else IDVENDOR="No VendorID"; fi
if [ -e $DEVDIRNAME/../idProduct ]; then IDPRODUCT=`cat 
$DEVDIRNAME/../idProduct`; else IDPRODUCT="No 

Re: [gentoo-user] pm-suspend problem

2015-10-13 Thread Daniel Frey
On 10/13/2015 05:39 PM, Philip Webb wrote:
> but doesn't wake up when the power button or a key is pressed, as it should ;
> I can power off & restart normally afterwards.
> 'dmesg' + 'syslog' simply show an immediate restart after the suspend.

There was a kernel change some time back that disable usb wakeup on all
USB hubs. Userspace needs to explicitly enable them or device wakeup
will not work.

I wrote a script some time back to do that but it can probably be done
with a udev rule.

Dan





Re: [gentoo-user] pm-suspend problem

2015-10-13 Thread Philip Webb
151013 Daniel Frey wrote:
> On 10/13/2015 05:39 PM, Philip Webb wrote:
>> but doesn't wake up when the power button or a key is pressed ;
>> I can power off & restart normally afterwards.
>> 'dmesg' + 'syslog' simply show an immediate restart after the suspend.
> There was a kernel change some time back
> that disabled usb wake-up on all USB hubs.
> Userspace needs to explicitly enable them or device wakeup will not work.
> I wrote a script some time back to do that,
> but it can probably be done with a udev rule.

Don't be coy ! -- can you post your script here ?
what would such a udev rule look like ?

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] pm-suspend problem

2015-10-13 Thread Philip Webb
151012 Philip Webb wrote:
> I want to be able to suspend my machine to RAM overnight or when I'm out.
> The pkg to use seems to be Pm-utils, which I've installed.
> 'pm-suspend' does suspend, but only briefly :
> after  5 s , it restarts automatically & everything is back as before.
> The log file shows this happening quite clearly.
> I'm using Fluxbox + OpenRC ; 'suspend to Ram' is compiled in the kernel.

I've done further Google research.
Many other people have had similar problems over the past few years
& the only regular suggestion is that there's a problem with ECHI etc :
I haven't tried following that up, as it's not recent.

I tested Mint 17.2 Xfce , which I have installed in another partition
& which is very quick'n'slick : suspend has the same effect as with Gentoo.
I've tried changing a few BIOS settings with no apparent effect,
but -- mysteriously -- Gentoo (but not Mint) is now actually suspending,
but doesn't wake up when the power button or a key is pressed, as it should ;
I can power off & restart normally afterwards.
'dmesg' + 'syslog' simply show an immediate restart after the suspend.

The result of all this is that I can't suspend to RAM & restart later :
that merely means that I have to repopulate my workspaces after each reboot,
but that's something I know by rote & can easily live with.

However, the one good + surprising outcome concerns the I/net.
Getting back in touch with my ISP can be slow + unpredictable,
tho' it always works after a few tries, which involve powering everything off.
However, I've discovered that if I don't switch off the router,
'dhcpcd' simply reconnects after a reboot (in Mint too)
& the I/net is immediately available : that's what I really care about.

So I can power the machine off while I'm asleep or out
iff I don't switch off the power-bar which also feeds the router.

If anyone has further thoughts on this subject,
they mb of more general interest, but for now I can carry on.

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] pm-suspend problem

2015-10-12 Thread Philip Webb
151012 Alec Ten Harmsel wrote:
> On Mon, Oct 12, 2015 at 05:46:00PM -0400, Philip Webb wrote:
>> I want to be able to suspend my machine to RAM overnight or when I'm out.
> Just curious why : why not just power it off or lock it ?

It's not relevant to the problem,
but I don't want to switch off the router which connects to my ISP,
as it cb a nuisance to reconnect again.  No, no further comment re this !

>> The pkg to use seems to be Pm-utils, which I've installed.
>> 'pm-suspend' does suspend, but only briefly :
>> after  5 s , it restarts automatically & everything is back as before.
>> The log file shows this happening quite clearly.
>> What am I doing wrong ?  Am I using the correct tool ?
> What desktop environment are you using ?  OpenRC or systemd ?
> If you are using a desktop environment,
> it should have the suspend functionality built into it.

The latter are not DE's : I use Fluxbox + OpenRC.

> Do you have support for suspending to RAM compiled into the kernel ?

I believe so.

Thanks for the prompt response, but this doesn't help much.

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca




Re: [gentoo-user] pm-suspend problem

2015-10-12 Thread Alec Ten Harmsel
On Mon, Oct 12, 2015 at 05:46:00PM -0400, Philip Webb wrote:
> I want to be able to suspend my machine to RAM overnight or when I'm out.

Just curious, you don't need to answer: why? Why not just power it off
or lock it?

> The pkg to use seems to be Pm-utils, which I've installed.
> 'pm-suspend' does suspend, but only briefly :
> after  5 s , it restarts automatically & everything is back as before.
> The log file shows this happening quite clearly.
> 
> What am I doing wrong ?  Am I using the correct tool ?

What desktop environment are you using? OpenRC or systemd? Lastly, do
you have support for suspending to RAM compiled into the kernel?

If you are using a desktop environment, it should have the suspend
functionality built into it. If you are using systemd, it should be as
simple as a `systemctl suspend`.

Alec



[gentoo-user] pm-suspend problem

2015-10-12 Thread Philip Webb
I want to be able to suspend my machine to RAM overnight or when I'm out.
The pkg to use seems to be Pm-utils, which I've installed.
'pm-suspend' does suspend, but only briefly :
after  5 s , it restarts automatically & everything is back as before.
The log file shows this happening quite clearly.

What am I doing wrong ?  Am I using the correct tool ?

-- 
,,
SUPPORT ___//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT`-O--O---'   purslowatchassdotutorontodotca