Commit b5a1aa81 authored by Thomas Falcon's avatar Thomas Falcon Committed by Greg Kroah-Hartman

ibmvnic: Fix endian errors in error reporting output


[ Upstream commit 75224c93 ]

Error reports received from firmware were not being converted from
big endian values, leading to bogus error codes reported on little
endian systems.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d864e675
...@@ -2197,12 +2197,12 @@ static void handle_error_info_rsp(union ibmvnic_crq *crq, ...@@ -2197,12 +2197,12 @@ static void handle_error_info_rsp(union ibmvnic_crq *crq,
if (!found) { if (!found) {
dev_err(dev, "Couldn't find error id %x\n", dev_err(dev, "Couldn't find error id %x\n",
crq->request_error_rsp.error_id); be32_to_cpu(crq->request_error_rsp.error_id));
return; return;
} }
dev_err(dev, "Detailed info for error id %x:", dev_err(dev, "Detailed info for error id %x:",
crq->request_error_rsp.error_id); be32_to_cpu(crq->request_error_rsp.error_id));
for (i = 0; i < error_buff->len; i++) { for (i = 0; i < error_buff->len; i++) {
pr_cont("%02x", (int)error_buff->buff[i]); pr_cont("%02x", (int)error_buff->buff[i]);
...@@ -2281,8 +2281,8 @@ static void handle_error_indication(union ibmvnic_crq *crq, ...@@ -2281,8 +2281,8 @@ static void handle_error_indication(union ibmvnic_crq *crq,
dev_err(dev, "Firmware reports %serror id %x, cause %d\n", dev_err(dev, "Firmware reports %serror id %x, cause %d\n",
crq->error_indication. crq->error_indication.
flags & IBMVNIC_FATAL_ERROR ? "FATAL " : "", flags & IBMVNIC_FATAL_ERROR ? "FATAL " : "",
crq->error_indication.error_id, be32_to_cpu(crq->error_indication.error_id),
crq->error_indication.error_cause); be16_to_cpu(crq->error_indication.error_cause));
error_buff = kmalloc(sizeof(*error_buff), GFP_ATOMIC); error_buff = kmalloc(sizeof(*error_buff), GFP_ATOMIC);
if (!error_buff) if (!error_buff)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment