From patchwork Fri Feb 5 20:10:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1436853 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DXRNn0r8pz9sVy for ; Sat, 6 Feb 2021 07:10:15 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1l87Qg-0004Yy-Dw; Fri, 05 Feb 2021 20:10:10 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l87Qd-0004Yr-Q3 for fwts-devel@lists.ubuntu.com; Fri, 05 Feb 2021 20:10:07 +0000 Received: from d198-53-221-123.abhsia.telus.net ([198.53.221.123] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l87Qd-0005WF-1y; Fri, 05 Feb 2021 20:10:07 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH][V2] lib: acpi: load acpi tables from sysfs by default Date: Fri, 5 Feb 2021 13:10:02 -0700 Message-Id: <20210205201002.181710-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Alex Hung --- [V2] Fix comments were not updated src/lib/src/fwts_acpi_tables.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index 4033e29b..2b45fae3 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1244,13 +1244,14 @@ int fwts_acpi_load_tables(fwts_framework *fw) ret = fwts_acpi_load_tables_from_acpidump(fw); require_fixup = true; } else if (fwts_check_root_euid(fw, true) == FWTS_OK) { - ret = fwts_acpi_load_tables_from_firmware(fw); + ret = fwts_acpi_load_tables_from_sysfs(fw); - /* Load from memory failed (e.g. no /dev/mem), so try sysfs */ - if (ret != FWTS_OK) { - ret = fwts_acpi_load_tables_from_sysfs(fw); + /* Load from sysfs failed (e.g. no /dev/mem), so try memory */ + if (ret != FWTS_OK) + ret = fwts_acpi_load_tables_from_firmware(fw); + else require_fixup = true; - } + } else { ret = FWTS_ERROR_NO_PRIV; }