]> git.baikalelectronics.ru Git - kernel.git/commit
USB: fix LANGID=0 regression
authorDaniel Mack <daniel@caiaq.de>
Fri, 10 Jul 2009 09:04:58 +0000 (11:04 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 12 Jul 2009 22:16:40 +0000 (15:16 -0700)
commit6bdbe2ed350a30360444c74c5cf390d9d44fe0cc
tree7222080c1f276caacd237f239dac0704107da319
parentbbb55e8ec2ea84f150263eddd6fec04c3ecb6e26
USB: fix LANGID=0 regression

commit 6f9c183 ("USB: allow malformed LANGID descriptors") broke support
for devices without string descriptor support.

Reporting string descriptors is optional to USB devices, and a device
lets us know it can't deal with strings by responding to the LANGID
request with a STALL token.

The kernel handled that correctly before 6f9c183 came in, but failed
hard if the LANGID was reported but broken. More than that, if a device
was not able to provide string descriptors, the LANGID was retrieved
over and over again at each string read request.

This patch changes the behaviour so that

 a) the LANGID is only queried once
 b) devices which can't handle string requests are not asked again
 c) devices with malformed LANGID values have a sane fallback to 0x0409

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/message.c