Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3785977pxb; Mon, 4 Oct 2021 09:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoxW7AAaUyg0j4vqNzIjbaEy1pJnrZMGmAcOQlZXvG/4pURwtvRqpEXJqYiHh7fmatg4Ag X-Received: by 2002:a17:906:7811:: with SMTP id u17mr18008387ejm.562.1633365189769; Mon, 04 Oct 2021 09:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633365189; cv=none; d=google.com; s=arc-20160816; b=ZFzEynpYXTpUBvQrA+cm2UGMMkiJ0+rG5L2Lp7SyNx0udSz/3KKwf+17J1V6uXuvV7 v41pLGYHLGXTZ9rK+SWMHnhbRWP/p+v8OKD2Ptt8PEEFUuOeThYuuKc1S9d683piIvBs l6s2OF7/dloC05I4seKrajFu1s75G0pqbv3r7wDg6f40FvYwzdevl1BQ+FYGronJx8pH WPBoJwAejvzS8bG09tA0kjyz8Z/8dOOJX1ivtHY5VUBplVMNNGK5qwd0mD6GA42qftiQ /wHah0kth0jkxEo79NoIbtbKKdrGiMoaN8X/0EVArv5t0lLEhGSCE1j6rBrmnwcEvCy3 Zevg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZiTthg4hrU1d+bzRpK9E9kNyWT0L3xil9x1BotEIbVg=; b=WVLK/otOMH+wuyDEGGydwpI2DwsuYtojyk9NjuVGuELuxaq/TIKTgITCIWNIdvV1ax cfATplC6N5HnPzP2v6HuDTrt8ss8ze8QUxIRjxKHjonQbhOTdxO88C3q3UkDD+BjrGdB ZMgGve2yu9bekQ3Wneh74AVVStz8tdx5qsVO1zejO9wRLQ1BR53dMFu3eTlbmhrYuhne mK6EaofeDhxcQZSZGZEsfWBiyuP3tuJxNLUOBv4h24gwYRj3XqFnfYpTQUwXFN5nornX uSbd7HJ55744ZQ8eH0pmS33NU/9xaP9nbcr1YghmicAoDgvv0HMP0d9i/Jg69Dz9ZDIu Naqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OaMJce5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si348299ejs.402.2021.10.04.09.32.27; Mon, 04 Oct 2021 09:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OaMJce5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237920AbhJDNfh (ORCPT + 99 others); Mon, 4 Oct 2021 09:35:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:47290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237858AbhJDNdP (ORCPT ); Mon, 4 Oct 2021 09:33:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9817763228; Mon, 4 Oct 2021 13:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353302; bh=OX65UY3n6udOwqxSX2gucVF8CzSQqHWhXYlhOWOw4uM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OaMJce5Gi+KU2In08KoKA5AGE7GyqKUbh71TDTiDJLIihkTkNwd5vYPCUq4Sgg5gI 7iIVjv4BFfMAU9JPIs2uTfe6NuZJs/JXsgxrzc3OWPrZGH0qegZwzF1Z3lgr6oVKoh 6mNGGFzBx2+Qsy6pmwIlTx6ec3Rxnf1/AJVKoKyU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhenyu Wang , Zhi A Wang , Sasha Levin Subject: [PATCH 5.14 075/172] drm/i915/gvt: fix the usage of ww lock in gvt scheduler. Date: Mon, 4 Oct 2021 14:52:05 +0200 Message-Id: <20211004125047.421057978@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhi A Wang [ Upstream commit d168cd797982db9db617113644c87b8f5f3cf27e ] As the APIs related to ww lock in i915 was changed recently, the usage of ww lock in GVT-g scheduler needs to be changed accrodingly. We noticed a deadlock when GVT-g scheduler submits the workload to i915. After some investigation, it seems the way of how to use ww lock APIs has been changed. Releasing a ww now requires a explicit i915_gem_ww_ctx_fini(). Fixes: 67f1120381df ("drm/i915/gvt: Introduce per object locking in GVT scheduler.") Cc: Zhenyu Wang Signed-off-by: Zhi A Wang Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/20210826143834.25410-1-zhi.a.wang@intel.com Acked-by: Zhenyu Wang Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 734c37c5e347..527b59b86312 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -576,7 +576,7 @@ static int prepare_shadow_batch_buffer(struct intel_vgpu_workload *workload) /* No one is going to touch shadow bb from now on. */ i915_gem_object_flush_map(bb->obj); - i915_gem_object_unlock(bb->obj); + i915_gem_ww_ctx_fini(&ww); } } return 0; @@ -630,7 +630,7 @@ static int prepare_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) return ret; } - i915_gem_object_unlock(wa_ctx->indirect_ctx.obj); + i915_gem_ww_ctx_fini(&ww); /* FIXME: we are not tracking our pinned VMA leaving it * up to the core to fix up the stray pin_count upon -- 2.33.0