Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
Nathan Chancellor <[email protected]>
| Newsgroups | org.kernel.vger.linux-integrity,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260819194039.GA3686901@ax162> |
On Wed, Aug 19, 2026 at 09:00:09PM +0200, Rafael J. Wysocki (Intel) wrote: > On Wed, Aug 19, 2026 at 7:32 PM Nathan Chancellor <[email protected]> wrote: > > > > On Wed, Aug 19, 2026 at 03:55:43PM +0200, Rafael J. Wysocki wrote: > > > And below is one to try. > > > > > > --- > > > drivers/acpi/acpi_platform.c | 7 ++++++- > > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > > > --- a/drivers/acpi/acpi_platform.c > > > +++ b/drivers/acpi/acpi_platform.c > > > @@ -85,7 +85,12 @@ static unsigned int acpi_platform_adjust > > > for (i = 0; i < count; ) { > > > struct resource *res = &resources[i]; > > > > > > - if (resource_type(new_res) != resource_type(res) || > > > + /* > > > + * Look for overlaps of resources of the same type that > > > + * would cause resource insertion to fail. > > > + */ > > > + if (__resource_contains_unbound(new_res, res) || > > > + resource_type(new_res) != resource_type(res) || > > > !resource_union(new_res, res, new_res)) { > > > i++; > > > continue; > > > > > > > > > > > > > This does not appear to resolve the probe failure for me. > > So can you please try to reverse new_res and res in the > __resource_contains_unbound() check in the patch and try again? Can confirm that diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index fffdd4f011b2..ea3b2e03ebae 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -85,7 +85,12 @@ static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev, for (i = 0; i < count; ) { struct resource *res = &resources[i]; - if (resource_type(new_res) != resource_type(res) || + /* + * Look for overlaps of resources of the same type that + * would cause resource insertion to fail. + */ + if (__resource_contains_unbound(res, new_res) || + resource_type(new_res) != resource_type(res) || !resource_union(new_res, res, new_res)) { i++; continue; -- resolves the probe failure for me. -- Cheers, Nathan