summaryrefslogtreecommitdiff
path: root/drivers/cxl
diff options
context:
space:
mode:
authorYuquan Wang <wangyuquan1236@phytium.com.cn>2024-03-18 10:29:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-17 11:19:27 +0200
commit645cef136e471a13fc11b99daf2c50deca79ac23 (patch)
tree6c2ae5e89a6cfe9cb1a4d76fc37d784150d27c71 /drivers/cxl
parentc0781d6898dcae9f8a7387a9ee60b8a651d45c5f (diff)
downloadlinux-645cef136e471a13fc11b99daf2c50deca79ac23.tar.gz
linux-645cef136e471a13fc11b99daf2c50deca79ac23.tar.bz2
linux-645cef136e471a13fc11b99daf2c50deca79ac23.zip
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 <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>
Diffstat (limited to 'drivers/cxl')
-rw-r--r--drivers/cxl/core/mbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index b12986b968da..e5f3592e5419 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;