From: Armin Wolf <W_Armin@gmx.de>
To: naveenkrishna.chatradhi@amd.com, carlos.bilbao@amd.com
Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
markgross@kernel.org, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86/amd/hsmp: Fix iomem handling
Date: Thu, 19 Oct 2023 15:51:22 +0200 [thread overview]
Message-ID: <20231019135122.21774-1-W_Armin@gmx.de> (raw)
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
next reply other threads:[~2023-10-19 13:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 13:51 Armin Wolf [this message]
2023-10-25 9:49 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231019135122.21774-1-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--cc=carlos.bilbao@amd.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=naveenkrishna.chatradhi@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®