mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
PCI/ASPM: Add pcie_aspm_remove_cap() to override advertised link states
Add pcie_aspm_remove_cap(). A quirk can use this to prevent use of ASPM L0s or L1 link states, even if the device advertised support for them. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Shawn Lin <shawn.lin@rock-chips.com> Reviewed-by: Lukas Wunner <lukas@wunner.de> Link: https://patch.msgid.link/20251110222929.2140564-3-helgaas@kernel.org
This commit is contained in:
@@ -1542,6 +1542,19 @@ int pci_enable_link_state_locked(struct pci_dev *pdev, int state)
|
||||
}
|
||||
EXPORT_SYMBOL(pci_enable_link_state_locked);
|
||||
|
||||
void pcie_aspm_remove_cap(struct pci_dev *pdev, u32 lnkcap)
|
||||
{
|
||||
if (lnkcap & PCI_EXP_LNKCAP_ASPM_L0S)
|
||||
pdev->aspm_l0s_support = 0;
|
||||
if (lnkcap & PCI_EXP_LNKCAP_ASPM_L1)
|
||||
pdev->aspm_l1_support = 0;
|
||||
|
||||
pci_info(pdev, "ASPM: Link Capabilities%s%s treated as unsupported to avoid device defect\n",
|
||||
lnkcap & PCI_EXP_LNKCAP_ASPM_L0S ? " L0s" : "",
|
||||
lnkcap & PCI_EXP_LNKCAP_ASPM_L1 ? " L1" : "");
|
||||
|
||||
}
|
||||
|
||||
static int pcie_aspm_set_policy(const char *val,
|
||||
const struct kernel_param *kp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user