Commit b7c59b03 authored by Yuquan Wang's avatar Yuquan Wang Committed by Dave Jiang

cxl/mem: Fix for the index of Clear Event Record Handle

The dev_dbg info for Clear Event Records mailbox command would report
the handle of the next record to clear not the current one.

This was because the index 'i' had incremented before printing the
current handle value.

Fixes: 6ebe28f9 ("cxl/mem: Read, trace, and clear events on driver load")
Signed-off-by: default avatarYuquan Wang <wangyuquan1236@phytium.com.cn>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Reviewed-by: default avatarFan Ni <fan.ni@samsung.com>
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
parent 4cece764
......@@ -915,7 +915,7 @@ static int cxl_clear_event_record(struct cxl_memdev_state *mds,
payload->handles[i++] = gen->hdr.handle;
dev_dbg(mds->cxlds.dev, "Event log '%d': Clearing %u\n", log,
le16_to_cpu(payload->handles[i]));
le16_to_cpu(payload->handles[i - 1]));
if (i == max_handles) {
payload->nr_recs = i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment