diff options
| -rw-r--r-- | drivers/gpu/drm/drm_cache.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index a6b690626a6b..9a62d7a53553 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <drm/drmP.h> | 32 | #include <drm/drmP.h> |
| 33 | 33 | ||
| 34 | #if defined(CONFIG_X86) | 34 | #if defined(CONFIG_X86) |
| 35 | #include <asm/smp.h> | ||
| 35 | 36 | ||
| 36 | /* | 37 | /* |
| 37 | * clflushopt is an unordered instruction which needs fencing with mfence or | 38 | * clflushopt is an unordered instruction which needs fencing with mfence or |
| @@ -64,12 +65,6 @@ static void drm_cache_flush_clflush(struct page *pages[], | |||
| 64 | drm_clflush_page(*pages++); | 65 | drm_clflush_page(*pages++); |
| 65 | mb(); | 66 | mb(); |
| 66 | } | 67 | } |
| 67 | |||
| 68 | static void | ||
| 69 | drm_clflush_ipi_handler(void *null) | ||
| 70 | { | ||
| 71 | wbinvd(); | ||
| 72 | } | ||
| 73 | #endif | 68 | #endif |
| 74 | 69 | ||
| 75 | void | 70 | void |
| @@ -82,7 +77,7 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages) | |||
| 82 | return; | 77 | return; |
| 83 | } | 78 | } |
| 84 | 79 | ||
| 85 | if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0) | 80 | if (wbinvd_on_all_cpus()) |
| 86 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); | 81 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); |
| 87 | 82 | ||
| 88 | #elif defined(__powerpc__) | 83 | #elif defined(__powerpc__) |
| @@ -121,7 +116,7 @@ drm_clflush_sg(struct sg_table *st) | |||
| 121 | return; | 116 | return; |
| 122 | } | 117 | } |
| 123 | 118 | ||
| 124 | if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0) | 119 | if (wbinvd_on_all_cpus()) |
| 125 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); | 120 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); |
| 126 | #else | 121 | #else |
| 127 | printk(KERN_ERR "Architecture has no drm_cache.c support\n"); | 122 | printk(KERN_ERR "Architecture has no drm_cache.c support\n"); |
| @@ -144,7 +139,7 @@ drm_clflush_virt_range(void *addr, unsigned long length) | |||
| 144 | return; | 139 | return; |
| 145 | } | 140 | } |
| 146 | 141 | ||
| 147 | if (on_each_cpu(drm_clflush_ipi_handler, NULL, 1) != 0) | 142 | if (wbinvd_on_all_cpus()) |
| 148 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); | 143 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); |
| 149 | #else | 144 | #else |
| 150 | printk(KERN_ERR "Architecture has no drm_cache.c support\n"); | 145 | printk(KERN_ERR "Architecture has no drm_cache.c support\n"); |
