On dGfx, the PL1 power limit being enabled and set to a low value results in a low GPU operating freq. It also negates the freq raise operation which is done before GuC firmware load. As a result GuC firmware load can time out. Such timeouts were seen in the GL #8062 bug below (where the PL1 power limit was enabled and set to a low value). Therefore disable the PL1 power limit when allowed by HW when loading GuC firmware. v2: - Take mutex (to disallow writes to power1_max) across GuC reset/fw load - Add hwm_power_max_restore to error return code path v3 (Jani N): - Add/remove explanatory comments - Function renames - Type corrections - Locking annotation v4: - Don't hold the lock across GuC reset (Rodrigo) - New locking scheme (suggested by Rodrigo) - Eliminate rpm_get in power_max_disable/restore, not needed (Tvrtko) v5: - Fix uninitialized pl1en variable compile warning reported by kernel build robot by creating new err_rps label Link: https://gitlab.freedesktop.org/drm/intel/-/issues/8062 Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230420164041.1428455-3-ashutosh.dixit@intel.com
28 lines
888 B
C
28 lines
888 B
C
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __I915_HWMON_H__
|
|
#define __I915_HWMON_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct drm_i915_private;
|
|
struct intel_gt;
|
|
|
|
#if IS_REACHABLE(CONFIG_HWMON)
|
|
void i915_hwmon_register(struct drm_i915_private *i915);
|
|
void i915_hwmon_unregister(struct drm_i915_private *i915);
|
|
void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old);
|
|
void i915_hwmon_power_max_restore(struct drm_i915_private *i915, bool old);
|
|
#else
|
|
static inline void i915_hwmon_register(struct drm_i915_private *i915) { };
|
|
static inline void i915_hwmon_unregister(struct drm_i915_private *i915) { };
|
|
static inline void i915_hwmon_power_max_disable(struct drm_i915_private *i915, bool *old) { };
|
|
static inline void i915_hwmon_power_max_restore(struct drm_i915_private *i915, bool old) { };
|
|
#endif
|
|
|
|
#endif /* __I915_HWMON_H__ */
|