diff options
author | Nirmoy Das <nirmoy.das@amd.com> | 2021-01-07 12:26:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-07 12:18:58 +0100 |
commit | 77e54793da0f17b6acad19471dc6f1f938a5e7f1 (patch) | |
tree | d077dec4e6d4c1b4db9078ea3079154c61a6e7a1 /drivers | |
parent | 2fd58d8bb0853c3f424a089f71805e26b9b5e899 (diff) | |
download | linux-stable-77e54793da0f17b6acad19471dc6f1f938a5e7f1.tar.gz linux-stable-77e54793da0f17b6acad19471dc6f1f938a5e7f1.tar.bz2 linux-stable-77e54793da0f17b6acad19471dc6f1f938a5e7f1.zip |
PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse
[ Upstream commit 907830b0fc9e374d00f3c83de5e426157b482c01 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cd628dd73719..83fda1987d1f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3361,7 +3361,14 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar) return 0; pci_read_config_dword(pdev, pos + PCI_REBAR_CAP, &cap); - return (cap & PCI_REBAR_CAP_SIZES) >> 4; + cap &= PCI_REBAR_CAP_SIZES; + + /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */ + if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f && + bar == 0 && cap == 0x7000) + cap = 0x3f000; + + return cap >> 4; } /** |