[PATCH 07/10] rtl8192e: rf_ps_lock doesn't need to be IRQ safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Mike McCormack <mikem@xxxxxxxxxx>
---
 drivers/staging/rtl8192e/r8190_rtl8256.c |   11 +++++------
 drivers/staging/rtl8192e/r8192E_core.c   |   14 ++++++--------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192e/r8190_rtl8256.c b/drivers/staging/rtl8192e/r8190_rtl8256.c
index db70505..7896d23 100644
--- a/drivers/staging/rtl8192e/r8190_rtl8256.c
+++ b/drivers/staging/rtl8192e/r8190_rtl8256.c
@@ -716,7 +716,6 @@ MgntActSet_RF_State(
 	bool 			bConnectBySSID = false;
 	RT_RF_POWER_STATE	rtState;
 	u16					RFWaitCounter = 0;
-	unsigned long flag;
 	RT_TRACE(COMP_POWER, "===>MgntActSet_RF_State(): StateToSet(%d)\n",StateToSet);
 
 	//1//
@@ -726,10 +725,10 @@ MgntActSet_RF_State(
 
 	while(true)
 	{
-		spin_lock_irqsave(&priv->rf_ps_lock,flag);
+		spin_lock(&priv->rf_ps_lock);
 		if(priv->RFChangeInProgress)
 		{
-			spin_unlock_irqrestore(&priv->rf_ps_lock,flag);
+			spin_unlock(&priv->rf_ps_lock);
 			RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): RF Change in progress! Wait to set..StateToSet(%d).\n", StateToSet);
 
 			// Set RF after the previous action is done.
@@ -751,7 +750,7 @@ MgntActSet_RF_State(
 		else
 		{
 			priv->RFChangeInProgress = true;
-			spin_unlock_irqrestore(&priv->rf_ps_lock,flag);
+			spin_unlock(&priv->rf_ps_lock);
 			break;
 		}
 	}
@@ -809,9 +808,9 @@ MgntActSet_RF_State(
 	}
 
 	// Release RF spinlock
-	spin_lock_irqsave(&priv->rf_ps_lock,flag);
+	spin_lock(&priv->rf_ps_lock);
 	priv->RFChangeInProgress = false;
-	spin_unlock_irqrestore(&priv->rf_ps_lock,flag);
+	spin_unlock(&priv->rf_ps_lock);
 
 	RT_TRACE(COMP_POWER, "<===MgntActSet_RF_State()\n");
 	return bActionAllowed;
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index d6af0b6..f7fee51 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -1892,16 +1892,15 @@ short rtl8192_is_tx_queue_empty(struct net_device *dev)
 static void rtl8192_hw_sleep_down(struct net_device *dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
-	unsigned long flags = 0;
 
-	spin_lock_irqsave(&priv->rf_ps_lock,flags);
+	spin_lock(&priv->rf_ps_lock);
 	if (priv->RFChangeInProgress) {
-		spin_unlock_irqrestore(&priv->rf_ps_lock,flags);
+		spin_unlock(&priv->rf_ps_lock);
 		RT_TRACE(COMP_RF, "rtl8192_hw_sleep_down(): RF Change in progress! \n");
 		printk("rtl8192_hw_sleep_down(): RF Change in progress!\n");
 		return;
 	}
-	spin_unlock_irqrestore(&priv->rf_ps_lock,flags);
+	spin_unlock(&priv->rf_ps_lock);
 
 	MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS);
 }
@@ -1918,17 +1917,16 @@ static void rtl8192_hw_sleep_wq (struct work_struct *work)
 static void rtl8192_hw_wakeup(struct net_device* dev)
 {
 	struct r8192_priv *priv = ieee80211_priv(dev);
-	unsigned long flags = 0;
 
-	spin_lock_irqsave(&priv->rf_ps_lock,flags);
+	spin_lock(&priv->rf_ps_lock);
 	if (priv->RFChangeInProgress) {
-		spin_unlock_irqrestore(&priv->rf_ps_lock,flags);
+		spin_unlock(&priv->rf_ps_lock);
 		RT_TRACE(COMP_RF, "rtl8192_hw_wakeup(): RF Change in progress! \n");
 		printk("rtl8192_hw_wakeup(): RF Change in progress! schedule wake up task again\n");
 		queue_delayed_work(priv->ieee80211->wq,&priv->ieee80211->hw_wakeup_wq,MSECS(10));//PowerSave is not supported if kernel version is below 2.6.20
 		return;
 	}
-	spin_unlock_irqrestore(&priv->rf_ps_lock,flags);
+	spin_unlock(&priv->rf_ps_lock);
 
 	MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS);
 }
-- 
1.7.0.4


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux