diff options
-rw-r--r-- | drivers/gpu/drm/drm_cache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index bb8f58012189..c518fb6cfb63 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c | |||
@@ -32,6 +32,12 @@ | |||
32 | #include <drm/drmP.h> | 32 | #include <drm/drmP.h> |
33 | 33 | ||
34 | #if defined(CONFIG_X86) | 34 | #if defined(CONFIG_X86) |
35 | |||
36 | /* | ||
37 | * clflushopt is an unordered instruction which needs fencing with mfence or | ||
38 | * sfence to avoid ordering issues. For drm_clflush_page this fencing happens | ||
39 | * in the caller. | ||
40 | */ | ||
35 | static void | 41 | static void |
36 | drm_clflush_page(struct page *page) | 42 | drm_clflush_page(struct page *page) |
37 | { | 43 | { |
@@ -44,7 +50,7 @@ drm_clflush_page(struct page *page) | |||
44 | 50 | ||
45 | page_virtual = kmap_atomic(page); | 51 | page_virtual = kmap_atomic(page); |
46 | for (i = 0; i < PAGE_SIZE; i += size) | 52 | for (i = 0; i < PAGE_SIZE; i += size) |
47 | clflush(page_virtual + i); | 53 | clflushopt(page_virtual + i); |
48 | kunmap_atomic(page_virtual); | 54 | kunmap_atomic(page_virtual); |
49 | } | 55 | } |
50 | 56 | ||