Skip to content

Commit 501b3d9

Browse files
committed
tools/testing/cxl: Make cxl_memdev_state available to other command emulation
Move @mds out of the event specific 'struct mock_event_store' and into the base 'struct cxl_mockmem_data' directly. This is in preparation for enabling cxl_test to exercise the notifier flow for 'sanitize' operation completion. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 88d3917 commit 501b3d9

File tree

1 file changed

+3
-3
lines changed
  • tools/testing/cxl/test

1 file changed

+3
-3
lines changed

tools/testing/cxl/test/mem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ struct mock_event_log {
133133
};
134134

135135
struct mock_event_store {
136-
struct cxl_memdev_state *mds;
137136
struct mock_event_log mock_logs[CXL_EVENT_TYPE_MAX];
138137
u32 ev_status;
139138
};
@@ -150,6 +149,7 @@ struct cxl_mockmem_data {
150149
int user_limit;
151150
int master_limit;
152151
struct mock_event_store mes;
152+
struct cxl_memdev_state *mds;
153153
u8 event_buf[SZ_4K];
154154
u64 timestamp;
155155
};
@@ -326,7 +326,7 @@ static void cxl_mock_event_trigger(struct device *dev)
326326
event_reset_log(log);
327327
}
328328

329-
cxl_mem_get_event_records(mes->mds, mes->ev_status);
329+
cxl_mem_get_event_records(mdata->mds, mes->ev_status);
330330
}
331331

332332
struct cxl_event_record_raw maint_needed = {
@@ -1415,6 +1415,7 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
14151415
if (IS_ERR(mds))
14161416
return PTR_ERR(mds);
14171417

1418+
mdata->mds = mds;
14181419
mds->mbox_send = cxl_mock_mbox_send;
14191420
mds->payload_size = SZ_4K;
14201421
mds->event.buf = (struct cxl_get_event_payload *) mdata->event_buf;
@@ -1447,7 +1448,6 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
14471448
if (rc)
14481449
return rc;
14491450

1450-
mdata->mes.mds = mds;
14511451
cxl_mock_add_event_logs(&mdata->mes);
14521452

14531453
cxlmd = devm_cxl_add_memdev(&pdev->dev, cxlds);

0 commit comments

Comments
 (0)