Re: [PATCH v4 13/14] cxl: Add a dev_dbg() when a decoder was added to a port

From: Dan Williams
Date: Thu Mar 06 2025 - 16:07:48 EST


Robert Richter wrote:
> Improve debugging by adding and unifying messages whenever a decoder
> was added to a port. It is especially useful to get the decoder
> mapping of the involved CXL host bridge or PCI device. This avoids a
> complex lookup of the decoder/port/device mappings in sysfs.

I am not opposed to this debug statement, but I hope that most use cases
for associating objects are handled by tooling and we don't need to keep
extending kernel debug statements for these queries.

E.g.: show all the decoders and targets of port1

# cxl list -PT -p 1 -Di
[
{
"port":"port1",
"host":"pci0000:34",
"depth":1,
"decoders_committed":0,
"nr_dports":1,
"dports":[
{
"dport":"0000:34:00.0",
"id":0
}
],
"decoders:port1":[
{
"decoder":"decoder2.0",
"interleave_ways":1,
"state":"disabled"
},
{
"decoder":"decoder2.1",
"interleave_ways":1,
"state":"disabled"
},
{
"decoder":"decoder2.2",
"interleave_ways":1,
"state":"disabled"
},
{
"decoder":"decoder2.3",
"interleave_ways":1,
"state":"disabled"
},
{
"decoder":"decoder1.0",
"interleave_ways":1,
"state":"disabled",
"nr_targets":1,
"targets":[
{
"target":"0000:34:00.0",
"position":0,
"id":0
}
]
}
]
}
]