Commit 98a863fe authored by Robert Richter's avatar Robert Richter Committed by Dave Jiang
Browse files

cxl: Add a dev_dbg() when a decoder was added to a port



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.

Example log messages:

  cxl_acpi ACPI0017:00: decoder0.0 added to root0
  cxl_acpi ACPI0017:00: decoder0.1 added to root0
  ...
   pci0000:e0: decoder1.0 added to port1
   pci0000:e0: decoder1.1 added to port1
  ...
  cxl_mem mem0: decoder5.0 added to endpoint5
  cxl_mem mem0: decoder5.1 added to endpoint5

Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
Reviewed-by: default avatarGregory Price <gourry@gourry.net>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarAlison Schofield <alison.schofield@intel.com>
Tested-by: default avatarGregory Price <gourry@gourry.net>
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20250509150700.2817697-15-rrichter@amd.com


Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
parent d90acdf4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -421,7 +421,15 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
	rc = cxl_decoder_add(cxld, target_map);
	if (rc)
		return rc;
	return cxl_root_decoder_autoremove(dev, no_free_ptr(cxlrd));

	rc = cxl_root_decoder_autoremove(dev, no_free_ptr(cxlrd));
	if (rc)
		return rc;

	dev_dbg(root_port->dev.parent, "%s added to %s\n",
		dev_name(&cxld->dev), dev_name(&root_port->dev));

	return 0;
}

static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg,
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ static int add_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
	if (rc)
		return rc;

	dev_dbg(&cxld->dev, "Added to port %s\n", dev_name(&port->dev));
	dev_dbg(port->uport_dev, "%s added to %s\n",
		dev_name(&cxld->dev), dev_name(&port->dev));

	return 0;
}