Skip to contentSkip to conversation

acpi, add region addresses to conflict output [v2]

PATCH In review Prarit Bhargava 2 participants 2 messages Nov 25, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi, add region addresses to conflict output [v2]

Currently the kernel does

ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20130517/utaddress-251)

This patch outputs the region address so that we now see

ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region 0x0000000000000400-0x000000000000047f \PMIO 1 (20130927/utaddress-252)

which is a lot more useful for debugging.

Also fix some simple comment linewrapping issues in this function.

Cc Myron Stowe <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>

[v2]: minor change to comments

---
 drivers/acpi/acpica/utaddress.c |   53 +++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 24 deletions(-)
drivers/acpi/acpica/utaddress.c +29 -24
index e0a2e27..eb4f28d 100644
@@ -224,35 +224,40 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
 
 	while (range_info) {
 		/*
-		 * Check if the requested Address/Length overlaps this address_range.
-		 * Four cases to consider:
+		 * Check if the requested Address/Length overlaps this
+		 * address_range.  Four cases to consider:
 		 *
-		 * 1) Input address/length is contained completely in the address range
+		 * 1) Input address/length is contained completely in the
+		 *    address range
 		 * 2) Input address/length overlaps range at the range start
 		 * 3) Input address/length overlaps range at the range end
 		 * 4) Input address/length completely encompasses the range
 		 */
-		if ((address <= range_info->end_address) &&
-		    (end_address >= range_info->start_address)) {
-
-			/* Found an address range overlap */
-
-			overlap_count++;
-			if (warn) {	/* Optional warning message */
-				pathname =
-				    acpi_ns_get_external_pathname(range_info->
-								  region_node);
-
-				ACPI_WARNING((AE_INFO,
-					      "0x%p-0x%p %s conflicts with Region %s %d",
-					      ACPI_CAST_PTR(void, address),
-					      ACPI_CAST_PTR(void, end_address),
-					      acpi_ut_get_region_name(space_id),
-					      pathname, overlap_count));
-				ACPI_FREE(pathname);
-			}
-		}
-
+		if ((address > range_info->end_address) &&
+		    (end_address < range_info->start_address))
+			goto next_range;
+
+		/* Found an address range overlap */
+		overlap_count++;
+
+		if (!warn)
+			goto next_range;
+
+		/* Optional warning message */
+		pathname =
+			 acpi_ns_get_external_pathname(range_info->region_node);
+
+		ACPI_WARNING((AE_INFO,
+			      "0x%p-0x%p %s conflicts with Region 0x%p-0x%p %s %d",
+			      ACPI_CAST_PTR(void, address),
+			      ACPI_CAST_PTR(void, end_address),
+			      acpi_ut_get_region_name(space_id),
+			      ACPI_CAST_PTR(void, range_info->start_address),
+			      ACPI_CAST_PTR(void, range_info->end_address),
+			      pathname, overlap_count));
+		ACPI_FREE(pathname);
+
+next_range:
 		range_info = range_info->next;
 	}
 
Signature · 1 line
1.7.9.3
#1 lore raw
Quoted 15 lines · Prarit Bhargava

Currently the kernel does

ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20130517/utaddress-251)

This patch outputs the region address so that we now see

ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region 0x0000000000000400-0x000000000000047f \PMIO 1 (20130927/utaddress-252)

which is a lot more useful for debugging.

Also fix some simple comment linewrapping issues in this function.

Quoted 7 lines
Cc Myron Stowe <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>

[v2]: minor change to comments

ACPICA patches should go to its upstream maintainers in the first place, as per MAINTAINERS (CCed now). Also ACPICA patches generally have to be integrated into ACPICA upstream before appearing in the kernel.

Thanks!

Quoted 74 lines
---
 drivers/acpi/acpica/utaddress.c |   53 +++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 24 deletions(-)
drivers/acpi/acpica/utaddress.c +29 -24
index e0a2e27..eb4f28d 100644
@@ -224,35 +224,40 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
 
 	while (range_info) {
 		/*
-		 * Check if the requested Address/Length overlaps this address_range.
-		 * Four cases to consider:
+		 * Check if the requested Address/Length overlaps this
+		 * address_range.  Four cases to consider:
 		 *
-		 * 1) Input address/length is contained completely in the address range
+		 * 1) Input address/length is contained completely in the
+		 *    address range
 		 * 2) Input address/length overlaps range at the range start
 		 * 3) Input address/length overlaps range at the range end
 		 * 4) Input address/length completely encompasses the range
 		 */
-		if ((address <= range_info->end_address) &&
-		    (end_address >= range_info->start_address)) {
-
-			/* Found an address range overlap */
-
-			overlap_count++;
-			if (warn) {	/* Optional warning message */
-				pathname =
-				    acpi_ns_get_external_pathname(range_info->
-								  region_node);
-
-				ACPI_WARNING((AE_INFO,
-					      "0x%p-0x%p %s conflicts with Region %s %d",
-					      ACPI_CAST_PTR(void, address),
-					      ACPI_CAST_PTR(void, end_address),
-					      acpi_ut_get_region_name(space_id),
-					      pathname, overlap_count));
-				ACPI_FREE(pathname);
-			}
-		}
-
+		if ((address > range_info->end_address) &&
+		    (end_address < range_info->start_address))
+			goto next_range;
+
+		/* Found an address range overlap */
+		overlap_count++;
+
+		if (!warn)
+			goto next_range;
+
+		/* Optional warning message */
+		pathname =
+			 acpi_ns_get_external_pathname(range_info->region_node);
+
+		ACPI_WARNING((AE_INFO,
+			      "0x%p-0x%p %s conflicts with Region 0x%p-0x%p %s %d",
+			      ACPI_CAST_PTR(void, address),
+			      ACPI_CAST_PTR(void, end_address),
+			      acpi_ut_get_region_name(space_id),
+			      ACPI_CAST_PTR(void, range_info->start_address),
+			      ACPI_CAST_PTR(void, range_info->end_address),
+			      pathname, overlap_count));
+		ACPI_FREE(pathname);
+
+next_range:
 		range_info = range_info->next;
 	}
 
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.