]> git.baikalelectronics.ru Git - kernel.git/commit
libertas: handle command failure immediately
authorDaniel Drake <dsd@laptop.org>
Sun, 15 Jul 2012 22:47:51 +0000 (23:47 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 17 Jul 2012 19:11:37 +0000 (15:11 -0400)
commiteae4522b52b13ca800389b3dca188d5847f3a880
treee637913a99c2609d0f4dcef6df2b6e907ec04ff1
parent2540180ff88de8f0c28c94d8ddff155b2366ac52
libertas: handle command failure immediately

Fail commands immediately when the request cannot be sent to the hardware.

This solves the following deadlock:
 1. Two commands are in the queue.
 2. The first command is sent, but causes a timeout, which kicks off an
    asynchronous device reset
 3. The second command is submitted to the device, and fails. The failure
    is noted but the existing code waits for the timeout handler to take
    care of the failure.
 4. The device reset kicks in, causing the device "surprise removed" flag
    to be set as the device disappears from the bus.
 5. lbs_thread notes this and enters "adapter removed; waiting to die"
    mode, without processing any further command timeouts.

While adjusting lbs thread logic to handle this situation may be one way
to fix this, it seems more practical to simplify handling of host_to_card
failure so that the commands are failed immediately without waiting for
more compliated timeout logic to kick in.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c