Re: OT: Suspend/restore and USB devices

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

 



On 04/01/2016 09:59 AM, Patrick O'Callaghan wrote:
On Fri, 2016-04-01 at 10:27 -0600, jd1008 wrote:
I have had the same problem. So, what I do is unmount the plugin,
remove it, and then hibernate.

Not really feasible when the device is used by the mouse, and in any
case it wouldn't gain anything over what I'm doing now.

I think this has to do with the driver binding. I saw a script in one
of the ubuntu fora that looked like it might to the trick. The link is

	http://askubuntu.com/a/549571

In a nutshell, he created a script that would be executed entering and
exiting sleep that would unbind the ehci or uhci module on sleep, and
rebind it on wake. He put the script in

	/etc/pm/sleep.d/20_usb_suspend_fix

and here is the content:

---------------- CUT HERE ---------------------------------------
#!/bin/sh

LOGTAG=PwrUsbFix
UNDO=/var/run/pm-utils/pm-suspend/storage/rebind_usb.sh

# check am root
[ "$(id -u)" = 0 ] || {
    echo "$LOGTAG : must be run as root!"
    exit 1
    }

case "${1}" in
    hibernate|suspend)
        : > ${UNDO}
find /sys/bus/pci/drivers -maxdepth 2 -path \*\[eu\]hci\* -name unbind | cut -d\/ -f -6 | \
            while read BUS ; do
                find ${BUS} -maxdepth 1 -type l -name 00\* | \
                    while read DEVPATH ; do
                        DEVICE=`basename $DEVPATH`
                        echo "$LOGTAG : echo ${DEVICE} > ${BUS}/unbind"
                        echo -n "${DEVICE}" > ${BUS}/unbind
echo "echo \"${LOGTAG} ${DEVICE} > ${BUS}/bind\"" >> ${UNDO} echo "echo -n \"${DEVICE}\" > ${BUS}/bind" >> ${UNDO}
                    done
            done
    ;;
    resume|thaw)
        . ${UNDO}
    ;;
esac

exit 0
---------------- CUT HERE ---------------------------------------

For Fedora use, I'd change the location defined in "UNDO" as that
directory isn't present on Fedora. I'd suggest something like:

	UNDO=/usr/local/bin/rebind_usb.sh

I have NOT tested this but it might be something worth trying.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-            The gene pool could use a little chlorine.              -
----------------------------------------------------------------------
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux