From: Dan Williams <dcbw@redhat.com>
To: Luis Carlos Cobo <luisca@cozybit.com>
Cc: linux-wireless@vger.kernel.org
Subject: [RFC PATCH] libertas_tf: clear current command on remove
Date: Mon, 08 Sep 2008 16:34:42 -0400 [thread overview]
Message-ID: <1220906082.1618.22.camel@localhost.localdomain> (raw)
Ensure that the current command is torn down when cleaning up.
Signed-off-by: Dan Williams <dcbw@redhat.com>
---
Completely untested but based on the libertas patch for the same
problem. Luis, can you give it a shot and make sure there aren't any
regressions when pulling the card or rmmod-ing the driver?
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index c948021..5f7bf04 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -296,8 +296,8 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
struct lbtf_private *priv = hw->priv;
unsigned long flags;
struct sk_buff *skb;
-
struct cmd_ctrl_node *cmdnode;
+
/* Flush pending command nodes */
spin_lock_irqsave(&priv->driver_lock, flags);
list_for_each_entry(cmdnode, &priv->cmdpendingq, list) {
@@ -306,7 +306,14 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
wake_up_interruptible(&cmdnode->cmdwait_q);
}
+ /* Flush the command the card is currently processing */
+ if (priv->cur_cmd) {
+ priv->cur_cmd->result = -ENOENT;
+ priv->cur_cmd->cmdwaitqwoken = 1;
+ wake_up_interruptible(&priv->cur_cmd->cmdwait_q);
+ }
spin_unlock_irqrestore(&priv->driver_lock, flags);
+
cancel_work_sync(&priv->cmd_work);
cancel_work_sync(&priv->tx_work);
while ((skb = skb_dequeue(&priv->bc_ps_buf)))
next reply other threads:[~2008-09-08 20:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-08 20:34 Dan Williams [this message]
2008-09-11 22:35 ` [RFC PATCH] libertas_tf: clear current command on remove Andrey Yurovsky
2008-09-15 7:21 ` Dan Williams
2008-09-15 19:44 ` Andrey Yurovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220906082.1618.22.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=luisca@cozybit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox