<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb, branch v2.6.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/usb?h=v2.6.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/usb?h=v2.6.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2005-10-17T21:45:49Z</updated>
<entry>
<title>[PATCH] USB: fix bug in handling of highspeed usb HID devices</title>
<updated>2005-10-17T21:45:49Z</updated>
<author>
<name>Christian Krause</name>
<email>chkr@plauener.de</email>
</author>
<published>2005-10-17T21:30:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=13b58ee51802a45d2b8853ffe0003d9fa768195c'/>
<id>urn:sha1:13b58ee51802a45d2b8853ffe0003d9fa768195c</id>
<content type='text'>
During the development of an USB device I found a bug in the handling of
Highspeed HID devices in the kernel.

What happened?

Highspeed HID devices are correctly recognized and enumerated by the
kernel. But even if usbhid kernel module is loaded, no HID reports are
received by the kernel.

The output of the hardware USB analyzer told me that the host doesn't
even poll for interrupt IN transfers (even the "interrupt in" USB
transfer are polled by the host).

After some debugging in hid-core.c I've found the reason.

In case of a highspeed device, the endpoint interval is re-calculated in
driver/usb/input/hid-core.c:

line 1669:
             /* handle potential highspeed HID correctly */
             interval = endpoint-&gt;bInterval;
             if (dev-&gt;speed == USB_SPEED_HIGH)
                   interval = 1 &lt;&lt; (interval - 1);

Basically this calculation is correct (refer to USB 2.0 spec, 9.6.6).
This new calculated value of "interval" is used as input for
usb_fill_int_urb:

line 1685:

            usb_fill_int_urb(hid-&gt;urbin, dev, pipe, hid-&gt;inbuf, 0,
                   hid_irq_in, hid, interval);

Unfortunately the same calculation as above is done a second time in
usb_fill_int_urb in the file include/linux/usb.h:

line 933:
        if (dev-&gt;speed == USB_SPEED_HIGH)
                urb-&gt;interval = 1 &lt;&lt; (interval - 1);
        else
                urb-&gt;interval = interval;

This means, that if the endpoint descriptor (of a high speed device)
specifies e.g. bInterval = 7, the urb-&gt;interval gets the value:

hid-core.c: interval = 1 &lt;&lt; (7-1) = 0x40 = 64
urb-&gt;interval = 1 &lt;&lt; (interval -1) = 1 &lt;&lt; (63) = integer overflow

Because of this the value of urb-&gt;interval is sometimes negative and is
rejected in core/urb.c:
line 353:
                /* too small? */
                if (urb-&gt;interval &lt;= 0)
                        return -EINVAL;

The conclusion is, that the recalculaton of the interval (which is
necessary for highspeed) should not be made twice, because this is
simply wrong. ;-)

Re-calculation in usb_fill_int_urb makes more sense, because it is the
most general approach. So it would make sense to remove it from
hid-core.c.

Because in hid-core.c the interval variable is only used for calling
usb_fill_int_urb, it is no problem to remove the highspeed
re-calculation in this file.

Signed-off-by: Christian Krause &lt;chkr@plauener.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] isp116x-hcd: fix handling of short transfers</title>
<updated>2005-10-17T21:45:49Z</updated>
<author>
<name>Olav Kongas</name>
<email>ok@artecdesign.ee</email>
</author>
<published>2005-10-17T21:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e9b765decfb49ddc105d303d491e1bee9769436f'/>
<id>urn:sha1:e9b765decfb49ddc105d303d491e1bee9769436f</id>
<content type='text'>
Increased use of scatter-gather by usb-storage driver after 2.6.13 has
exposed a buggy codepath in isp116x-hcd, which was probably never
visited before: bug happened only for those urbs, for which
URB_SHORT_NOT_OK was set AND short transfer occurred.

The fix attached was tested in 2 ways: (a) it fixed failing
initialization of a flash drive with an embedded hub; (b) the fix was
tested with 'usbtest' against a modified g_zero driver (on top of
net2280), which generated short bulk IN transfers of various lengths
including multiples and non-multiples of max_packet_length.

Signed-off-by: Olav Kongas &lt;ok@artecdesign.ee&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] usbserial: Regression in USB generic serial driver</title>
<updated>2005-10-15T01:13:31Z</updated>
<author>
<name>Randall Nortman</name>
<email>linuxkernellist@wonderclown.com</email>
</author>
<published>2005-10-15T00:21:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7a3ca7d2b5ec31b2cfa594b961d77e68075e33c7'/>
<id>urn:sha1:7a3ca7d2b5ec31b2cfa594b961d77e68075e33c7</id>
<content type='text'>
Kernel version 2.6.13 introduced a regression in the generic USB
serial converter driver (usbserial.o, drivers/usb/serial/generic.c).
The bug manifests, as far as I can tell, whenever you attempt to write
to the device -- the write will never complete (write() returns 0, or
blocks).

Signed-off-by: Randall Nortman &lt;oss@wonderclown.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>Use the new "kill_proc_info_as_uid()" for USB disconnect too</title>
<updated>2005-10-10T23:31:30Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-10-10T23:31:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d7dd8a72ab8d305fbe1c4bb571e0633eba3a8d23'/>
<id>urn:sha1:d7dd8a72ab8d305fbe1c4bb571e0633eba3a8d23</id>
<content type='text'>
All the same issues - we can't just save the pointer to the thread, we
must save the pid/uid/euid combination.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Fix signal sending in usbdevio on async URB completion</title>
<updated>2005-10-10T23:16:33Z</updated>
<author>
<name>Harald Welte</name>
<email>laforge@gnumonks.org</email>
</author>
<published>2005-10-10T17:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=46113830a18847cff8da73005e57bc49c2f95a56'/>
<id>urn:sha1:46113830a18847cff8da73005e57bc49c2f95a56</id>
<content type='text'>
If a process issues an URB from userspace and (starts to) terminate
before the URB comes back, we run into the issue described above.  This
is because the urb saves a pointer to "current" when it is posted to the
device, but there's no guarantee that this pointer is still valid
afterwards.

In fact, there are three separate issues:

1) the pointer to "current" can become invalid, since the task could be
   completely gone when the URB completion comes back from the device.

2) Even if the saved task pointer is still pointing to a valid task_struct,
   task_struct-&gt;sighand could have gone meanwhile.

3) Even if the process is perfectly fine, permissions may have changed,
   and we can no longer send it a signal.

So what we do instead, is to save the PID and uid's of the process, and
introduce a new kill_proc_info_as_uid() function.

Signed-off-by: Harald Welte &lt;laforge@gnumonks.org&gt;
[ Fixed up types and added symbol exports ]
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] usb/core/hcd-pci.c: don't free_irq() on suspend</title>
<updated>2005-09-30T16:23:30Z</updated>
<author>
<name>Daniel Ritz</name>
<email>daniel.ritz@gmx.ch</email>
</author>
<published>2005-09-29T19:39:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=03cdc0c304e1c068d49adc32264f07af76253e4c'/>
<id>urn:sha1:03cdc0c304e1c068d49adc32264f07af76253e4c</id>
<content type='text'>
the free_irq() in USB suspend breaks resume on some setups where USB
(ohci/ehci) shares the interrupt with an other device.

Signed-off-by: Daniel Ritz &lt;daniel.ritz@gmx.ch&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>Merge master.kernel.org:/home/rmk/linux-2.6-arm</title>
<updated>2005-09-30T15:39:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-09-30T15:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1dd465cac8d3ba18a9840d032f6604147269c031'/>
<id>urn:sha1:1dd465cac8d3ba18a9840d032f6604147269c031</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[PATCH] proc_mkdir() should be used to create procfs directories</title>
<updated>2005-09-29T15:46:26Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ftp.linux.org.uk</email>
</author>
<published>2005-09-28T21:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=666002218d59db271e5c1ede1d80227170c51987'/>
<id>urn:sha1:666002218d59db271e5c1ede1d80227170c51987</id>
<content type='text'>
A bunch of create_proc_dir_entry() calls creating directories had crept
in since the last sweep; converted to proc_mkdir().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[ARM] Don't include mach-types.h unnecessarily</title>
<updated>2005-09-29T10:15:51Z</updated>
<author>
<name>Russell King</name>
<email>rmk@dyn-67.arm.linux.org.uk</email>
</author>
<published>2005-09-29T10:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc611a1a50caa04bae82ed3c1fc6505132f8343f'/>
<id>urn:sha1:fc611a1a50caa04bae82ed3c1fc6505132f8343f</id>
<content type='text'>
It's pointless to include mach-types.h if you're not going to use
anything from it.  These references were removed as a result of:

grep -lr 'asm/mach-types\.h' . | xargs grep -L 'machine_is_\|MACH_TYPE_\|MACHINE_START\|machine_type'

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>[ARM] Don't include asm/arch/hardware.h directly</title>
<updated>2005-09-29T10:12:52Z</updated>
<author>
<name>Russell King</name>
<email>rmk@dyn-67.arm.linux.org.uk</email>
</author>
<published>2005-09-29T10:12:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d0877904470c149c6553f1309cfed6c90d67cf91'/>
<id>urn:sha1:d0877904470c149c6553f1309cfed6c90d67cf91</id>
<content type='text'>
Since asm/hardware.h's only reason for existing is to include
asm/arch/hardware.h, it's completely pointless to include both.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
