rtw88: don't consider deep PS mode when transmitting packet
In original flow, driver needs to ensure chip leave deep ps mode before transmitting any packet, and don't enter deep ps mode beofre PCIE DMA is finished. Now with the support of 8822ce's hardware setting and firmware after v9.9.11, these limits are removed. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20211221020230.20764-1-pkshih@realtek.com
This commit is contained in:
parent
68b930ad46
commit
5d5d68bcff
@ -111,6 +111,7 @@ enum rtw_fw_feature {
|
||||
FW_FEATURE_LPS_C2H = BIT(1),
|
||||
FW_FEATURE_LCLK = BIT(2),
|
||||
FW_FEATURE_PG = BIT(3),
|
||||
FW_FEATURE_TX_WAKE = BIT(4),
|
||||
FW_FEATURE_BCN_FILTER = BIT(5),
|
||||
FW_FEATURE_NOTIFY_SCAN = BIT(6),
|
||||
FW_FEATURE_ADAPTIVITY = BIT(7),
|
||||
|
@ -611,6 +611,9 @@ static void rtw_pci_deep_ps_enter(struct rtw_dev *rtwdev)
|
||||
bool tx_empty = true;
|
||||
u8 queue;
|
||||
|
||||
if (rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_TX_WAKE))
|
||||
goto enter_deep_ps;
|
||||
|
||||
lockdep_assert_held(&rtwpci->irq_lock);
|
||||
|
||||
/* Deep PS state is not allowed to TX-DMA */
|
||||
@ -636,7 +639,7 @@ static void rtw_pci_deep_ps_enter(struct rtw_dev *rtwdev)
|
||||
"TX path not empty, cannot enter deep power save state\n");
|
||||
return;
|
||||
}
|
||||
|
||||
enter_deep_ps:
|
||||
set_bit(RTW_FLAG_LEISURE_PS_DEEP, rtwdev->flags);
|
||||
rtw_power_mode_change(rtwdev, true);
|
||||
}
|
||||
@ -807,7 +810,8 @@ static void rtw_pci_tx_kick_off_queue(struct rtw_dev *rtwdev, u8 queue)
|
||||
bd_idx = rtw_pci_tx_queue_idx_addr[queue];
|
||||
|
||||
spin_lock_bh(&rtwpci->irq_lock);
|
||||
rtw_pci_deep_ps_leave(rtwdev);
|
||||
if (!rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_TX_WAKE))
|
||||
rtw_pci_deep_ps_leave(rtwdev);
|
||||
rtw_write16(rtwdev, bd_idx, ring->r.wp & TRX_BD_IDX_MASK);
|
||||
spin_unlock_bh(&rtwpci->irq_lock);
|
||||
}
|
||||
|
@ -83,6 +83,9 @@ void rtw_power_mode_change(struct rtw_dev *rtwdev, bool enter)
|
||||
/* Each request require an ack from firmware */
|
||||
request |= POWER_MODE_ACK;
|
||||
|
||||
if (rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_TX_WAKE))
|
||||
request |= POWER_TX_WAKE;
|
||||
|
||||
rtw_write8(rtwdev, rtwdev->hci.rpwm_addr, request);
|
||||
|
||||
/* Check firmware get the power requset and ack via cpwm register */
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#define POWER_MODE_ACK BIT(6)
|
||||
#define POWER_MODE_PG BIT(4)
|
||||
#define POWER_TX_WAKE BIT(1)
|
||||
#define POWER_MODE_LCLK BIT(0)
|
||||
|
||||
#define LEAVE_LPS_TRY_CNT 5
|
||||
|
Loading…
Reference in New Issue
Block a user