diff options
author | Jiqian Chen <Jiqian.Chen@amd.com> | 2023-07-25 18:45:45 +0800 |
---|---|---|
committer | Huang Rui <ray.huang@amd.com> | 2023-08-22 16:04:53 +0800 |
commit | 9f90729631a5322ef1c05c9654487fab82b71462 (patch) | |
tree | 29f84780125f6c337445fa9b7674abf78db3ee3b | |
parent | 23d80dd907313da380b511345a14e159bcef81dc (diff) | |
download | linux-upstream-for-pvh.tar.gz |
drivers/pci: Don't restore rebar state on Xen PVH dom0upstream-for-pvh
PCIe Rebar capability is disabled when dGPU is used on PVH dom0. So, we
don't restore rebar state here.
Will enable it once pcie resizable bar is correctly performed on Xen
PVH.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
-rw-r--r-- | drivers/pci/pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 60230da957e0c4..4b05bccc2ece9d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -32,6 +32,7 @@ #include <asm/dma.h> #include <linux/aer.h> #include <linux/bitfield.h> +#include <xen/xen.h> #include "pci.h" DEFINE_MUTEX(pci_slot_mutex); @@ -1765,6 +1766,14 @@ static void pci_restore_rebar_state(struct pci_dev *pdev) unsigned int pos, nbars, i; u32 ctrl; + /* + * PVH dom0 doesn't support resizable bar capability, + * we don't need to restore rebar on PVH dom0. + */ + if (xen_initial_domain() && xen_pvh_domain()) { + return; + } + pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_REBAR); if (!pos) return; |