From: Richard Cheng <icheng@nvidia.com>
To: alejandro.lucero-palau@amd.com
Cc: linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org,
rafael@kernel.org, Alejandro Lucero <alucerop@amd.com>
Subject: Re: [RFC PATCH v1 1/1] acpi/hmat: preserve hmat_adist_nb notifier block
Date: Thu, 2 Jul 2026 15:20:47 +0800 [thread overview]
Message-ID: <akYPrcsz2tWl7ga4@MWDK4CY14F> (raw)
In-Reply-To: <20260630143507.30193-2-alejandro.lucero-palau@amd.com>
On Tue, Jun 30, 2026 at 03:35:07PM +0800, alejandro.lucero-palau@amd.com wrote:
> From: Alejandro Lucero <alucerop@amd.com>
>
> Remove __meminitdata from hmat_adist_nb declaration preserving it even
> when CONFIG_MEMORY_HOTPLUG is not set. Otherwise further notifier
> registrations using register_mt_adistance_algorithm() will find a
> notifier chain likely corrupted. This is the case when a CXL Type2
> driver will load after kernel initialization and a CXL region created from
> its committed HDM decoders registers an mt_adistance_algorithm notifier.
>
> Signed-off-by: Alejandro Lucero <alucerop@amd.com>
> ---
> drivers/acpi/numa/hmat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
> index 9792dc394756..3006789ae31f 100644
> --- a/drivers/acpi/numa/hmat.c
> +++ b/drivers/acpi/numa/hmat.c
> @@ -995,7 +995,7 @@ static int hmat_calculate_adistance(struct notifier_block *self,
> return NOTIFY_STOP;
> }
>
> -static struct notifier_block hmat_adist_nb __meminitdata = {
> +static struct notifier_block hmat_adist_nb = {
> .notifier_call = hmat_calculate_adistance,
> .priority = 100,
> };
> --
> 2.34.1
>
>
I think this is not limited to CXL type 2 device.
cxl_region_probe() already calls register_mt_adistance_algorithm(), and CXL_REGION
depends only on SPARSEMEM, not MEMORY_HOTPLUG, so with NUMA=y, MEMORY_HOTPLUG=n, CXL_ACPI=y and CXL_REGION=y,
any runtime CXL region probe walks the chain. I would suggest some tweak for commit message.
Also adding Fixes: 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT")
And maybe keep unconditional removal rather than a consumer-keyed attribute.
register_mt_adistance_algorithm() is callable by any runtime module,
not just CXL, so a CONFIG_CXL_MEM-keyed condition would still leave the hole
for other callers.
What do you think ?
Best regards,
Richard Cheng.
next prev parent reply other threads:[~2026-07-02 7:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 14:35 [RFC PATCH v1 0/1] Fix hmat_adist_nb for coming CXL Type2 alejandro.lucero-palau
2026-06-30 14:35 ` [RFC PATCH v1 1/1] acpi/hmat: preserve hmat_adist_nb notifier block alejandro.lucero-palau
2026-06-30 16:18 ` Dave Jiang
2026-07-02 7:20 ` Richard Cheng [this message]
2026-07-06 6:57 ` Alejandro Lucero Palau
2026-07-09 1:37 ` Richard Cheng
2026-07-15 14:47 ` Alejandro Lucero Palau
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=akYPrcsz2tWl7ga4@MWDK4CY14F \
--to=icheng@nvidia.com \
--cc=alejandro.lucero-palau@amd.com \
--cc=alucerop@amd.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=rafael@kernel.org \
/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