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]
Message-ID: <50D6039D.4000001@linux.vnet.ibm.com>
Date:	Sat, 22 Dec 2012 17:01:49 -0200
From:	Lucas Kannebley Tavares <lucaskt@...ux.vnet.ibm.com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	dri-devel@...ts.freedesktop.org, David Airlie <airlied@...ux.ie>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	brking@...ux.vnet.ibm.com, benh@....ibm.com,
	Betty Dall <betty.dall@...com>,
	Thadeu Lima de Souza Cascardo <cascardo@...ux.vnet.ibm.com>
Subject: [PATCH] drm: fixed access to PCI host bridges

During the process of obtaining the speed cap for the device, it
attempts go get the PCI Host bus. However on architectures such as PPC
or IA64, those do not appear as devices.

Signed-off-by: Lucas Kannebley Tavares <lucaskt@...ux.vnet.ibm.com>
---
  drivers/gpu/drm/drm_pci.c |    5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 754bc96..ea41234 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -479,8 +479,13 @@ int drm_pcie_get_speed_cap_mask(struct drm_device 
*dev, u32 *mask)
  	if (!pci_is_pcie(dev->pdev))
  		return -EINVAL;

+	// find PCI device for capabilities
  	root = dev->pdev->bus->self;

+	// some architectures might not have host bridges as PCI devices
+	if (root == NULL)
+		root = dev->pdev;
+
  	pos = pci_pcie_cap(root);
  	if (!pos)
  		return -EINVAL;

-- 
Lucas Kannebley Tavares
Software Engineer
IBM Linux Technology Center

--
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