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]
Date:	Tue, 20 Apr 2010 22:35:59 -0700
From:	Yinghai <yinghai.lu@...cle.com>
To:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>
CC:	Bjorn Helgaas <bjorn.helgaas@...com>,
	Andy Isaacson <adi@...apodia.org>, guenter.roeck@...csson.com,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Thomas Renninger <trenn@...e.de>
Subject: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS



Don't clear root bus resource too early, until We can make sure _CRS works

also restore it, if all _CRS get rejected because of conflicts

Signed-off-by: Yinghai Lu <yinghai@...nel.org>

---
 arch/x86/pci/acpi.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/x86/pci/acpi.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/acpi.c
+++ linux-2.6/arch/x86/pci/acpi.c
@@ -196,9 +196,6 @@ get_current_resources(struct acpi_device
 	struct pci_root_info info;
 	size_t size;
 
-	if (pci_use_crs)
-		pci_bus_remove_resources(bus);
-
 	info.bridge = device;
 	info.bus = bus;
 	info.res_num = 0;
@@ -217,10 +214,20 @@ get_current_resources(struct acpi_device
 		goto name_alloc_fail;
 	sprintf(info.name, "PCI Bus %04x:%02x", domain, busnum);
 
+	/* Only clear that when _CRS works for sure*/
+	if (pci_use_crs)
+		pci_bus_remove_resources(bus);
+
 	info.res_num = 0;
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
 				&info);
 
+	if (pci_use_crs && !info.res_num) {
+		/* Restore default one */
+		bus->resource[0] = &ioport_resource;
+		bus->resource[1] = &iomem_resource;
+	}
+
 	return;
 
 name_alloc_fail:
--
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