From: Gregory Price <gourry@gourry.net>
To: Szuying Chen <chensiying21@gmail.com>
Cc: akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com,
dan.j.williams@intel.com, jhubbard@nvidia.com,
akinobu.mita@gmail.com, sumanthk@linux.ibm.com,
peterz@infradead.org, huang.ying.caritas@gmail.com,
linux-kernel@vger.kernel.org, Andrew_Su@asmedia.com.tw,
Yd_Tseng@asmedia.com.tw, Ed_Huang@asmedia.com.tw,
Cindy1_Hsu@asmedia.com.tw, Jesse1_Chang@asmedia.com.tw,
Richard_Hsu@asmedia.com.tw, Chloe_Chen@asmedia.com.tw
Subject: Re: [PATCH] kernel: resourse: Add conditional handling for ACPI device
Date: Fri, 17 Oct 2025 10:11:15 -0400 [thread overview]
Message-ID: <aPJOg2XsyIYUUaEi@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20251017023531.5616-1-Chloe_Chen@asmedia.com.tw>
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@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;
> + }
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
>
next prev parent reply other threads:[~2025-10-17 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 2:35 Szuying Chen
2025-10-17 14:11 ` Gregory Price [this message]
2025-10-18 19:07 ` Andy Shevchenko
2025-10-23 8:04 ` Szuying Chen
2025-10-23 8:51 ` Andy Shevchenko
2025-10-20 8:46 ` kernel test robot
2025-10-20 10:01 ` Andy Shevchenko
2025-10-27 6:36 Szuying Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aPJOg2XsyIYUUaEi@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=Andrew_Su@asmedia.com.tw \
--cc=Chloe_Chen@asmedia.com.tw \
--cc=Cindy1_Hsu@asmedia.com.tw \
--cc=Ed_Huang@asmedia.com.tw \
--cc=Jesse1_Chang@asmedia.com.tw \
--cc=Richard_Hsu@asmedia.com.tw \
--cc=Yd_Tseng@asmedia.com.tw \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=chensiying21@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=huang.ying.caritas@gmail.com \
--cc=jhubbard@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sumanthk@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®