LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-05-2008, 01:05 PM   #1
wadsworth
Member
 
Registered: Aug 2007
Distribution: Slackware64 13.37
Posts: 215

Rep: Reputation: 65
Lightbulb USB power always on (fix?)


I have an issue thats been bothering me since I switched from MS Windows
over two years ago. Windows used to completely power down my computer.
Shutting down from Linux leaves the USB ports powered, so a USB mouse/gamepad
just sits there and "glows" all night for no good reason. Very annoying.

I've been poking around google off-and-on for a solution ever since.
It seems that this occurs due to a "buggy" BIOS implementation that mostly
affects nForce chipset motherboards. (Mine is a Gigabyte GA-7N400-L nForce2)

Finally stumbled on a thread that spans almost two years (!!!)
but contains a workaround:
http://bugzilla.kernel.org/show_bug.cgi?id=5410

Applied the patch, recompiled. And IT WORKS!
USB ports power down just like they should. Awesome.

Here is the diff from my 2.6.21.5 tree:
Code:
--- ./drivers/usb/host/ohci-hcd.c.orig	2007-06-11 14:37:06.000000000 -0400
+++ ./drivers/usb/host/ohci-hcd.c	2008-04-03 22:56:53.000000000 -0400
@@ -361,7 +361,8 @@
 static void ohci_usb_reset (struct ohci_hcd *ohci)
 {
 	ohci->hc_control = ohci_readl (ohci, &ohci->regs->control);
-	ohci->hc_control &= OHCI_CTRL_RWC;
+	/* ohci->hc_control &= OHCI_CTRL_RWC; */
+	ohci->hc_control &= (OHCI_CTRL_RWC | OHCI_CTRL_HCFS);
 	ohci_writel (ohci, ohci->hc_control, &ohci->regs->control);
 }
I guess my question is, could you see any problem surfacing from using this patch?
From my limited understanding of what this patch does, it sounds safe.
I've only been running this kernel for a few days, zero problems so far.
Any thoughts/opinions would be appreciated.

I have to mention that Zenwalk 5.0 properly powers off the USB ports at shutdown.
Only distro that ever has. Thought that maybe the kernel version Zenwalk used
(2.6.24.2) had finally fixed this, so I compiled a vanilla 2.6.24.4 kernel
for Slackware. No luck, same issue. Not sure what Zenwalk did to fix the problem,
but they seem to have it solved.

Thanks!
 
Old 04-05-2008, 01:12 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Very rarely does Pat include any patched sources in Slackware, one of the main goals with Slackware is having the system built from all vanilla sources rather than relying on distro-specific patches like many of the others do (it can lead to instability and general incompatibility with other systems).

I don't know enough about the kernel to say if this is 100% safe or not, but I do have to wonder why it has never been implemented into the mainline kernel. Until that point we won't see it in Slackware, that much is certain.
 
Old 04-05-2008, 01:41 PM   #3
wadsworth
Member
 
Registered: Aug 2007
Distribution: Slackware64 13.37
Posts: 215

Original Poster
Rep: Reputation: 65
The kernel devs thinking is probably:
"We're doing the right thing, you're closed-source BIOS isn't.
Since its closed-source, we have no way to fix it. Have a nice day."

Its a little much to expect kernel devs to work around bugs they have no knowledge of
or control over.

Still, would be nice to see some kind of fix in the main kernel.
 
Old 04-05-2008, 02:56 PM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Maybe it's not a 'fix' maybe it's a 'workaround', in which case it may still make it.
 
Old 04-06-2008, 01:55 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
This seems to be a pretty harmless workaround which shouldn't cause you any grief unless you are using ACPI's suspend functionality with a USB keyboard or mouse; and/or (maybe) wake-on-lan with some sort of USB connected network device.
The macros mentioned are 'host controller functional state' and 'remote wakeup connected'

There seems to be little chance of the fix affecting other systems and since it's just a one-line patch it should be easy enough for you to patch your own kernel to apply the fix, at least until the code in that area gets re-written to where it can't be recognized -or maybe the USB developers figure out another way to handle things which takes your problem into account.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
power outage, managed to fix the harddrives with fsck, now qmail doesnt work linux_linux Linux - Newbie 3 03-15-2008 08:54 PM
USB IR receivers supporting power on/off via mb power header dblade Linux - Hardware 0 09-16-2007 01:22 AM
open suse 10.2 usb fix ziggis-soft SUSE / openSUSE 1 01-14-2007 11:35 AM
DISCUSSION: Laptop crashes when power source is changed fix bufo333 LinuxAnswers Discussion 1 02-06-2005 11:21 AM
How to fix this USB mouse with scroll IamDaniel Slackware 5 12-04-2003 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration