Skip to contentSkip to conversation

drm/gpu: Add comment for memory barrier

PATCH Applied Bhanusree 2 participants 2 messages Oct 24, 2019

Subsystems (2)
lore
Share & tools
lore

Bhanusree

author
#0 lore raw

PATCH v2 1/1 drm/gpu: Add comment for memory barrier

-Add comment for memory barrier
-Issue found using checkpatch.pl

---

v2:modified memory barrier comments appropriately

 drivers/gpu/drm/drm_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_cache.c +2 -2
index 3bd76e9..e574261 100644
@@ -62,10 +62,10 @@ static void drm_cache_flush_clflush(struct page *pages[],
 {
 	unsigned long i;
 
-	mb();
+	mb(); /*Full memory barrier used before so that CLFLUSH is ordered*/
 	for (i = 0; i < num_pages; i++)
 		drm_clflush_page(*pages++);
-	mb();
+	mb(); /*Also used after CLFLUSH so that all cache is flushed*/
 }
 #endif
 
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 7 lines · Bhanusree
(quoted diff) +0 -2
-Add comment for memory barrier
-Issue found using checkpatch.pl

---

v2:modified memory barrier comments appropriately

Applied, thanks.
-Daniel

Quoted 24 lines
 drivers/gpu/drm/drm_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_cache.c +2 -2
index 3bd76e9..e574261 100644
@@ -62,10 +62,10 @@ static void drm_cache_flush_clflush(struct page *pages[],
 {
 	unsigned long i;
 
-	mb();
+	mb(); /*Full memory barrier used before so that CLFLUSH is ordered*/
 	for (i = 0; i < num_pages; i++)
 		drm_clflush_page(*pages++);
-	mb();
+	mb(); /*Also used after CLFLUSH so that all cache is flushed*/
 }
 #endif
 
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel