linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Debug 0/2] Debug ACPI resource parsing failure
       [not found] <alpine.LSU.2.11.1503020932210.29400@er-systems.de>
@ 2015-03-02  9:51 ` Jiang Liu
  2015-03-02  9:51   ` [Debug 1/2] x86/PCI/ACPI: Ignore resources consumed by host bridge itself Jiang Liu
  2015-03-02  9:51   ` [Debug 2/2] x86/PCI/ACPI: Gather debug info Jiang Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Jiang Liu @ 2015-03-02  9:51 UTC (permalink / raw)
  To: Thomas Voegtle
  Cc: Jiang Liu, Bjorn Helgaas, Rafael J . Wysocki, Dave Airlie, LKML,
	linux-pci, linux-acpi, Thomas Gleixner, Lv Zheng

Hi Thomas,
	According to the dmesg, it seems that BIOS reports malformed
ACPI resource descriptors. The new code enforces stricter checks for
ACPI resource descriptors, so it skips some malformed ACPI resource
descriptors. Could you please to try this two patches again?
Thanks!
Gerry

Jiang Liu (2):
  x86/PCI/ACPI: Ignore resources consumed by host bridge itself
  x86/PCI/ACPI: Gather debug info

 arch/x86/pci/acpi.c     |   10 +++++++---
 drivers/acpi/resource.c |    7 ++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Debug 1/2] x86/PCI/ACPI: Ignore resources consumed by host bridge itself
  2015-03-02  9:51 ` [Debug 0/2] Debug ACPI resource parsing failure Jiang Liu
@ 2015-03-02  9:51   ` Jiang Liu
  2015-03-02  9:51   ` [Debug 2/2] x86/PCI/ACPI: Gather debug info Jiang Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Jiang Liu @ 2015-03-02  9:51 UTC (permalink / raw)
  To: Thomas Voegtle, Bjorn Helgaas, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86
  Cc: Jiang Liu, Rafael J . Wysocki, Dave Airlie, LKML, linux-pci,
	linux-acpi, Lv Zheng

When parsing resources for PCI host bridge, we should ignore resources
consumed by host bridge itself and only report window resources available
to child PCI busses.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 arch/x86/pci/acpi.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 6ac273832f28..ddafc9e8b9b3 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -331,7 +331,7 @@ static void probe_pci_root_info(struct pci_root_info *info,
 				struct list_head *list)
 {
 	int ret;
-	struct resource_entry *entry;
+	struct resource_entry *entry, *tmp;
 
 	sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum);
 	info->bridge = device;
@@ -345,8 +345,12 @@ static void probe_pci_root_info(struct pci_root_info *info,
 		dev_dbg(&device->dev,
 			"no IO and memory resources present in _CRS\n");
 	else
-		resource_list_for_each_entry(entry, list)
-			entry->res->name = info->name;
+		resource_list_for_each_entry_safe(entry, tmp, list) {
+			if (entry->res->flags & IORESOURCE_WINDOW)
+				entry->res->name = info->name;
+			else
+				resource_list_destroy_entry(entry);
+		}
 }
 
 struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Debug 2/2] x86/PCI/ACPI: Gather debug info
  2015-03-02  9:51 ` [Debug 0/2] Debug ACPI resource parsing failure Jiang Liu
  2015-03-02  9:51   ` [Debug 1/2] x86/PCI/ACPI: Ignore resources consumed by host bridge itself Jiang Liu
@ 2015-03-02  9:51   ` Jiang Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Jiang Liu @ 2015-03-02  9:51 UTC (permalink / raw)
  To: Thomas Voegtle, Rafael J. Wysocki, Len Brown
  Cc: Jiang Liu, Bjorn Helgaas, Dave Airlie, LKML, linux-pci,
	linux-acpi, Thomas Gleixner, Lv Zheng


Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
 drivers/acpi/resource.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 4752b9939987..43de252a75b4 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -46,10 +46,10 @@ static bool acpi_dev_resource_len_valid(u64 start, u64 end, u64 len, bool io)
 	if (len && reslen && reslen == len && start <= end)
 		return true;
 
-	pr_info("ACPI: invalid or unassigned resource %s [%016llx - %016llx] length [%016llx]\n",
+	pr_warn("ACPI: invalid or unassigned resource %s [%016llx - %016llx] length [%016llx]\n",
 		io ? "io" : "mem", start, end, len);
 
-	return false;
+	return reslen != 0;
 }
 
 static void acpi_dev_memresource_flags(struct resource *res, u64 len,
@@ -193,13 +193,14 @@ static bool acpi_decode_space(struct resource_win *win,
 	u64 len = attr->address_length;
 	struct resource *res = &win->res;
 
+	pr_warn("acpi: address space [%llx-%llx] len %llx\n", attr->minimum, attr->maximum, attr->address_length);
 	/*
 	 * Filter out invalid descriptor according to ACPI Spec 5.0, section
 	 * 6.4.3.5 Address Space Resource Descriptors.
 	 */
 	if ((addr->min_address_fixed != addr->max_address_fixed && len) ||
 	    (addr->min_address_fixed && addr->max_address_fixed && !len))
-		pr_debug("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n",
+		pr_warn("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n",
 			 addr->min_address_fixed, addr->max_address_fixed, len);
 
 	res->start = attr->minimum;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-02  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.LSU.2.11.1503020932210.29400@er-systems.de>
2015-03-02  9:51 ` [Debug 0/2] Debug ACPI resource parsing failure Jiang Liu
2015-03-02  9:51   ` [Debug 1/2] x86/PCI/ACPI: Ignore resources consumed by host bridge itself Jiang Liu
2015-03-02  9:51   ` [Debug 2/2] x86/PCI/ACPI: Gather debug info Jiang Liu

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