From patchwork Wed Jul 19 12:54:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9851943 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 5D3A960392 for ; Wed, 19 Jul 2017 12:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FF2628641 for ; Wed, 19 Jul 2017 12:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44C9C2864A; Wed, 19 Jul 2017 12:55:44 +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=unavailable 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 C9ADF28641 for ; Wed, 19 Jul 2017 12:55:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92E316E526; Wed, 19 Jul 2017 12:55:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 51B906E51B for ; Wed, 19 Jul 2017 12:55:16 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id m4so568082wmi.4 for ; Wed, 19 Jul 2017 05:55:16 -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=CWsIe+CUB9jCfltmQ0tLBYha0k/KzozNpy9W/AfSdxk=; b=En6kK/XGQoMSmf0ixf9N/r5pPtXYGFyECmmQn5DepSqjyo35SeBt5kzoPbny+tJ4nc WE2IUXXcSIHsirYx7uSC3EU7n3qGdoP3HoL0K1jELGx93QS7JPPsBg0V1GdSt9i1pLPb ZMzwURGHgpUWHGpge2wLRzEyZlpNN57oNi1do= 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=CWsIe+CUB9jCfltmQ0tLBYha0k/KzozNpy9W/AfSdxk=; b=iev5onqEk19EVtv1sfQAjF0JQMGOnV2trrVcx9DoMCn2H2x+Id0E7N3A07Upj8h9MM eMkdbZ0rJAFjBrinzpDZdV8soUBSy8l1LZIIjZwLZvrwF6y84etD9EgJAV4U4Phvlnpd lEEGjEuKO5At8t9/xtptWkDPR+X4YTci8sSXfkcD/9tOJc5r02BiBT+sh4kFd/8JLCeR 7HRgQMjFVy5bRqB2kZdEDj0oVmja1WIYBfcO4iUga6+MiFG29UxElzSTdDpbYqqZBMPm GP5EjFJbEmz1k3CmPEccVLnfheYpQe4c8vosNeBIlZ5xX3jOy6cTLdlD+FRrqWJdGBAi JrZQ== X-Gm-Message-State: AIVw110a1H4E26M4FyjkTWg7ApBVngocO5lUjhE2u0mDQ1YIXgTVimoT s/+hFBoJ5f5qYVP8H7U= X-Received: by 10.80.220.203 with SMTP id v11mr356649edk.253.1500468914719; Wed, 19 Jul 2017 05:55:14 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id e46sm3069420edd.26.2017.07.19.05.55.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jul 2017 05:55:13 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/9] drm/i915: Avoid the gpu reset vs. modeset deadlock Date: Wed, 19 Jul 2017 14:54:56 +0200 Message-Id: <20170719125502.25696-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170719125502.25696-1-daniel.vetter@ffwll.ch> References: <20170719125502.25696-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Joonas Lahtinen , Daniel Vetter , Mika Kuoppala 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 ... 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 97777ffa1566..010a1f3e000c 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.