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: <aV5T3Lh4TxvpOZi4@kekkonen.localdomain>
Date: Wed, 7 Jan 2026 14:38:52 +0200
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Kartik Rajput <kkartik@...dia.com>
Cc: lenb@...nel.org, mika.westerberg@...ux.intel.com,
	andriy.shevchenko@...ux.intel.com, thierry.reding@...il.com,
	jonathanh@...dia.com, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] ACPI: bus: Use OF match data for PRP0001 matched
 devices

Hi Kartik,

On Wed, Jan 07, 2026 at 05:33:18PM +0530, Kartik Rajput wrote:
> When a device is matched via PRP0001, the driver's OF (DT) match table
> must be used to obtain the device match data. If a driver provides both
> an acpi_match_table and an of_match_table, the current
> acpi_device_get_match_data() path consults the driver's acpi_match_table
> and returns NULL (no ACPI ID matches).
> 
> Explicitly detect PRP0001 and fetch match data from the driver's
> of_match_table via acpi_of_device_get_match_data().
> 
> Fixes: 886ca88be6b3 ("ACPI / bus: Respect PRP0001 when retrieving device match data")
> Cc: stable@...r.kernel.org
> Signed-off-by: Kartik Rajput <kkartik@...dia.com>
> ---
> Changes in v2:
> 	* Fix build errors.

Thanks for the update.

> ---
>  drivers/acpi/bus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 5e110badac7b..6658c4339656 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -1031,8 +1031,9 @@ const void *acpi_device_get_match_data(const struct device *dev)
>  {
>  	const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
>  	const struct acpi_device_id *match;
> +	struct acpi_device *adev = ACPI_COMPANION(dev);
>  
> -	if (!acpi_ids)
> +	if (!strcmp(ACPI_DT_NAMESPACE_HID, acpi_device_hid(adev)))

I'd swap the arguments to have the static one on the right, i.e.

	if (!strcmp(acpi_device_hid(adev), ACPI_DT_NAMESPACE_HID))

The patch looks good apart from that IMO.

>  		return acpi_of_device_get_match_data(dev);
>  
>  	match = acpi_match_device(acpi_ids, dev);

-- 
Kind regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ