summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/amd/hsmp/hsmp.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 17:08:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 17:08:55 +0300
commit81bd6aab35ad9ecce95dfe3e33c807effe370d83 (patch)
tree6c856cb948d3bc12246f696b209a410ae138d52f /drivers/platform/x86/amd/hsmp/hsmp.c
parenta681e6559ce6fe8ca56333f7041d0a0d38aaee94 (diff)
parent1562d948232546cfad45a1beddc70fe0c7b34950 (diff)
downloadlinux-rolling-stable.tar.xz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform/x86/amd/hsmp/hsmp.c')
-rw-r--r--drivers/platform/x86/amd/hsmp/hsmp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/platform/x86/amd/hsmp/hsmp.c b/drivers/platform/x86/amd/hsmp/hsmp.c
index a3ac09a90de4..ab877112f4c8 100644
--- a/drivers/platform/x86/amd/hsmp/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp/hsmp.c
@@ -99,7 +99,7 @@ static int __hsmp_send_message(struct hsmp_socket *sock, struct hsmp_message *ms
short_sleep = jiffies + msecs_to_jiffies(HSMP_SHORT_SLEEP);
timeout = jiffies + msecs_to_jiffies(HSMP_MSG_TIMEOUT);
- while (time_before(jiffies, timeout)) {
+ while (true) {
ret = sock->amd_hsmp_rdwr(sock, mbinfo->msg_resp_off, &mbox_status, HSMP_RD);
if (ret) {
dev_err(sock->dev, "Error %d reading mailbox status\n", ret);
@@ -108,6 +108,10 @@ static int __hsmp_send_message(struct hsmp_socket *sock, struct hsmp_message *ms
if (mbox_status != HSMP_STATUS_NOT_READY)
break;
+
+ if (!time_before(jiffies, timeout))
+ break;
+
if (time_before(jiffies, short_sleep))
usleep_range(50, 100);
else