From: Yuquan Wang Date: Mon, 18 Mar 2024 02:29:28 +0000 (+0800) Subject: cxl/mem: Fix for the index of Clear Event Record Handle X-Git-Tag: v6.6.28~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=645cef136e471a13fc11b99daf2c50deca79ac23;p=thirdparty%2Fkernel%2Fstable.git cxl/mem: Fix for the index of Clear Event Record Handle [ Upstream commit b7c59b038c656214f56432867056997c2e0fc268 ] 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: 6ebe28f9ec72 ("cxl/mem: Read, trace, and clear events on driver load") Signed-off-by: Yuquan Wang Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Reviewed-by: Fan Ni Signed-off-by: Dave Jiang Signed-off-by: Sasha Levin --- diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index b12986b968da4..e5f3592e54191 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -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;