aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi2020-07-30 11:27:51 +0200
committerFelix Fietkau2020-09-24 18:10:12 +0200
commit763d750c38484cb1fbe389a5cf45b391b9eaa056 (patch)
treefd09018747382beb9645a89a0f1b064ecec59ce2
parentcddaaa56375615c256eb6960d3092ddb8a7a9154 (diff)
mt76: do not inject packets if MT76_STATE_PM is set
Do not tx packets in mt76_txq_send_burst() or mt76_txq_schedule_list() if the device is in runtime-pm Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/tx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 3afd89ecd6c9..40ec55ac9a7c 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -460,7 +460,8 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq,
if (probe)
break;
- if (test_bit(MT76_RESET, &phy->state))
+ if (test_bit(MT76_STATE_PM, &phy->state) ||
+ test_bit(MT76_RESET, &phy->state))
return -EBUSY;
skb = mt76_txq_dequeue(phy, mtxq, false);
@@ -516,7 +517,8 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
if (sq->swq_queued >= 4)
break;
- if (test_bit(MT76_RESET, &phy->state)) {
+ if (test_bit(MT76_STATE_PM, &phy->state) ||
+ test_bit(MT76_RESET, &phy->state)) {
ret = -EBUSY;
break;
}