@@ -50,7 +50,7 @@
struct mt76x2_mcu {
struct mutex mutex;
- wait_queue_head_t wait;
+ struct completion resp_cmpl;
struct sk_buff_head res_q;
u32 msg_seq;
@@ -74,7 +74,7 @@ void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
if (q == MT_RXQ_MCU) {
skb_queue_tail(&dev->mcu.res_q, skb);
- wake_up(&dev->mcu.wait);
+ complete(&dev->mcu.resp_cmpl);
return;
}
@@ -139,7 +139,7 @@ int mt76x2_dma_init(struct mt76x2_dev *dev)
mt76_dma_attach(&dev->mt76);
- init_waitqueue_head(&dev->mcu.wait);
+ init_completion(&dev->mcu.resp_cmpl);
skb_queue_head_init(&dev->mcu.res_q);
tasklet_init(&dev->tx_tasklet, mt76x2_tx_tasklet, (unsigned long) dev);
@@ -61,8 +61,7 @@ mt76x2_mcu_get_response(struct mt76x2_dev *dev, unsigned long expires)
return NULL;
timeout = expires - jiffies;
- wait_event_timeout(dev->mcu.wait, !skb_queue_empty(&dev->mcu.res_q),
- timeout);
+ wait_for_completion_timeout(&dev->mcu.resp_cmpl, timeout);
return skb_dequeue(&dev->mcu.res_q);
}
In order to reuse mcu related code supporting mt76x2u based devices, use completion instead of wait_queue for mcu responses queue Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> --- drivers/net/wireless/mediatek/mt76/mt76x2.h | 2 +- drivers/net/wireless/mediatek/mt76/mt76x2_dma.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt76x2_mcu.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-)