Commit 91457eaa authored by Cathy Luo's avatar Cathy Luo Committed by Kalle Valo

mwifiex: reduce spinlock usage in main process

We will reset more_task_flag at the end of main process
routine. This optimization will help to remove spinlock
operations at couple of places in the code.
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f022ea52
...@@ -231,11 +231,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -231,11 +231,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
goto exit_main_proc; goto exit_main_proc;
} else { } else {
adapter->mwifiex_processing = true; adapter->mwifiex_processing = true;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
} }
process_start: process_start:
do { do {
adapter->more_task_flag = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
if ((adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING) || if ((adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING) ||
(adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY)) (adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY))
break; break;
...@@ -275,7 +274,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -275,7 +274,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
adapter->pm_wakeup_fw_try = true; adapter->pm_wakeup_fw_try = true;
mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3)); mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3));
adapter->if_ops.wakeup(adapter); adapter->if_ops.wakeup(adapter);
spin_lock_irqsave(&adapter->main_proc_lock, flags);
continue; continue;
} }
...@@ -335,7 +333,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -335,7 +333,6 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
(adapter->ps_state == PS_STATE_PRE_SLEEP) || (adapter->ps_state == PS_STATE_PRE_SLEEP) ||
(adapter->ps_state == PS_STATE_SLEEP_CFM) || (adapter->ps_state == PS_STATE_SLEEP_CFM) ||
adapter->tx_lock_flag){ adapter->tx_lock_flag){
spin_lock_irqsave(&adapter->main_proc_lock, flags);
continue; continue;
} }
...@@ -386,12 +383,14 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -386,12 +383,14 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
} }
break; break;
} }
spin_lock_irqsave(&adapter->main_proc_lock, flags);
} while (true); } while (true);
spin_lock_irqsave(&adapter->main_proc_lock, flags); spin_lock_irqsave(&adapter->main_proc_lock, flags);
if (adapter->more_task_flag) if (adapter->more_task_flag) {
adapter->more_task_flag = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto process_start; goto process_start;
}
adapter->mwifiex_processing = false; adapter->mwifiex_processing = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags); spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment