From: Alejandro Lucero Palau <alejandro.lucero-palau@amd.com>
To: linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, rafael@kernel.org
Cc: Alejandro Lucero <alucerop@amd.com>
Subject: Re: [PATCH v2 0/1] Fix hmat_adist_nb for CXL
Date: Mon, 10 Aug 2026 10:31:16 +0100 [thread overview]
Message-ID: <645b4aa0-1be1-491c-bbe2-f44bdcd9cd5d@amd.com> (raw)
In-Reply-To: <20260716181114.35962-1-alejandro.lucero-palau@amd.com>
Hi Rafael,
Just a reminder of this fix which, if not applied, could trigger
problems for the CXL Type2 drivers recently merged in net-next:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=997bfb05c919d2c5ee77c594d354f6c61b99ccdf
As stated in the commit after comments from Richard, this could also be
a problem for current Type3 CXL kernel support depending on kernel
configuration.
Let me know if you see any problem with this fix.
Thank you.
On 7/16/26 19:11, alejandro.lucero-palau@amd.com wrote:
> From: Alejandro Lucero <alucerop@amd.com>
>
> v2:
> - Add Fixes (Richarg Cheng)
> - Change commit as fix for Type2/Type3 (Richar Cheng)
>
> RFC
> ===
> While working on adding CXL Type2 support I found a problem with
> register_mt_adistance_algorithm() which is used inside
> cxl_region_probe(). It turns out my kernel config had not
> CONFIG_MEMORY_HOTPLUG enabled leading to the hmat_adist_nb notifier
> block deleted after kernel initialization without doing any notifer
> block unregister, leaving the notifier chain unaware of this. A CXL
> Type2 driver can be load after kernel initialization and with a kernel
> not enabling memory hotplug, the notifier registration crashes if the
> released memory from hmat_adist_nb is reused.
>
> I'm not sure but I do not think this can happen for Type3 devices
> because the related CXL driver is used only during kernel initialization
> if memory hotplug not enabled. Type2, aka CXL accelerator drivers, is
> coming and the problem will arise with certainty.
>
> I have contemplated to modify how the identified __meminit and
> __meminitdat are defined in linux/init.h, extending the case for being
> empty definitions if CONFIG_CXL_MEM=y, but I think it makes sense to
> only avoid the use of __meminit for hmat_adist_nb.
>
> FWIW, a Type2 device should not require CONFIG_MEMORY_HOTPLUG and its
> memory is currently initialized by the BIOS. Maybe not having memory
> hotplug enabled is unusual and even more with CXL, so another option
> could be to enable memory hotplug if CXL mem is enabled.
>
> Alejandro Lucero (1):
> acpi/hmat: preserve hmat_adist_nb notifier block
>
> drivers/acpi/numa/hmat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> base-commit: 8cd9520d35a6c38db6567e97dd93b1f11f185dc6
prev parent reply other threads:[~2026-08-10 9:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 18:11 [PATCH v2 0/1] Fix hmat_adist_nb for CXL alejandro.lucero-palau
2026-07-16 18:11 ` [PATCH v2 1/1] acpi/hmat: preserve hmat_adist_nb notifier block alejandro.lucero-palau
2026-07-16 20:27 ` Dave Jiang
2026-07-17 0:20 ` Jonathan Cameron
2026-08-10 9:31 ` Alejandro Lucero Palau [this message]
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=645b4aa0-1be1-491c-bbe2-f44bdcd9cd5d@amd.com \
--to=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