linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: gurchetansingh@chromium.org (Gurchetan Singh)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] drm/vgem: flush page during page fault
Date: Tue, 23 Jan 2018 18:56:05 -0800	[thread overview]
Message-ID: <20180124025606.3020-4-gurchetansingh@chromium.org> (raw)
In-Reply-To: <20180124025606.3020-2-gurchetansingh@chromium.org>

This is required to use buffers allocated by vgem on AMD and ARM devices.
We're experiencing a case where eviction of the cache races with userspace
writes. To fix this, flush the cache after retrieving a page.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
 drivers/gpu/drm/vgem/vgem_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 802a97e1a4bf..ed6db7218f04 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -112,6 +112,7 @@ static int vgem_gem_fault(struct vm_fault *vmf)
 				break;
 		}
 
+		drm_flush_pages(&page, 1);
 	}
 	return ret;
 }
-- 
2.13.5

  parent reply	other threads:[~2018-01-24  2:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  2:56 [PATCH 2/5] drm: add ARM flush implementation Gurchetan Singh
2018-01-24  2:56 ` [PATCH 3/5] drm: add ARM64 flush implementations Gurchetan Singh
2018-01-24 12:00   ` Robin Murphy
2018-01-24 12:36     ` Russell King - ARM Linux
2018-01-24 13:14       ` Robin Murphy
2018-01-30  9:53     ` Daniel Vetter
2018-01-24  2:56 ` Gurchetan Singh [this message]
2018-01-24  2:56 ` [PATCH 5/5] drm: use drm_flush_sg where possible Gurchetan Singh
2018-01-24 11:50 ` [PATCH 2/5] drm: add ARM flush implementation Lucas Stach
2018-01-24 12:45 ` Russell King - ARM Linux
     [not found]   ` <CAAfnVBkwmrcr14ZhmhgAnLHwL8zotnnCeWAVwBGmVcU9oGRerA@mail.gmail.com>
2018-01-24 19:26     ` Russell King - ARM Linux
2018-01-24 23:43       ` Gurchetan Singh
2018-01-25 14:06       ` Thierry Reding
2018-01-30 10:14 ` Daniel Vetter
2018-01-30 11:31   ` Russell King - ARM Linux
2018-01-30 12:27     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124025606.3020-4-gurchetansingh@chromium.org \
    --to=gurchetansingh@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).