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-next>] [day] [month] [year] [list]
Message-ID: <540E1D75.5000500@gmail.com>
Date:	Mon, 08 Sep 2014 14:19:49 -0700
From:	Rajat Jain <rajatxjain@...il.com>
To:	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	bhelgaas@...gle.com
CC:	rajatjain@...iper.net, groeck@...iper.net
Subject: [PATCH] pci/probe: Ignore the device id while handling CRS

Some root ports may return the actual device id returned by the
endpoint, instead of faking up a synthetic id (0xFFFF) as specified
by the PCIe spec (sec 2.3.2). We have seen such broken devices in the
past that match this behaviour:
(Ref: https://lkml.org/lkml/2007/11/1/198)

To take care of the same, CRS was disabled then, however, we want to
enable CRS now (https://lkml.org/lkml/2014/9/2/509), but still do not
want to break such devices. Thus check only against the
(vendor id == 1) and ignore the device id.

Signed-off-by: Rajat Jain <rajatxjain@...il.com>
Signed-off-by: Rajat Jain <rajatjain@...iper.net>
Signed-off-by: Guenter Roeck <groeck@...iper.net>
---
 drivers/pci/probe.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3c4c35c..0076a9b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1305,8 +1305,13 @@ bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
 	    *l == 0x0000ffff || *l == 0xffff0000)
 		return false;
 
-	/* Configuration request Retry Status */
-	while (*l == 0xffff0001) {
+	/*
+	 * Configuration request Retry Status. Note that some root ports
+	 * are broken and may return actual device ID instead of a synthetic ID
+	 * (0xFFFF) to be faked as per the PCIe spec. Hence ignore the device ID
+	 * and only check for (vendor id == 1)
+	 */
+	while (*l & 0xffff == 0x0001) {
 		if (!crs_timeout)
 			return false;
 
-- 
1.7.9.5

--
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