diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2014-08-27 13:01:35 -0600 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-08-27 17:54:50 -0400 |
commit | 0bd252de78d406485c896508c13a8f7a78ee8353 (patch) | |
tree | aa2899f955d4b69ad9fedfd349bf12daef9fabdc /drivers/gpu/drm/radeon/cik.c | |
parent | 0a5f6e9d60e71e4b6dbeabd97bc887d6b2b0f0c8 (diff) | |
download | op-kernel-dev-0bd252de78d406485c896508c13a8f7a78ee8353.zip op-kernel-dev-0bd252de78d406485c896508c13a8f7a78ee8353.tar.gz |
radeon: Test for PCI root bus before assuming bus->self
If we assign a Radeon device to a virtual machine, we can no longer
assume a fixed hardware topology, like the GPU having a parent device.
This patch simply adds a few pci_is_root_bus() tests to avoid passing
a NULL pointer to PCI access functions, allowing the radeon driver to
work in a QEMU 440FX machine with an assigned HD8570 on the emulated
PCI root bus.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/cik.c')
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index e576988..fa95659 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -9563,6 +9563,9 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev) int ret, i; u16 tmp16; + if (pci_is_root_bus(rdev->pdev->bus)) + return; + if (radeon_pcie_gen2 == 0) return; @@ -9789,7 +9792,8 @@ static void cik_program_aspm(struct radeon_device *rdev) if (orig != data) WREG32_PCIE_PORT(PCIE_LC_LINK_WIDTH_CNTL, data); - if (!disable_clkreq) { + if (!disable_clkreq && + !pci_is_root_bus(rdev->pdev->bus)) { struct pci_dev *root = rdev->pdev->bus->self; u32 lnkcap; |