Commit c6a5f8da authored by Bhanusree's avatar Bhanusree Committed by Daniel Vetter

drm/gpu: Fix Memory barrier without comment Issue

-Issue found using checkpatch.pl
-Insert comments for memory barrier usage
Signed-off-by: default avatarBhanusree <bhanusreemahesh@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1571984858-4644-1-git-send-email-bhanusreemahesh@gmail.com
parent e109c6db
...@@ -126,10 +126,10 @@ drm_clflush_sg(struct sg_table *st) ...@@ -126,10 +126,10 @@ drm_clflush_sg(struct sg_table *st)
if (static_cpu_has(X86_FEATURE_CLFLUSH)) { if (static_cpu_has(X86_FEATURE_CLFLUSH)) {
struct sg_page_iter sg_iter; struct sg_page_iter sg_iter;
mb(); mb(); /*CLFLUSH is ordered only by using memory barriers*/
for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) for_each_sg_page(st->sgl, &sg_iter, st->nents, 0)
drm_clflush_page(sg_page_iter_page(&sg_iter)); drm_clflush_page(sg_page_iter_page(&sg_iter));
mb(); mb(); /*Make sure that all cache line entry is flushed*/
return; return;
} }
...@@ -160,11 +160,11 @@ drm_clflush_virt_range(void *addr, unsigned long length) ...@@ -160,11 +160,11 @@ drm_clflush_virt_range(void *addr, unsigned long length)
void *end = addr + length; void *end = addr + length;
addr = (void *)(((unsigned long)addr) & -size); addr = (void *)(((unsigned long)addr) & -size);
mb(); mb(); /*CLFLUSH is only ordered with a full memory barrier*/
for (; addr < end; addr += size) for (; addr < end; addr += size)
clflushopt(addr); clflushopt(addr);
clflushopt(end - 1); /* force serialisation */ clflushopt(end - 1); /* force serialisation */
mb(); mb(); /*Ensure that evry data cache line entry is flushed*/
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment