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 E0C99C3DA4A for ; Tue, 20 Aug 2024 18:58:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8B3210E837; Tue, 20 Aug 2024 18:58:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="AWFRkiq6"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8E4D10E837 for ; Tue, 20 Aug 2024 18:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724180316; x=1755716316; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=SdmoLfe6ll2ZZNB6lyjPW2gOSCqjVb99GBUrgxSsWjI=; b=AWFRkiq6pONpf5SH5J2ohuACx4TTevgID8bSceuII3HEmvnmnv02E7dV JROsZUR1WKI6aDXPm6d0K90K+tLlaqTXAu2RxkjsGZGT7TA1U+5B+8e+8 v3630ryN73WrxTJxo/wPYCyu0VYf9I/okeDOr2wSTNlLKgUYC5HF0Pcie OVVJMzIpIdlMxKJWzWjWANgFGWqlbNbIEWzanxXi4Vi2OWKAI2V+m1h+p 22x6kwMPAkwxavIRhgymtggxtfpmtY5v5MkXqz6WBQMbyDIPZfYgY8Drp cVi18jI5mux2gktuTCmwzR8hU4WZG4AReuuIyoyDg0gOunPRgo6s1pY0b g==; X-CSE-ConnectionGUID: bK6g6JRURMyjv5/ZzHvHTw== X-CSE-MsgGUID: Ehljdf4qSaOaERIihyJnLQ== X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="22313753" X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; d="scan'208";a="22313753" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2024 11:58:36 -0700 X-CSE-ConnectionGUID: ZbtlNpINQUyJPSzlIEh7vA== X-CSE-MsgGUID: YPJZrTd/SZ+mwoivyuEoAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; d="scan'208";a="91552619" Received: from jorgera1-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.124.118.77]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2024 11:58:37 -0700 Date: Tue, 20 Aug 2024 11:52:23 -0700 Message-ID: <87a5h781so.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Himal Prasad Ghimiray Cc: intel-xe@lists.freedesktop.org Subject: Re: [PATCH 1/3] drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure In-Reply-To: <20240820090230.3258128-1-himal.prasad.ghimiray@intel.com> References: <20240820090230.3258128-1-himal.prasad.ghimiray@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/29.4 (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 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, 20 Aug 2024 02:02:28 -0700, Himal Prasad Ghimiray wrote: > > drm_sched_job_add_dependency() drops references even in case of error, > no need for caller to call dma_fence_put. OK, there's another reference taken in xe_sync_entry_parse() but that is typically dropped via xe_sync_entry_cleanup(). Reviewed-by: Ashutosh Dixit > > Signed-off-by: Himal Prasad Ghimiray > --- > drivers/gpu/drm/xe/xe_sync.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c > index ca826aeb41ea..a0675f57a398 100644 > --- a/drivers/gpu/drm/xe/xe_sync.c > +++ b/drivers/gpu/drm/xe/xe_sync.c > @@ -206,16 +206,9 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef, > > int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job) > { > - int err; > - > - if (sync->fence) { > - err = drm_sched_job_add_dependency(&job->drm, > - dma_fence_get(sync->fence)); > - if (err) { > - dma_fence_put(sync->fence); > - return err; > - } > - } > + if (sync->fence) > + return drm_sched_job_add_dependency(&job->drm, > + dma_fence_get(sync->fence)); > > return 0; > } > -- > 2.34.1 >