projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3085982
)
drm/i915: Add compiler barrier to wait_for
author
Mika Kuoppala
<
[email protected]
>
Mon, 23 Apr 2018 11:37:54 +0000
(14:37 +0300)
committer
Mika Kuoppala
<
[email protected]
>
Tue, 24 Apr 2018 12:46:27 +0000
(15:46 +0300)
We need to be careful to not let compiler evaluate
the expiration and the operation on it's terms.
Document and enforce that COND will be evaluated
before checking timeout expiration.
Suggested-by: Chris Wilson <
[email protected]
>
Cc: Chris Wilson <
[email protected]
>
Signed-off-by: Mika Kuoppala <
[email protected]
>
Reviewed-by: Chris Wilson <
[email protected]
>
Link:
https://patchwork.freedesktop.org/patch/msgid/
[email protected]
drivers/gpu/drm/i915/intel_drv.h
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/intel_drv.h
b/drivers/gpu/drm/i915/intel_drv.h
index 33ff2638c92bbf92641b2d19f7ed5311f5a182c0..58868b93d2a0967eda5ce61b85f279593e2c1cd2 100644
(file)
--- a/
drivers/gpu/drm/i915/intel_drv.h
+++ b/
drivers/gpu/drm/i915/intel_drv.h
@@
-56,6
+56,8
@@
for (;;) { \
const bool expired__ = ktime_after(ktime_get_raw(), end__); \
OP; \
+ /* Guarantee COND check prior to timeout */ \
+ barrier(); \
if (COND) { \
ret__ = 0; \
break; \
@@
-96,6
+98,8
@@
u64 now = local_clock(); \
if (!(ATOMIC)) \
preempt_enable(); \
+ /* Guarantee COND check prior to timeout */ \
+ barrier(); \
if (COND) { \
ret = 0; \
break; \