Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp575617imu; Thu, 20 Dec 2018 01:40:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4qLAHKpsqr7O/cPwfVFUhh7XvziI2N9vRi+bcPd4KW/SDv/M66Hljdhc7eoT7UreC/eOi X-Received: by 2002:a63:2406:: with SMTP id k6mr21719708pgk.229.1545298832968; Thu, 20 Dec 2018 01:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545298832; cv=none; d=google.com; s=arc-20160816; b=CGiw1FOQpTczdlbbNI3QZAb9z00Vu+mUL3moc3scQ3j1nsDqpeI+geibYhbVZPmV/0 WWdb/z5a7YvbydDR6cVVdbCmdiM2+0OOLlNOs7LaM5n0paUJcW4wx886fZ8sJkfZpS1s ZYMME9c2P1luLifwiivaH+ck/v4PQD3HDU2ebb9k3geA7c/qEl7DrYPU72YrRMD7Prku l4xMgbj+/MidwGB7FLUE1pr8gy6hPnLHCZADRIPUgmDDI3rZlTK4lWtLcqp6Py59Be/L fWs7uCvWvm/kSlq9A7VFeRX0iF78PWElWQ3ArHlrTErFPYIWRgovLCVRSygjrTA7jj1Y kSsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c8ykeBOJVNoA0Ho5RRTswOP0G2vEW5xsznZS3WFrxgE=; b=S8XWViJNR3kfRJVhYjb2MFBdBTPQ36Ytax/WYDKOCch32DjL5JH4W1nKtSLIK8OHm6 AtTwnRJ0p8B/BSFXHhlek4eLBN4KrJxQWJb94B1ZLMfhqShgREox43xeuUTXajBy5Als 78zP5/fC9dmm1Hy47B4yOMY3CWndZdgWDt2DEPBSCpT05S/sRdnRF6P0Q2jJA6BSL5yV 8AdvbRlFAwC/1aRFmf8V2Y4iXNZfFoEHsanPk7ZxbaoLTVmZ3Ie3Whya1fA+m4IcWMgJ M2z2Yq9/rZ3igKDViGb1/lCLdVuIFyk61TtiOYlH8uOeOh4Jc8u4Kutqb/1+/Cd3Lxmw TgHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uD26uI28; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k186si18908779pgc.576.2018.12.20.01.40.17; Thu, 20 Dec 2018 01:40:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uD26uI28; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731999AbeLTJZ4 (ORCPT + 99 others); Thu, 20 Dec 2018 04:25:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:49288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731272AbeLTJZx (ORCPT ); Thu, 20 Dec 2018 04:25:53 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6CE97217D7; Thu, 20 Dec 2018 09:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545297952; bh=XQcIXmM4zyw7Gr2425pipSwHuaDiMO8642yEr1ymNT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uD26uI284JeOokLtcNoEc5aTerD6ATIQkE2kejNnSg1fp5zr2PDWbX/0iQdbLJx8V rc3NzZi80VLW0ds25Stke1uZf/feRVldebjAwywrREO8ghk2beU8ZWUYZpmmSyM68Z 2Y9rtR4baIEbQLSSrGhkwFQ+60foiw3DanEfs250= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Mika Kuoppala , Tvrtko Ursulin , Joonas Lahtinen Subject: [PATCH 4.14 17/72] drm/i915/execlists: Apply a full mb before execution for Braswell Date: Thu, 20 Dec 2018 10:18:16 +0100 Message-Id: <20181220085923.012748508@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Wilson commit cf66b8a0ba142fbd1bf10ac8f3ae92d1b0cb7b8f upstream. Braswell is really picky about having our writes posted to memory before we execute or else the GPU may see stale values. A wmb() is insufficient as it only ensures the writes are visible to other cores, we need a full mb() to ensure the writes are in memory and visible to the GPU. The most frequent failure in flushing before execution is that we see stale PTE values and execute the wrong pages. References: 987abd5c62f9 ("drm/i915/execlists: Force write serialisation into context image vs execution") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: stable@vger.kernel.org Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20181206084431.9805-3-chris@chris-wilson.co.uk (cherry picked from commit 490b8c65b9db45896769e1095e78725775f47b3e) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_lrc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -343,8 +343,13 @@ static u64 execlists_update_context(stru * may not be visible to the HW prior to the completion of the UC * register write and that we may begin execution from the context * before its image is complete leading to invalid PD chasing. + * + * Furthermore, Braswell, at least, wants a full mb to be sure that + * the writes are coherent in memory (visible to the GPU) prior to + * execution, and not just visible to other CPUs (as is the result of + * wmb). */ - wmb(); + mb(); return ce->lrc_desc; }