From patchwork Thu Dec 7 10:19:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 1873561 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 4SmX7p6xg9z23nS for ; Fri, 8 Dec 2023 11:29:10 +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 1rBOjp-0003MT-Rx; Fri, 08 Dec 2023 00:29:06 +0000 Received: from mail-dm6nam04on2051.outbound.protection.outlook.com ([40.107.102.51] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rBOjk-0003Jl-Cd for fwts-devel@lists.ubuntu.com; Fri, 08 Dec 2023 00:29:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=litGABct8tQ1dVZCt+TzDsfNO1dnBwLIcO8QY5cYcmiW748MgI8lqSXdB1nsJtjP2e2qMHQtNanckB5Kw3BGcGvnK6hFCyxbwUO7A4PveqUHug0jfcpA+YTZphp2SVzW74Zf3KChaVc+j7ItM84Lcbw/Tm3sp+t1qY/EHsJ0f/PWg8cRvAecmLSr61Ig9IZ3kz73rDDWr3I73vqdKp6DuksLY/LY8oZd9EvMRSwlyDFzZ9atDUbA0rFHEOH3+zsp73OFXaTrOdpyXf88qcOO8gdr3y3IqAtiGyiYKrFWNwfZKZsvs5qB3NPB+COT+mbmDLUwAp4FuOC/NLinhNS+QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bfB8xMV9Gi8rlG6dFP8Yhg5yUsDClBtFWmwLsp6pCm0=; b=Wqf9watisPoRcmmMXcMmWoCO5B72Qc/9fh1JP5JUHyqadXSe2DuDp/F42enk7eQ0aPguRSleX/hbF7as1sD5Lt62zZ6MCmcwEipJqkZ5nY2vL/b4h0cPF2O/7tjEuG12OGQYJpqtrxLUW1m6PS53R3x0Mj/X5nbRpVnXse3lDv9e7323BWCoCgpAHFOeyGUsGuUbBPBrzbPuIehwIMYq+n7ta81HFQkdkDNFHiVyMIf3b0wfZnJ3tSIG5P4rTUx5Rdig7QzayM9YfG2xC0fm8i0o3Y1mspAWXZy68atXZX0XphYGGqhMOgm/x3LJr1cWJcHBB0HHOAekw4FkFcKz2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) Received: from SA1P222CA0020.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:22c::21) by PH7PR12MB6785.namprd12.prod.outlook.com (2603:10b6:510:1ab::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Fri, 8 Dec 2023 00:28:54 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:806:22c:cafe::70) by SA1P222CA0020.outlook.office365.com (2603:10b6:806:22c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.27 via Frontend Transport; Fri, 8 Dec 2023 00:28:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Fri, 8 Dec 2023 00:28:54 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 7 Dec 2023 18:28:50 -0600 From: Mario Limonciello To: Subject: [PATCH 3/3] Drop support for pm-utils Date: Thu, 7 Dec 2023 04:19:27 -0600 Message-ID: <20231207101927.9378-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231207101927.9378-1-mario.limonciello@amd.com> References: <20231207101927.9378-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|PH7PR12MB6785:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e83e7ed-3191-4def-61a2-08dbf784a8d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WxN/4GkjcvCSnVBUxIQ8agmM4rWSFxoStdHZtz7f7GAKH2b+YUSH8zpb2NidlJnwVbTqcVmi8NWv0Q+T5ZT2qh+XUHezIwPeaFBEQL8Tyn1H3wV8RfYVCsjkCJDQsSjnQ4JScvzxSp9ve976mRG7fczdpcNP5/Gel8nboV8JLnKBCMBAb3UcebZD6hNwUXt6a6vVbGnMJiEsyLaXNjPAT2Se2/2nO+5oddRSe4SM39O3Dp1ig/KDkSwiJpSmIYXhrTMFGnN5or8YDP+6EF/RZNAW7/uGaIRLprxy7zThxEfiWoLluv9yVxX0FgVr/eF+NJCNDtTbBeRFm6FTBFi+g14IcBgIOC/Eb0T+VRdNE2BwWOnYxdv4StuZ4b51YyKawpGfelMNqw4GuwM7dHmC/wWuxlqSscKlzlwVS1xwTjFiECYtZdGpvaRu10lLZbzT4kPWvy6mU7d/tXXt4Yh6lQvj4FdNC06uTGTtxsI8m3U31PhOqBCFDhDFnpoYDd5VkJnoTub33fyHCNfKo0aVqYgTqC9SSYzoTFdu4t3xP3UQOnq4/RPl2da41Amwm1QZTc8UjOt40PjeppmT9w3qThwNxqV8sKyXYjRqxdVi929ieEAcY2KRthGzc8YlHG+BmXI1sXIkL+lRpjXXoltKehx08FLbJpA2NV22qM/b7qQyX/wekyxU7OdSZo/xO4MUxHdsu+VPhJbD+pHJsmEwOKliaKawGh0tBmu0QYsaSnKg1QueK3iu8yP2WudRCRi0SafhWJBE+CoEPYJ6WcI5WQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(64100799003)(186009)(82310400011)(451199024)(1800799012)(36840700001)(46966006)(40470700004)(41300700001)(83380400001)(336012)(36860700001)(2616005)(5660300002)(86362001)(1076003)(40480700001)(426003)(16526019)(30864003)(2906002)(26005)(44832011)(47076005)(40460700003)(356005)(7696005)(81166007)(4326008)(8936002)(6666004)(8676002)(6916009)(70206006)(70586007)(478600001)(316002)(36756003)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2023 00:28:54.2560 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e83e7ed-3191-4def-61a2-08dbf784a8d0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6785 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: , Cc: Mario Limonciello Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" This has been long deprecated and isn't used in any distros anymore. Signed-off-by: Mario Limonciello --- doc/fwts.1 | 5 -- fwts-test/arg-help-0001/arg-help-0001.log | 6 +- fwts-test/arg-help-0001/arg-help-0002.log | 6 +- scripts/bash-completion/fwts | 2 +- src/acpi/s3/s3.c | 82 ++--------------------- src/acpi/s3power/s3power.c | 47 ++----------- src/acpi/s4/s4.c | 52 -------------- src/lib/include/fwts_types.h | 1 - src/lib/src/fwts_framework.c | 10 ++- 9 files changed, 18 insertions(+), 193 deletions(-) diff --git a/doc/fwts.1 b/doc/fwts.1 index b8217271..173e6ede 100644 --- a/doc/fwts.1 +++ b/doc/fwts.1 @@ -239,8 +239,6 @@ specify the power method to use to enter S3 or S4 (or autodetection will be used .br logind \- the default method, where available (requires dbus and logind). .br -pm-utils \- the previous default method, now deprecated. -.br sysfs \- the fallback, used when logind is not available. .br e.g. \-\-pm\-method=sysfs @@ -275,9 +273,6 @@ specifies a script or program to run after each S3 resume. The hookscript must return 0 to indicate success, or non-zero to indicate failure. Failures will abort subsequent S3 test iterations. .TP -.B \-\-s3\-quirks=--quirk[,--quirk] -specify a comma separated list of quirk arguments to pass to pm-suspend, for example: \-\-s3\-quirks=\-\-quirk\-s3\-bios,\-\-quirk\-save\-pci -.TP .B \-\-s3\-sleep\-delay=N sleep N seconds from the start of the suspend to the wakeup time. Note that this time MUST be longer than the time it takes to suspend the machine otherwise the diff --git a/fwts-test/arg-help-0001/arg-help-0001.log b/fwts-test/arg-help-0001/arg-help-0001.log index 54bdd001..0f38f6b4 100644 --- a/fwts-test/arg-help-0001/arg-help-0001.log +++ b/fwts-test/arg-help-0001/arg-help-0001.log @@ -110,8 +110,7 @@ --pm-method Select the power method to use. Accepted values are - "logind", "pm-utils", - "sysfs" + "logind", "sysfs" -P, --power-states Test S3, S4 power states. -q, --quiet Run quietly. @@ -169,9 +168,6 @@ --s3-multiple Run S3 tests multiple times, e.g. --s3-multiple=10. ---s3-quirks Comma separated list - of quirk arguments to - pass to pm-suspend. --s3-resume-hook hook Run a hook script after each S3 resume, 0 exit indicates diff --git a/fwts-test/arg-help-0001/arg-help-0002.log b/fwts-test/arg-help-0001/arg-help-0002.log index 54bdd001..0f38f6b4 100644 --- a/fwts-test/arg-help-0001/arg-help-0002.log +++ b/fwts-test/arg-help-0001/arg-help-0002.log @@ -110,8 +110,7 @@ --pm-method Select the power method to use. Accepted values are - "logind", "pm-utils", - "sysfs" + "logind", "sysfs" -P, --power-states Test S3, S4 power states. -q, --quiet Run quietly. @@ -169,9 +168,6 @@ --s3-multiple Run S3 tests multiple times, e.g. --s3-multiple=10. ---s3-quirks Comma separated list - of quirk arguments to - pass to pm-suspend. --s3-resume-hook hook Run a hook script after each S3 resume, 0 exit indicates diff --git a/scripts/bash-completion/fwts b/scripts/bash-completion/fwts index 3632fd45..eecf8144 100644 --- a/scripts/bash-completion/fwts +++ b/scripts/bash-completion/fwts @@ -51,7 +51,7 @@ _fwts() return 0 ;; '--pm-method') - COMPREPLY=( $(compgen -W "logind pm-utils sysfs" -- $cur) ) + COMPREPLY=( $(compgen -W "logind sysfs" -- $cur) ) return 0 ;; '--log-filter'|'--log-format'|'-w'|'--log-width'|'-R'|'-rsdp'|\ diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c index 222d9f57..5983f83d 100644 --- a/src/acpi/s3/s3.c +++ b/src/acpi/s3/s3.c @@ -30,8 +30,6 @@ #include #include -#define PM_SUSPEND_PMUTILS "pm-suspend" -#define PM_SUSPEND_HYBRID_PMUTILS "pm-suspend-hybrid" #define PM_SUSPEND_PATH "/sys/power/mem_sleep" #define PM_SUSPEND_LAST_HW_SLEEP "/sys/power/suspend_stats/last_hw_sleep" #define PM_SUSPEND_TOTAL_HW_SLEEP "/sys/power/suspend_stats/total_hw_sleep" @@ -47,7 +45,6 @@ static int s3_max_delay = 30; /* max time between resume and next suspend */ static float s3_delay_delta = 0.5; /* amount to add to delay between each S3 tests */ static int s3_sleep_delay = 30; /* time between start of suspend and wakeup */ static bool s3_device_check = false; /* check for device config changes */ -static char *s3_quirks = NULL; /* Quirks to be passed to pm-suspend */ static int s3_device_check_delay = 15; /* Time to sleep after waking up and then running device check */ static bool s3_min_max_delay = false; static float s3_suspend_time = 15.0; /* Maximum allowed suspend time */ @@ -292,17 +289,13 @@ static void detect_pm_method(fwts_pm_method_vars *fwts_settings) fwts_sysfs_can_hybrid_suspend(fwts_settings) : fwts_sysfs_can_suspend(fwts_settings)) fwts_settings->fw->pm_method = FWTS_PM_SYSFS; - else - fwts_settings->fw->pm_method = FWTS_PM_PMUTILS; } #if FWTS_ENABLE_LOGIND static int wrap_logind_do_suspend(fwts_pm_method_vars *fwts_settings, const int percent, - int *duration, - const char *str) + int *duration) { - FWTS_UNUSED(str); char *action = s3_hybrid ? PM_SUSPEND_HYBRID_LOGIND : PM_SUSPEND_LOGIND; fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); @@ -317,12 +310,10 @@ static int wrap_logind_do_suspend(fwts_pm_method_vars *fwts_settings, static int wrap_sysfs_do_suspend(fwts_pm_method_vars *fwts_settings, const int percent, - int *duration, - const char *str) + int *duration) { int status; - FWTS_UNUSED(str); (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); @@ -339,30 +330,6 @@ static int wrap_sysfs_do_suspend(fwts_pm_method_vars *fwts_settings, return status; } -static int wrap_pmutils_do_suspend(fwts_pm_method_vars *fwts_settings, - const int percent, - int *duration, - const char *command) -{ - int status = 0; - - (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); - fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); - (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); - (void)fwts_klog_write(fwts_settings->fw, "Starting fwts suspend\n"); - (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); - time(&(fwts_settings->t_start)); - (void)fwts_exec(command, &status); - (void)fwts_klog_write(fwts_settings->fw, FWTS_RESUME "\n"); - (void)fwts_klog_write(fwts_settings->fw, "Finished fwts resume\n"); - time(&(fwts_settings->t_end)); - fwts_progress_message(fwts_settings->fw, percent, "(Resumed)"); - - *duration = (int)(fwts_settings->t_end - fwts_settings->t_start); - - return status; -} - static uint64_t get_uint64_sysfs(const char *path) { uint64_t val; @@ -442,7 +409,7 @@ static int s3_do_suspend_resume(fwts_framework *fw, fwts_list resume_wakeup_soure; bool wk_src_found = false; - int (*do_suspend)(fwts_pm_method_vars *, const int, int*, const char*); + int (*do_suspend)(fwts_pm_method_vars *, const int, int*); fwts_settings = calloc(1, sizeof(fwts_pm_method_vars)); if (fwts_settings == NULL) @@ -467,10 +434,6 @@ static int s3_do_suspend_resume(fwts_framework *fw, do_suspend = &wrap_logind_do_suspend; break; #endif - case FWTS_PM_PMUTILS: - fwts_log_info(fw, "Using pm-utils as the default power method."); - do_suspend = &wrap_pmutils_do_suspend; - break; case FWTS_PM_SYSFS: fwts_log_info(fw, "Using sysfs as the default power method."); do_suspend = &wrap_sysfs_do_suspend; @@ -485,37 +448,6 @@ static int s3_do_suspend_resume(fwts_framework *fw, if (s3_device_check) fwts_hwinfo_get(fw, &hwinfo1); - /* Format up pm-suspend command with optional quirking arguments */ - if (fw->pm_method == FWTS_PM_PMUTILS) { - if (s3_hybrid) { - if ((command = fwts_realloc_strcat(NULL, PM_SUSPEND_HYBRID_PMUTILS)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - } else { - if ((command = fwts_realloc_strcat(NULL, PM_SUSPEND_PMUTILS)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - } - - /* For now we only support quirks with pm-utils */ - if (s3_quirks) { - if ((command = fwts_realloc_strcat(command, " ")) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - if ((quirks = fwts_args_comma_list(s3_quirks)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - if ((command = fwts_realloc_strcat(command, quirks)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - } - } - fwts_wakealarm_trigger(fw, delay); if (read_wakeup_source(&suspend_wakeup_soure) != FWTS_ERROR) { @@ -523,7 +455,7 @@ static int s3_do_suspend_resume(fwts_framework *fw, } /* Do S3 / S2idle here */ - status = do_suspend(fwts_settings, percent, &duration, command); + status = do_suspend(fwts_settings, percent, &duration); if (wk_src_found) { if (read_wakeup_source(&resume_wakeup_soure) != FWTS_ERROR) { @@ -617,7 +549,7 @@ static int s3_do_suspend_resume(fwts_framework *fw, "Alternatively, re-test with the kernel parameter \"idle=mwait\". "); } - /* Add in error check for pm-suspend status */ + /* Add in error check for suspend status */ if ((status > 0) && (status < 128)) { (*pm_errors)++; fwts_failed(fw, LOG_LEVEL_HIGH, "PMActionFailedPreSleep", @@ -1019,9 +951,6 @@ static int s3_options_handler(fwts_framework *fw, int argc, char * const argv[], case 5: s3_device_check = true; break; - case 6: - s3_quirks = optarg; - break; case 7: s3_device_check_delay = atoi(optarg); s3_device_check = true; @@ -1056,7 +985,6 @@ static fwts_option s3_options[] = { { "s3-delay-delta", "", 1, "Time to be added to delay between S3 iterations. Used in conjunction with --s3-min-delay and --s3-max-delay, e.g. --s3-delay-delta=2.5" }, { "s3-sleep-delay", "", 1, "Sleep N seconds between start of suspend and wakeup, e.g. --s3-sleep-delay=60" }, { "s3-device-check", "", 0, "Check differences between device configurations over a S3 cycle. Note we add a default of 15 seconds to allow wifi to re-associate. Cannot be used with --s3-min-delay, --s3-max-delay and --s3-delay-delta." }, - { "s3-quirks", "", 1, "Comma separated list of quirk arguments to pass to pm-suspend." }, { "s3-device-check-delay", "", 1, "Sleep N seconds before we run a device check after waking up from suspend. Default is 15 seconds, e.g. --s3-device-check-delay=20" }, { "s3-suspend-time", "", 1, "Maximum expected suspend time in seconds, e.g. --s3-suspend-time=3.5" }, { "s3-resume-time", "", 1, "Maximum expected resume time in seconds, e.g. --s3-resume-time=5.1" }, diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c index 46d68651..6aeeb127 100644 --- a/src/acpi/s3power/s3power.c +++ b/src/acpi/s3power/s3power.c @@ -31,8 +31,6 @@ #include #include -#define PM_SUSPEND "pm-suspend" - static int s3power_sleep_delay = 600; /* time between start of suspend and wakeup */ static uint32_t battery_capacity_mAh; static uint32_t battery_capacity_mWh; @@ -126,18 +124,13 @@ static void detect_pm_method(fwts_pm_method_vars *fwts_settings) #endif if (fwts_sysfs_can_suspend(fwts_settings)) fwts_settings->fw->pm_method = FWTS_PM_SYSFS; - else - fwts_settings->fw->pm_method = FWTS_PM_PMUTILS; } #if FWTS_ENABLE_LOGIND static int wrap_logind_do_suspend(fwts_pm_method_vars *fwts_settings, const int percent, - int *duration, - const char *str) + int *duration) { - FWTS_UNUSED(str); - fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); /* This blocks by entering a glib mainloop */ *duration = fwts_logind_wait_for_resume_from_action(fwts_settings, PM_SUSPEND_LOGIND, 0); @@ -150,12 +143,10 @@ static int wrap_logind_do_suspend(fwts_pm_method_vars *fwts_settings, static int wrap_sysfs_do_suspend(fwts_pm_method_vars *fwts_settings, const int percent, - int *duration, - const char *str) + int *duration) { int status; - FWTS_UNUSED(str); fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); time(&(fwts_settings->t_start)); (void)fwts_klog_write(fwts_settings->fw, "Starting fwts suspend\n"); @@ -171,28 +162,6 @@ static int wrap_sysfs_do_suspend(fwts_pm_method_vars *fwts_settings, return status; } -static int wrap_pmutils_do_suspend(fwts_pm_method_vars *fwts_settings, - const int percent, - int *duration, - const char *command) -{ - int status = FWTS_OK; - - fwts_progress_message(fwts_settings->fw, percent, "(Suspending)"); - time(&(fwts_settings->t_start)); - (void)fwts_klog_write(fwts_settings->fw, "Starting fwts suspend\n"); - (void)fwts_klog_write(fwts_settings->fw, FWTS_SUSPEND "\n"); - (void)fwts_exec(command, &status); - (void)fwts_klog_write(fwts_settings->fw, FWTS_RESUME "\n"); - (void)fwts_klog_write(fwts_settings->fw, "Finished fwts resume\n"); - time(&(fwts_settings->t_end)); - fwts_progress_message(fwts_settings->fw, percent, "(Resumed)"); - - *duration = (int)(fwts_settings->t_end - fwts_settings->t_start); - - return status; -} - static void s3power_difference(fwts_framework *fw, uint32_t before, uint32_t after, uint32_t battery_capacity, char *units) @@ -254,7 +223,7 @@ static int s3power_test(fwts_framework *fw) fwts_pm_method_vars *fwts_settings; - int (*do_suspend)(fwts_pm_method_vars *, const int, int*, const char*); + int (*do_suspend)(fwts_pm_method_vars *, const int, int*); #if FWTS_ENABLE_LOGIND #if !GLIB_CHECK_VERSION(2,35,0) @@ -286,10 +255,6 @@ static int s3power_test(fwts_framework *fw) do_suspend = &wrap_logind_do_suspend; break; #endif - case FWTS_PM_PMUTILS: - fwts_log_info(fw, "Using pm-utils as the default power method."); - do_suspend = &wrap_pmutils_do_suspend; - break; case FWTS_PM_SYSFS: fwts_log_info(fw, "Using sysfs as the default power method."); do_suspend = &wrap_sysfs_do_suspend; @@ -320,7 +285,7 @@ static int s3power_test(fwts_framework *fw) (void)fwts_pm_debug_set(1); /* Do S3 here */ - status = do_suspend(fwts_settings, 100, &duration, PM_SUSPEND); + status = do_suspend(fwts_settings, 100, &duration); /* Restore pm debug value */ if (pm_debug != -1) @@ -331,7 +296,7 @@ static int s3power_test(fwts_framework *fw) s3power_difference(fw, capacity_before_mAh, capacity_after_mAh, battery_capacity_mAh, "mAh"); s3power_difference(fw, capacity_before_mWh, capacity_after_mWh, battery_capacity_mWh, "mWh"); - fwts_log_info(fw, "pm-suspend returned %d after %d seconds.", status, duration); + fwts_log_info(fw, "suspend returned %d after %d seconds.", status, duration); if (duration < s3power_sleep_delay) fwts_failed(fw, LOG_LEVEL_MEDIUM, "ShortSuspend", @@ -341,7 +306,7 @@ static int s3power_test(fwts_framework *fw) fwts_failed(fw, LOG_LEVEL_HIGH, "LongSuspend", "Unexpected: S3 much longer than expected (%d seconds).", duration); - /* Add in error check for pm-suspend status */ + /* Add in error check for suspend status */ if ((status > 0) && (status < 128)) { fwts_failed(fw, LOG_LEVEL_MEDIUM, "PMActionFailedPreS3", "pm-action failed before trying to put the system " diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c index eaba1fbd..3e16fbdf 100644 --- a/src/acpi/s4/s4.c +++ b/src/acpi/s4/s4.c @@ -97,8 +97,6 @@ static void detect_pm_method(fwts_pm_method_vars *fwts_settings) #endif if (fwts_sysfs_can_hibernate(fwts_settings)) fwts_settings->fw->pm_method = FWTS_PM_SYSFS; - else - fwts_settings->fw->pm_method = FWTS_PM_PMUTILS; } #if FWTS_ENABLE_LOGIND @@ -143,28 +141,6 @@ static int wrap_sysfs_do_s4(fwts_pm_method_vars *fwts_settings, return status; } -static int wrap_pmutils_do_s4(fwts_pm_method_vars *fwts_settings, - const int percent, - int *duration, - const char *command) -{ - int status = 0; - - fwts_progress_message(fwts_settings->fw, percent, "(Hibernating)"); - time(&(fwts_settings->t_start)); - (void)fwts_klog_write(fwts_settings->fw, "Starting fwts hibernate\n"); - (void)fwts_klog_write(fwts_settings->fw, FWTS_HIBERNATE "\n"); - (void)fwts_exec(command, &status); - (void)fwts_klog_write(fwts_settings->fw, FWTS_RESUME "\n"); - (void)fwts_klog_write(fwts_settings->fw, "Finished fwts resume\n"); - time(&(fwts_settings->t_end)); - fwts_progress_message(fwts_settings->fw, percent, "(Resumed)"); - - *duration = (int)(fwts_settings->t_end - fwts_settings->t_start); - - return status; -} - static int s4_hibernate(fwts_framework *fw, int *klog_errors, int *hw_errors, @@ -209,10 +185,6 @@ static int s4_hibernate(fwts_framework *fw, do_s4 = &wrap_logind_do_s4; break; #endif - case FWTS_PM_PMUTILS: - fwts_log_info(fw, "Using pm-utils as the default power method."); - do_s4 = &wrap_pmutils_do_s4; - break; case FWTS_PM_SYSFS: fwts_log_info(fw, "Using sysfs as the default power method."); do_s4 = &wrap_sysfs_do_s4; @@ -227,30 +199,6 @@ static int s4_hibernate(fwts_framework *fw, if (s4_device_check) fwts_hwinfo_get(fw, &hwinfo1); - if (fw->pm_method == FWTS_PM_PMUTILS) { - /* Format up pm-hibernate command with optional quirking arguments */ - if ((command = fwts_realloc_strcat(NULL, PM_HIBERNATE)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - - /* For now we only support quirks with pm-utils */ - if (s4_quirks) { - if ((command = fwts_realloc_strcat(command, " ")) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - if ((quirks = fwts_args_comma_list(s4_quirks)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - if ((command = fwts_realloc_strcat(command, quirks)) == NULL) { - rc = FWTS_OUT_OF_MEMORY; - goto tidy; - } - } - } - fwts_wakealarm_trigger(fw, s4_sleep_delay); /* Do s4 here */ diff --git a/src/lib/include/fwts_types.h b/src/lib/include/fwts_types.h index e30d7817..57138769 100644 --- a/src/lib/include/fwts_types.h +++ b/src/lib/include/fwts_types.h @@ -47,7 +47,6 @@ typedef enum { typedef enum { FWTS_PM_LOGIND, - FWTS_PM_PMUTILS, FWTS_PM_SYSFS, FWTS_PM_UNDEFINED } fwts_pm_method; diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c index e10f8764..a0de67e5 100644 --- a/src/lib/src/fwts_framework.c +++ b/src/lib/src/fwts_framework.c @@ -130,7 +130,7 @@ static fwts_option fwts_framework_options[] = { { "acpica", "", 1, "Enable ACPICA run time options." }, { "uefitests", "", 0, "Run UEFI tests." }, { "rsdp", "R:", 1, "Specify the physical address of the ACPI RSDP." }, - { "pm-method", "", 1, "Select the power method to use. Accepted values are \"logind\", \"pm-utils\", \"sysfs\""}, + { "pm-method", "", 1, "Select the power method to use. Accepted values are \"logind\", \"sysfs\""}, { "show-tests-categories","", 0, "Show tests and associated categories." }, { "acpitests", "", 0, "Run general ACPI tests." }, { "acpicompliance", "", 0, "Run ACPI tests for spec compliance." }, @@ -1112,15 +1112,13 @@ static int fwts_framework_pm_method_parse(fwts_framework *fw, const char *arg) fw->pm_method = FWTS_PM_LOGIND; else #endif - if (strcmp(arg, "pm-utils") == 0) - fw->pm_method = FWTS_PM_PMUTILS; - else if (strcmp(arg, "sysfs") == 0) + if (strcmp(arg, "sysfs") == 0) fw->pm_method = FWTS_PM_SYSFS; else { #if FWTS_ENABLE_LOGIND - fprintf(stderr, "--pm-method only supports logind, pm-utils and sysfs methods\n"); + fprintf(stderr, "--pm-method only supports logind and sysfs methods\n"); #else - fprintf(stderr, "--pm-method only supports pm-utils and sysfs methods\n"); + fprintf(stderr, "--pm-method only supports sysfs method\n"); #endif return FWTS_ERROR; }