mt76: sdio: do not run mt76_txq_schedule directly
In order to support runtime-pm for sdio, do not run mt76_txq_schedule directly, but schedule tx_worker instead Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
1153668eef
commit
aac5104bf6
1 changed files with 11 additions and 5 deletions
|
@ -184,9 +184,6 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
|
||||||
if (!q->queued)
|
if (!q->queued)
|
||||||
wake_up(&dev->tx_wait);
|
wake_up(&dev->tx_wait);
|
||||||
|
|
||||||
if (!mcu)
|
|
||||||
mt76_txq_schedule(&dev->phy, q->qid);
|
|
||||||
|
|
||||||
return nframes;
|
return nframes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,19 +192,28 @@ static void mt76s_status_worker(struct mt76_worker *w)
|
||||||
struct mt76_sdio *sdio = container_of(w, struct mt76_sdio,
|
struct mt76_sdio *sdio = container_of(w, struct mt76_sdio,
|
||||||
status_worker);
|
status_worker);
|
||||||
struct mt76_dev *dev = container_of(sdio, struct mt76_dev, sdio);
|
struct mt76_dev *dev = container_of(sdio, struct mt76_dev, sdio);
|
||||||
|
bool resched = false;
|
||||||
int i, nframes;
|
int i, nframes;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
int ndata_frames = 0;
|
||||||
|
|
||||||
nframes = mt76s_process_tx_queue(dev, dev->q_mcu[MT_MCUQ_WM]);
|
nframes = mt76s_process_tx_queue(dev, dev->q_mcu[MT_MCUQ_WM]);
|
||||||
|
|
||||||
for (i = 0; i <= MT_TXQ_PSD; i++)
|
for (i = 0; i <= MT_TXQ_PSD; i++)
|
||||||
nframes += mt76s_process_tx_queue(dev,
|
ndata_frames += mt76s_process_tx_queue(dev,
|
||||||
dev->phy.q_tx[i]);
|
dev->phy.q_tx[i]);
|
||||||
|
nframes += ndata_frames;
|
||||||
|
if (ndata_frames > 0)
|
||||||
|
resched = true;
|
||||||
|
|
||||||
if (dev->drv->tx_status_data &&
|
if (dev->drv->tx_status_data &&
|
||||||
!test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
|
!test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
|
||||||
queue_work(dev->wq, &dev->sdio.stat_work);
|
queue_work(dev->wq, &dev->sdio.stat_work);
|
||||||
} while (nframes > 0);
|
} while (nframes > 0);
|
||||||
|
|
||||||
|
if (resched)
|
||||||
|
mt76_worker_schedule(&dev->sdio.txrx_worker);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mt76s_tx_status_data(struct work_struct *work)
|
static void mt76s_tx_status_data(struct work_struct *work)
|
||||||
|
|
Loading…
Add table
Reference in a new issue