diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-04-28 05:51:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-29 15:36:14 -0400 |
commit | 28a6e577c65cc317fed5265efc43ce9282928bd4 (patch) | |
tree | 4d99bbef18582fe6f1d211920e25d3705be0a87d /drivers/net/wireless/iwlegacy/iwl3945-base.c | |
parent | 81e63263aa3c5bfa64aa3206f4be3e59afc1c183 (diff) |
iwlegacy: more priv->mutex serialization
Check status bits with mutex taken, because when we wait for mutex
unlock, status can change. Patch should also make remaining sync
commands be send with priv->mutex taken. That will prevent execute
these commands when we are currently reset firmware, what could
possibly cause troubles.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl3945-base.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c index cc7ebcee60e5..5bdcc36f543f 100644 --- a/drivers/net/wireless/iwlegacy/iwl3945-base.c +++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c | |||
@@ -2748,11 +2748,12 @@ static void iwl3945_bg_init_alive_start(struct work_struct *data) | |||
2748 | struct iwl_priv *priv = | 2748 | struct iwl_priv *priv = |
2749 | container_of(data, struct iwl_priv, init_alive_start.work); | 2749 | container_of(data, struct iwl_priv, init_alive_start.work); |
2750 | 2750 | ||
2751 | mutex_lock(&priv->mutex); | ||
2751 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2752 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
2752 | return; | 2753 | goto out; |
2753 | 2754 | ||
2754 | mutex_lock(&priv->mutex); | ||
2755 | iwl3945_init_alive_start(priv); | 2755 | iwl3945_init_alive_start(priv); |
2756 | out: | ||
2756 | mutex_unlock(&priv->mutex); | 2757 | mutex_unlock(&priv->mutex); |
2757 | } | 2758 | } |
2758 | 2759 | ||
@@ -2761,11 +2762,12 @@ static void iwl3945_bg_alive_start(struct work_struct *data) | |||
2761 | struct iwl_priv *priv = | 2762 | struct iwl_priv *priv = |
2762 | container_of(data, struct iwl_priv, alive_start.work); | 2763 | container_of(data, struct iwl_priv, alive_start.work); |
2763 | 2764 | ||
2765 | mutex_lock(&priv->mutex); | ||
2764 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 2766 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
2765 | return; | 2767 | goto out; |
2766 | 2768 | ||
2767 | mutex_lock(&priv->mutex); | ||
2768 | iwl3945_alive_start(priv); | 2769 | iwl3945_alive_start(priv); |
2770 | out: | ||
2769 | mutex_unlock(&priv->mutex); | 2771 | mutex_unlock(&priv->mutex); |
2770 | } | 2772 | } |
2771 | 2773 | ||
@@ -2995,10 +2997,12 @@ static void iwl3945_bg_restart(struct work_struct *data) | |||
2995 | } else { | 2997 | } else { |
2996 | iwl3945_down(priv); | 2998 | iwl3945_down(priv); |
2997 | 2999 | ||
2998 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 3000 | mutex_lock(&priv->mutex); |
3001 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { | ||
3002 | mutex_unlock(&priv->mutex); | ||
2999 | return; | 3003 | return; |
3004 | } | ||
3000 | 3005 | ||
3001 | mutex_lock(&priv->mutex); | ||
3002 | __iwl3945_up(priv); | 3006 | __iwl3945_up(priv); |
3003 | mutex_unlock(&priv->mutex); | 3007 | mutex_unlock(&priv->mutex); |
3004 | } | 3008 | } |
@@ -3009,11 +3013,12 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data) | |||
3009 | struct iwl_priv *priv = | 3013 | struct iwl_priv *priv = |
3010 | container_of(data, struct iwl_priv, rx_replenish); | 3014 | container_of(data, struct iwl_priv, rx_replenish); |
3011 | 3015 | ||
3016 | mutex_lock(&priv->mutex); | ||
3012 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 3017 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
3013 | return; | 3018 | goto out; |
3014 | 3019 | ||
3015 | mutex_lock(&priv->mutex); | ||
3016 | iwl3945_rx_replenish(priv); | 3020 | iwl3945_rx_replenish(priv); |
3021 | out: | ||
3017 | mutex_unlock(&priv->mutex); | 3022 | mutex_unlock(&priv->mutex); |
3018 | } | 3023 | } |
3019 | 3024 | ||