Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> writes:
On Mon, 29 Jul 2024 16:46:11 +0800Yes. We need some other way to identify type2 devices.
Huang Ying <ying.huang@xxxxxxxxx> wrote:
The memory range of a type2 accelerator should be managed by the type2As in previous need to be careful as that may not mean it's
accelerator specific driver instead of the common dax region drivers,
as discussed in [1].
[1] https://lore.kernel.org/linux-cxl/66469ff1b8fbc_2c2629427@xxxxxxxxxxxxxxxxxxxxxxxxx.notmuch/
So, in this patch, we skip dax regions creation for type2 accelerator
device memory regions.
Based on: https://lore.kernel.org/linux-cxl/168592159835.1948938.1647215579839222774.stgit@xxxxxxxxxxxxxxxxxxxxxxxxx/
Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx>
Co-developed-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx>
Cc: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
Cc: Dave Jiang <dave.jiang@xxxxxxxxx>
Cc: Alison Schofield <alison.schofield@xxxxxxxxx>
Cc: Vishal Verma <vishal.l.verma@xxxxxxxxx>
Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
Cc: Alejandro Lucero <alucerop@xxxxxxx>
---
drivers/cxl/core/region.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 9a483c8a32fd..b37e12bb4a35 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -3435,6 +3435,14 @@ static int cxl_region_probe(struct device *dev)
p->res->start, p->res->end, cxlr,
is_system_ram) > 0)
return 0;
+ /*
+ * HDM-D[B] (device-memory) regions have accelerator
+ * specific usage, skip device-dax registration.
+ */
+ if (cxlr->type == CXL_DECODER_DEVMEM)
+ return 0;
an accelerator.
However, we do need to deal with BI setup for HDM-DB type 3 devicesYes. We need to check BI configuration too.
etc and to check the HDM Decoder capability registers to make sure
Supported Coherence model is appropriate. (e.g. 11 for host only or
device coherency - HDM-H/HDM-DB)
--+
+ /* HDM-H routes to device-dax */
return devm_cxl_add_dax_region(cxlr);
default:
dev_dbg(&cxlr->dev, "unsupported region mode: %d\n",
Best Regards,
Huang, Ying