From: Akshay Gupta <akshay.gupta@amd.com>
To: <linux-kernel@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <arnd@arndb.de>,
<Anand.Umarji@amd.com>, Akshay Gupta <akshay.gupta@amd.com>,
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Subject: [PATCH v5 3/3] misc: amd-sbi: Explicitly clear in/out arg "mb_in_out"
Date: Wed, 16 Jul 2025 11:07:29 +0000 [thread overview]
Message-ID: <20250716110729.2193725-3-akshay.gupta@amd.com> (raw)
In-Reply-To: <20250716110729.2193725-1-akshay.gupta@amd.com>
- New AMD processor will support different input/output for same command.
- In some scenarios the input value is not cleared, which will be added to
output before reporting the data.
- Clearing input explicitly will be a cleaner and safer approach.
Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Signed-off-by: Akshay Gupta <akshay.gupta@amd.com>
---
New patch
drivers/misc/amd-sbi/rmi-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/misc/amd-sbi/rmi-core.c b/drivers/misc/amd-sbi/rmi-core.c
index 9048517c088c..3dec2fc00124 100644
--- a/drivers/misc/amd-sbi/rmi-core.c
+++ b/drivers/misc/amd-sbi/rmi-core.c
@@ -320,6 +320,10 @@ int rmi_mailbox_xfer(struct sbrmi_data *data,
ret = regmap_read(data->regmap, SBRMI_OUTBNDMSG7, &ec);
if (ret || ec)
goto exit_clear_alert;
+
+ /* Clear the input value before updating the output data */
+ msg->mb_in_out = 0;
+
/*
* For a read operation, the initiator (BMC) reads the firmware
* response Command Data Out[31:0] from SBRMI::OutBndMsg_inst[4:1]
--
2.25.1
prev parent reply other threads:[~2025-07-16 11:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 11:07 [PATCH v5 1/3] misc: amd-sbi: Address potential integer overflow issue reported in smatch Akshay Gupta
2025-07-16 11:07 ` [PATCH v5 2/3] misc: amd-sbi: Address copy_to/from_user() warning " Akshay Gupta
2025-07-16 11:07 ` Akshay Gupta [this message]
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=20250716110729.2193725-3-akshay.gupta@amd.com \
--to=akshay.gupta@amd.com \
--cc=Anand.Umarji@amd.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naveenkrishna.chatradhi@amd.com \
/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®