Skip to content

Commit 123204a

Browse files
IcenowyRevySR
authored andcommitted
FROMLIST: PCI: hide mysterious 8MB 64-bit pref BAR on Intel Arc PCIe Switch
The upstream port device of Intel Arc series dGPUs' internal PCIe switch contains a mysterious 8MB 64-bit prefetchable BAR. All reads to memory mapped to that BAR returns 0xFFFFFFFF and writes have no effect. When the PCI bus isn't configured by any firmware (e.g. a PCIe controller solely initialized by Linux kernel), the PCI space allocation algorithm of Linux will allocate the main VRAM BAR of Arc dGPU device at base+0, and then the 8MB BAR at base+256M, which prevents the main VRAM BAR gets resized. As the functionality and performance of Arc dGPU will get severely restricted with small BAR, this makes a problem. Hide the mysterious 8MB BAR to Linux PCI subsystem, to allow resizing the VRAM BAR to VRAM size with the Linux PCI space allocation algorithm. Signed-off-by: Icenowy Zheng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Han Gao <[email protected]>
1 parent 920e7dd commit 123204a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/pci/quirks.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,6 +3682,22 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x37d0, quirk_broken_intx_masking);
36823682
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x37d1, quirk_broken_intx_masking);
36833683
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x37d2, quirk_broken_intx_masking);
36843684

3685+
/*
3686+
* Intel Arc dGPUs' internal switch upstream port contains a mysterious 8MB
3687+
* 64-bit prefetchable BAR that blocks resize of main dGPU VRAM BAR with
3688+
* Linux's PCI space allocation algorithm.
3689+
*/
3690+
static void quirk_intel_xe_upstream(struct pci_dev *pdev)
3691+
{
3692+
memset(&pdev->resource[0], 0, sizeof(pdev->resource[0]));
3693+
}
3694+
/* Intel Arc A380 PCI Express Switch Upstream Port */
3695+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x4fa1, quirk_intel_xe_upstream);
3696+
/* Intel Arc A770 PCI Express Switch Upstream Port */
3697+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x4fa0, quirk_intel_xe_upstream);
3698+
/* Intel Arc B580 PCI Express Switch Upstream Port */
3699+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0xe2ff, quirk_intel_xe_upstream);
3700+
36853701
static u16 mellanox_broken_intx_devs[] = {
36863702
PCI_DEVICE_ID_MELLANOX_HERMON_SDR,
36873703
PCI_DEVICE_ID_MELLANOX_HERMON_DDR,

0 commit comments

Comments
 (0)