[PATCH] kernel: resourse: Add conditional handling for ACPI device

Szuying Chen
2025-10-17T02:35:41Z

To avoid address conflicts and related errors, specific checks for
the ACPI device "AMDIF031" should be bypassed.

Signed-off-by: Szuying Chen <Chloe_Chen@asmedia.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;
+ }
+
+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