OSDN Git Service

bnxt_en: fix HWRM error when querying VF temperature
authorEdwin Peer <edwin.peer@broadcom.com>
Wed, 26 Aug 2020 05:08:37 +0000 (01:08 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Aug 2020 14:19:03 +0000 (07:19 -0700)
commit12cce90b934bf2b0ed9c339b4d5503e69954351a
tree46eaf5d8c81cc4ec274b7a7a2edfc99871ea31ad
parentb148bb238c02f0c7797efed026e9bba5892d2172
bnxt_en: fix HWRM error when querying VF temperature

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c