{"id":810153,"url":"http://patchwork.ozlabs.org/api/patches/810153/?format=json","web_url":"http://patchwork.ozlabs.org/project/fwts/patch/1504616268-28745-1-git-send-email-Sakar.Arora@arm.com/","project":{"id":24,"url":"http://patchwork.ozlabs.org/api/projects/24/?format=json","name":"Firmware Test Suite development","link_name":"fwts","list_id":"fwts-devel.lists.ubuntu.com","list_email":"fwts-devel@lists.ubuntu.com","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504616268-28745-1-git-send-email-Sakar.Arora@arm.com>","list_archive_url":null,"date":"2017-09-05T12:57:48","name":"acpi: method: sbbr: set some methods as optional","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4e9bbb793456c19576545621ce4e9fa2163bd0c7","submitter":{"id":72038,"url":"http://patchwork.ozlabs.org/api/people/72038/?format=json","name":"Sakar Arora","email":"Sakar.Arora@arm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/fwts/patch/1504616268-28745-1-git-send-email-Sakar.Arora@arm.com/mbox/","series":[{"id":1576,"url":"http://patchwork.ozlabs.org/api/series/1576/?format=json","web_url":"http://patchwork.ozlabs.org/project/fwts/list/?series=1576","date":"2017-09-05T12:57:48","name":"acpi: method: sbbr: set some methods as optional","version":1,"mbox":"http://patchwork.ozlabs.org/series/1576/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/810153/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/810153/checks/","tags":{},"related":[],"headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmmwT3jdJz9t16;\n\tTue,  5 Sep 2017 22:58:01 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1dpDQV-0007Cz-FD; Tue, 05 Sep 2017 12:57:59 +0000","from foss.arm.com ([217.140.101.70])\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <Sakar.Arora@arm.com>) id 1dpDQT-0007Cp-Vp\n\tfor fwts-devel@lists.ubuntu.com; Tue, 05 Sep 2017 12:57:58 +0000","from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 182122B;\n\tTue,  5 Sep 2017 05:57:57 -0700 (PDT)","from u201365.usa.Arm.com (a75592.asiapac.arm.com [10.162.2.158])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id\n\tAA0DB3F578; Tue,  5 Sep 2017 05:57:55 -0700 (PDT)"],"From":"Sakar Arora <Sakar.Arora@arm.com>","To":"fwts-devel@lists.ubuntu.com","Subject":"[PATCH] acpi: method: sbbr: set some methods as optional","Date":"Tue,  5 Sep 2017 18:27:48 +0530","Message-Id":"<1504616268-28745-1-git-send-email-Sakar.Arora@arm.com>","X-Mailer":"git-send-email 2.7.4","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Cc":"Prasanth.Pulla@arm.com, Charles.Garcia-Tobin@arm.com","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"},"content":"As per SBBR spec, methods _WAK and _PTS are made optional.\n\nMethod _SST is mandatory. But its absence is now reported\nas warning. Systems that do not support user visible\nstatus such as LED (e.g. ARM FVP), can treat this as just\nwarning. Others must treat _SST method's absence as failure.\n\nSigned-off-by: Sakar Arora <Sakar.Arora@arm.com>\n---\n src/acpi/method/method.c | 48 +++++++++---------------------------------------\n 1 file changed, 9 insertions(+), 39 deletions(-)","diff":"diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c\nindex d082fc1..4000deb 100644\n--- a/src/acpi/method/method.c\n+++ b/src/acpi/method/method.c\n@@ -4449,12 +4449,13 @@ static int method_test_SST(fwts_framework *fw)\n \targ[0].Type = ACPI_TYPE_INTEGER;\n \tfor (i = 0; i <= 4; i++) {\n \t\targ[0].Integer.Value = i;\n-\t\tif (fw->flags & FWTS_FLAG_TEST_SBBR)\n-\t\t\tret = method_evaluate_method(fw, METHOD_MANDATORY,\n-\t\t\t\t\"_SST\", arg, 1, method_test_NULL_return, NULL);\n-\t\telse\n-\t\t\tret = method_evaluate_method(fw, METHOD_OPTIONAL,\n-\t\t\t\t\"_SST\", arg, 1, method_test_NULL_return, NULL);\n+\t\tret = method_evaluate_method(fw, METHOD_OPTIONAL,\n+\t\t\t\"_SST\", arg, 1, method_test_NULL_return, NULL);\n+\n+\t\tif(ret == FWTS_NOT_EXIST && (fw->flags & FWTS_FLAG_TEST_SBBR)) {\n+\t\t\tfwts_warning(fw, \"_SST method not found. This should be treated as error \"\n+\t\t\t\t\t\"if the platform provides user visible status such as LED.\");\n+\t\t}\n \n \t\tif (ret != FWTS_OK)\n \t\t\tbreak;\n@@ -6483,23 +6484,7 @@ static int method_test_PTS(fwts_framework *fw)\n \t\targ[0].Integer.Value = i;\n \n \t\tfwts_log_info(fw, \"Test _PTS(%d).\", i);\n-\t\tif (!(fw->flags & FWTS_FLAG_TEST_SBBR))\n-\t\t\tmethod_evaluate_method(fw, METHOD_OPTIONAL, \"_PTS\", arg, 1, method_test_NULL_return, NULL);\n-\t\telse\n-\t\t\tif (method_evaluate_method(fw, METHOD_MANDATORY, \"_PTS\", arg, 1,\n-\t\t\t\tmethod_test_NULL_return, NULL) == FWTS_NOT_EXIST) {\n-\t\t\t\tfwts_advice(fw,\n-\t\t\t\t\t\"Could not find _PTS. This method provides a \"\n-\t\t\t\t\t\"mechanism to do housekeeping functions, such \"\n-\t\t\t\t\t\"as write sleep state to the embedded \"\n-\t\t\t\t\t\"controller before entering a sleep state. If \"\n-\t\t\t\t\t\"the machine cannot suspend (S3), \"\n-\t\t\t\t\t\"hibernate (S4) or shutdown (S5) then it \"\n-\t\t\t\t\t\"could be because _PTS is missing.  Note that \"\n-\t\t\t\t\t\"ACPI 1.0 wants _PTS to be executed before \"\n-\t\t\t\t\t\"suspending devices.\");\n-\t\t\t\tbreak;\n-\t\t\t}\n+\t\tmethod_evaluate_method(fw, METHOD_OPTIONAL, \"_PTS\", arg, 1, method_test_NULL_return, NULL);\n \t\tfwts_log_nl(fw);\n \t}\n \treturn FWTS_OK;\n@@ -6577,22 +6562,7 @@ static int method_test_WAK(fwts_framework *fw)\n \t\targ[0].Type = ACPI_TYPE_INTEGER;\n \t\targ[0].Integer.Value = i;\n \t\tfwts_log_info(fw, \"Test _WAK(%d) System Wake, State S%d.\", i, i);\n-\t\tif (!(fw->flags & FWTS_FLAG_TEST_SBBR))\n-\t\t\tmethod_evaluate_method(fw, METHOD_OPTIONAL, \"_WAK\", arg, 1, method_test_WAK_return, &i);\n-\t\telse\n-\t\t\tif (method_evaluate_method(fw, METHOD_MANDATORY, \"_WAK\", arg, 1,\n-\t\t\t\tmethod_test_WAK_return, &i) == FWTS_NOT_EXIST) {\n-\t\t\t\tfwts_advice(fw,\n-\t\t\t\t\t\"Section 7.3.7 states that a system that wakes \"\n-\t\t\t\t\t\"from a sleeping state will invoke the _WAK \"\n-\t\t\t\t\t\"control to issue device, thermal and other \"\n-\t\t\t\t\t\"notifications to ensure that the operating system \"\n-\t\t\t\t\t\"checks the states of various devices, thermal \"\n-\t\t\t\t\t\"zones, etc.  The Linux kernel will report an \"\n-\t\t\t\t\t\"ACPI exception if _WAK is does not exist when \"\n-\t\t\t\t\t\"it returns from a sleep state.\");\n-\t\t\t\tbreak;\n-\t\t\t}\n+\t\tmethod_evaluate_method(fw, METHOD_OPTIONAL, \"_WAK\", arg, 1, method_test_WAK_return, &i);\n \t\tfwts_log_nl(fw);\n \t}\n \treturn FWTS_OK;\n","prefixes":[]}