Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [bug report] drm/xe/hwmon: expose fan speed
Date: Thu, 5 Jun 2025 10:32:50 +0300	[thread overview]
Message-ID: <aEFIIukIcd2Od9sv@black.fi.intel.com> (raw)
In-Reply-To: <aEE3C2DpYkmbTPMA@stanley.mountain>

On Thu, Jun 05, 2025 at 09:19:55AM +0300, Dan Carpenter wrote:
> Hello Raag Jadav,
> 
> Commit 28f79ac609de ("drm/xe/hwmon: expose fan speed") from Mar 12,
> 2025 (linux-next), leads to the following Smatch static checker
> warning:
> 
> 	drivers/gpu/drm/xe/xe_hwmon.c:1008 xe_hwmon_fan_is_visible()
> 	error: uninitialized symbol 'uval'.
> 
> drivers/gpu/drm/xe/xe_hwmon.c
>     995 static umode_t
>     996 xe_hwmon_fan_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
>     997 {
>     998         u32 uval;
>     999 
>     1000         if (!hwmon->xe->info.has_fan_control)
>     1001                 return 0;
>     1002 
>     1003         switch (attr) {
>     1004         case hwmon_fan_input:
>     1005                 if (xe_hwmon_pcode_read_fan_control(hwmon, FSC_READ_NUM_FANS, &uval))
>     1006                         return 0;
>     1007 
> --> 1008                 return channel < uval ? 0444 : 0;
>     1009         default:
>     1010                 return 0;
>     1011         }
>     1012 }
> 
> The problem is in pcode_mailbox_rw() where we return success without
> writing to *uval.
> 
>     89  static int pcode_mailbox_rw(struct xe_tile *tile, u32 mbox, u32 *data0, u32 *data1,
>     90                              unsigned int timeout_ms, bool return_data,
>     91                              bool atomic)
>     92  {
>     93          if (tile_to_xe(tile)->info.skip_pcode)
>     94                  return 0;
>                         ^^^^^^^^^
> data0 is *uval.

Thanks for the report. IIUC xe->info.skip_pcode is set for IS_SRIOV_VF(xe)
cases and we don't register hwmon interface in that case.

Raag

      reply	other threads:[~2025-06-05  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05  6:19 [bug report] drm/xe/hwmon: expose fan speed Dan Carpenter
2025-06-05  7:32 ` Raag Jadav [this message]

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=aEFIIukIcd2Od9sv@black.fi.intel.com \
    --to=raag.jadav@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=intel-xe@lists.freedesktop.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