提交 1c41fd5f 编写于 作者: B Bjorn Andersson 提交者: Kalle Valo

wcn36xx: Change indication list lock to spinlock

In preparation for handling incoming messages from IRQ context, change
the indication list lock to a spinlock
Signed-off-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 909aa60c
...@@ -2243,10 +2243,10 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len) ...@@ -2243,10 +2243,10 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len)
msg_ind->msg_len = len; msg_ind->msg_len = len;
memcpy(msg_ind->msg, buf, len); memcpy(msg_ind->msg, buf, len);
mutex_lock(&wcn->hal_ind_mutex); spin_lock(&wcn->hal_ind_lock);
list_add_tail(&msg_ind->list, &wcn->hal_ind_queue); list_add_tail(&msg_ind->list, &wcn->hal_ind_queue);
queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work); queue_work(wcn->hal_ind_wq, &wcn->hal_ind_work);
mutex_unlock(&wcn->hal_ind_mutex); spin_unlock(&wcn->hal_ind_lock);
wcn36xx_dbg(WCN36XX_DBG_HAL, "indication arrived\n"); wcn36xx_dbg(WCN36XX_DBG_HAL, "indication arrived\n");
break; break;
default: default:
...@@ -2260,8 +2260,9 @@ static void wcn36xx_ind_smd_work(struct work_struct *work) ...@@ -2260,8 +2260,9 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
container_of(work, struct wcn36xx, hal_ind_work); container_of(work, struct wcn36xx, hal_ind_work);
struct wcn36xx_hal_msg_header *msg_header; struct wcn36xx_hal_msg_header *msg_header;
struct wcn36xx_hal_ind_msg *hal_ind_msg; struct wcn36xx_hal_ind_msg *hal_ind_msg;
unsigned long flags;
mutex_lock(&wcn->hal_ind_mutex); spin_lock_irqsave(&wcn->hal_ind_lock, flags);
hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, hal_ind_msg = list_first_entry(&wcn->hal_ind_queue,
struct wcn36xx_hal_ind_msg, struct wcn36xx_hal_ind_msg,
...@@ -2293,8 +2294,8 @@ static void wcn36xx_ind_smd_work(struct work_struct *work) ...@@ -2293,8 +2294,8 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
msg_header->msg_type); msg_header->msg_type);
} }
list_del(wcn->hal_ind_queue.next); list_del(wcn->hal_ind_queue.next);
spin_unlock_irqrestore(&wcn->hal_ind_lock, flags);
kfree(hal_ind_msg); kfree(hal_ind_msg);
mutex_unlock(&wcn->hal_ind_mutex);
} }
int wcn36xx_smd_open(struct wcn36xx *wcn) int wcn36xx_smd_open(struct wcn36xx *wcn)
{ {
...@@ -2307,7 +2308,7 @@ int wcn36xx_smd_open(struct wcn36xx *wcn) ...@@ -2307,7 +2308,7 @@ int wcn36xx_smd_open(struct wcn36xx *wcn)
} }
INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work); INIT_WORK(&wcn->hal_ind_work, wcn36xx_ind_smd_work);
INIT_LIST_HEAD(&wcn->hal_ind_queue); INIT_LIST_HEAD(&wcn->hal_ind_queue);
mutex_init(&wcn->hal_ind_mutex); spin_lock_init(&wcn->hal_ind_lock);
ret = wcn->ctrl_ops->open(wcn, wcn36xx_smd_rsp_process); ret = wcn->ctrl_ops->open(wcn, wcn36xx_smd_rsp_process);
if (ret) { if (ret) {
...@@ -2327,5 +2328,4 @@ void wcn36xx_smd_close(struct wcn36xx *wcn) ...@@ -2327,5 +2328,4 @@ void wcn36xx_smd_close(struct wcn36xx *wcn)
{ {
wcn->ctrl_ops->close(); wcn->ctrl_ops->close();
destroy_workqueue(wcn->hal_ind_wq); destroy_workqueue(wcn->hal_ind_wq);
mutex_destroy(&wcn->hal_ind_mutex);
} }
...@@ -215,7 +215,7 @@ struct wcn36xx { ...@@ -215,7 +215,7 @@ struct wcn36xx {
struct completion hal_rsp_compl; struct completion hal_rsp_compl;
struct workqueue_struct *hal_ind_wq; struct workqueue_struct *hal_ind_wq;
struct work_struct hal_ind_work; struct work_struct hal_ind_work;
struct mutex hal_ind_mutex; spinlock_t hal_ind_lock;
struct list_head hal_ind_queue; struct list_head hal_ind_queue;
/* DXE channels */ /* DXE channels */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册