Skip to contentSkip to conversation

cxl/component_regs: Fix offset

PATCH In review Ben Widawsky 2 participants 2 messages Jun 11, 2021 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/component_regs: Fix offset

The CXL.cache and CXL.mem registers begin after the CXL.io registers which occupy the first 0x1000 bytes. The current code wasn't setting this up properly for future users of the component registers. It was correct for the probing code however.

Cc Jonathan Cameron <[email protected]>
Cc Ira Weiny <[email protected]>
---
 drivers/cxl/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core.c +1 -1
index 92db02fe7aa8..c7f956fa3ada 100644
@@ -671,7 +671,7 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
 			length = 0x20 * decoder_cnt + 0x10;
 
 			map->hdm_decoder.valid = true;
-			map->hdm_decoder.offset = offset;
+			map->hdm_decoder.offset = CXL_CM_OFFSET + offset;
 			map->hdm_decoder.size = length;
 			break;
 		default:
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Thu, 10 Jun 2021 22:11:13 -0700 Ben Widawsky <[email protected]> wrote:

The CXL.cache and CXL.mem registers begin after the CXL.io registers which occupy the first 0x1000 bytes. The current code wasn't setting this up properly for future users of the component registers. It was correct for the probing code however.

Cc Jonathan Cameron <[email protected]>
Cc Ira Weiny <[email protected]>

I guess we could have assumed that this offset was always form CXL_CM_OFFSET but as that's a bit odd, this change makes sense.

Quoted 17 lines
---
 drivers/cxl/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core.c +1 -1
index 92db02fe7aa8..c7f956fa3ada 100644
@@ -671,7 +671,7 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
 			length = 0x20 * decoder_cnt + 0x10;
 
 			map->hdm_decoder.valid = true;
-			map->hdm_decoder.offset = offset;
+			map->hdm_decoder.offset = CXL_CM_OFFSET + offset;
 			map->hdm_decoder.size = length;
 			break;
 		default: