linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Kannebley Tavares <lucaskt@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	brking@linux.vnet.ibm.com, benh@au1.ibm.com,
	Betty Dall <betty.dall@hp.com>,
	Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Subject: [PATCH] drm: fixed access to PCI host bridges
Date: Sat, 22 Dec 2012 17:01:49 -0200	[thread overview]
Message-ID: <50D6039D.4000001@linux.vnet.ibm.com> (raw)
In-Reply-To: <50D60349.7080400@linux.vnet.ibm.com>

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


  reply	other threads:[~2012-12-22 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 23:04 drm: Added ppc64 root device getter Lucas Kannebley Tavares
2012-12-13 23:31 ` Bjorn Helgaas
2012-12-22 19:00   ` Lucas Kannebley Tavares
2012-12-22 19:01     ` Lucas Kannebley Tavares [this message]
2012-12-26 22:40       ` [PATCH] drm: fixed access to PCI host bridges Bjorn Helgaas
2012-12-26 22:47         ` Dave Airlie
2012-12-22 19:07     ` [PATCH] drm: change pci_read_config_dword calls to pcie_capability_read_dword ones Lucas Kannebley Tavares

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D6039D.4000001@linux.vnet.ibm.com \
    --to=lucaskt@linux.vnet.ibm.com \
    --cc=airlied@linux.ie \
    --cc=benh@au1.ibm.com \
    --cc=betty.dall@hp.com \
    --cc=bhelgaas@google.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=cascardo@linux.vnet.ibm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).