From mboxrd@z Thu Jan 1 00:00:00 1970 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 08E31C636CC for ; Thu, 16 Feb 2023 04:08:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B68F10E2BB; Thu, 16 Feb 2023 04:08:17 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF34810E2BB for ; Thu, 16 Feb 2023 04:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676520495; x=1708056495; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=ZYnaDKFKb69IwKuqpQfrOOLeUweXsYL1L298hEW1LkM=; b=Z1Dc/bIDlK26A0nlYEasvy3Lr6elsY6+JZTA1diBkis4J/xmhSQnAlIa 5sl+vxR7TzXBtQGz815IzMp4OX6el48V9tBN985+bgCKfFG64+JNaNHxC bAFxdTpXMX9kfSscl10qrPFn6BgikgQiXbXQ6LP3yKJv/ux690zZ6ZCbV f9JOTXtQzK0usFJMm0L49KFjtdiq8E0NcwnmVyWrb4xjcw9KywOWSVumT TAzbFRhfm3tdaB9pQaiXXNP/tHwddFqMxRfh4weU44rv7Rkxw3FAI9yQG UzOaNVgUZxJfkd5v4dNAXu2oxHzxQow3auA2mwwH+GOGCfUZ752T2rriG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="417841410" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="417841410" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 20:08:15 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="843993760" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="843993760" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.251.28.186]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 20:08:14 -0800 Date: Wed, 15 Feb 2023 19:56:38 -0800 Message-ID: <873576ntzd.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <20230215005419.2100887-2-umesh.nerlige.ramappa@intel.com> References: <20230215005419.2100887-1-umesh.nerlige.ramappa@intel.com> <20230215005419.2100887-2-umesh.nerlige.ramappa@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 1/9] drm/i915/perf: Drop wakeref on GuC RC error 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: Lionel G Landwerlin , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 14 Feb 2023 16:54:11 -0800, Umesh Nerlige Ramappa wrote: > > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c > index 824a34ec0b83..393a0da8b7c8 100644 > --- a/drivers/gpu/drm/i915/i915_perf.c > +++ b/drivers/gpu/drm/i915/i915_perf.c > @@ -1592,9 +1592,7 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream) > /* > * Wa_16011777198:dg2: Unset the override of GUCRC mode to enable rc6. > */ > - if (intel_uc_uses_guc_rc(>->uc) && > - (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_C0) || > - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_B0))) > + if (stream->override_gucrc) > drm_WARN_ON(>->i915->drm, > intel_guc_slpc_unset_gucrc_mode(>->uc.guc.slpc)); > > @@ -3305,13 +3303,15 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, > if (ret) { > drm_dbg(&stream->perf->i915->drm, > "Unable to override gucrc mode\n"); > - goto err_config; > + goto err_fw; > } > + > + stream->override_gucrc = true; > } > > ret = alloc_oa_buffer(stream); > if (ret) > - goto err_oa_buf_alloc; > + goto err_gucrc; > > stream->ops = &i915_oa_stream_ops; > > @@ -3344,12 +3344,16 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, > > free_oa_buffer(stream); > > -err_oa_buf_alloc: > - free_oa_configs(stream); > +err_gucrc: > + if (stream->override_gucrc) > + intel_guc_slpc_unset_gucrc_mode(>->uc.guc.slpc); > > +err_fw: > intel_uncore_forcewake_put(stream->uncore, FORCEWAKE_ALL); > intel_engine_pm_put(stream->engine); > > + free_oa_configs(stream); > + > err_config: > free_noa_wait(stream); [nice-to-have] The previous naming scheme for labels in the function is the place from which the goto is issued so err_fw should be named err_gucrc and err_gucrc should be called the preevious name err_oa_buf_alloc but otherwise the code seems correct so this is: Reviewed-by: Ashutosh Dixit