aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2010-12-17 20:36:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-20 14:49:48 -0500
commitd704300fa546a613ec3821b908528b20685cb92a (patch)
treef11a738d188c0f0538d385cb205a1149534c6014
parentf0b3e4b7307f02a203029441b0473a84aebc6435 (diff)
rtlwifi: Fix use of mutex in interrupt code
A previous conversion from semaphoreto mutexes missed the fact that one of the semaphores was used in interrupt code. Fixed by changing to a spinlock. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rtlwifi/base.c2
-rw-r--r--drivers/net/wireless/rtlwifi/ps.c5
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h4
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 87530eaa88bd..77fa59af63d8 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -309,8 +309,8 @@ int rtl_init_core(struct ieee80211_hw *hw)
309 } 309 }
310 310
311 /* <4> locks */ 311 /* <4> locks */
312 mutex_init(&rtlpriv->locks.ips_mutex);
313 mutex_init(&rtlpriv->locks.conf_mutex); 312 mutex_init(&rtlpriv->locks.conf_mutex);
313 spin_lock_init(&rtlpriv->locks.ips_lock);
314 spin_lock_init(&rtlpriv->locks.irq_th_lock); 314 spin_lock_init(&rtlpriv->locks.irq_th_lock);
315 spin_lock_init(&rtlpriv->locks.h2c_lock); 315 spin_lock_init(&rtlpriv->locks.h2c_lock);
316 spin_lock_init(&rtlpriv->locks.rf_ps_lock); 316 spin_lock_init(&rtlpriv->locks.rf_ps_lock);
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c
index 22c293e5b88c..d2326c13449e 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers/net/wireless/rtlwifi/ps.c
@@ -286,8 +286,9 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)
286 struct rtl_priv *rtlpriv = rtl_priv(hw); 286 struct rtl_priv *rtlpriv = rtl_priv(hw);
287 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 287 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
288 enum rf_pwrstate rtstate; 288 enum rf_pwrstate rtstate;
289 unsigned long flags;
289 290
290 mutex_lock(&rtlpriv->locks.ips_mutex); 291 spin_lock_irqsave(&rtlpriv->locks.ips_lock, flags);
291 292
292 if (ppsc->b_inactiveps) { 293 if (ppsc->b_inactiveps) {
293 rtstate = ppsc->rfpwr_state; 294 rtstate = ppsc->rfpwr_state;
@@ -303,7 +304,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw)
303 } 304 }
304 } 305 }
305 306
306 mutex_unlock(&rtlpriv->locks.ips_mutex); 307 spin_unlock_irqrestore(&rtlpriv->locks.ips_lock, flags);
307} 308}
308 309
309/*for FW LPS*/ 310/*for FW LPS*/
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 77d5fa370bdc..d44d79613d2d 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1192,11 +1192,11 @@ struct rtl_hal_cfg {
1192}; 1192};
1193 1193
1194struct rtl_locks { 1194struct rtl_locks {
1195 /*sem */ 1195 /* mutex */
1196 struct mutex ips_mutex;
1197 struct mutex conf_mutex; 1196 struct mutex conf_mutex;
1198 1197
1199 /*spin lock */ 1198 /*spin lock */
1199 spinlock_t ips_lock;
1200 spinlock_t irq_th_lock; 1200 spinlock_t irq_th_lock;
1201 spinlock_t h2c_lock; 1201 spinlock_t h2c_lock;
1202 spinlock_t rf_ps_lock; 1202 spinlock_t rf_ps_lock;