From patchwork Sat Jul 15 11:40:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9842327 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 6BFAE60212 for ; Sat, 15 Jul 2017 11:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B6BC286FB for ; Sat, 15 Jul 2017 11:40:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 505922872B; Sat, 15 Jul 2017 11:40:30 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 CD33C286FB for ; Sat, 15 Jul 2017 11:40:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61FB86E901; Sat, 15 Jul 2017 11:40:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C9146E901 for ; Sat, 15 Jul 2017 11:40:26 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id j85so14950480wmj.0 for ; Sat, 15 Jul 2017 04:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mKDI78rhU6vbArTQmVKH2TVzIX/L9SVejFuHy6b2n7Q=; b=dLi1aJVr+kz5E7WQxZZKgAopojDVE1rT3uL0pRBzwiVNzuK9O3UcC7W5/WDobawpGX NeEiS3hescwEYm9lTpc0e6U6VU/xVxLWyWhzvaQC8UxW4VHgnbT3I6wcCsIRy3HJJjHR G1PEJiZDg4DapSzkbkm5/cYbHsZtAl14/nDrs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mKDI78rhU6vbArTQmVKH2TVzIX/L9SVejFuHy6b2n7Q=; b=ShoF45Zc7RfP3iOOiKfkxGDS1PaPXITnJHCcXAOqh+Q0Sg+J+q87cHIB/TbCqJda82 UXdGKDYaufjCMKbS3JNQhxnmUvlPzOBOQ+poLIGmIbqozshEwpd8oLq35UUnwrXkkqJZ tU/KwHdkk0djTLIhvMfHb4j56MzafNSE6/SPLLpjuxWZZA9T6CrNwNKbcZBIusmotkvl D0P2qPFQGlySgIdGgoc7sNE5vsVOy9XtuditanSAhhnCkWb/QraejfNILG+/p1M7yQ6G y2sqmwh5+EFk3BbcUVnAH6voV49MWT67IDUCkxttV6iPgHzODisKyXw4QQe6DwkxeHOQ e3GQ== X-Gm-Message-State: AIVw110t2Wkv3tJmROfDv0cPDROlzUIerSXzw025Rb/WBWEjSXFbE1QW Oz+3lPxvoJG7GKak9a0= X-Received: by 10.80.165.164 with SMTP id a33mr10470060edc.53.1500118824517; Sat, 15 Jul 2017 04:40:24 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id c8sm5898449edc.13.2017.07.15.04.40.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jul 2017 04:40:23 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sat, 15 Jul 2017 13:40:04 +0200 Message-Id: <20170715114006.6380-6-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170715114006.6380-1-daniel.vetter@ffwll.ch> References: <20170715114006.6380-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Mika Kuoppala , Daniel Vetter Subject: [Intel-gfx] [PATCH 5/7] drm/i915: Avoid the gpu reset vs. modeset deadlock X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP ... using the biggest hammer we have. This is essentially a weaponized version of the timeout-based wedging Chris added in commit 36703e79a982c8ce5a8e43833291f2719e92d0d1 Author: Chris Wilson Date: Thu Jun 22 11:56:25 2017 +0100 drm/i915: Break modeset deadlocks on reset Because defense-in-depth is good it's good to still have both. Also note that with the locking change we can now restrict this a lot (old gpus and special testing only), so this doesn't kill the TDR benefits on at least anything remotely modern. And futuremore with a few tricks it should be possible to make a much more educated guess about whether an atomic commit is stuck waiting on the gpu (atomic_t counting the pending i915_sw_fence used by the atomic modeset code should do it), so we can improve this. But for now just start with something that is guaranteed to recover faster, for much better CI througput. This defacto reverts TDR on these platforms, but there's not really a single commit to specify as the sole offender. Fixes: 4680816be336 ("drm/i915: Wait first for submission, before waiting for request completion") Fixes: 221fe7994554 ("drm/i915: Perform a direct reset of the GPU from the waiter") Cc: Chris Wilson Cc: Mika Kuoppala Cc: Joonas Lahtinen Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b0de36f11f6d..dd541fe71d0a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3471,6 +3471,11 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv) !gpu_reset_clobbers_display(dev_priv)) return; + /* We have a modeset vs reset deadlock, defensively unbreak it. + * + * FIXME: We can do a _lot_ better, this is just a first iteration.*/ + i915_gem_set_wedged(dev_priv); + /* * Need mode_config.mutex so that we don't * trample ongoing ->detect() and whatnot.