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: <50D6050B.8080400@linux.vnet.ibm.com>
Date:	Sat, 22 Dec 2012 17:07:55 -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: change pci_read_config_dword calls to pcie_capability_read_dword
 ones

Replacing these calls avoids compatibility problems with PCIe v1/v2
Capability structures.

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

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;
  	lnkcap2 &= 0xfe;
-- 

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