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 B51C2C02181 for ; Wed, 22 Jan 2025 13:47:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6468610E6E3; Wed, 22 Jan 2025 13:47:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="jh2xpNoL"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8796C10E307; Wed, 22 Jan 2025 13:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737553660; x=1769089660; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=5EMgbOOLhmTpBeCBWxm2mkcZ97Qj3rei/MmM+ArG0Us=; b=jh2xpNoLQqg1tCJrK9R8aK+ycn0fGCwlmVQAVZM0rAunGeAu6axqj5rQ t1Qpp1y6IwtEOGbQ8mlc6CvwVymBNRQsGfGMhl+NPXvPh0jtyH2zjKybE kkg0ksyZew4a63pyx0ZB0VOVNX8YbA/+Wl82h03LAKHYRva439yDMi0xU 2/PSdg3J6WKCsiLeNReboJ+sGxrGfOHcNl7xAerx/NOfweOvbFrNWWeD+ eYFbbCINoMCbNIYtZagIt1D5XYrdSxIq+h6vlek/Qy2VVDzwJ08ELemXq zyk5F6lyfesGxcij5UV5H6QkOty5NUrSXr92yZzkNKRTheAT6/nX7DRnh w==; X-CSE-ConnectionGUID: u/3UMorpQ3qGKrGWJ06eRA== X-CSE-MsgGUID: s8635dTNTiWyl+vEq3/DSg== X-IronPort-AV: E=McAfee;i="6700,10204,11323"; a="37893812" X-IronPort-AV: E=Sophos;i="6.13,225,1732608000"; d="scan'208";a="37893812" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2025 05:47:39 -0800 X-CSE-ConnectionGUID: mVRwqNL8SKi4c9tZq/iwGg== X-CSE-MsgGUID: gcVuPiKkS5SFBD4BzrU2+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,225,1732608000"; d="scan'208";a="107671702" Received: from lfiedoro-mobl.ger.corp.intel.com (HELO localhost) ([10.245.246.30]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2025 05:47:35 -0800 From: Jani Nikula To: Krzysztof Karas , Ingyu Jang Cc: Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915/gt: Handle INTEL_WAKEREF_DEF return value in gen8_ggtt_bind_get_ce In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20250116193528.2297487-1-ingyujang25@gmail.com> Date: Wed, 22 Jan 2025 15:47:32 +0200 Message-ID: <87msfjneob.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 22 Jan 2025, Krzysztof Karas wrote: > Hi Ingyu, > >> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c >> index d60a6ca0cae5..8d22d8f2243d 100644 >> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c >> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c >> @@ -311,7 +311,7 @@ static struct intel_context *gen8_ggtt_bind_get_ce(struct i915_ggtt *ggtt, intel >> * doing rpm_resume(). >> */ >> *wakeref = intel_gt_pm_get_if_awake(gt); >> - if (!*wakeref) >> + if (!*wakeref || *wakeref == INTEL_WAKEREF_DEF) > INTEL_WAKEREF_DEF is a wrapper for an error pointer - how about > IS_ERR_OR_NULL() macro? Without going a bit deeper into the code > it is not apparent that INTEL_WAKEREF_DEF is indicating an error. > > Nice catch nevertheless. It's not a nice catch. It's wrong [1]. BR, Jani. [1] https://lore.kernel.org/r/87cyglg9w2.fsf@intel.com > > Krzysztof > >> return NULL; >> >> intel_engine_pm_get(ce->engine); >> -- >> 2.34.1 >> -- Jani Nikula, Intel