aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wajdeczko <[email protected]>2024-02-13 16:43:53 +0100
committerMichal Wajdeczko <[email protected]>2024-02-13 18:59:52 +0100
commit602f9ebf321a9442857ff0685c9a6dfb78bf807b (patch)
tree334cdb1a424fec11cd8326809c6b04e3206e3dc0
parent3ed34c655210090f4105be1ba5ab5f8f1dccefe1 (diff)
drm/xe/vf: Don't enable hwmon if VF
Registers used by hwmon are not available for VF drivers. Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Badal Nilawar <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/xe/xe_hwmon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index f0194d5121a5..b82233a41606 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;