diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-04-18 19:45:45 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-04-21 21:55:54 +0300 |
commit | dc5d5f9d3fe4d0c26b4e4beb25d056ffcc5fbf02 (patch) | |
tree | 1c23a7df356b88981dbf8206823d5f98cf3cd06b /drivers/net/wireless/mediatek/mt76/mt7921/pci.c | |
parent | 36873246f78a2d82eb8c43f74af52f199757dcff (diff) | |
download | linux-dc5d5f9d3fe4d0c26b4e4beb25d056ffcc5fbf02.tar.xz |
mt76: mt7921: enable sw interrupts
Enable sw interrupts in order to wake the device from deep sleep
receiving packets
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921/pci.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index 40e2086d075c..d5da98d36f63 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -61,6 +61,18 @@ static void mt7921_irq_tasklet(unsigned long data) if (intr & MT_INT_TX_DONE_MCU) mask |= MT_INT_TX_DONE_MCU; + if (intr & MT_INT_MCU_CMD) { + u32 intr_sw; + + intr_sw = mt76_rr(dev, MT_MCU_CMD); + /* ack MCU2HOST_SW_INT_STA */ + mt76_wr(dev, MT_MCU_CMD, intr_sw); + if (intr_sw & MT_MCU_CMD_WAKE_RX_PCIE) { + mask |= MT_INT_RX_DONE_DATA; + intr |= MT_INT_RX_DONE_DATA; + } + } + mt76_set_irq_mask(&dev->mt76, MT_WFDMA0_HOST_INT_ENA, mask, 0); if (intr & MT_INT_TX_DONE_ALL) @@ -253,6 +265,7 @@ static int mt7921_pci_resume(struct pci_dev *pdev) mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff); mt7921_irq_enable(dev, MT_INT_RX_DONE_ALL | MT_INT_TX_DONE_ALL | MT_INT_MCU_CMD); + mt76_set(dev, MT_MCU2HOST_SW_INT_ENA, MT_MCU_CMD_WAKE_RX_PCIE); /* put dma enabled */ mt76_set(dev, MT_WFDMA0_GLO_CFG, |