tree: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git pm head: 624306d2c241c274e498619cabc2ae1dc7112ad1 commit: 624306d2c241c274e498619cabc2ae1dc7112ad1 [2/2] x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231006/202310061830.A7jaXxeG-lkp@xxxxxxxxx/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231006/202310061830.A7jaXxeG-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202310061830.A7jaXxeG-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): >> arch/x86/pci/fixup.c:929:6: error: use of undeclared identifier 'pm_suspend_target_state' if (pm_suspend_target_state == PM_SUSPEND_ON) ^ >> arch/x86/pci/fixup.c:929:33: error: use of undeclared identifier 'PM_SUSPEND_ON' if (pm_suspend_target_state == PM_SUSPEND_ON) ^ >> arch/x86/pci/fixup.c:951:20: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] rp->pme_support = FIELD_GET(PCI_PM_CAP_PME_MASK, pmc); ^ 3 errors generated. vim +/pm_suspend_target_state +929 arch/x86/pci/fixup.c 907 908 #ifdef CONFIG_SUSPEND 909 /* 910 * Root Ports on some AMD SoCs advertise PME_Support for D3hot and D3cold, but 911 * if the SoC is put into a hardware sleep state by the amd-pmc driver, the 912 * Root Ports don't generate wakeup interrupts for USB devices. 913 * 914 * When suspending, remove D3hot and D3cold from the PME_Support advertised 915 * by the Root Port so we don't use those states if we're expecting wakeup 916 * interrupts. Restore the advertised PME_Support when resuming. 917 */ 918 static void amd_rp_pme_suspend(struct pci_dev *dev) 919 { 920 struct pci_dev *rp; 921 922 /* 923 * PM_SUSPEND_ON means we're doing runtime suspend, which means 924 * amd-pmc will not be involved so PMEs during D3 work as advertised. 925 * 926 * The PMEs *do* work if amd-pmc doesn't put the SoC in the hardware 927 * sleep state, but we assume amd-pmc is always present. 928 */ > 929 if (pm_suspend_target_state == PM_SUSPEND_ON) 930 return; 931 932 rp = pcie_find_root_port(dev); 933 if (!rp->pm_cap) 934 return; 935 936 rp->pme_support &= ~((PCI_PM_CAP_PME_D3hot|PCI_PM_CAP_PME_D3cold) >> 937 PCI_PM_CAP_PME_SHIFT); 938 dev_info_once(&rp->dev, "quirk: disabling D3cold for suspend\n"); 939 } 940 941 static void amd_rp_pme_resume(struct pci_dev *dev) 942 { 943 struct pci_dev *rp; 944 u16 pmc; 945 946 rp = pcie_find_root_port(dev); 947 if (!rp->pm_cap) 948 return; 949 950 pci_read_config_word(rp, rp->pm_cap + PCI_PM_PMC, &pmc); > 951 rp->pme_support = FIELD_GET(PCI_PM_CAP_PME_MASK, pmc); -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki