Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp578211imu; Thu, 20 Dec 2018 01:44:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/VC7+yISPA4vVzICh4zT/d5odzT1n3tM32Qp9V6An6zG2JHs3pYHSTXLZyWQIMTV139qSYg X-Received: by 2002:a62:1a91:: with SMTP id a139mr15045709pfa.64.1545299045639; Thu, 20 Dec 2018 01:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545299045; cv=none; d=google.com; s=arc-20160816; b=qylZaDBaSneT/tZkTmBieuAocz2T1a8QEuGvlDGNe6uw3Uava6a+MxcPRETnCG1Fu1 E8HZH9of3j6fO7rUy7DCdPbkCRnFwhcP2d7x83h1UdHzz+dhptvKrPc8R+a4zIWyKiYU B38Qm4HbHDEikQuywMh0JK0ycptz+wyrsTdea7kjAjhhJDUygSvnWta1XcbnncGnocn2 YReNG4vRIrpYk9XkQGKsHGfMuA4Mx8teNkQ5DVqPQ1cw7oVpg3wm5+si2ikglUUlyyC3 BTizT4bDlevKtC8shfqfn5VSrrNe3oozSE7JqBKEUrjfx6GwjPlyDClBzDjahNnuDEo6 xdtg== 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=v++9bTA6oJcjyxblhZsC3dzy7QEM1aGflyZ/EQccTbk=; b=zizRlqzLFzhdxNleIbT21umcM1D2+IkTXCy9bIqBpaT+Rd9I6a5mwh5T2F0cER6zJC 57X2doC7CqWVIakrjdB8e7eu9NJrRTRs6hX51I6OEjBPm4eFhyCfSXI25twwN3IxYX5p 3VS2O+PAfChpGCE4vRyaZHuTtw86UJhd82iDy42IIi0tFlwnoNYS96qFoy4ut8wdlby1 CW0fN1xijCcY0wqvLEqHZc0oLHYy3V084ijaArUUXXYrp8Cx6cd6y9alNE911/pDcM1c goO38x8x1HPB+VRH6XiABvfe4x96Cvw6pqD3XnvL6anXS70ZkUMIpCCpUpR+EkHQ6vqA zT6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ma4oRRQh; 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 v5si17218500ply.74.2018.12.20.01.43.50; Thu, 20 Dec 2018 01:44:05 -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=Ma4oRRQh; 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 S1731937AbeLTJma (ORCPT + 99 others); Thu, 20 Dec 2018 04:42:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:53630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731556AbeLTJX1 (ORCPT ); Thu, 20 Dec 2018 04:23:27 -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 5C7F92177B; Thu, 20 Dec 2018 09:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545297806; bh=IzAOZSxeSOyHM5GeQBuEmiO3601NTm3LmpBUMWbv6eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ma4oRRQh1Nhh1KVCzWOvIyA1vt08Gd25kjA1VDMh0eZCJQBxmv7mH9EF5gIPFgw2R e6ZAxx0qDpkuBbdb0KJmx+Gh4gb5cZyZCnN7KJTITm6pojmDSjnLELtX8b39F0oX4r L2Xq1p54HymkdTM8gxE0QbF0S4GNmD+w0b0ac1/o= 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.9 16/61] drm/i915/execlists: Apply a full mb before execution for Braswell Date: Thu, 20 Dec 2018 10:18:16 +0100 Message-Id: <20181220085844.383286101@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085843.743900603@linuxfoundation.org> References: <20181220085843.743900603@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.9-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 @@ -386,8 +386,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; }