mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86/amd/hsmp: Fix iomem handling
@ 2023-10-19 13:51 Armin Wolf
  2023-10-25  9:49 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Armin Wolf @ 2023-10-19 13:51 UTC (permalink / raw)
  To: naveenkrishna.chatradhi, carlos.bilbao
  Cc: hdegoede, ilpo.jarvinen, markgross, platform-driver-x86, linux-kernel

Since the metrics table is marked as io memory,
use memcpy_fromio() when copying its contents.

Compile-tested only.

Fixes: 5150542b8ec5 ("platform/x86/amd/hsmp: add support for metrics tbl")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/platform/x86/amd/hsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c
index b056a5c8654a..b55d80e29139 100644
--- a/drivers/platform/x86/amd/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp.c
@@ -362,7 +362,7 @@ static ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj,
 	ret = hsmp_send_message(&msg);
 	if (ret)
 		return ret;
-	memcpy(buf, sock->metric_tbl_addr, bin_attr->size);
+	memcpy_fromio(buf, sock->metric_tbl_addr, bin_attr->size);

 	return bin_attr->size;
 }
--
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-25  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 13:51 [PATCH] platform/x86/amd/hsmp: Fix iomem handling Armin Wolf
2023-10-25  9:49 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®