[lkml]   [2004]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Slight optimisation of the uhci-hcd init code
Thanks for fowarding this, Johannes.

On Mon, 9 Feb 2004 wrote:

> Hello,
> While trying to understand why starting usb on my laptop made the bus master
> activity full I came accross a strange code in uhci-hcd: a seven level nested
> "if". The same thing can be achieved with a simgle ffz(). The attached patch
> should give to the code a bit better looking, on my x86 it even saves 96 bytes,
> cool ;-)
> hoping you like it,
> Eric Piel

It's a nice idea. I was planning to alter the logic behind that nested
"if" anyway, and I'll keep your recommendation in mind when I do it.

> PS: still, I'm not sure it's normal to see ffffffff as "bus master activity" in
> /proc/acpi/processor/CPU0/power as soon as uhci-hcd is loaded. In particular, it
> prevents the processor to go to C3 state. Could you give me your pint of view?

I'm not sure exactly what the ffffffff value means -- maximum utilization?

Anyway, a UHCI host controller is a bus master and it can generate a lot
of activity depending on what USB devices are plugged in. If no USB
devices are plugged, the controller will be suspended after 1 second.
Of course then it shouldn't be accessing the PCI bus at all.

There is one exception to this. Some manufacturers try to disable unused
USB ports on their motherboards by tying the overcurrent input permanently
high. (This seems to be particularly common among laptops.) With some
Intel controllers this strategy generates "device-connected" interrupts,
so the driver doesn't try to suspend the controller. There's a patch to
fix this behavior currently being tested.

Alan Stern

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:00    [W:0.071 / U:0.048 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site