aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-11-30 12:12:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-07 16:51:20 -0500
commit0c9cc640225f4bd7c9aad87b1431bd8d9a29b338 (patch)
tree59b141441e7d8c948c92eadeeb9946a93c2f2e36
parent8e9f33f0ced82a797d285b233e1c956cbd5c7de3 (diff)
mwl8k: allow more time for firmware commands to complete
Some firmware commands can under some circumstances take more than 2 seconds to complete. This patch bumps the timeout up to 10 seconds, and prints a message whenever a command takes more than 2 seconds. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwl8k.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index f1566f93696e..793a83e10e16 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1579,8 +1579,8 @@ static void mwl8k_fw_unlock(struct ieee80211_hw *hw)
1579 * Command processing. 1579 * Command processing.
1580 */ 1580 */
1581 1581
1582/* Timeout firmware commands after 2000ms */ 1582/* Timeout firmware commands after 10s */
1583#define MWL8K_CMD_TIMEOUT_MS 2000 1583#define MWL8K_CMD_TIMEOUT_MS 10000
1584 1584
1585static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) 1585static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1586{ 1586{
@@ -1631,12 +1631,21 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1631 MWL8K_CMD_TIMEOUT_MS); 1631 MWL8K_CMD_TIMEOUT_MS);
1632 rc = -ETIMEDOUT; 1632 rc = -ETIMEDOUT;
1633 } else { 1633 } else {
1634 int ms;
1635
1636 ms = MWL8K_CMD_TIMEOUT_MS - jiffies_to_msecs(timeout);
1637
1634 rc = cmd->result ? -EINVAL : 0; 1638 rc = cmd->result ? -EINVAL : 0;
1635 if (rc) 1639 if (rc)
1636 printk(KERN_ERR "%s: Command %s error 0x%x\n", 1640 printk(KERN_ERR "%s: Command %s error 0x%x\n",
1637 wiphy_name(hw->wiphy), 1641 wiphy_name(hw->wiphy),
1638 mwl8k_cmd_name(cmd->code, buf, sizeof(buf)), 1642 mwl8k_cmd_name(cmd->code, buf, sizeof(buf)),
1639 le16_to_cpu(cmd->result)); 1643 le16_to_cpu(cmd->result));
1644 else if (ms > 2000)
1645 printk(KERN_NOTICE "%s: Command %s took %d ms\n",
1646 wiphy_name(hw->wiphy),
1647 mwl8k_cmd_name(cmd->code, buf, sizeof(buf)),
1648 ms);
1640 } 1649 }
1641 1650
1642 return rc; 1651 return rc;