summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-07-15 23:47:51 +0100
committerJohn W. Linville <linville@tuxdriver.com>2012-07-17 15:11:37 -0400
commit9c3099f7cb02adf5a3554bdef96bdc24a3d468e7 (patch)
treee637913a99c2609d0f4dcef6df2b6e907ec04ff1 /drivers/net/wireless/libertas/cmd.c
parent20d2ebe512b9ad0f8fdd867a02d7a309344e8a6a (diff)
downloadblackbird-op-linux-9c3099f7cb02adf5a3554bdef96bdc24a3d468e7.tar.gz
blackbird-op-linux-9c3099f7cb02adf5a3554bdef96bdc24a3d468e7.zip
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>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r--drivers/net/wireless/libertas/cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index dd0743c42b47..26e68326710b 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1020,9 +1020,9 @@ static void lbs_submit_command(struct lbs_private *priv,
if (ret) {
netdev_info(priv->dev, "DNLD_CMD: hw_host_to_card failed: %d\n",
ret);
- /* Let the timer kick in and retry, and potentially reset
- the whole thing if the condition persists */
- timeo = HZ/4;
+ /* Reset dnld state machine, report failure */
+ priv->dnld_sent = DNLD_RES_RECEIVED;
+ lbs_complete_command(priv, cmdnode, ret);
}
if (command == CMD_802_11_DEEP_SLEEP) {
OpenPOWER on IntegriCloud