On Fri, 25 Sep 2009, Mikael Pettersson wrote: > > > So an empty bus should be suspended, and thus not need the timer? > > > > It should be. Unless you have turned off the "wakeup" attribute under > > /sys/bus/usb/devices/usbN/power. > > > > If you want to get more information about what's happening, build a > > kernel with CONFIG_USB_DEBUG enabled and see what shows up in the dmesg > > log. > > I rebuilt with CONFIG_USB_DEBUG=y but no /sys/bus/usb/devices/usbN/power > appeared (apparently it depends on CONFIG_PM). The kernel boot log indicated > that it knew the UHCI bus was empty, but it didn't stop the timer: ... > usb usb1: suspend_rh (auto-stop) > > I had a look in drivers/usb/, and this suspend_rh (auto-stop) > means that hub told uhci that the bus is empty. There is some > code in suspend_rh() to determine if the timer should be stopped > or not, but apparently that code didn't decide to stop the timer. > > Next I rebuilt with CONFIG_PM and CONFIG_USB_SUSPEND. That made > a significant difference: ... > And now the timer doesn't show up in /proc/timer_stats any more. Nice. > > The platform doesn't have any firmware support for power management, > suspend to ram, or anything like that, so kernels are typically built > without CONFIG_PM enabled (like many other embedded systems). Shouldn't > that timer be halted also in the !CONFIG_PM case? Ah. It hadn't occurred to me that you wouldn't have CONFIG_PM enabled. The code for the routine you were looking at includes this comment: /* In auto-stop mode wakeups must always be detected, but * Resume-Detect interrupts may be prohibited. (In the absence * of CONFIG_PM, they are always disallowed.) */ So it is behaving as intended -- without Resume-Detect interrupts the driver has to poll and therefore has to use a timer. The idea behind this was: If the system manager hasn't enabled CONFIG_PM then he doesn't want power management, so he isn't interested in saving power, so the extra power used by the timer doesn't matter. You can try building a kernel with CONFIG_PM and without CONFIG_USB_SUSPEND. That combination also should succeed in turning off the timer. Alternatively, you can simply unload uhci-hcd, or turn off CONFIG_USB_UHCI_HCD. But of course this isn't feasible if you want to be able to use USB devices... Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html