From patchwork Sat Jan 3 23:31:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 5564631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6754F9F48A for ; Mon, 5 Jan 2015 01:51:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92D6520176 for ; Mon, 5 Jan 2015 01:51:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2037D20165 for ; Mon, 5 Jan 2015 01:51:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 991CA6E1B2; Sun, 4 Jan 2015 17:51:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 421 seconds by postgrey-1.34 at gabe; Sat, 03 Jan 2015 15:38:45 PST Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B5A989D7C for ; Sat, 3 Jan 2015 15:38:45 -0800 (PST) Received: from localhost.localdomain (ppp83-237-8-205.pppoe.mtu-net.ru [83.237.8.205]) by mail.ispras.ru (Postfix) with ESMTPSA id 9334154006F; Sun, 4 Jan 2015 02:31:40 +0300 (MSK) From: Alexey Khoroshilov To: Oded Gabbay Subject: [PATCH] drm/radeon: do not left queue acquired if timeout happens in kgd_hqd_destroy() Date: Sun, 4 Jan 2015 02:31:20 +0300 Message-Id: <1420327880-25415-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Sun, 04 Jan 2015 17:51:27 -0800 Cc: ldv-project@linuxtesting.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alexey Khoroshilov 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If timeout happens, kgd_hqd_destroy() just returns -ETIME leaving queue acquired. It may cause a deadlock, so the patch proposes to release queue before return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/gpu/drm/radeon/radeon_kfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index 242fd8b1b221..335e29dbab05 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -556,6 +556,7 @@ static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type, if (timeout == 0) { pr_err("kfd: cp queue preemption time out (%dms)\n", temp); + release_queue(kgd); return -ETIME; } msleep(20);