diff options
author | Yan-Hsuan Chuang <yhchuang@realtek.com> | 2019-07-31 20:22:46 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-08-06 15:42:12 +0300 |
commit | 713a30de45a2ec8619228280e4832b5d6a34e759 (patch) | |
tree | 56e115b0cbe0a38a398bbfe415abc14b1555b58a /drivers/net/wireless/realtek/rtw88/fw.c | |
parent | 0d762f031d702272a17910fbeb45ab15b9673617 (diff) |
rtw88: enclose c2h cmd handle with mutex
C2H commands that cannot be handled in IRQ context should
be protected by rtwdev->mutex. Because they might have a
sequece of hardware operations that does not want to be
interfered.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/fw.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/fw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index 3c4dcb7cf69e..3b06f7150c41 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -36,6 +36,8 @@ void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb) c2h = (struct rtw_c2h_cmd *)(skb->data + pkt_offset); len = skb->len - pkt_offset - 2; + mutex_lock(&rtwdev->mutex); + switch (c2h->id) { case C2H_HALMAC: rtw_fw_c2h_cmd_handle_ext(rtwdev, skb); @@ -43,6 +45,8 @@ void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb) default: break; } + + mutex_unlock(&rtwdev->mutex); } void rtw_fw_c2h_cmd_rx_irqsafe(struct rtw_dev *rtwdev, u32 pkt_offset, |