mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 05:16:57 +00:00
wifi: mt76: transform aspm_conf for pci_disable_link_state
commit b478e162f227 ("PCI/ASPM: Consolidate link state defines") changed
PCIE_LINK_STATE_L0S (1) to (BIT(0) | BIT(1)). PCI_EXP_LNKCTL_ASPM_L0S (1)
and PCI_EXP_LNKCTL_ASPM_L1 (2) are no longer matched with
PCIE_LINK_STATE_L0S (3) and PCIE_LINK_STATE_L1 (4).
On the platform enabling ASPM L0s and L1, mt76_pci_disable_aspm is not able
to disable L1. Fix this by transforming aspm_conf to pcie link state.
Signed-off-by: Jiajia Liu <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
2ab649809d
commit
7825972b0a
@@ -30,8 +30,14 @@ void mt76_pci_disable_aspm(struct pci_dev *pdev)
|
|||||||
|
|
||||||
if (IS_ENABLED(CONFIG_PCIEASPM)) {
|
if (IS_ENABLED(CONFIG_PCIEASPM)) {
|
||||||
int err;
|
int err;
|
||||||
|
int state = 0;
|
||||||
|
|
||||||
err = pci_disable_link_state(pdev, aspm_conf);
|
if (aspm_conf & PCI_EXP_LNKCTL_ASPM_L0S)
|
||||||
|
state |= PCIE_LINK_STATE_L0S;
|
||||||
|
if (aspm_conf & PCI_EXP_LNKCTL_ASPM_L1)
|
||||||
|
state |= PCIE_LINK_STATE_L1;
|
||||||
|
|
||||||
|
err = pci_disable_link_state(pdev, state);
|
||||||
if (!err)
|
if (!err)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user