From patchwork Fri Feb 25 00:52:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1597403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=pr3rhlIn; dkim-atps=neutral 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4K4WTw58BSz9sFt for ; Fri, 25 Feb 2022 11:53:07 +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 1nNOqy-0001el-Qz; Fri, 25 Feb 2022 00:53:00 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nNOqw-0001ee-QZ for fwts-devel@lists.ubuntu.com; Fri, 25 Feb 2022 00:52:58 +0000 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 38D533F1BE for ; Fri, 25 Feb 2022 00:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645750378; bh=lcjIOs/u6PusNYVbb3q57tucg+CF0HUvFCbWtyZnJcE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pr3rhlInfOU3Nhrgv67NiBWDeIrDyIlVTC2kikux96Pgvz2QYvbc5zF4ROFIGdwOk dFERgf6X7vE8PEyMADFLgkoWC9QZm8v+N5dKzLLKMXhoIMEDL5D5rMk5f0qui+KXSm yYGn2X1pWSIFsw+eJY8pWvzw/2p/dwk34HsZHqRYtRA2FoW+nZyRXoasLl6nUi3cqm 5i+1+GICW4TOwijXDEFkd8EWJOiKyP5qDNH1qcXo8Q+895NhqjK6HxdTK1x0X/t+7m 1VGOXRLJ4R8Mm0iBzpaE5W5tWgr0v5TYzzruVY/LW9sNFrJm/aSjb/iFzIOFCcy68s TDNXY+qQOAL6A== Received: by mail-pg1-f200.google.com with SMTP id bj8-20020a056a02018800b0035ec8c16f0bso1802698pgb.11 for ; Thu, 24 Feb 2022 16:52:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lcjIOs/u6PusNYVbb3q57tucg+CF0HUvFCbWtyZnJcE=; b=UOIibL1lXiBYihBOxiYHyQcLOCKxvuLHj5KYa0wQ+ysU6ry8S3w+N6UWg7SwxStmtm i7Eqw6zeaTDJPuBMu//B4qqpj+8nBH+QkxCdxMaZlLRtLOHm/P2DhZVaV5nZhWY60JrJ ib9iT7tlm13I1A+k/Y8VxfKBfPinJBQ7xrQHK04b98KhdgdGcgamS4Bg158vdepW9O0m uM1QqEZRACaib3I99czmiqnFRN35+vMcS9JeOU6Wo0G6CdAxrFm9lORVAx4bPkfg7SLv 4WfBJUTe+L9fDNDANK34xlg14e6IE8eG+dQrnuvtmVLyCXviHhalyNPcyKJa2oqW6t9a 6zxw== X-Gm-Message-State: AOAM5333FctC+WEk5y+KFxwHqXDYA/So2YSJKqCBRGdmJnUDde+dgRsW /rxiO4qH4ZYMpgP68OTSm4EcdqHGGMBaVV1GCi2x2kY5TVOUsuBtkmn9jEVk4QSTzsOpPmlzo9s wvtjQ7GsEPvY6piQO5s/gXsOGJv6ObxQcV4JuSapS X-Received: by 2002:a65:5a8e:0:b0:365:3b6:47fb with SMTP id c14-20020a655a8e000000b0036503b647fbmr422634pgt.147.1645750375145; Thu, 24 Feb 2022 16:52:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6Nc9wWUc4kgaPJfgJtDZvtIWyqIlCpFLsYMyxLKPPlL+7EnqvlRYk9QQ7s1cmEWop87PXdg== X-Received: by 2002:a65:5a8e:0:b0:365:3b6:47fb with SMTP id c14-20020a655a8e000000b0036503b647fbmr422610pgt.147.1645750374735; Thu, 24 Feb 2022 16:52:54 -0800 (PST) Received: from canonical.com (node-1w7jr9yebujeq5th4a1ypmgvp.ipv6.telus.net. [2001:56a:78ed:fb00::ff5]) by smtp.gmail.com with ESMTPSA id go1-20020a17090b03c100b001bcb5ef0597sm3981190pjb.55.2022.02.24.16.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 16:52:54 -0800 (PST) From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi/time: skip a number of TAD methods when _GCP[0] is clear Date: Thu, 24 Feb 2022 17:52:52 -0700 Message-Id: <20220225005252.1058803-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" This is according to mantis 2253. Signed-off-by: Alex Hung Acked-by: Ivan Hu --- src/acpi/devices/time/time.c | 50 ++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/src/acpi/devices/time/time.c b/src/acpi/devices/time/time.c index 74f8bb41..f87c27d7 100644 --- a/src/acpi/devices/time/time.c +++ b/src/acpi/devices/time/time.c @@ -34,6 +34,14 @@ static ACPI_HANDLE device; static uint32_t capability; +static bool is_AC_wake_implemented(void) +{ + if (capability & 0x01) + return true; + + return false; +} + static ACPI_STATUS get_device_handle(ACPI_HANDLE handle, uint32_t level, void *context, void **ret_val) { @@ -213,9 +221,12 @@ static int method_test_GWS(fwts_framework *fw) arg[0].Type = ACPI_TYPE_INTEGER; arg[0].Integer.Value = 1; /* DC timer */ - return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, - "_GWS", arg, 1, method_test_GWS_return, NULL); -} + if (is_AC_wake_implemented()) + return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, + "_GWS", arg, 1, method_test_GWS_return, NULL); + else + return fwts_evaluate_method(fw, METHOD_OPTIONAL, &device, + "_GWS", arg, 1, method_test_GWS_return, NULL);} static void method_test_CWS_return( fwts_framework *fw, @@ -246,8 +257,13 @@ static int method_test_CWS(fwts_framework *fw) for (i = 0; i < 2; i++) { arg[0].Integer.Value = i; - ret = fwts_evaluate_method(fw, METHOD_MANDATORY, &device, - "_CWS", arg, 1, method_test_CWS_return, NULL); + + if (is_AC_wake_implemented()) + ret = fwts_evaluate_method(fw, METHOD_MANDATORY, &device, + "_CWS", arg, 1, method_test_CWS_return, NULL); + else + ret = fwts_evaluate_method(fw, METHOD_OPTIONAL, &device, + "_CWS", arg, 1, method_test_CWS_return, NULL); if (ret != FWTS_OK) break; @@ -277,8 +293,12 @@ static int method_test_STV(fwts_framework *fw) arg[1].Type = ACPI_TYPE_INTEGER; arg[1].Integer.Value = 100; /* timer value */ - return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, - "_STV", arg, 2, fwts_method_test_passed_failed_return, "_STV"); + if (is_AC_wake_implemented()) + return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, + "_STV", arg, 2, fwts_method_test_passed_failed_return, "_STV"); + else + return fwts_evaluate_method(fw, METHOD_OPTIONAL, &device, + "_STV", arg, 2, fwts_method_test_passed_failed_return, "_STV"); } static int method_test_TIP(fwts_framework *fw) @@ -288,8 +308,12 @@ static int method_test_TIP(fwts_framework *fw) arg[0].Type = ACPI_TYPE_INTEGER; arg[0].Integer.Value = 1; /* DC timer */ - return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, - "_TIP", arg, 1, fwts_method_test_integer_return, NULL); + if (is_AC_wake_implemented()) + return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, + "_TIP", arg, 1, fwts_method_test_integer_return, NULL); + else + return fwts_evaluate_method(fw, METHOD_OPTIONAL, &device, + "_TIP", arg, 1, fwts_method_test_integer_return, NULL); } static int method_test_TIV(fwts_framework *fw) @@ -299,8 +323,12 @@ static int method_test_TIV(fwts_framework *fw) arg[0].Type = ACPI_TYPE_INTEGER; arg[0].Integer.Value = 1; /* DC timer */ - return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, - "_TIV", arg, 1, fwts_method_test_integer_return, NULL); + if (is_AC_wake_implemented()) + return fwts_evaluate_method(fw, METHOD_MANDATORY, &device, + "_TIV", arg, 1, fwts_method_test_integer_return, NULL); + else + return fwts_evaluate_method(fw, METHOD_OPTIONAL, &device, + "_TIV", arg, 1, fwts_method_test_integer_return, NULL); } /* Evaluate Device Identification Objects - all are optional */