lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Aug 2014 18:11:01 -0400
From:	Alex Deucher <alexdeucher@...il.com>
To:	Alex Williamson <alex.williamson@...hat.com>
Cc:	"Deucher, Alexander" <alexander.deucher@....com>,
	Christian Koenig <christian.koenig@....com>,
	Maling list - DRI developers 
	<dri-devel@...ts.freedesktop.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] radeon: Test for PCI root bus before assuming bus->self

On Wed, Aug 27, 2014 at 3:01 PM, Alex Williamson
<alex.williamson@...hat.com> wrote:
> 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@...hat.com>

Added to my -fixes queue.  thanks!

Alex


> ---
>
>  drivers/gpu/drm/radeon/cik.c |    6 +++++-
>  drivers/gpu/drm/radeon/si.c  |    6 +++++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 79a5a55..cc34308 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -9555,6 +9555,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;
>
> @@ -9781,7 +9784,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;
>
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index a1274a3..ffb1d4e 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -7177,6 +7177,9 @@ static void si_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;
>
> @@ -7454,7 +7457,8 @@ static void si_program_aspm(struct radeon_device *rdev)
>                         if (orig != data)
>                                 WREG32_PIF_PHY1(PB1_PIF_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;
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ