From: Dave Jiang <dave.jiang@intel.com>
To: Alison Schofield <alison.schofield@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Alejandro Lucero <alucerop@amd.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH] cxl/core: Check existence of cxl_memdev_state in poison test
Date: Wed, 1 Apr 2026 10:19:50 -0700 [thread overview]
Message-ID: <bb403342-6dba-4656-88ff-c69ad3779abe@intel.com> (raw)
In-Reply-To: <20260331005047.2813980-1-alison.schofield@intel.com>
On 3/30/26 5:50 PM, Alison Schofield wrote:
> Before now, all CXL memdevs were assumed to have a mailbox-backed
> cxl_memdev_state, so poison command checks could safely dereference
> the @mds.
>
> With the introduction of Type 2 devices, a memdev may not implement
> a mailbox interface, and so there is no associated cxl_memdev_state.
> Guard against this case by returning false when @mds is absent.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Applied to cxl/next
261a02b93d9b
> ---
> drivers/cxl/core/memdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 273c22118d3d..591425866045 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -204,6 +204,9 @@ bool cxl_memdev_has_poison_cmd(struct cxl_memdev *cxlmd,
> {
> struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlmd->cxlds);
>
> + if (!mds)
> + return 0;
> +
> return test_bit(cmd, mds->poison.enabled_cmds);
> }
>
prev parent reply other threads:[~2026-04-01 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 0:50 [PATCH] cxl/core: Check existence of cxl_memdev_state in poison test Alison Schofield
2026-03-31 5:58 ` Alejandro Lucero Palau
2026-04-01 17:19 ` Dave Jiang [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=bb403342-6dba-4656-88ff-c69ad3779abe@intel.com \
--to=dave.jiang@intel.com \
--cc=alison.schofield@intel.com \
--cc=alucerop@amd.com \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.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