From patchwork Wed Oct 2 13:35:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 2974821 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 97D729F2B8 for ; Wed, 2 Oct 2013 13:37:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06765201FA for ; Wed, 2 Oct 2013 13:37:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C31B920174 for ; Wed, 2 Oct 2013 13:37:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ACE7E7868 for ; Wed, 2 Oct 2013 06:37:07 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D032E646C for ; Wed, 2 Oct 2013 06:35:50 -0700 (PDT) Received: by mail-ee0-f53.google.com with SMTP id b15so392531eek.26 for ; Wed, 02 Oct 2013 06:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=iHtJq2CVt8MWcc9YG8mWpbX5nhVrVE5OzY4RswaespA=; b=xCqnvpwVjPZbUzukOIMaZjQk1Yu8dUz2nlI9tNMS24hbnd9Ucgwr6iu9XNnjfPKpor THgXHshbrlbwlF7RowFESiay7kuYqRuy+gHnsjIMvuhtVs8JsQL3LvBgS2Nh8SpnXQw/ HOxLy+ncw0eHFecFCSy/gJHziBHfRLYW5GK5b6qaSlK4/9wruTjJaCRDSoL3mygvwwQ/ w4SOtFBnLq3RhawphYAu8D6P6jZttgBF81TdElEn08yUr9lmbQijf+iaseRFt1Z6OA9p gffEW56YFKTn2rNt67ONgQbs2FMkOuIz08dCDPbsHrrfN/yH117ejxxtZrOX9G17/mn7 /vkg== X-Received: by 10.14.241.141 with SMTP id g13mr2868929eer.75.1380720948407; Wed, 02 Oct 2013 06:35:48 -0700 (PDT) Received: from localhost.localdomain ([194.228.11.217]) by mx.google.com with ESMTPSA id j7sm3871203eeo.15.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Oct 2013 06:35:47 -0700 (PDT) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: signal all fences after lockup to avoid endless waiting in GEM_WAIT Date: Wed, 2 Oct 2013 15:35:39 +0200 Message-Id: <1380720939-3903-1-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Marek Olšák After a lockup, fences are not signalled sometimes, causing the GEM_WAIT_IDLE ioctl to never return, which sometimes results in an X server freeze. This fixes only one of many deadlocks which can occur during a lockup. Signed-off-by: Marek Olšák --- drivers/gpu/drm/radeon/radeon_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 841d0e0..7b97baa 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -1552,6 +1552,11 @@ int radeon_gpu_reset(struct radeon_device *rdev) radeon_save_bios_scratch_regs(rdev); /* block TTM */ resched = ttm_bo_lock_delayed_workqueue(&rdev->mman.bdev); + + mutex_lock(&rdev->ring_lock); + radeon_fence_driver_force_completion(rdev); + mutex_unlock(&rdev->ring_lock); + radeon_pm_suspend(rdev); radeon_suspend(rdev);