From: Eddie James <eajames@linux.ibm.com>
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
jdelvare@suse.com, Eddie James <eajames@linux.ibm.com>
Subject: [PATCH] hwmon (occ): Fix response length in checksum retry
Date: Wed, 20 Jul 2022 14:30:36 -0500 [thread overview]
Message-ID: <20220720193036.8743-1-eajames@linux.ibm.com> (raw)
Retrying for checksum failure doesn't work since the response length
gets zeroed out in the submit function. Fix this by resetting the
response length to its original value before the retry.
Fixes: c27b98ca0edb ("hwmon (occ): Retry for checksum failure")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/hwmon/occ/p9_sbe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/occ/p9_sbe.c b/drivers/hwmon/occ/p9_sbe.c
index 4a1fe4ee8e2c..f3791a589b01 100644
--- a/drivers/hwmon/occ/p9_sbe.c
+++ b/drivers/hwmon/occ/p9_sbe.c
@@ -82,6 +82,7 @@ static bool p9_sbe_occ_save_ffdc(struct p9_sbe_occ *ctx, const void *resp,
static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd, size_t len,
void *resp, size_t resp_len)
{
+ size_t original_resp_len = resp_len;
struct p9_sbe_occ *ctx = to_p9_sbe_occ(occ);
int rc, i;
@@ -97,6 +98,7 @@ static int p9_sbe_occ_send_cmd(struct occ *occ, u8 *cmd, size_t len,
}
if (rc != -EBADE)
return rc;
+ resp_len = original_resp_len;
}
switch (((struct occ_response *)resp)->return_status) {
--
2.31.1
next reply other threads:[~2022-07-20 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 19:30 Eddie James [this message]
2022-07-21 3:46 ` [PATCH] hwmon (occ): Fix response length in checksum retry Guenter Roeck
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=20220720193036.8743-1-eajames@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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