From patchwork Mon Nov 25 18:25:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 3233881 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 274DD9F3A0 for ; Mon, 25 Nov 2013 18:26:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0084B2026D for ; Mon, 25 Nov 2013 18:26:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88AEF20265 for ; Mon, 25 Nov 2013 18:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756869Ab3KYS0F (ORCPT ); Mon, 25 Nov 2013 13:26:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21208 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753758Ab3KYS0E (ORCPT ); Mon, 25 Nov 2013 13:26:04 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAPIPuq7011744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Nov 2013 13:25:56 -0500 Received: from prarit.bos.redhat.com ([10.18.17.119]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAPIPs8R031296; Mon, 25 Nov 2013 13:25:55 -0500 From: Prarit Bhargava To: linux-acpi@vger.kernel.org Cc: Prarit Bhargava , Myron Stowe , "Rafael J. Wysocki" , Len Brown , mjg59@srcf.ucam.org Subject: [PATCH] acpi, add region addresses to conflict output [v2] Date: Mon, 25 Nov 2013 13:25:50 -0500 Message-Id: <1385403950-11297-1-git-send-email-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Prarit Bhargava Cc: Myron Stowe Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: mjg59@srcf.ucam.org [v2]: minor change to comments --- drivers/acpi/acpica/utaddress.c | 53 +++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c index e0a2e27..eb4f28d 100644 --- a/drivers/acpi/acpica/utaddress.c +++ b/drivers/acpi/acpica/utaddress.c @@ -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; }