From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kuba@kernel.org,
Edwin Peer <edwin.peer@broadcom.com>,
Marc Smith <msmith626@gmail.com>
Subject: [PATCH net 6/8] bnxt_en: fix HWRM error when querying VF temperature
Date: Wed, 26 Aug 2020 01:08:37 -0400 [thread overview]
Message-ID: <1598418519-20168-7-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1598418519-20168-1-git-send-email-michael.chan@broadcom.com>
From: Edwin Peer <edwin.peer@broadcom.com>
Firmware returns RESOURCE_ACCESS_DENIED for HWRM_TEMP_MONITORY_QUERY for
VFs. This produces unpleasing error messages in the log when temp1_input
is queried via the hwmon sysfs interface from a VF.
The error is harmless and expected, so silence it and return unknown as
the value. Since the device temperature is not particularly sensitive
information, provide flexibility to change this policy in future by
silencing the error rather than avoiding the HWRM call entirely for VFs.
Fixes: cde49a42a9bb ("bnxt_en: Add hwmon sysfs support to read temperature")
Cc: Marc Smith <msmith626@gmail.com>
Reported-by: Marc Smith <msmith626@gmail.com>
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d6f3592..a23ccb0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -9289,16 +9289,19 @@ static ssize_t bnxt_show_temp(struct device *dev,
struct hwrm_temp_monitor_query_input req = {0};
struct hwrm_temp_monitor_query_output *resp;
struct bnxt *bp = dev_get_drvdata(dev);
- u32 temp = 0;
+ u32 len = 0;
resp = bp->hwrm_cmd_resp_addr;
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_TEMP_MONITOR_QUERY, -1, -1);
mutex_lock(&bp->hwrm_cmd_lock);
- if (!_hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
- temp = resp->temp * 1000; /* display millidegree */
+ if (!_hwrm_send_message_silent(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
+ len = sprintf(buf, "%u\n", resp->temp * 1000); /* display millidegree */
mutex_unlock(&bp->hwrm_cmd_lock);
- return sprintf(buf, "%u\n", temp);
+ if (len)
+ return len;
+
+ return sprintf(buf, "unknown\n");
}
static SENSOR_DEVICE_ATTR(temp1_input, 0444, bnxt_show_temp, NULL, 0);
--
1.8.3.1
next prev parent reply other threads:[~2020-08-26 5:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 5:08 [PATCH net 0/8] bnxt_en: Bug fixes Michael Chan
2020-08-26 5:08 ` [PATCH net 1/8] bnxt_en: Don't query FW when netif_running() is false Michael Chan
2020-08-26 5:08 ` [PATCH net 2/8] bnxt_en: Check for zero dir entries in NVRAM Michael Chan
2020-08-26 5:08 ` [PATCH net 3/8] bnxt_en: Fix ethtool -S statitics with XDP or TCs enabled Michael Chan
2020-08-26 5:08 ` [PATCH net 4/8] bnxt_en: Fix PCI AER error recovery flow Michael Chan
2020-08-26 5:08 ` [PATCH net 5/8] bnxt_en: Fix possible crash in bnxt_fw_reset_task() Michael Chan
2020-08-26 5:08 ` Michael Chan [this message]
2020-08-26 5:08 ` [PATCH net 7/8] bnxt_en: init RSS table for Minimal-Static VF reservation Michael Chan
2020-08-26 5:08 ` [PATCH net 8/8] bnxt_en: Setup default RSS map in all scenarios Michael Chan
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=1598418519-20168-7-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=davem@davemloft.net \
--cc=edwin.peer@broadcom.com \
--cc=kuba@kernel.org \
--cc=msmith626@gmail.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).