Linux Integrity Measurement development
 help / color / mirror / Atom feed
* [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
@ 2026-08-07 10:22 Rafael J. Wysocki
  2026-08-07 12:57 ` Paul Menzel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-08-07 10:22 UTC (permalink / raw)
  To: Linux ACPI
  Cc: LKML, Andy Shevchenko, Mika Westerberg, Julien, jarkko,
	linux-integrity

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

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 <julien82453@gmail.com>
Closes: https://lore.kernel.org/linux-integrity/CAJOGg3z6LJPDsdPNBxajgy8_wQxfhYBRxe4EiurZf3kPU5A5Bw@mail.gmail.com/ [1]
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v2 -> v3:
   * Use resource_union() and adjust code and comment (Andy)
   * Include ioport.h directly

v1 -> v2:
   * Add the expanded resource instead of and not in addition to the other
     overlapping one (Sashiko)

---
 drivers/acpi/acpi_platform.c |   39 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -12,6 +12,7 @@
 #include <linux/bits.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
@@ -71,6 +72,36 @@ static struct notifier_block acpi_platfo
 	.notifier_call = acpi_platform_device_remove_notify,
 };
 
+static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
+						   struct resource *new_res,
+						   struct resource *resources,
+						   unsigned int count)
+{
+	unsigned int i;
+
+	if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
+		return count;
+
+	for (i = 0; i < count; ) {
+		struct resource *res = &resources[i];
+
+		if (resource_type(new_res) != resource_type(res) ||
+		    !resource_union(new_res, res, new_res)) {
+			i++;
+			continue;
+		}
+
+		dev_info(&adev->dev, "%pR expanded to avoid overlap\n", new_res);
+		/*
+		 * Eliminate the previously processed resource that overlapped
+		 * with the new one because it is not necessary any more.
+		 */
+		memmove(res, res + 1, (--count - i) * sizeof(*res));
+	}
+
+	return count;
+}
+
 static void acpi_platform_fill_resource(struct acpi_device *adev,
 	const struct resource *src, struct resource *dest)
 {
@@ -151,10 +182,14 @@ struct platform_device *acpi_create_plat
 				return ERR_PTR(-ENOMEM);
 			}
 			count = 0;
-			list_for_each_entry(rentry, &resource_list, node)
+			list_for_each_entry(rentry, &resource_list, node) {
+				count = acpi_platform_adjust_resources(adev,
+								       rentry->res,
+								       resources,
+								       count);
 				acpi_platform_fill_resource(adev, rentry->res,
 							    &resources[count++]);
-
+			}
 			acpi_dev_free_resource_list(&resource_list);
 		}
 	}




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
  2026-08-07 10:22 [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps Rafael J. Wysocki
@ 2026-08-07 12:57 ` Paul Menzel
  2026-08-07 13:31   ` Rafael J. Wysocki (Intel)
  2026-08-08 20:04 ` Andy Shevchenko
  2026-08-10 15:35 ` Jarkko Sakkinen
  2 siblings, 1 reply; 6+ messages in thread
From: Paul Menzel @ 2026-08-07 12:57 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-acpi, LKML, Andy Shevchenko, Mika Westerberg, julien82453,
	jarkko, linux-integrity

Dear Rafael,


Thank you for the patch.

Am 07.08.26 um 12:22 schrieb Rafael J. Wysocki:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> 
> 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].

Reading the diff, it might be useful to paste the log warning already here:

     tpm_crb_acpi MSFT0101:00: [Firmware Bug]: Bad ACPI memory layout

> 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 <julien82453@gmail.com>
> Closes: https://lore.kernel.org/linux-integrity/CAJOGg3z6LJPDsdPNBxajgy8_wQxfhYBRxe4EiurZf3kPU5A5Bw@mail.gmail.com/ [1]
> Cc: All applicable <stable@vger.kernel.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> v2 -> v3:
>     * Use resource_union() and adjust code and comment (Andy)
>     * Include ioport.h directly
> 
> v1 -> v2:
>     * Add the expanded resource instead of and not in addition to the other
>       overlapping one (Sashiko)
> 
> ---
>   drivers/acpi/acpi_platform.c |   39 +++++++++++++++++++++++++++++++++++++--
>   1 file changed, 37 insertions(+), 2 deletions(-)
> 
> --- a/drivers/acpi/acpi_platform.c
> +++ b/drivers/acpi/acpi_platform.c
> @@ -12,6 +12,7 @@
>   #include <linux/bits.h>
>   #include <linux/device.h>
>   #include <linux/err.h>
> +#include <linux/ioport.h>
>   #include <linux/kernel.h>
>   #include <linux/module.h>
>   #include <linux/dma-mapping.h>
> @@ -71,6 +72,36 @@ static struct notifier_block acpi_platfo
>   	.notifier_call = acpi_platform_device_remove_notify,
>   };
>   
> +static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
> +						   struct resource *new_res,
> +						   struct resource *resources,
> +						   unsigned int count)
> +{
> +	unsigned int i;
> +
> +	if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
> +		return count;
> +
> +	for (i = 0; i < count; ) {
> +		struct resource *res = &resources[i];
> +
> +		if (resource_type(new_res) != resource_type(res) ||
> +		    !resource_union(new_res, res, new_res)) {
> +			i++;
> +			continue;
> +		}
> +
> +		dev_info(&adev->dev, "%pR expanded to avoid overlap\n", new_res);

Maybe more normal user understandable:

     %pR expanded to fit all resources to avoid overlap

For the record, Julian reported that now the lines below are logged:

     MSFT0101:00: [mem 0xfed40000-0xfed4103f] expanded to avoid overlap
     tpm_crb_acpi MSFT0101:00: [Firmware Bug]: Bad ACPI memory layout

> +		/*
> +		 * Eliminate the previously processed resource that overlapped
> +		 * with the new one because it is not necessary any more.
> +		 */
> +		memmove(res, res + 1, (--count - i) * sizeof(*res));
> +	}
> +
> +	return count;
> +}
> +
>   static void acpi_platform_fill_resource(struct acpi_device *adev,
>   	const struct resource *src, struct resource *dest)
>   {
> @@ -151,10 +182,14 @@ struct platform_device *acpi_create_plat
>   				return ERR_PTR(-ENOMEM);
>   			}
>   			count = 0;
> -			list_for_each_entry(rentry, &resource_list, node)
> +			list_for_each_entry(rentry, &resource_list, node) {
> +				count = acpi_platform_adjust_resources(adev,
> +								       rentry->res,
> +								       resources,
> +								       count);
>   				acpi_platform_fill_resource(adev, rentry->res,
>   							    &resources[count++]);
> -
> +			}
>   			acpi_dev_free_resource_list(&resource_list);
>   		}
>   	}

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
  2026-08-07 12:57 ` Paul Menzel
@ 2026-08-07 13:31   ` Rafael J. Wysocki (Intel)
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-08-07 13:31 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Rafael J. Wysocki, linux-acpi, LKML, Andy Shevchenko,
	Mika Westerberg, julien82453, jarkko, linux-integrity

On Fri, Aug 7, 2026 at 2:57 PM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
> Dear Rafael,
>
>
> Thank you for the patch.
>
> Am 07.08.26 um 12:22 schrieb Rafael J. Wysocki:
> > From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> >
> > 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].
>
> Reading the diff, it might be useful to paste the log warning already here:
>
>      tpm_crb_acpi MSFT0101:00: [Firmware Bug]: Bad ACPI memory layout

It's there in the message pointed to by the Closes: tag though.

> > 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 <julien82453@gmail.com>
> > Closes: https://lore.kernel.org/linux-integrity/CAJOGg3z6LJPDsdPNBxajgy8_wQxfhYBRxe4EiurZf3kPU5A5Bw@mail.gmail.com/ [1]
> > Cc: All applicable <stable@vger.kernel.org>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >
> > v2 -> v3:
> >     * Use resource_union() and adjust code and comment (Andy)
> >     * Include ioport.h directly
> >
> > v1 -> v2:
> >     * Add the expanded resource instead of and not in addition to the other
> >       overlapping one (Sashiko)
> >
> > ---
> >   drivers/acpi/acpi_platform.c |   39 +++++++++++++++++++++++++++++++++++++--
> >   1 file changed, 37 insertions(+), 2 deletions(-)
> >
> > --- a/drivers/acpi/acpi_platform.c
> > +++ b/drivers/acpi/acpi_platform.c
> > @@ -12,6 +12,7 @@
> >   #include <linux/bits.h>
> >   #include <linux/device.h>
> >   #include <linux/err.h>
> > +#include <linux/ioport.h>
> >   #include <linux/kernel.h>
> >   #include <linux/module.h>
> >   #include <linux/dma-mapping.h>
> > @@ -71,6 +72,36 @@ static struct notifier_block acpi_platfo
> >       .notifier_call = acpi_platform_device_remove_notify,
> >   };
> >
> > +static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
> > +                                                struct resource *new_res,
> > +                                                struct resource *resources,
> > +                                                unsigned int count)
> > +{
> > +     unsigned int i;
> > +
> > +     if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
> > +             return count;
> > +
> > +     for (i = 0; i < count; ) {
> > +             struct resource *res = &resources[i];
> > +
> > +             if (resource_type(new_res) != resource_type(res) ||
> > +                 !resource_union(new_res, res, new_res)) {
> > +                     i++;
> > +                     continue;
> > +             }
> > +
> > +             dev_info(&adev->dev, "%pR expanded to avoid overlap\n", new_res);
>
> Maybe more normal user understandable:
>
>      %pR expanded to fit all resources to avoid overlap

What about "expanded due to overlap"?  I'd prefer it to be shorter
because the resource printout takes up some message space already.

> For the record, Julian reported that now the lines below are logged:
>
>      MSFT0101:00: [mem 0xfed40000-0xfed4103f] expanded to avoid overlap
>      tpm_crb_acpi MSFT0101:00: [Firmware Bug]: Bad ACPI memory layout

Right, and the second one comes from the driver binding to the device.

> > +             /*
> > +              * Eliminate the previously processed resource that overlapped
> > +              * with the new one because it is not necessary any more.
> > +              */
> > +             memmove(res, res + 1, (--count - i) * sizeof(*res));
> > +     }
> > +
> > +     return count;
> > +}
> > +
> >   static void acpi_platform_fill_resource(struct acpi_device *adev,
> >       const struct resource *src, struct resource *dest)
> >   {
> > @@ -151,10 +182,14 @@ struct platform_device *acpi_create_plat
> >                               return ERR_PTR(-ENOMEM);
> >                       }
> >                       count = 0;
> > -                     list_for_each_entry(rentry, &resource_list, node)
> > +                     list_for_each_entry(rentry, &resource_list, node) {
> > +                             count = acpi_platform_adjust_resources(adev,
> > +                                                                    rentry->res,
> > +                                                                    resources,
> > +                                                                    count);
> >                               acpi_platform_fill_resource(adev, rentry->res,
> >                                                           &resources[count++]);
> > -
> > +                     }
> >                       acpi_dev_free_resource_list(&resource_list);
> >               }
> >       }
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>

Thank you!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
  2026-08-07 10:22 [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps Rafael J. Wysocki
  2026-08-07 12:57 ` Paul Menzel
@ 2026-08-08 20:04 ` Andy Shevchenko
  2026-08-10 10:41   ` Rafael J. Wysocki (Intel)
  2026-08-10 15:35 ` Jarkko Sakkinen
  2 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2026-08-08 20:04 UTC (permalink / raw)
  To: Rafael J. Wysocki, Ilpo Järvinen
  Cc: Linux ACPI, LKML, Mika Westerberg, Julien, jarkko,
	linux-integrity

On Fri, Aug 07, 2026 at 12:22:37PM +0200, Rafael J. Wysocki wrote:

> 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.

...

>    * Use resource_union() and adjust code and comment (Andy)

Thanks, LGTM now,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> +static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
> +						   struct resource *new_res,
> +						   struct resource *resources,
> +						   unsigned int count)
> +{
> +	unsigned int i;
> +
> +	if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))

Can also be

	if (!(resource_type(new_res) & (IORESOURCE_IO | IORESOURCE_MEM)))

> +		return count;
> +
> +	for (i = 0; i < count; ) {
> +		struct resource *res = &resources[i];

> +		if (resource_type(new_res) != resource_type(res) ||
> +		    !resource_union(new_res, res, new_res)) {

Wondering why we don't have the resource type checks in resource_overlaps(),
but we have in resource_contains(). Ilpo, do you know?

> +			i++;
> +			continue;
> +		}
> +
> +		dev_info(&adev->dev, "%pR expanded to avoid overlap\n", new_res);
> +		/*
> +		 * Eliminate the previously processed resource that overlapped
> +		 * with the new one because it is not necessary any more.
> +		 */
> +		memmove(res, res + 1, (--count - i) * sizeof(*res));
> +	}
> +
> +	return count;
> +}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
  2026-08-08 20:04 ` Andy Shevchenko
@ 2026-08-10 10:41   ` Rafael J. Wysocki (Intel)
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-08-10 10:41 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, Ilpo Järvinen, Linux ACPI, LKML,
	Mika Westerberg, Julien, jarkko, linux-integrity

On Sat, Aug 8, 2026 at 10:04 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Aug 07, 2026 at 12:22:37PM +0200, Rafael J. Wysocki wrote:
>
> > 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.
>
> ...
>
> >    * Use resource_union() and adjust code and comment (Andy)
>
> Thanks, LGTM now,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks!

> > +static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
> > +                                                struct resource *new_res,
> > +                                                struct resource *resources,
> > +                                                unsigned int count)
> > +{
> > +     unsigned int i;
> > +
> > +     if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
>
> Can also be
>
>         if (!(resource_type(new_res) & (IORESOURCE_IO | IORESOURCE_MEM)))

It could, but it would add a redundant "bitwise and" with the type mask.

I guess the compiler can be expected to optimize it away, but if it
doesn't get optimized away, it's just pure useless overhead.

> > +             return count;
> > +
> > +     for (i = 0; i < count; ) {
> > +             struct resource *res = &resources[i];
>
> > +             if (resource_type(new_res) != resource_type(res) ||
> > +                 !resource_union(new_res, res, new_res)) {
>
> Wondering why we don't have the resource type checks in resource_overlaps(),

Yeah, it looks like a missing piece.

> but we have in resource_contains(). Ilpo, do you know?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps
  2026-08-07 10:22 [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps Rafael J. Wysocki
  2026-08-07 12:57 ` Paul Menzel
  2026-08-08 20:04 ` Andy Shevchenko
@ 2026-08-10 15:35 ` Jarkko Sakkinen
  2 siblings, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2026-08-10 15:35 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux ACPI, LKML, Andy Shevchenko, Mika Westerberg, Julien,
	linux-integrity

On Fri, Aug 07, 2026 at 12:22:37PM +0200, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> 
> 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 <julien82453@gmail.com>
> Closes: https://lore.kernel.org/linux-integrity/CAJOGg3z6LJPDsdPNBxajgy8_wQxfhYBRxe4EiurZf3kPU5A5Bw@mail.gmail.com/ [1]
> Cc: All applicable <stable@vger.kernel.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> v2 -> v3:
>    * Use resource_union() and adjust code and comment (Andy)
>    * Include ioport.h directly
> 
> v1 -> v2:
>    * Add the expanded resource instead of and not in addition to the other
>      overlapping one (Sashiko)
> 
> ---
>  drivers/acpi/acpi_platform.c |   39 +++++++++++++++++++++++++++++++++++++--
>  1 file changed, 37 insertions(+), 2 deletions(-)
> 
> --- a/drivers/acpi/acpi_platform.c
> +++ b/drivers/acpi/acpi_platform.c
> @@ -12,6 +12,7 @@
>  #include <linux/bits.h>
>  #include <linux/device.h>
>  #include <linux/err.h>
> +#include <linux/ioport.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/dma-mapping.h>
> @@ -71,6 +72,36 @@ static struct notifier_block acpi_platfo
>  	.notifier_call = acpi_platform_device_remove_notify,
>  };
>  
> +static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
> +						   struct resource *new_res,
> +						   struct resource *resources,
> +						   unsigned int count)
> +{
> +	unsigned int i;
> +
> +	if (!(new_res->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
> +		return count;
> +
> +	for (i = 0; i < count; ) {
> +		struct resource *res = &resources[i];
> +
> +		if (resource_type(new_res) != resource_type(res) ||
> +		    !resource_union(new_res, res, new_res)) {
> +			i++;
> +			continue;
> +		}
> +
> +		dev_info(&adev->dev, "%pR expanded to avoid overlap\n", new_res);
> +		/*
> +		 * Eliminate the previously processed resource that overlapped
> +		 * with the new one because it is not necessary any more.
> +		 */
> +		memmove(res, res + 1, (--count - i) * sizeof(*res));
> +	}
> +
> +	return count;
> +}
> +
>  static void acpi_platform_fill_resource(struct acpi_device *adev,
>  	const struct resource *src, struct resource *dest)
>  {
> @@ -151,10 +182,14 @@ struct platform_device *acpi_create_plat
>  				return ERR_PTR(-ENOMEM);
>  			}
>  			count = 0;
> -			list_for_each_entry(rentry, &resource_list, node)
> +			list_for_each_entry(rentry, &resource_list, node) {
> +				count = acpi_platform_adjust_resources(adev,
> +								       rentry->res,
> +								       resources,
> +								       count);
>  				acpi_platform_fill_resource(adev, rentry->res,
>  							    &resources[count++]);
> -
> +			}
>  			acpi_dev_free_resource_list(&resource_list);
>  		}
>  	}
> 
> 
> 

Applied to my tree I'll just run some tests.

BR, Jarkko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-10 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 10:22 [PATCH v3] ACPI: scan: Avoid registering platform devices with resource overlaps Rafael J. Wysocki
2026-08-07 12:57 ` Paul Menzel
2026-08-07 13:31   ` Rafael J. Wysocki (Intel)
2026-08-08 20:04 ` Andy Shevchenko
2026-08-10 10:41   ` Rafael J. Wysocki (Intel)
2026-08-10 15:35 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox