Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4080448imu; Tue, 18 Dec 2018 08:45:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vd3WjOyHPvPdP9Q3Y8DuGSzK6RC09GxDHGTsctW0NuiXYQS9ZE/FGS9gqcLJ8WoIAdfO74 X-Received: by 2002:a63:d157:: with SMTP id c23mr16278339pgj.170.1545151518817; Tue, 18 Dec 2018 08:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545151518; cv=none; d=google.com; s=arc-20160816; b=OgUykd2FJgKQlnQlJOPwZ1UG+LwN4i0IDG0ZMuCQWGFmT/dbGPAwPOcb0X+kCUV8iS v9ir/8nTB9foiBwEO0B0LigwsIb3xlDbBY5UqkzJXU9XNZUhmdOsdmDOOS4XcK6L7XMC 8oBWyAkw2h7LPGS7mlXMO3SiQQLVXgJPHcq25doG5nO8vCMy7u3lllEO0rtnu3j8L0n0 CO1KARq0JeJw5BFw+ukc4TThiZ0Kc/uff8H7dbKBAx+s1RHBa/iubgzrXquaXnk7SpVb KYuBLcrtp5kMuWUozpwkx+sAqyhox80ETj3WLiOlrLSwfQQ6suXoIqMkOVLYr6FvOYI1 uCgQ== 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=VIrlE+GY+ZFh0R1ygpHmHxiKNG3IQrlhk0strd/eedA=; b=WamrIMjkJKMw5hA2MkWobBuC0nSVo8cBtlzNDvsxeHs77YHyV6fFMzv6+fudi0NCvu DnHpLnM81LHTlZZW3QN17tgy6Csb8sNjrWG9be5cc0IL6c7SJ5mBW25eqOckQS0e21+7 YlHsJmSble5cDR3RD4wvxoEmSd9nusaWdztmbUmrv8MkWXr4Istoqzni7EmBFsw1KxKJ yKOsLlbvlME5vMAQHQbb2BhCph9UamGtJ5FO6cOObY4QB7iR039O+87p8ugmNncNqpLt 5PdqX3U+nLle3AaWLFUqRhyn1vNS/LwLR8+kcGRaNEStxpwviBzmVkeg7TIHFYcnXqsi PEWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=egKN3Nrf; 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 f34si11443860ple.280.2018.12.18.08.44.57; Tue, 18 Dec 2018 08:45:18 -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=egKN3Nrf; 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 S1727530AbeLRQla (ORCPT + 99 others); Tue, 18 Dec 2018 11:41:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:38944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeLRQl1 (ORCPT ); Tue, 18 Dec 2018 11:41: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 4194F218A2; Tue, 18 Dec 2018 16:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545151286; bh=RTGjUgXmLk3+fJYRp0agh7q+R0Cs/2uN3T/tUCsbrKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=egKN3NrfVKgPD62WMWD6vRsqOIZD12ll7CJxRaLHIxSIw0jcSU9jd8naC2pGAIgra BHH/T2pcg4EHvSCf1mqgZ6TPQa9o+X5JKpP5UUOwYTZWz8r2OScKFkS5WQ1nHvmFps us8aYJsEJy7G1gzlt4hyRKFueM99I2Di9OledQ6E= 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.19 37/44] drm/i915/execlists: Apply a full mb before execution for Braswell Date: Tue, 18 Dec 2018 17:39:49 +0100 Message-Id: <20181218163931.750845579@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181218163927.119623235@linuxfoundation.org> References: <20181218163927.119623235@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.19-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 @@ -442,8 +442,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; }