Using HAL to disable USB hub "wakeup" setting

Dan Streetman ddstreet at us.ibm.com
Wed Mar 18 11:33:57 PDT 2009


Hello,

I have a system unit (a couple different model types, actually) with a
quirk that I think should be addressed in HAL and I wanted to see what
you think.

The system has integrated USB hubs, and when the system goes into
S3/suspend, those USB hubs' ports are powered down completely.  Since
Linux defaults to enable the "remote wakeup" for USB hubs, which
causes a system wakeup from suspend when a USB device is disconnected
(or connected), when the system is entering suspend and those hubs
power down their ports, if there are any USB device(s) connected then
the power loss causes a "disconnect" and thus the hubs immediately
wake up the system.

Since the hardware is hard-wired to drop power, the only way to fix it
is to disable the "remote wakeup" for those hubs.  This seems like a
perfect match into HAL, by just creating a policy to match on the
system unit model type info and specific USB PCI info, and disable the
USB wakeup for the appropriate USB hubs.

My questions are, first, is this a good fit for HAL?  Or should it be
done somewhere else?
Second, should I create a new program and/or script to go into
/usr/lib/hal/ ?  The specific way (as far as I know) to do this for
Linux is to echo "disabled" to the "power/wakeup" sysfs node of the
device, but I believe from reading up on HAL that all "addons" and/or
"callouts" should use only programs from the /usr/lib/hal/
subdirectory.  Right?

If HAL is the right place to handle this I'll send a patch in.

I also have a couple other questions I'll send in separate emails.

Thanks!


More information about the hal mailing list