Skip to content

Commit

Permalink
mt76: do not inject packets if MT76_STATE_PM is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Aug 5, 2020
1 parent a560251 commit 5c42061
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tx.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 5c42061

Please sign in to comment.