Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse

RX 5600 XT Pulse advertises support for BAR 0 being 256MB, 512MB,
or 1GB, but it also supports 2GB, 4GB, and 8GB. Add a rebar
size quirk so that the BAR 0 is big enough to cover complete VARM.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20210107175017.15893-5-nirmoy.das@amd.com

authored by

Nirmoy Das and committed by
Christian König
907830b0 192f1bf7

+8 -1
+8 -1
drivers/pci/pci.c
··· 3603 3603 return 0; 3604 3604 3605 3605 pci_read_config_dword(pdev, pos + PCI_REBAR_CAP, &cap); 3606 - return (cap & PCI_REBAR_CAP_SIZES) >> 4; 3606 + cap &= PCI_REBAR_CAP_SIZES; 3607 + 3608 + /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */ 3609 + if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f && 3610 + bar == 0 && cap == 0x7000) 3611 + cap = 0x3f000; 3612 + 3613 + return cap >> 4; 3607 3614 } 3608 3615 EXPORT_SYMBOL(pci_rebar_get_possible_sizes); 3609 3616