aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-06-02 14:00:34 -0400
committerGuido Guenther <agx@bogon.sigxcpu.org>2007-06-03 18:38:23 +0200
commite0b11ff37daaf931a9fa2d367bf0c35d1e43121f (patch)
tree57c5f8938b64b3a1d46b37210aee05b014d39b4e
parent0aba255685f1dc8025eca83673c2d89ea4393027 (diff)
[PATCH] Internal firmware download should just sleep without any timers
Timers are justified if they are scheduled in the interrupt context or if they are modified. Neither is the case. Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--at76_usb.c29
-rw-r--r--at76_usb.h4
2 files changed, 3 insertions, 30 deletions
diff --git a/at76_usb.c b/at76_usb.c
index 14baefc..e31a734 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -1994,14 +1994,6 @@ static int at76_disassoc_req(struct at76_priv *priv, struct bss_info *bss)
}
-/* the firmware download timeout (after remap) */
-static void at76_fw_dl_timeout(unsigned long par)
-{
- struct at76_priv *priv = (struct at76_priv *)par;
- schedule_work(&priv->work_reset_device);
-}
-
-
/* the restart timer timed out */
static void at76_restart_timeout(unsigned long par)
{
@@ -4334,7 +4326,9 @@ static int at76_load_internal_fw(struct at76_priv *priv)
at76_dbg(DBG_DEVSTART, "sleeping for 2 seconds");
priv->istate = EXTFW_DOWNLOAD;
- mod_timer(&priv->fw_dl_timer, jiffies + 2 * HZ + 1);
+ schedule_timeout_interruptible(2 * HZ + 1);
+ usb_reset_device(priv->udev);
+ priv->istate = WAIT_FOR_DISCONNECT;
end_internal_fw:
mutex_unlock(&priv->mtx);
@@ -4599,18 +4593,6 @@ static void at76_work_new_bss(struct work_struct *work)
}
-static void at76_work_reset_device(struct work_struct *work)
-{
- struct at76_priv *priv = container_of(work, struct at76_priv,
- work_reset_device);
-
- mutex_lock(&priv->mtx);
- usb_reset_device(priv->udev);
- priv->istate = WAIT_FOR_DISCONNECT;
- mutex_unlock(&priv->mtx);
-}
-
-
static int at76_startup_device(struct at76_priv *priv)
{
struct at76_card_config *ccfg = &priv->card_config;
@@ -6129,7 +6111,6 @@ static struct at76_priv *at76_alloc_new_device(struct usb_device *udev,
INIT_WORK(&priv->work_join, at76_work_join);
INIT_WORK(&priv->work_mgmt_timeout, at76_work_mgmt_timeout);
INIT_WORK(&priv->work_new_bss, at76_work_new_bss);
- INIT_WORK(&priv->work_reset_device, at76_work_reset_device);
INIT_WORK(&priv->work_restart, at76_work_restart);
INIT_WORK(&priv->work_scan, at76_work_scan);
INIT_WORK(&priv->work_set_promisc, at76_work_set_promisc);
@@ -6146,10 +6127,6 @@ static struct at76_priv *at76_alloc_new_device(struct usb_device *udev,
priv->mgmt_timer.data = (unsigned long)priv;
priv->mgmt_timer.function = at76_mgmt_timeout;
- init_timer(&priv->fw_dl_timer);
- priv->fw_dl_timer.data = (unsigned long)priv;
- priv->fw_dl_timer.function = at76_fw_dl_timeout;
-
spin_lock_init(&priv->mgmt_spinlock);
priv->next_mgmt_bulk = NULL;
priv->istate = INTFW_DOWNLOAD;
diff --git a/at76_usb.h b/at76_usb.h
index 474049c..7fd61f5 100644
--- a/at76_usb.h
+++ b/at76_usb.h
@@ -473,7 +473,6 @@ struct at76_priv {
struct work_struct work_join;
struct work_struct work_mgmt_timeout;
struct work_struct work_new_bss;
- struct work_struct work_reset_device;
struct work_struct work_restart;
struct work_struct work_scan;
struct work_struct work_set_promisc;
@@ -576,9 +575,6 @@ struct at76_priv {
/* store rx fragments until complete */
struct rx_data_buf rx_data[NR_RX_DATA_BUF];
- /* firmware downloading stuff */
- struct timer_list fw_dl_timer; /* timer used to wait after REMAP
- until device is reset */
int extfw_size;
int intfw_size;
/* these point into a buffer managed by the firmware dl functions, no need to dealloc */