Re: [PATCH v2 2/8] ACPI: video: Rework checking for duplicate video bus devices

From: Danilo Krummrich

Date: Fri Mar 13 2026 - 10:19:34 EST


On Fri Mar 13, 2026 at 1:56 PM CET, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> The current way of checking for duplicate video bus devices in
> acpi_video_bus_probe() is based on walking the ACPI namespace which is
> not necessary after recent driver conversions. It is also susceptible
> to race conditions (for example, if two video bus devices are probed at
> the same time) and ordering issues.
>
> Instead of doing it the old way, inspect the children of the parent of
> the device being probed, excluding the latter and the children that are
> not auxiliary devices. For each of the remaining children, check if any
> of the entries in the video_bus_head list is equal to its driver data
> which can only happen if the given child has been processed by
> acpi_video_bus_probe() successfully and so it is a duplicate of the
> one being probed.
>
> Moreover, to prevent acpi_video_bus_probe() from processing two devices
> concurrently, which might defeat the above check, use a new internal
> mutex in it.
>
> Also, print the FW_BUG message only if allow_duplicates is unset which
> allows the entire duplicates check to be skipped in that case (doing
> it just to print the message about the case that is going to be
> ignored anyway is kind of pointless).
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

Reviewed-by: Danilo Krummrich <dakr@xxxxxxxxxx>