Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp485281pxt; Fri, 6 Aug 2021 06:48:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnDLjWCLf01EV46gm8nl3+scZE01UgvsJNZaiLCDdkqtY1FhrqWbcWa4VqII2vH4hzP6Q4 X-Received: by 2002:a6b:7a04:: with SMTP id h4mr1334754iom.149.1628257722533; Fri, 06 Aug 2021 06:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628257722; cv=none; d=google.com; s=arc-20160816; b=BCLF0a8iBtr1cz1ZMQpXT/GXwtqeeUKdyRuBhuQpcm9FkUGKf2XmkMeNFDOwFHtX3w zmgvNRtoHEHkb2hWxxXvA1GMfp+Jf5hUIaEbpqkc03pzBS6crKBSjAM1FyM9vE3ffwBA S7dzBX0n2p7vSMpZ+UCVRH4rOQmz5gftIZ+BauBEB1EUoD0GUUXRDusU13NBze0ZsEW/ emwgIVR4BrPoJUz03+mi8zwQuP2evYijmHhdJbu8Y4CyKYewJADJGYYfl01hDkQfwl6w XmYa/Gl8exxk8vgp2I5Lye43SSv8GB9mqUIblx9iaO/5V7VTI2ZhdciB6s4bquyRPkSg +sRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yXleIXw3js2o91uvO0a8Y+wz3snyGxESTMsKIc6hjq4=; b=CXG23spuuGv2oY+I9xnng562+f3zrx3IRLEPFwed9Y9ed1kmd1tAr8ByuiL4R4L7D4 leousH/VuTZEHXzqn6sVb8IRMeDffSPs4Ob3T3LOIbUxm7EU7ZCBLnm/fUNA2XP86xua vhrVX7LrR6rOCYeq9FHxIeKm7iDHRLuKNeGlFLnOXU0SN2fqvTnXDFa1zumt9+aikkGh WYmXm0Q3/JvoHiDHqkzV0fOxcFz6w55zD+dSU7kZxH7yTUSENACjwp3QTzjfD7R9utbY vZ5xTTYSiKsw20RbUkHVCgb9ZMF1j01aqi9Rz9ImPFyYPC4NQqs5TdM8rMD/9u2JvZ/M mlNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W7aNKtir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si8862314jao.21.2021.08.06.06.48.28; Fri, 06 Aug 2021 06:48:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W7aNKtir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244227AbhHFIV4 (ORCPT + 99 others); Fri, 6 Aug 2021 04:21:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:48828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244168AbhHFITZ (ORCPT ); Fri, 6 Aug 2021 04:19:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E838461205; Fri, 6 Aug 2021 08:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237936; bh=SyoPct+cDIETvuJP9Nr39Sk4NZK825b0fa1JC9H3wwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7aNKtirHNFkE9pmLcJBO4pTIvP1ig0EN654jGhgnd/4WOV92QNdLeTWPcv8+99Hh /hywBBcQYdx7Rzhol0yrlXrlGF7LarAwPuBZO1AGfbqgA6iPjDwyDTwoJfe2L1dk9J C1gvpKhIk+YfkilsRXe2F9+LtJKnw7Sk4B7VE2N8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Ekstrand , Marcin Slusarz , Jason Ekstrand , Daniel Vetter , Jon Bloomfield , Rodrigo Vivi , Sasha Levin Subject: [PATCH 5.10 02/30] Revert "drm/i915: Propagate errors on awaiting already signaled fences" Date: Fri, 6 Aug 2021 10:16:40 +0200 Message-Id: <20210806081113.213387289@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.126861800@linuxfoundation.org> References: <20210806081113.126861800@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Ekstrand commit 3761baae908a7b5012be08d70fa553cc2eb82305 upstream. This reverts commit 9e31c1fe45d555a948ff66f1f0e3fe1f83ca63f7. Ever since that commit, we've been having issues where a hang in one client can propagate to another. In particular, a hang in an app can propagate to the X server which causes the whole desktop to lock up. Error propagation along fences sound like a good idea, but as your bug shows, surprising consequences, since propagating errors across security boundaries is not a good thing. What we do have is track the hangs on the ctx, and report information to userspace using RESET_STATS. That's how arb_robustness works. Also, if my understanding is still correct, the EIO from execbuf is when your context is banned (because not recoverable or too many hangs). And in all these cases it's up to userspace to figure out what is all impacted and should be reported to the application, that's not on the kernel to guess and automatically propagate. What's more, we're also building more features on top of ctx error reporting with RESET_STATS ioctl: Encrypted buffers use the same, and the userspace fence wait also relies on that mechanism. So it is the path going forward for reporting gpu hangs and resets to userspace. So all together that's why I think we should just bury this idea again as not quite the direction we want to go to, hence why I think the revert is the right option here. For backporters: Please note that you _must_ have a backport of https://lore.kernel.org/dri-devel/20210602164149.391653-2-jason@jlekstrand.net/ for otherwise backporting just this patch opens up a security bug. v2: Augment commit message. Also restore Jason's sob that I accidentally lost. v3: Add a note for backporters Signed-off-by: Jason Ekstrand Reported-by: Marcin Slusarz Cc: # v5.6+ Cc: Jason Ekstrand Cc: Marcin Slusarz Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3080 Fixes: 9e31c1fe45d5 ("drm/i915: Propagate errors on awaiting already signaled fences") Acked-by: Daniel Vetter Reviewed-by: Jon Bloomfield Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210714193419.1459723-3-jason@jlekstrand.net (cherry picked from commit 93a2711cddd5760e2f0f901817d71c93183c3b87) Signed-off-by: Rodrigo Vivi Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/i915_request.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 0e813819b041..d8fef42ca38e 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -1285,10 +1285,8 @@ i915_request_await_execution(struct i915_request *rq, do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } if (fence->context == rq->fence.context) continue; @@ -1386,10 +1384,8 @@ i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) do { fence = *child++; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - i915_sw_fence_set_error_once(&rq->submit, fence->error); + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) continue; - } /* * Requests on the same timeline are explicitly ordered, along -- 2.30.2