From patchwork Sat Dec 22 19:07:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Kannebley Tavares X-Patchwork-Id: 1906371 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 7E116DFB79 for ; Sat, 22 Dec 2012 20:49:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46A74E5EAA for ; Sat, 22 Dec 2012 12:49:13 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by gabe.freedesktop.org (Postfix) with ESMTP id 66B99E5CB2 for ; Sat, 22 Dec 2012 11:08:15 -0800 (PST) Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 22 Dec 2012 17:08:14 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 22 Dec 2012 17:08:12 -0200 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 69A903520054 for ; Sat, 22 Dec 2012 14:08:11 -0500 (EST) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay03.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBMJ7pD724510542 for ; Sat, 22 Dec 2012 17:07:51 -0200 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBMH8XN4007186 for ; Sat, 22 Dec 2012 15:08:34 -0200 Received: from oc4135502304.ibm.com ([9.78.144.202]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qBMH8Wrk007182; Sat, 22 Dec 2012 15:08:32 -0200 Message-ID: <50D6050B.8080400@linux.vnet.ibm.com> Date: Sat, 22 Dec 2012 17:07:55 -0200 From: Lucas Kannebley Tavares User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 MIME-Version: 1.0 To: Bjorn Helgaas Subject: [PATCH] drm: change pci_read_config_dword calls to pcie_capability_read_dword ones References: <50CA5EE2.30206@linux.vnet.ibm.com> <50D60349.7080400@linux.vnet.ibm.com> In-Reply-To: <50D60349.7080400@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12122219-2194-0000-0000-000004028630 X-Mailman-Approved-At: Sat, 22 Dec 2012 12:46:10 -0800 Cc: benh@au1.ibm.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Betty Dall , brking@linux.vnet.ibm.com, Thadeu Lima de Souza Cascardo X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Replacing these calls avoids compatibility problems with PCIe v1/v2 Capability structures. Signed-off-by: Lucas Kannebley Tavares --- drivers/gpu/drm/drm_pci.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) lnkcap2 &= 0xfe; diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index ea41234..b824d4c 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -486,17 +486,13 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) if (root == NULL) root = dev->pdev; - pos = pci_pcie_cap(root); - if (!pos) - return -EINVAL; - /* we've been informed via and serverworks don't make the cut */ if (root->vendor == PCI_VENDOR_ID_VIA || root->vendor == PCI_VENDOR_ID_SERVERWORKS) return -EINVAL; - pci_read_config_dword(root, pos + PCI_EXP_LNKCAP, &lnkcap); - pci_read_config_dword(root, pos + PCI_EXP_LNKCAP2, &lnkcap2); + pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap); + pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap2); lnkcap &= PCI_EXP_LNKCAP_SLS;