]> git.baikalelectronics.ru Git - kernel.git/commit
rt2x00: tune multi-registers I/O timeout
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 8 Oct 2014 12:16:37 +0000 (14:16 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Oct 2014 18:16:13 +0000 (14:16 -0400)
commitcbb2cd0ca95c50cac0645b06eb470f1ea0110f8a
treee340750fa2dea7835e24612f1415e10c91cba126
parent6701a876d5e5b4e6b371f77300a9a6d80c91c06b
rt2x00: tune multi-registers I/O timeout

We provide timeout value to rt2x00usb_vendor_request_buff() based on
number of registers to process. That value is passed down to
rt2x00usb_vendor_req_buff_lock() and ends in usb_control_msg(). But we
do not read/write all registers in rt2x00usb_vendor_req_buff_lock() at
once. We read/write them in chunks of 64 bytes in the loop, hence passed
timeout value to low level is too big.

Patch removes timeout argument from rt2x00usb_vendor_request_buff() and
use short REGISTER_TIMEOUT in rt2x00usb_vendor_req_buff_lock(). That
timeout value should be fine for 64 bytes and smaller requests. For
EEPROM read we introduced new timeout value equal to 2 seconds.

Patch fixes process uninterruptible sleep stalls for long period, when
USB bus has problem to satisfy a request and we wait very long time on
usb_start_wait_urb().

Reported-and-tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt2x00usb.h