diff mbox series

[1/2] drm/i915: Don't try to disable host RPS when this was never enabled.

Message ID 20220902095126.373036-1-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Don't try to disable host RPS when this was never enabled. | expand

Commit Message

Rodrigo Vivi Sept. 2, 2022, 9:51 a.m. UTC
Specially in GT reset case this could be triggered and try
to disable things that had never been enabled. Let's add
some protection here.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_rps.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nirmoy Das Sept. 2, 2022, 10:48 a.m. UTC | #1
LGTM the series is:

Acked-by: Nirmoy Das <nirmoy.das@intel.com>

On 9/2/2022 11:51 AM, Rodrigo Vivi wrote:
> Specially in GT reset case this could be triggered and try
> to disable things that had never been enabled. Let's add
> some protection here.
>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_rps.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
> index 579ae9ac089c..6fadde4ee7bf 100644
> --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> @@ -1551,6 +1551,9 @@ void intel_rps_disable(struct intel_rps *rps)
>   {
>   	struct drm_i915_private *i915 = rps_to_i915(rps);
>   
> +	if (!intel_rps_is_enabled(rps))
> +		return;
> +
>   	intel_rps_clear_enabled(rps);
>   	intel_rps_clear_interrupts(rps);
>   	intel_rps_clear_timer(rps);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
index 579ae9ac089c..6fadde4ee7bf 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -1551,6 +1551,9 @@  void intel_rps_disable(struct intel_rps *rps)
 {
 	struct drm_i915_private *i915 = rps_to_i915(rps);
 
+	if (!intel_rps_is_enabled(rps))
+		return;
+
 	intel_rps_clear_enabled(rps);
 	intel_rps_clear_interrupts(rps);
 	intel_rps_clear_timer(rps);