From: Michal Wajdeczko Date: Tue, 13 Feb 2024 15:43:53 +0000 (+0100) Subject: drm/xe/vf: Don't enable hwmon if VF X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=602f9ebf321a9442857ff0685c9a6dfb78bf807b;p=linux.git drm/xe/vf: Don't enable hwmon if VF Registers used by hwmon are not available for VF drivers. Signed-off-by: Michal Wajdeczko Cc: Badal Nilawar Reviewed-by: Badal Nilawar Link: https://patchwork.freedesktop.org/patch/msgid/20240213154355.1221-7-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c index f0194d5121a5d..b82233a416062 100644 --- a/drivers/gpu/drm/xe/xe_hwmon.c +++ b/drivers/gpu/drm/xe/xe_hwmon.c @@ -17,6 +17,7 @@ #include "xe_mmio.h" #include "xe_pcode.h" #include "xe_pcode_api.h" +#include "xe_sriov.h" enum xe_hwmon_reg { REG_PKG_RAPL_LIMIT, @@ -746,6 +747,10 @@ void xe_hwmon_register(struct xe_device *xe) if (!IS_DGFX(xe)) return; + /* hwmon is not available on VFs */ + if (IS_SRIOV_VF(xe)) + return; + hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); if (!hwmon) return;