Re: [PATCH 4.19 34/88] bnxt_en: fix HWRM error when querying VF temperature

Pavel Machek
2020-09-08T19:47:42Z

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Hi!

> 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")

Is this new interface described somewhere?

> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -6836,16 +6836,19 @@ static ssize_t bnxt_show_temp(struct device *dev,
...
> - return sprintf(buf, "%u\n", temp);
> + if (len)
> + return len;
> +
> + return sprintf(buf, "unknown\n");
> }

We normally just do return -EIO (or other error code) in such cases.

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]