[PATCH 6/8] drm/xe/vf: Don't enable hwmon if VF

Nilawar, Badal badal.nilawar at intel.com
Tue Jan 16 20:04:08 UTC 2024



On 12-01-2024 20:56, Michal Wajdeczko wrote:
> Registers used by hwmon are not available for VF drivers.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Badal Nilawar <badal.nilawar at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_hwmon.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index 6ef2aa1eae8b..9848bf84b58b 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -16,6 +16,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,
> @@ -745,6 +746,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;
Reviewed-by: Badal Nilawar <badal.nilawar at intel.com>
> +
>   	hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL);
>   	if (!hwmon)
>   		return;


More information about the Intel-xe mailing list