lkml.org 
[lkml]   [2012]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@linux.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



\
 
 \ /
  Last update: 2012-12-22 20:21    [W:0.083 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site