Skip to content

Commit

Permalink
zd1211rw: reset device when CR_BCN_FIFO_SEMAPHORE freezes in beacon s…
Browse files Browse the repository at this point in the history
…etup

When driver fails to acquire device semaphore lock, device usually
freezes soon afterwards. So failing to acquire lock indicates us that
not everything is going right in device/fw. So reset device when
this happens.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Feb 4, 2011
1 parent a0fd751 commit 3985a46
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/net/wireless/zd1211rw/zd_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
dev_err(zd_mac_dev(mac),
"Giving up beacon config.\n");
r = -ETIMEDOUT;
goto release_sema;
goto reset_device;
}
}
msleep(20);
Expand Down Expand Up @@ -770,6 +770,17 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
mutex_unlock(&mac->chip.mutex);
kfree(ioreqs);
return r;

reset_device:
mutex_unlock(&mac->chip.mutex);
kfree(ioreqs);

/* semaphore stuck, reset device to avoid fw freeze later */
dev_warn(zd_mac_dev(mac), "CR_BCN_FIFO_SEMAPHORE stuck, "
"reseting device...");
usb_queue_reset_device(mac->chip.usb.intf);

return r;
}

static int fill_ctrlset(struct zd_mac *mac,
Expand Down

0 comments on commit 3985a46

Please sign in to comment.