diff options
author | Brian Norris <briannorris@chromium.org> | 2020-03-12 16:08:48 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-03-23 19:29:26 +0200 |
commit | 57fb39e247754b60401358b1f4be78ab6f5ef9f4 (patch) | |
tree | db5433d720ad71deee07d70a20f39f7dc341a413 /drivers/net/wireless/realtek/rtw88/pci.h | |
parent | 53efdc9cb9e6a6f693a81da005280df92b813933 (diff) |
rtw88: don't hold all IRQs disabled for PS operations
This driver generally only needs to ensure that
(a) it doesn't try to process TX interrupts at the same time as
power-save operations (and similar)
(b) the device interrupt gets disabled while we're still handling the
last set of interrupts
For (a), all the operations (e.g., PS transitions, packet handling)
happens in non-atomic contexts (e.g., threaded IRQ).
For (b), we only need mutual exclusion for brief sections (i.e., while
we're actually manipulating the interrupt mask/status).
So, we can introduce a separate lock for handling (b), disabling IRQs
while we do it. For (a), we can demote the locking to BH only, now that
(b) (the only steps done in atomic context) and that has its own lock.
This helps reduce the amount of time this driver spends with IRQs off.
Notably, transitioning out of power-save modes can take >3 milliseconds,
and this transition is done under the protection of 'irq_lock'.
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200312080852.16684-2-yhchuang@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/pci.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/pci.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/pci.h b/drivers/net/wireless/realtek/rtw88/pci.h index cd4fcd064cdb..b60a359febe6 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.h +++ b/drivers/net/wireless/realtek/rtw88/pci.h @@ -198,7 +198,9 @@ struct rtw_pci_rx_ring { struct rtw_pci { struct pci_dev *pdev; - /* used for pci interrupt */ + /* Used for PCI interrupt. */ + spinlock_t hwirq_lock; + /* Used for PCI TX queueing. */ spinlock_t irq_lock; u32 irq_mask[4]; bool irq_enabled; |