From: Gregory Price <gregory.price@memverge.com>
To: linux-cxl@vger.kernel.org
Cc: Dan Williams <dan.j.williams@intel.com>,
Dave Jiang <dave.jiang@intel.com>
Subject: Re: [BUG] Root port fails to match with port driver on non-RCH topology
Date: Thu, 15 Jun 2023 14:51:13 -0400 [thread overview]
Message-ID: <ZItdoWTyOS5YSPzz@memverge.com> (raw)
In-Reply-To: <ZItcdaq3j8kW+/Sy@memverge.com>
On Thu, Jun 15, 2023 at 02:46:13PM -0400, Gregory Price wrote:
> On Thu, Jun 15, 2023 at 12:16:05PM -0400, Gregory Price wrote:
> follow up with more context, there is a subsequent error on
> cxl_port_probe which causes dev->driver to remain NULL.
>
>
> [ 15.561313] cxl_mem mem0: CXL port topology root0 not enabled
> [ 15.561315] cxl_mem mem0: call_driver_probe failed
wrong prints here, this should have read:
[ 15.549316] cxl root0: driver set to cxl_port
[ 15.549732] cxl_port root0: call_driver_probe failed
I confirmed that call_driver_probe sinks down to a call to
cxl_port_probe and that is failing on cxl_port_probe(root0).
Rest of the commentary below is accurate.
>
>
> drivers/cxl/port.c
> static int cxl_port_probe(struct device *dev)
> {
> struct cxl_port *port = to_cxl_port(dev);
>
> if (is_cxl_endpoint(port))
> return cxl_endpoint_port_probe(port);
> return cxl_switch_port_probe(port);
> }
>
>
> since root is not an endpoint, we probe root as a switch port.
>
> static int cxl_switch_port_probe(struct cxl_port *port)
> {
> struct cxl_hdm *cxlhdm;
> int rc;
>
> rc = devm_cxl_port_enumerate_dports(port);
> if (rc < 0)
> return rc;
>
> if (rc == 1)
> return devm_cxl_add_passthrough_decoder(port);
>
> cxlhdm = devm_cxl_setup_hdm(port, NULL);
> if (IS_ERR(cxlhdm))
> return PTR_ERR(cxlhdm);
>
> return devm_cxl_enumerate_decoders(cxlhdm, NULL);
> }
>
>
> It is likely that dev_cxl_port_enumate_dports is failing, though more
> investigation is needed at this point.
>
> What I don't know is whether cxl_port_probe is intended to probe the
> root port, or if we should simply be attaching the driver to the root
> port device explicitly rather than going through probe.
>
> Any guidance would be appreciated.
>
> ~Gregory
next prev parent reply other threads:[~2023-06-15 18:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 16:16 [BUG] Root port fails to match with port driver on non-RCH topology Gregory Price
2023-06-15 18:46 ` Gregory Price
2023-06-15 18:51 ` Gregory Price [this message]
2023-06-15 22:43 ` Gregory Price
2023-06-22 9:48 ` Jonathan Cameron
2023-06-22 14:47 ` Gregory Price
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=ZItdoWTyOS5YSPzz@memverge.com \
--to=gregory.price@memverge.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-cxl@vger.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