diff mbox series

[3/3] Drop support for pm-utils

Message ID 20231207101927.9378-4-mario.limonciello@amd.com
State New
Headers show
Series [1/3] s3: Add support for reading total s2idle residency from generic API | expand

Commit Message

Mario Limonciello Dec. 7, 2023, 10:19 a.m. UTC
This has been long deprecated and isn't used in any distros anymore.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 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(-)

Comments

Ivan Hu Dec. 14, 2023, 8:46 a.m. UTC | #1
Pm-utils are still available, https://launchpad.net/ubuntu/+source/pm-utils
After installing the pm-utils, the tests works.

We think we should keep this for debugging and testing purposes until the packages are not available.

Cheers,
Ivan

On 2023/12/7 18:19, Mario Limonciello wrote:
> This has been long deprecated and isn't used in any distros anymore.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   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 <unistd.h>
>   #include <errno.h>
>   
> -#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 <time.h>
>   #include <inttypes.h>
>   
> -#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;
>   	}
Mario Limonciello Dec. 14, 2023, 7:08 p.m. UTC | #2
On 12/14/2023 02:46, ivanhu wrote:
> Pm-utils are still available, https://launchpad.net/ubuntu/+source/pm-utils
> After installing the pm-utils, the tests works.
> 
> We think we should keep this for debugging and testing purposes until 
> the packages are not available.

I don't know how much more dead it can become.  I don't think it's a 
good house of cards to build on an expectation that it can be used even 
for debugging.

Upstream hasn't changed in 13 years:
https://cgit.freedesktop.org/pm-utils/

Debian hasn't changed in 4 years:
https://tracker.debian.org/pkg/pm-utils

I've filed a bug with the Debian release manager to remove it.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058701

> 
> Cheers,
> Ivan
> 
> On 2023/12/7 18:19, Mario Limonciello wrote:
>> This has been long deprecated and isn't used in any distros anymore.
>>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   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 <unistd.h>
>>   #include <errno.h>
>> -#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 <time.h>
>>   #include <inttypes.h>
>> -#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;
>>       }
Ivan Hu Dec. 15, 2023, 12:44 a.m. UTC | #3
Understood, currently fwts default using "logind" for the test, if testers haven't specified it the with pm-metod, it should not be a problem.

I'll check if anyone still using it internally and externally and keep this patch till I get comfirmed. Thanks!

Cheers,
Ivan

On 12/15/23 03:08, Mario Limonciello wrote:
> On 12/14/2023 02:46, ivanhu wrote:
>> Pm-utils are still available, https://launchpad.net/ubuntu/+source/pm-utils
>> After installing the pm-utils, the tests works.
>>
>> We think we should keep this for debugging and testing purposes until the packages are not available.
> 
> I don't know how much more dead it can become.  I don't think it's a good house of cards to build on an expectation that it can be used even for debugging.
> 
> Upstream hasn't changed in 13 years:
> https://cgit.freedesktop.org/pm-utils/
> 
> Debian hasn't changed in 4 years:
> https://tracker.debian.org/pkg/pm-utils
> 
> I've filed a bug with the Debian release manager to remove it.
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058701
> 
>>
>> Cheers,
>> Ivan
>>
>> On 2023/12/7 18:19, Mario Limonciello wrote:
>>> This has been long deprecated and isn't used in any distros anymore.
>>>
>>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>>> ---
>>>   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 <unistd.h>
>>>   #include <errno.h>
>>> -#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 <time.h>
>>>   #include <inttypes.h>
>>> -#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;
>>>       }
>
diff mbox series

Patch

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 <unistd.h>
 #include <errno.h>
 
-#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 <time.h>
 #include <inttypes.h>
 
-#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;
 	}