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 6C957C7EE23 for ; Thu, 1 Jun 2023 14:38:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4E3910E55A; Thu, 1 Jun 2023 14:38:15 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DB7D10E554; Thu, 1 Jun 2023 14:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685630292; x=1717166292; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kN660c8NFUyOdJrkLu+dYkEvaszRGd9qNNXBXk/WuAU=; b=Lm3mcd0VGbXN2qsJoo8Io7xGDFQZrEZPRF0Doizz4jZzJn0ZHPJRUAEE JyfajGNtw03CWcSj6WHeUeOuTfmu171gF6LO+9OHfmv3be784eHNIMfbs BUThI7qn8GoqBCPYUD6EwT39lzVtWVZ5TDpSerQ70hV3ROAjz6EU2PeHQ riStR1dWPcYcXvEfqs0uLOSg0oha+XMnHmb2dATnuvqHUL+sX6SUQcrXx LGJ1NlaR61xWU/ZDOqYzv0YeqX2/oTWEZqz8l+33J/GghgwXy55xJ/QY6 QVjq21W8GX7uiDKJOujT7qabm1bMtD4qJ5q9jHIR8B6DNG0PLCmk9WSz3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="441936189" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="441936189" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 07:38:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="684867629" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="684867629" Received: from mborsali-mobl.amr.corp.intel.com (HELO intel.com) ([10.251.208.75]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 07:38:05 -0700 Date: Thu, 1 Jun 2023 16:38:02 +0200 From: Andi Shyti To: "Upadhyay, Tejas" Message-ID: References: <20230526124138.2006110-1-andi.shyti@linux.intel.com> <6897a425-8217-8fca-d0a0-fc02073f6b45@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Use the correct error value when kernel_context() fails 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: "Hajda, Andrzej" , Intel GFX , DRI Devel , Chris Wilson , "stable@vger.kernel.org" , Dan Carpenter , Andi Shyti Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi Tejas, > > > @@ -1530,8 +1530,8 @@ static int live_busywait_preempt(void *arg) > > > struct drm_i915_gem_object *obj; > > > struct i915_vma *vma; > > > enum intel_engine_id id; > > > - int err = -ENOMEM; > > > u32 *map; > > > + int err; > > We could initialize err with 0 and remove err = 0 assignment below but leaving up to you. that assignement must be a leftover from previous patches because err is already initialized here: err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL); will remove it. Thanks! > > > > > > /* > > > * Verify that even without HAS_LOGICAL_RING_PREEMPTION, we > > can @@ > > > -1539,13 +1539,17 @@ static int live_busywait_preempt(void *arg) > > > */ > > > > > > ctx_hi = kernel_context(gt->i915, NULL); > > > - if (!ctx_hi) > > > - return -ENOMEM; > > > + if (IS_ERR(ctx_hi)) > > > + return PTR_ERR(ctx_hi); > > > + > > > ctx_hi->sched.priority = I915_CONTEXT_MAX_USER_PRIORITY; > > > > > > ctx_lo = kernel_context(gt->i915, NULL); > > > - if (!ctx_lo) > > > + if (IS_ERR(ctx_lo)) { > > > + err = PTR_ERR(ctx_lo); > > > goto err_ctx_hi; > > > + } > > > + > > Looks fine, > Acked-by: Tejas Upadhyay Thank you! Andi > > > > ctx_lo->sched.priority = I915_CONTEXT_MIN_USER_PRIORITY; > > > > > > obj = i915_gem_object_create_internal(gt->i915, PAGE_SIZE); >