On 5/18/06, Guennadi Liakhovetski <[EMAIL PROTECTED]> wrote:
Hi all, I've experimented a bit with the hub-power switching program from NIIBE Yutaka and I've got a couple of questions to my observations. On Sat, 14 Jan 2006, NIIBE Yutaka wrote: > Vlado Handziski wrote: >> http://thread.gmane.org/gmane.linux.usb.devel/36739 >> >> >> at the end I have posted a python wrapper over libusb for controlling the >> hub port power. The issue with the "self-healing" in the kernel is still >> there. We are currently patching the kernel to disable the automatic >> re-powering. First short question - what is this about? I haven't seen any such attempts under 2.6.16/17-rc3? Have they been in the meantime fixed?
The problem occurs when there is a hub downstream from the power controlled port. For example, in the following topology with 2 hubs: H_C->HUB1->HUB2->USB_DEVICE if the port on HUB1 to which HUB2 is attached (the upstream port of HUB2) is switched off, the kernel driver detects -EPROTO errors, and after 10 retries re-powers the whole chain, ultimately re-powering the managed port and the downstream devices. For our application, we have modified the driver to simply ignore the -EPROTO events. --- linux-2.6.16/drivers/usb/core/hub.c.old 2006-05-09 10:58:15.000000000 +0200 +++ linux-2.6.16/drivers/usb/core/hub.c 2006-05-09 10:57:42.000000000 +0200 @@ -302,6 +302,7 @@ static void hub_irq(struct urb *urb, str case -ENOENT: /* synchronous unlink */ case -ECONNRESET: /* async unlink */ case -ESHUTDOWN: /* hardware going away */ + case -EPROTO: /* port power off */ return; default: /* presumably an error */ This is quick and dirty and can cause state consistency problems since the driver is not aware about the external power control commands. Having said that, we would be happy to help in designing/implementing a "proper" solution that would keep the internal state machine of the driver sane while allowing user-space port power control. Vlado ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel