From patchwork Thu Sep 1 19:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 12963181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2565AECAAD5 for ; Thu, 1 Sep 2022 19:32:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77CC010E1AF; Thu, 1 Sep 2022 19:32:39 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8303310E1AF for ; Thu, 1 Sep 2022 19:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662060753; x=1693596753; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5Fhp8lnHaklCewe54tAQ90aoozjHlS5bFMWoZsFKap0=; b=H3t9d5RfEyIFVzTxzXUgLRtwmaHdYhGXoljmxrahFM4St3u085QAllpJ KvxkyGuSYAh9bafDVYVtl6RzctLpkAdnwfaMXwX/l6SW3oqH84cmyHqQN S4j8yJL0ertQ5Macv8pCczzSYU0fwgSoamrnneG2/bYjG5qy/h0W+bGta ny1YAeugQgUpf7DIBYHlj8Mb0iRB+LX5CVWvi3wYYe0NKILFqUatX//Zx dVlIeMvVMV6nTnEBahoV/kPrSy4iAm+DQX4o0HZY8RfoL8Wt1ywjq/r/M 8ViFAnG+Mizvw4FxgTcNvlfao2Njwf/yiZIlCKEShKCRHcZwlBZgf1IGI A==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="321964989" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="321964989" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 12:32:33 -0700 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="563592360" Received: from rishabhj-mobl1.amr.corp.intel.com (HELO rdvivi-mobl4.intel.com) ([10.255.36.114]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 12:32:32 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Thu, 1 Sep 2022 15:32:28 -0400 Message-Id: <20220901193228.255098-2-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220901193228.255098-1-rodrigo.vivi@intel.com> References: <20220901193228.255098-1-rodrigo.vivi@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Don't try to disable host RPS when this was never enabled. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Signed-off-by: Rodrigo Vivi --- 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 2c8d9eeb7e7e..6bd0aa21f56b 100644 --- a/drivers/gpu/drm/i915/gt/intel_rps.c +++ b/drivers/gpu/drm/i915/gt/intel_rps.c @@ -1548,6 +1548,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);