[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aPJOg2XsyIYUUaEi@gourry-fedora-PF4VCD3F>
Date: Fri, 17 Oct 2025 10:11:15 -0400
From: Gregory Price <gourry@...rry.net>
To: Szuying Chen <chensiying21@...il.com>
Cc: akpm@...ux-foundation.org, andriy.shevchenko@...ux.intel.com,
dan.j.williams@...el.com, jhubbard@...dia.com,
akinobu.mita@...il.com, sumanthk@...ux.ibm.com,
peterz@...radead.org, huang.ying.caritas@...il.com,
linux-kernel@...r.kernel.org, Andrew_Su@...edia.com.tw,
Yd_Tseng@...edia.com.tw, Ed_Huang@...edia.com.tw,
Cindy1_Hsu@...edia.com.tw, Jesse1_Chang@...edia.com.tw,
Richard_Hsu@...edia.com.tw, Chloe_Chen@...edia.com.tw
Subject: Re: [PATCH] kernel: resourse: Add conditional handling for ACPI
device
On Fri, Oct 17, 2025 at 10:35:31AM +0800, Szuying Chen wrote:
> To avoid address conflicts and related errors, specific checks for
> the ACPI device "AMDIF031" should be bypassed.
>
> Signed-off-by: Szuying Chen <Chloe_Chen@...edia.com.tw>
> ---
> kernel/resource.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/kernel/resource.c b/kernel/resource.c
> index b9fa2a4ce089..9ffcd5bdb62e 100644
> --- a/kernel/resource.c
> +++ b/kernel/resource.c
> @@ -177,6 +177,27 @@ static struct resource *alloc_resource(gfp_t flags)
> return kzalloc(sizeof(struct resource), flags);
> }
>
> +static int IgnoreResource(struct resource *tmp)
> +{
> + char *pt, *name_sep;
> + char *name;
> +
> + pt = kstrdup(tmp->name, GFP_KERNEL);
> + name_sep = pt;
> + if (!name_sep)
> + goto out;
> +
> + name = strsep(&name_sep, ":");
> + if (strcmp(name, "AMDIF031") == 0) {
> + kfree(pt);
> + return 1;
> + }
Assuming we actually want this, i think we probably need to put this in
an arch/ extension, not hard-coded into kernel/. There's no need for
non-x86 platforms to ever touch this.
> +
> +out:
> + kfree(pt);
> + return 0;
> +}
> +
> /* Return the conflict entry if you can't request it */
> static struct resource * __request_resource(struct resource *root, struct resource *new)
> {
> @@ -202,6 +223,8 @@ static struct resource * __request_resource(struct resource *root, struct resour
> p = &tmp->sibling;
> if (tmp->end < start)
> continue;
> + if (IgnoreResource(tmp))
> + continue;
> return tmp;
> }
> }
> --
> 2.39.2
>
Powered by blists - more mailing lists