From patchwork Mon May 2 15:40:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 8993421 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA1809F1C1 for ; Mon, 2 May 2016 15:41:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A4C120219 for ; Mon, 2 May 2016 15:41:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 302F7201C7 for ; Mon, 2 May 2016 15:41:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF13C6E607; Mon, 2 May 2016 15:41:07 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04A516E606; Mon, 2 May 2016 15:41:06 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id e201so17606895wme.2; Mon, 02 May 2016 08:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=/qmWSl3gn14T4Vhg+7aSwpD6Vt4K7yGib8Qu5XePJZo=; b=coF8G0HUa/QaNpO1ccwPa4HGIhfX9639cXbJ/LrPdyIYfjQSbAIeYEmLJF9h0DlU7/ +mXrUvO+B+RnJDNM9jr5C+YPZJ1EuLU11zfHIAqSYNSYDXea0zoF76hiS9TGJY02qOZU 0HAiV5qck7lXbzKBvtLh/x8/v4anZRYaUCASk5Gk7bxxG+oOAYz2N6mxrSYfqeEYRPDh EdO8lIxdNFZ+mpmQCIJJ1+GK2KvIpI+gtK0WDJLKOHyTVvKYWQNL3khNfDcTpp3nDEgu YLd4rZ3rx0Q8UbqG/fc23wRp3FRdfM2pwDz+3wrIH5zC2kFM5v4DBdONutIhmVQWn7Wx hzNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=/qmWSl3gn14T4Vhg+7aSwpD6Vt4K7yGib8Qu5XePJZo=; b=P84mpaHqBfmlsVhk+eWfpS9ePTTEdYUukDsf2d0JwaWBtvffljcClblhTvcfzJlztb UnXn60NIrhuJ90rRZZR/aK+JVOTYgVhVksQWhMlX3eJRti+EC1W8Mi/AlKda5ef8S3rD wBWFCYVX69PWVdrfgH9hWXKJtM8LK/AtMMH55n4wkwCW2wf3ZrHFoUfdIhriXwVJ8l3s ZaHrxRGf9DWHah4La71IMsSdsTELYhG9xj66UkvEBwJPppndqjgnmznFBHfBxvPKnIkn xENYyamTTU1ExGJyu1qZocYzK6YiBqNAq7DzPYnDK6shiJBDUqgSzGULqMCjvdql+At5 7ZZg== X-Gm-Message-State: AOPr4FU1sa3iJ4axDfK2RbY7Uz1CzNhMO5YQVLtk+bkGPO96To+FhsZH+uHNJeiMB1l8vg== X-Received: by 10.194.15.8 with SMTP id t8mr16337473wjc.177.1462203664577; Mon, 02 May 2016 08:41:04 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id r123sm19436755wmg.20.2016.05.02.08.41.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 08:41:03 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 2 May 2016 16:40:51 +0100 Message-Id: <1462203651-26457-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, Jason Ekstrand , Akash Goel , stable@vger.kernel.org Subject: [Intel-gfx] [CI-resend] drm: Restore double clflush on the last partial cacheline X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This effectively reverts commit afcd950cafea6e27b739fe7772cbbeed37d05b8b Author: Chris Wilson Date: Wed Jun 10 15:58:01 2015 +0100 drm: Avoid the double clflush on the last cache line in drm_clflush_virt_range() as we have observed issues with serialisation of the clflush operations on Baytrail+ Atoms with partial updates. Applying the double flush on the last cacheline forces that clflush to be ordered with respect to the previous clflush, and the mfence then protects against prefetches crossing the clflush boundary. The same issue can be demonstrated in userspace with igt/gem_exec_flush. Fixes: afcd950cafea6 (drm: Avoid the double clflush on the last cache...) Testcase: igt/gem_concurrent_blit Testcase: igt/gem_partial_pread_pwrite Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92845 Signed-off-by: Chris Wilson Cc: dri-devel@lists.freedesktop.org Cc: Akash Goel Cc: Imre Deak Cc: Daniel Vetter Cc: Jason Ekstrand Cc: stable@vger.kernel.org Reviewed-by: Mika Kuoppala --- Just a quick resend to test this patch against BAT with the new gem_exec_flush test cases. -Chris --- drivers/gpu/drm/drm_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 6743ff7dccfa..7f4a6c550319 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -136,6 +136,7 @@ drm_clflush_virt_range(void *addr, unsigned long length) mb(); for (; addr < end; addr += size) clflushopt(addr); + clflushopt(end - 1); /* force serialisation */ mb(); return; }