From patchwork Wed Aug 19 07:49:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 508612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 295FD140562; Wed, 19 Aug 2015 17:50:03 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZRy8F-0008He-39; Wed, 19 Aug 2015 07:49:59 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZRy88-0008HU-WF for fwts-devel@lists.ubuntu.com; Wed, 19 Aug 2015 07:49:52 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZRy88-0008DW-EJ; Wed, 19 Aug 2015 07:49:52 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: fadt: merge tests for reset register Date: Wed, 19 Aug 2015 15:49:52 +0800 Message-Id: <1439970592-23738-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Colin Ian King Acked-by: Ivan Hu --- src/acpi/fadt/fadt.c | 57 +++++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c index 8d06d97..4778984 100644 --- a/src/acpi/fadt/fadt.c +++ b/src/acpi/fadt/fadt.c @@ -300,39 +300,6 @@ static void acpi_table_check_fadt_gpe( } } -static void acpi_table_check_fadt_reset( - fwts_framework *fw, - const fwts_acpi_table_fadt *fadt, - bool *passed) -{ - if (!(fadt->flags & FADT_RESET_SUPPORTED)) - return; - - if (fadt->header.length>=129) { - if ((fadt->reset_reg.address_space_id != 0) && - (fadt->reset_reg.address_space_id != 1) && - (fadt->reset_reg.address_space_id != 2)) { - *passed = false; - fwts_failed(fw, LOG_LEVEL_MEDIUM, - "FADTBadRESETREG", - "FADT RESET_REG address space ID was %" - PRIu8 ", must be System Memory space (0), " - "System I/O space (1), or PCI configuration " - "space (2).", - fadt->reset_reg.address_space_id); - fwts_advice(fw, - "If the FADT RESET_REG address space ID is " - "not set correctly then ACPI writes " - "to this register *may* nor work correctly, " - "meaning a reboot via this mechanism may not work."); - } - if ((fadt->reset_value == 0) && - (fadt->reset_reg.address != 0)) - fwts_warning(fw, "FADT RESET_VALUE is zero, which " - "may be incorrect, it is usually non-zero."); - } -} - static int fadt_test1(fwts_framework *fw) { bool passed = true; @@ -367,7 +334,6 @@ static int fadt_test1(fwts_framework *fw) "ACPI processor idle routine will not use C3 power states."); } */ - acpi_table_check_fadt_reset(fw, fadt, &passed); if (passed) fwts_passed(fw, "No issues found in FADT table."); @@ -490,6 +456,29 @@ static int fadt_test3(fwts_framework *fw) "specification states that the FADT register bit offset should be 0."); } else fwts_passed(fw, "FADT register bit offset is 0 as expected."); + + if (fadt->header.length >= 129) { + if ((fadt->reset_reg.address_space_id != 0) && + (fadt->reset_reg.address_space_id != 1) && + (fadt->reset_reg.address_space_id != 2)) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "FADTBadRESETREG", + "FADT RESET_REG address space ID was %" + PRIu8 ", must be System Memory space (0), " + "System I/O space (1), or PCI configuration " + "space (2).", + fadt->reset_reg.address_space_id); + fwts_advice(fw, + "If the FADT RESET_REG address space ID is " + "not set correctly then ACPI writes " + "to this register *may* nor work correctly, " + "meaning a reboot via this mechanism may not work."); + } + if ((fadt->reset_value == 0) && + (fadt->reset_reg.address != 0)) + fwts_warning(fw, "FADT RESET_VALUE is zero, which " + "may be incorrect, it is usually non-zero."); + } } else { fwts_skipped(fw, "FADT flags indicates reset register not supported, skipping test."); return FWTS_SKIP;