From patchwork Fri Dec 29 08:07:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1881019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T1dMR4Ns0z20Rq for ; Fri, 29 Dec 2023 19:09:38 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rJ7vp-000283-U2; Fri, 29 Dec 2023 08:09:25 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rJ7tv-0001Vu-JK for fwts-devel@lists.ubuntu.com; Fri, 29 Dec 2023 08:07:29 +0000 Received: from canonical.com (unknown [10.101.194.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id BC2753F6CB for ; Fri, 29 Dec 2023 08:07:26 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: einj: test more error injection actions for einjv2 (mantis 2287) Date: Fri, 29 Dec 2023 16:07:23 +0800 Message-Id: <20231229080723.29961-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.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" BugLink:https://bugs.launchpad.net/fwts/+bug/2047212 Add more error injection actions EINJV2_SET_ERROR_TYPE and EINJV2_GET_ERROR_TYPE for AVPI6.5 Signed-off-by: Ivan Hu --- src/acpi/einj/einj.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/acpi/einj/einj.c b/src/acpi/einj/einj.c index 7aae08b0..e52bd873 100644 --- a/src/acpi/einj/einj.c +++ b/src/acpi/einj/einj.c @@ -81,14 +81,26 @@ static int einj_test1(fwts_framework *fw) fwts_log_info_verbatim(fw, " Mask : 0x%16.16" PRIx64, entry->mask); - if (entry->serialization_action > 0x9 && - entry->serialization_action != 0xFF) { - fwts_failed(fw, LOG_LEVEL_MEDIUM, - "EINJBadInjectionAction", - "EINJ Injection Action must be within 0~9 " - "or 0xFF got 0x%" PRIx8 " instead", - entry->serialization_action); - passed = false; + if (einj->header.revision >= 2) { + if (entry->serialization_action > 0x11 && + entry->serialization_action != 0xFF) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "EINJBadInjectionAction", + "EINJ Injection Action must be within 0~9 " + "or 0xFF got 0x%" PRIx8 " instead", + entry->serialization_action); + passed = false; + } + } else { + if (entry->serialization_action > 0x9 && + entry->serialization_action != 0xFF) { + fwts_failed(fw, LOG_LEVEL_MEDIUM, + "EINJBadInjectionAction", + "EINJ Injection Action must be within 0~9 " + "or 0xFF got 0x%" PRIx8 " instead", + entry->serialization_action); + passed = false; + } } if (entry->instruction > 0x4) {