Bug 8231 - USB_SUSPEND couse usb scanner to freeze on scan.
Summary: USB_SUSPEND couse usb scanner to freeze on scan.
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-19 00:31 UTC by Oleksij Rempel (fishor)
Modified: 2007-04-29 13:23 UTC (History)
0 users

See Also:
Kernel Version: 2.6.20, 2.6.21-rc4
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg (5.83 KB, text/plain)
2007-03-19 00:47 UTC, Oleksij Rempel (fishor)
Details
lsusb -v (2.72 KB, text/plain)
2007-03-19 09:00 UTC, Oleksij Rempel (fishor)
Details

Description Oleksij Rempel (fishor) 2007-03-19 00:31:11 UTC
Distribution: Ubuntu 7.04
Hardware Environment: scnanner Epson Perfection 1670 + USB ICH7
Software Environment: sane, kernel 
Problem Description:
Scanner will freeze if it used on kernel compiled with USB_SUSPEND support.

It's looks like this:
This is OK:
0---scan--->
0---ready--<

This happen with USB_SUSPEND:
0-----scan----->
         X8----<

Steps to reproduce:
1. Use USB_SUSPEND enabled kernel, like default kernel in Ubuntu 7.04
or kompile vanila kernel.
2. Attach scanner and execute ~# scanimage -d snapscan > test.pnm
Comment 1 Oleksij Rempel (fishor) 2007-03-19 00:47:56 UTC
Created attachment 10829 [details]
dmesg

[  129.919768] hub 3-0:1.0: hub_suspend
[  129.919774] usb usb3: suspend_rh
[  129.919777] usb usb3: usb auto-suspend
[  187.245691]	usbdev5.3_ep81: ep_device_release called for usbdev5.3_ep81
<---- scanner freeze here!!!
[  187.246291]	usbdev5.3_ep02: ep_device_release called for usbdev5.3_ep02
[  187.246876]	usbdev5.3_ep83: ep_device_release called for usbdev5.3_ep83
[  189.247786] usb 5-3: usb auto-suspend
Comment 2 Oleksij Rempel (fishor) 2007-03-19 01:00:16 UTC
It's issue uppears on ehci and uhci.
I seems like with start of scanimage usb device waked up, and after scanimage
exit device will be suspend. The problem is scanimage exit before divice is ready:
scanimage start -------scan--------> scanimage exit
now scanner should by it self go back to ready mode:
scanimage exit ----go back---------> ready to the next scan
but after scanimage exit in about 2 seconds , kernel think there is nothink
happening on this device and put it sleep (kill it).
scanimage exit ----2 sec.--X    
Comment 3 Oleksij Rempel (fishor) 2007-03-19 01:25:34 UTC
on solution is to fix sane. but it's looks like sane can't check if scanner is
done or not. Some think like sleep(8) funktion is needed to sane before exit or
kernel before usb_suspend.
Comment 4 Oleksij Rempel (fishor) 2007-03-19 03:20:54 UTC
The best USB_SUSPEND for scanner is about 15min, bocous after suspen it need
warming up about 40 secons ( it is a lot of time, if you sacann some images with
interwal about 5 min ).
Comment 5 Oleksij Rempel (fishor) 2007-03-19 09:00:17 UTC
Created attachment 10836 [details]
lsusb -v
Comment 6 Oleksij Rempel (fishor) 2007-04-29 13:23:06 UTC
fixed in main stream.

Note You need to log in before you can comment on or make changes to this bug.