Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps

"Rafael J. Wysocki" <[email protected]>
Newsgroups gmane.linux.acpi.devel,gmane.linux.kernel
Organization Linux Kernel Development - Intel
Message-ID <[email protected]>
On Wednesday, August 19, 2026 1:06:50 PM CEST Rafael J. Wysocki (Intel) wrote:
> On Wed, Aug 19, 2026 at 12:18 PM Rafael J. Wysocki (Intel)
> <[email protected]> wrote:
> >
> > Hi Nathan,
> >
> > On Wed, Aug 19, 2026 at 2:37 AM Nathan Chancellor <[email protected]> wrote:
> > >
> > > Hi Rafael,
> > >
> > > On Fri, Aug 07, 2026 at 12:22:37PM +0200, Rafael J. Wysocki wrote:
> > > > From: "Rafael J. Wysocki" <[email protected]>
> > > >
> > > > If acpi_dev_get_resources() returns overlapping I/O or memory resources,
> > > > the subsequent registration of a platform device will fail with -EBUSY
> > > > due to a resource conflict.  This is reported to happen on Acer Aspire
> > > > ES1-572 [1].
> > > >
> > > > Avoid that by adjusting resources returned by acpi_dev_get_resources()
> > > > to eliminate partial overlaps between them.
> > > >
> > > > This has not been regarded as necessary before because putting
> > > > overlapping resources into the _CRS of one device is really pointless,
> > > > but now that the issue has been reported to actually happen in the
> > > > field, it needs to be done.
> > > >
> > > > Fixes: ab06eb920401 ("ACPI: scan: Register platform devices for fixed event buttons")
> > > > Reported-by: Julien <[email protected]>
> > > > Closes: https://lore.kernel.org/linux-integrity/CAJOGg3z6LJPDsdPNBxajgy8_wQxfhYBRxe4EiurZf3kPU5A5Bw@mail.gmail.com/ [1]
> > > > Cc: All applicable <[email protected]>
> > > > Signed-off-by: Rafael J. Wysocki <[email protected]>
> > >
> > > I bisected the following kernel message that I see on one of my aarch64
> > > test machines to this change in -next as commit f234fdaae1ca ("ACPI:
> > > scan: Avoid registering platform devices with resource overlaps"):
> > >
> > >   arm-cmn ARMHC600:00: probe with driver arm-cmn failed with error -22
> > >
> > > Is this expected? If not, what information would be helpful for debugging this?
> >
> > No, it is not.
> >
> > First, please send a boot log from the failing machine.
> >
> > Second, I think we may need the acpidump output from it.
> 
> So looking at the driver code, it expects to get two resources and it
> is confused when it gets just one, so most likely arm_cmn_get_root()
> fails.
> 
> I guess what happens is that originally one of the resources is within
> the other one completely (or the creation of the platform device would
> fail), which is kind of valid, so resource_overlaps() returns true for
> them, and they get merged.  This means that
> acpi_platform_adjust_resources() needs to look for partial overlaps
> only.
> 
> I'll send a patch to adjust it later today.

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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.