Skip to content

Commit

Permalink
cxl/mem: Fix for the index of Clear Event Record Handle
Browse files Browse the repository at this point in the history
[ Upstream commit b7c59b0 ]

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: 6ebe28f ("cxl/mem: Read, trace, and clear events on driver load")
Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuquan Wang authored and gregkh committed Apr 17, 2024
1 parent c0781d6 commit 645cef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cxl/core/mbox.c
Expand Up @@ -928,7 +928,7 @@ static int cxl_clear_event_record(struct cxl_memdev_state *mds,
for (cnt = 0; cnt < total; cnt++) {
payload->handles[i++] = get_pl->records[cnt].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;
Expand Down

0 comments on commit 645cef1

Please sign in to comment.