lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGzukhSTqWzXJRAL@surfacebook>
Date:   Tue, 23 May 2023 19:49:22 +0300
From:   andy.shevchenko@...il.com
To:     Mario Limonciello <mario.limonciello@....com>
Cc:     rafael@...nel.org, hdegoede@...hat.com, linus.walleij@...aro.org,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-gpio@...r.kernel.org, platform-driver-x86@...r.kernel.org,
        linux-pm@...r.kernel.org, Shyam-sundar.S-k@....com,
        Basavaraj.Natikar@....com
Subject: Re: [PATCH v2 2/4] ACPI: x86: Add pm_debug_messages for LPS0 _DSM
 state tracking

Mon, May 22, 2023 at 03:00:31PM -0500, Mario Limonciello kirjoitti:
> Enabling debugging messages for the state requires turning on dynamic
> debugging for the file. To make it more accessible, use
> `pm_debug_messages` and clearer strings for what is happening.

...

> +		switch (state) {
> +		case ACPI_LPS0_SCREEN_OFF:
> +			return "screen off";
> +		case ACPI_LPS0_SCREEN_ON:
> +			return "screen on";
> +		case ACPI_LPS0_ENTRY:
> +			return "lps0 entry";
> +		case ACPI_LPS0_EXIT:
> +			return "lps0 exit";
> +		case ACPI_LPS0_MS_ENTRY:
> +			return "lps0 ms entry";
> +		case ACPI_LPS0_MS_EXIT:
> +			return "lps0 ms exit";

No default?

> +		}

...

> +		switch (state) {
> +		case ACPI_LPS0_SCREEN_ON_AMD:
> +			return "screen on";
> +		case ACPI_LPS0_SCREEN_OFF_AMD:
> +			return "screen off";
> +		case ACPI_LPS0_ENTRY_AMD:
> +			return "lps0 entry";
> +		case ACPI_LPS0_EXIT_AMD:
> +			return "lps0 exit";
> +		}
> +	}
> +
> +	return "unknown";

Make it default in each switch-case. That way we might have an option to alter
them if needed.

...

> -	acpi_handle_debug(lps0_device_handle, "_DSM function %u evaluation %s\n",
> -			  func, out_obj ? "successful" : "failed");
> +	lps0_dsm_state = func;
> +	if (pm_debug_messages_on) {
> +		acpi_handle_info(lps0_device_handle,
> +				"%s transitioned to state %s\n",
> +				 out_obj ? "Successfully" : "Failed to",
> +				 acpi_sleep_dsm_state_to_str(lps0_dsm_state));
> +	}

Can we keep the original choice (i.e. 

	? "successful" : "failed");

) unmodified? The rationale is that we migh add something like
str_successful_failed() to the string_helpers.h for wider use and common
standardization.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ