On Tue, 23 Mar 2004, Alan Stern wrote: > I'd say gphoto2 could use a little rewriting. > > In the meantime, here's a compromise patch. It should be acceptable to > gphoto2. Does it still result in those suspend_hc/wakeup_hc cycles? If
I have skipped your previous patch; the patch you sent on Friday (with proc_setconfig) seems to have improved the situation already, and showed that iscan used proc_setconfig. The patch of this mail you sent (quoted for reference below) seems to help as well with iscan when it's running alone, however, running usbmodules at the same time as iscan's preview scan (or full scan) causes usbmodules to complain: Warning: invalid config descriptor Config 0 descriptor too long, truncating and iscan to abort. It hangs then for a short while but comes back to life and can be killed. The scanner's sled moves to the home position when I've run usbmodules and the port or scanner hangs after that. I can revive things by power cycling the scanner. The remaining dmesg messages from the iscan hangs are: usb 3-2: bulk timeout on ep2in usbfs: USBDEVFS_BULK failed dev 2 ep 0x82 len 4096 ret -110 usb 3-2: bulk timeout on ep2in usbfs: USBDEVFS_BULK failed dev 2 ep 0x82 len 42 ret -110 I am currently observing delays starting up iscan in the second range, but I advise to not research these yet unless other people report such problems from IDLE machines. My test machine is under heavy I/O load (cron jobs running find and such) and strace shows it's the disk I/O that causes latencies up to 0.2 s per single syscall (usually open or mmap2 on some /usr/lib file). Thank you so far. > it does then something else is still wrong and needs to be fixed. Both > strace and dmesg output will help. > > ===== drivers/usb/core/devio.c 1.88 vs edited ===== > --- 1.88/drivers/usb/core/devio.c Wed Mar 17 14:16:46 2004 > +++ edited/drivers/usb/core/devio.c Tue Mar 23 11:27:20 2004 > @@ -414,6 +414,8 @@ > > if (ep & ~(USB_DIR_IN|0xf)) > return -EINVAL; > + if (!dev->actconfig) > + return -ESRCH; > for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { > iface = dev->actconfig->interface[i]; > for (j = 0; j < iface->num_altsetting; j++) { > @@ -434,6 +436,8 @@ > > if (ifn & ~0xff) > return -EINVAL; > + if (!dev->actconfig) > + return -ESRCH; > for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { > if (dev->actconfig->interface[i]-> > altsetting[0].desc.bInterfaceNumber == ifn) > @@ -750,9 +754,24 @@ > static int proc_setconfig(struct dev_state *ps, void __user *arg) > { > unsigned int u; > + struct usb_host_config *actconfig = ps->dev->actconfig; > > if (get_user(u, (unsigned int __user *)arg)) > return -EFAULT; > + if (actconfig && actconfig->desc.bConfigurationValue == u) > + return usb_reset_configuration(ps->dev); > + > + /* Don't change the configuration if any interfaces are claimed. > + * It would interfere with other drivers' operations, and if an > + * interface is claimed by usbfs it would cause deadlock. */ > + if (actconfig) { > + int i; > + > + for (i = 0; i < actconfig->desc.bNumInterfaces; ++i) { > + if (usb_interface_claimed(actconfig->interface[i])) > + return -EBUSY; > + } > + } > return usb_set_configuration(ps->dev, u); > } -- Matthias Andree Encrypt your mail: my GnuPG key ID is 0x052E7D95 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel