From: sashiko-bot@kernel.org
To: "Davidlohr Bueso" <dave@stgolabs.net>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/5] cxl: Add BI register probing and port initialization
Date: Fri, 05 Jun 2026 01:33:07 +0000 [thread overview]
Message-ID: <20260605013307.DA9421F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260605003329.2584012-2-dave@stgolabs.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Silent failure to map and configure CXL BI Route Table due to probe sequence mismatch
--
commit 34d3cc24691a25107f1dbbcc8e03fc18ffcae164
Author: Davidlohr Bueso <dave@stgolabs.net>
cxl: Add BI register probing and port initialization
This commit adds register probing for BI Route Table and BI Decoder capability
structures. It introduces helpers to map these structures at dport-creation
time and port probe time.
> diff --git a/drivers/cxl/port.c b/drivers/cxl/port.c
> index ada51948d52fa..2dd712c5d312a 100644
> --- a/drivers/cxl/port.c
> +++ b/drivers/cxl/port.c
[ ... ]
> @@ -58,6 +58,62 @@ static int discover_region(struct device *dev, void *unused)
[ ... ]
> +static void cxl_port_map_bi(struct cxl_port *port)
> +{
> + struct cxl_register_map *map = &port->reg_map;
[ ... ]
> + /* map this port's own BI capability */
> + if (is_cxl_endpoint(port)) {
> + if (!map->component_map.bi_decoder.valid) {
> + dev_dbg(&port->dev, "BI Decoder registers not found\n");
> + return;
> + }
> + cap_id = CXL_CM_CAP_CAP_ID_BI_DECODER;
> + } else {
> + if (!map->component_map.bi_rt.valid) {
> + dev_dbg(&port->dev, "BI RT registers not found\n");
> + return;
> + }
[Severity: High]
Does this silently fail to map the BI Route Table registers for switch
ports?
When called from cxl_switch_port_probe(), the component registers have not
been discovered yet. The registers are actually probed and marked valid when
the first downstream port is added, which triggers cxl_port_add_dport() to call
cxl_port_setup_regs().
Because the valid flag is always false here during switch port probe, the map
function returns early and permanently leaves port->regs.bi_rt unmapped. Will
this bypass the required hardware commit protocol for the switch upstream port
and break Back-Invalidate coherency for downstream endpoints?
> + cap_id = CXL_CM_CAP_CAP_ID_BI_RT;
> + }
> +
> + map->host = &port->dev;
> + if (cxl_map_component_regs(map, &port->regs, BIT(cap_id)))
> + dev_dbg(&port->dev, "Failed to map BI capability 0x%x\n",
> + cap_id);
> +}
> +
> static int cxl_switch_port_probe(struct cxl_port *port)
> {
> /* Reset nr_dports for rebind of driver */
[ ... ]
> @@ -66,6 +122,8 @@ static int cxl_switch_port_probe(struct cxl_port *port)
> /* Cache the data early to ensure is_visible() works */
> read_cdat_data(port);
>
> + cxl_port_map_bi(port);
> +
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605003329.2584012-1-dave@stgolabs.net?part=1
next prev parent reply other threads:[~2026-06-05 1:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 0:33 [PATCH v4 0/5] cxl: Support Back-Invalidate Davidlohr Bueso
2026-06-05 0:33 ` [PATCH 1/5] cxl: Add BI register probing and port initialization Davidlohr Bueso
2026-06-05 1:33 ` sashiko-bot [this message]
2026-06-05 2:03 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 2/5] cxl/pci: Add BI topology enable/disable Davidlohr Bueso
2026-06-05 1:29 ` sashiko-bot
2026-06-05 2:11 ` Richard Cheng
2026-06-05 2:20 ` Richard Cheng
2026-06-05 2:23 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 3/5] cxl/hdm: Add BI coherency support for endpoint decoders Davidlohr Bueso
2026-06-05 0:33 ` [PATCH 4/5] cxl: Add HDM-DB region creation Davidlohr Bueso
2026-06-05 1:34 ` sashiko-bot
2026-06-05 2:37 ` Richard Cheng
2026-06-05 0:33 ` [PATCH 5/5] cxl/hdm: Rename decoder coherency flags Davidlohr Bueso
2026-06-05 2:38 ` [PATCH v4 0/5] cxl: Support Back-Invalidate Richard Cheng
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=20260605013307.DA9421F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dave@stgolabs.net \
--cc=linux-cxl@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.