Skip to content

Commit e774830

Browse files
committed
cxl/acpi: Minimize granularity for x1 interleaves
The kernel enforces that region granularity is >= to the top-level interleave-granularity for the given CXL window. However, when the CXL window interleave is x1, i.e. non-interleaved at the host bridge level, then the specified granularity does not matter. Override the window specified granularity to the CXL minimum so that any valid region granularity is >= to the root granularity. Reported-by: Jonathan Cameron <[email protected]> Reviewed-by: Vishal Verma <[email protected]> Reviewed-by: Alison Schofield <[email protected]> Link: https://lore.kernel.org/r/165853776917.2430596.16823264262010844458.stgit@dwillia2-xfh.jf.intel.com [djbw: add CXL_DECODER_MIN_GRANULARITY per vishal] Signed-off-by: Dan Williams <[email protected]>
1 parent 2bde6db commit e774830

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/cxl/acpi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg,
140140
.end = res->end,
141141
};
142142
cxld->interleave_ways = ways;
143+
/*
144+
* Minimize the x1 granularity to advertise support for any
145+
* valid region granularity
146+
*/
147+
if (ways == 1)
148+
ig = CXL_DECODER_MIN_GRANULARITY;
143149
cxld->interleave_granularity = ig;
144150

145151
rc = cxl_decoder_add(cxld, target_map);

drivers/cxl/cxl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ enum cxl_decoder_type {
248248
*/
249249
#define CXL_DECODER_MAX_INTERLEAVE 16
250250

251+
#define CXL_DECODER_MIN_GRANULARITY 256
252+
251253
/**
252254
* struct cxl_decoder - Common CXL HDM Decoder Attributes
253255
* @dev: this decoder's device

0 commit comments

Comments
 (0)