Skip to contentSkip to conversation

cxl/mem: Demarcate vendor specific capability IDs

PATCH In review Ben Widawsky 2 participants 2 messages May 20, 2021 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/mem: Demarcate vendor specific capability IDs

Vendor capabilities occupy 0x8000 to 0xFFFF according to CXL 2.0 spec 8.2.8.2.1 CXL Device Capabilities. While they are not defined by the spec, they are allowed and not "unknown". Call this detail out in the logs to let users easily distinguish the difference.

This patch is a squash of two earlier patches and take in some minor suggestions from both Vishal and Dan.

Cc Vishal Verma <[email protected]>
Cc Dan Williams <[email protected]>
---
 drivers/cxl/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cxl/core.c +4 -1
index 84b90db57420..38979c97158d 100644
@@ -60,7 +60,10 @@ void cxl_setup_device_regs(struct device *dev, void __iomem *base,
 			regs->memdev = register_block;
 			break;
 		default:
-			dev_dbg(dev, "Unknown cap ID: %d (0x%x)\n", cap_id, offset);
+			if (cap_id >= 0x8000)
+				dev_dbg(dev, "Vendor cap ID: %#x offset: %#x\n", cap_id, offset);
+			else
+				dev_dbg(dev, "Unknown cap ID: %#x offset: %#x\n", cap_id, offset);
 			break;
 		}
 	}
Signature · 1 line
2.31.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ben Widawsky

Vendor capabilities occupy 0x8000 to 0xFFFF according to CXL 2.0 spec 8.2.8.2.1 CXL Device Capabilities. While they are not defined by the spec, they are allowed and not "unknown". Call this detail out in the logs to let users easily distinguish the difference.

This patch is a squash of two earlier patches and take in some minor suggestions from both Vishal and Dan.

Should this be in the commit mesasge?

Quoted 5 lines
Cc Vishal Verma <[email protected]>
Cc Dan Williams <[email protected]>

---

Other than that, looks good to me,

Quoted 19 lines
 drivers/cxl/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cxl/core.c +4 -1
index 84b90db57420..38979c97158d 100644
@@ -60,7 +60,10 @@ void cxl_setup_device_regs(struct device *dev, void __iomem *base,
 			regs->memdev = register_block;
 			break;
 		default:
-			dev_dbg(dev, "Unknown cap ID: %d (0x%x)\n", cap_id, offset);
+			if (cap_id >= 0x8000)
+				dev_dbg(dev, "Vendor cap ID: %#x offset: %#x\n", cap_id, offset);
+			else
+				dev_dbg(dev, "Unknown cap ID: %#x offset: %#x\n", cap_id, offset);
 			break;
 		}
 	}