I'm puzzled with the new behaviour in 2.6.7 kernel; it worked in
2.6.x (x<=6) and 2.4.x kernels. I'm writing an USB camera driver
which streams frames using isochronous transfer mode.

The interrupt handler is called every 0.01 second normally (10 packets in
each URB); but if the driver sleeps (by calling
wait_for_event_interruptible) sometimes there is a 0.95 second pause in the
isochronous interrupts, and data sent by the camera is lost. The
wait_for_event_interruptible is called from V4L1 read()/ioctl() function
implementation.

Between the 0.95 second pause between calling schedule()
(inside wait_for_event_interruptible) and the isochronous
interrupt, there are no other kernel messages (I have
"USB verbose debug messages" enabled)

If the condition in wait_for_event() is true so that the driver
doesn't really sleep, everything works well. Also if I call
schedule() directly without setting the task state to
TASK_INTERRUPTIBLE first, there is no problem.

I tried changing all kernel configuration options that I thought
could matter, in particular all debugging options,
"Enforce USB bandwidth allocation", SMP support, and pre-emptible
kernel. I also tried replacing uhci-hcd.c from the kernel 2.6.6;
nothing helped.

In 2.6.6 the problem occurs never; in 2.6.7 its frequency depends
on whether the image decoding is done in kernel driver or in
userspace program, and whether the userspace program has artificial
delay (calling usleep(50000) or not). Below are some statistics
(number of the 0.95s pauses/number of the schedule() calls):
267-mjpgdecshow-usleep.txt              10/21 (48%)
267-mjpgdecdrv-usleep.txt               13/13 (100%)
267-mjpgdecshow.txt                     0/100 (0%)
267-mjpgdecdrv.txt                      2/111 (2%)
267-bayerdecdrv-usleep.txt              2/737 (0.27%)
267uhci6-mjpgdecdrv-usleep.txt          5/5 (100%)
267uhci6-mjpgdecshow-usleep.txt         39/73 (53%)
where
267uhci6 = uhci-hcd.c replaced from kernel 2.6.6
mjpg = using MJPG format (as opposed to Bayer)
decdrv = decoding image into RGB in the driver
decshow = decoding image into RGB in userspace
usleep = userspace program contains usleep(50000)

The problem doesn't appear in my laptop having OHCI (the problem happens in
a computer having UHCI).

Linux version 2.6.7 ([EMAIL PROTECTED]) (gcc version 2.95.4 20011002
(Debian prerelease)) #1 SMP Fri Jul 23 20:
18:05 EEST 2004

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 6
cpu MHz         : 927.479
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse
bogomips        : 1830.91

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 6
cpu MHz         : 927.479
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse
bogomips        : 1851.39


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to