Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 11:02:22 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: i915_utils.h

Log Message:
(XXX unsure) attempt to match linux with additional parameter OP

Author: Maya Rashish <m...@netbsd.org>
Committer: Taylor R Campbell <riastr...@netbsd.org>


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h:1.3 src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h:1.4
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h:1.3	Sun Dec 19 09:59:13 2021
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_utils.h	Sun Dec 19 11:02:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_utils.h,v 1.3 2021/12/19 09:59:13 riastradh Exp $	*/
+/*	$NetBSD: i915_utils.h,v 1.4 2021/12/19 11:02:22 riastradh Exp $	*/
 
 /*
  * Copyright © 2016 Intel Corporation
@@ -299,11 +299,14 @@ wait_remaining_ms_from_jiffies(unsigned 
  * check the condition before the timeout.
  */
 #ifdef __NetBSD__
-#define _wait_for(COND, MS, Wmin, Wmax) ({ \
+#define __wait_for(OP, COND, MS, Wmin, Wmax) ({ \
 	int ret__ = 0;							\
 	if (cold) {							\
 		int ms = (MS);						\
 		while (!(COND)) {					\
+			OP;						\
+			/* Guarantee COND check prior to timeout */	\
+			barrier();					\
 			if (--ms < 0) {					\
 				DELAY(1000);				\
 				if (!(COND))				\
@@ -315,6 +318,9 @@ wait_remaining_ms_from_jiffies(unsigned 
 	} else {							\
 		unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \
 		while (!(COND)) {					\
+			OP;						\
+			/* Guarantee COND check prior to timeout */	\
+			barrier();					\
 			if (time_after(jiffies, timeout__)) {		\
 				if (!(COND))				\
 					ret__ = -ETIMEDOUT;		\

Reply via email to