From patchwork Sun Dec 4 23:57:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 9460145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0441F60231 for ; Sun, 4 Dec 2016 23:59:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6C6625D99 for ; Sun, 4 Dec 2016 23:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D96CE26212; Sun, 4 Dec 2016 23:59:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3359C25D99 for ; Sun, 4 Dec 2016 23:59:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0461D6E229; Sun, 4 Dec 2016 23:59:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-f194.google.com (mail-wj0-f194.google.com [209.85.210.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id B14F56E229; Sun, 4 Dec 2016 23:59:29 +0000 (UTC) Received: by mail-wj0-f194.google.com with SMTP id he10so22739484wjc.2; Sun, 04 Dec 2016 15:59:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mYtWnbUWP3J/01mSoEwNOKuTAhD3Zvnt4L8agLXCRjE=; b=bI2nshaT9z3CBlnPO1CQDi0mdAHwkgyXzgJjmhshyGz9TFmXzYyH1R804FJULJI+YG mR/5OYBWuDcnugFTn0g1OsdS7a1FFrS+0Lr1SzfedmL8Wos9r+8MEfDzTnsVLhyfouSk gYJPZlD0kf609kibGfBQK8sI3ANaqKDQJ2VPmQ20KCX3SpZdwPcGphuTKUJqLxiWYryr VQgDEzRA5DJRbiNtxWYlfqg8Drd/+2WD6FO0TgEBCz9BMAqFcXTla7pTH0ZIx3Ux2ICo PGTZciSBGYCep6CZpla7AIM3EO/3NH59WYvAw3NylrtMx9se3o4KQ5JDNmxwtWd3KRv8 u/YQ== X-Gm-Message-State: AKaTC035Veuzzn1Hnuc9suy2ChiaPPcAY3ucfyRK2+WAQ5VmvIkrtUE978xq1vzhIpQrmA== X-Received: by 10.194.26.133 with SMTP id l5mr47812395wjg.4.1480895968004; Sun, 04 Dec 2016 15:59:28 -0800 (PST) Received: from localhost.localdomain (host31-49-164-118.range31-49.btcentralplus.com. [31.49.164.118]) by smtp.gmail.com with ESMTPSA id q7sm17554807wjh.9.2016.12.04.15.59.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Dec 2016 15:59:27 -0800 (PST) From: Eric Engestrom To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915/gvt: fix deadlock in dispatch_workload()'s error path Date: Sun, 4 Dec 2016 23:57:18 +0000 Message-Id: <20161204235718.1102-1-eric@engestrom.ch> X-Mailer: git-send-email 2.10.2 Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Eric Engestrom , Daniel Vetter , Pei Zhang , Zhi Wang , igvt-g-dev@lists.01.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 90d27a1 moved the lock before this error path but forgot to add an unlock here. Fixes: 90d27a1b180e51ef0713 ("drm/i915/gvt: fix deadlock in workload_thread") Cc: Pei Zhang Cc: Zhenyu Wang Signed-off-by: Eric Engestrom --- drivers/gpu/drm/i915/gvt/scheduler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index f898df3..cd13c4b 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -177,6 +177,7 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) rq = i915_gem_request_alloc(dev_priv->engine[ring_id], shadow_ctx); if (IS_ERR(rq)) { gvt_err("fail to allocate gem request\n"); + mutex_unlock(&dev_priv->drm.struct_mutex); workload->status = PTR_ERR(rq); return workload->status; }