From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Kannebley Tavares Subject: [PATCH] drm: fixed access to PCI host bridges Date: Sat, 22 Dec 2012 17:01:49 -0200 Message-ID: <50D6039D.4000001@linux.vnet.ibm.com> References: <50CA5EE2.30206@linux.vnet.ibm.com> <50D60349.7080400@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50D60349.7080400@linux.vnet.ibm.com> Sender: linux-pci-owner@vger.kernel.org To: Bjorn Helgaas Cc: dri-devel@lists.freedesktop.org, David Airlie , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, brking@linux.vnet.ibm.com, benh@au1.ibm.com, Betty Dall , Thadeu Lima de Souza Cascardo List-Id: dri-devel@lists.freedesktop.org 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 --- 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