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: <ZkscFnmHeWWma7Nb@google.com>
Date: Mon, 20 May 2024 17:47:02 +0800
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Ben Walsh <ben@...nut.com>
Cc: Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>,
	"Dustin L. Howett" <dustin@...ett.net>,
	Kieran Levin <ktl@...me.work>,
	Thomas Weißschuh <linux@...ssschuh.net>,
	Mario Limonciello <mario.limonciello@....com>,
	chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] platform/chrome: cros_ec_lpc: Correct ACPI name for
 Framework Laptop

On Wed, May 15, 2024 at 06:56:30AM +0100, Ben Walsh wrote:
> Framework Laptops' ACPI exposes the EC as name "PNP0C09". Use this to
> find the device. This makes it easy to find the AML mutex via the
> ACPI_COMPANION device.
> 
> The name "PNP0C09" is part of the ACPI standard, not Chrome-specific,
> so only recognise the device if the DMI data is recognised too.

I don't quite understand the statement.  Why it needs DMI data?

> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
[...]
> -/* True if ACPI device is present */
> -static bool cros_ec_lpc_acpi_device_found;
> +/*
> + * Index into cros_ec_lpc_acpi_device_ids of ACPI device,
> + * negative for ACPI device not found.
> + */
> +static int cros_ec_lpc_acpi_device_found;

Rename it to `cros_ec_lpc_acpi_device_index` for clarity?

>  static int __init cros_ec_lpc_init(void)
>  {
>  	int ret;
> -	acpi_status status;
>  	const struct dmi_system_id *dmi_match;
>  
> -	status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device,
> -				  &cros_ec_lpc_acpi_device_found, NULL);
> -	if (ACPI_FAILURE(status))
> -		pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME);
> +	cros_ec_lpc_acpi_device_found = cros_ec_lpc_find_acpi_dev(
> +		cros_ec_lpc_driver.driver.acpi_match_table);

Or just use `cros_ec_lpc_acpi_device_ids`.

> -	} else if (!cros_ec_lpc_acpi_device_found) {
> +	} else if (cros_ec_lpc_acpi_device_found <= 0) {
> +		/* Standard EC "PNP0C09" not supported without DMI data */

Asked the same question above, why PNP0C09 needs DMI data?  Also the way is
a bit confusing as "PNP0C09" must be at index 0 in the acpi_device_id.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ