Skip to content

Commit

Permalink
mt76: mt7663: check isr read return value in mt7663s_rx_work
Browse files Browse the repository at this point in the history
In order to avoid using stale isr values, check return value from
sdio_readsb() in mt7663s_rx_work()

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Lorenzo Bianconi authored and Felix Fietkau committed Sep 24, 2020
1 parent 1522ff7 commit 4178d96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,12 @@ void mt7663s_rx_work(struct work_struct *work)
/* disable interrupt */
sdio_claim_host(sdio->func);
sdio_writel(sdio->func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, NULL);
sdio_readsb(sdio->func, intr, MCR_WHISR, sizeof(struct mt76s_intr));
ret = sdio_readsb(sdio->func, intr, MCR_WHISR, sizeof(*intr));
sdio_release_host(sdio->func);

if (ret < 0)
goto out;

trace_dev_irq(dev, intr->isr, 0);

if (intr->isr & WHIER_RX0_DONE_INT_EN) {
Expand All @@ -306,7 +309,7 @@ void mt7663s_rx_work(struct work_struct *work)
queue_work(sdio->txrx_wq, &sdio->rx.recv_work);
return;
}

out:
/* enable interrupt */
sdio_claim_host(sdio->func);
sdio_writel(sdio->func, WHLPCR_INT_EN_SET, MCR_WHLPCR, NULL);
Expand Down

0 comments on commit 4178d96

Please sign in to comment.