ACK: [PATCH 6/6] acpi: s3power: force enable /sys/power/pm_debug_messages (LP: #1772563)

Alex Hung alex.hung at canonical.com
Fri Jun 8 01:12:50 UTC 2018


On 2018-06-07 07:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Some kernels may not have this set to 1 to get PM debug messages
> for the S3 cycle, so force enable it on and then restore it back
> after the test.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpi/s3power/s3power.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index b63c8d28..c20b3b8f 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -243,6 +243,7 @@ static int s3power_test(fwts_framework *fw)
>   	int status;
>   	int duration;
>   	int rc = FWTS_OK;
> +	int pm_debug;
>   
>   	bool offline;
>   
> @@ -315,9 +316,16 @@ static int s3power_test(fwts_framework *fw)
>   
>   	fwts_wakealarm_trigger(fw, s3power_sleep_delay);
>   
> +	(void)fwts_pm_debug_get(&pm_debug);
> +	(void)fwts_pm_debug_set(1);
> +
>   	/* Do S3 here */
>   	status = do_suspend(fwts_settings, 100, &duration, PM_SUSPEND);
>   
> +	/* Restore pm debug value */
> +	if (pm_debug != -1)
> +		(void)fwts_pm_debug_set(pm_debug);
> +
>   	s3power_get_remaining_capacity(fw, &capacity_after_mAh, &capacity_after_mWh);
>   
>   	s3power_difference(fw, capacity_before_mAh, capacity_after_mAh, battery_capacity_mAh, "mAh");
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list