[PATCH igt] igt/gen7_forcewake_mt: Make the mmio register as volatile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prevent the compiler from caching reads/writes to the hw register as we
do want to perform mmio.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 tests/gen7_forcewake_mt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/gen7_forcewake_mt.c b/tests/gen7_forcewake_mt.c
index 07320ef9e..8a23d13e0 100644
--- a/tests/gen7_forcewake_mt.c
+++ b/tests/gen7_forcewake_mt.c
@@ -106,8 +106,9 @@ static void *igfx_get_mmio(void)
 static void *thread(void *arg)
 {
 	struct thread *t = arg;
-	uint32_t *forcewake_mt = (uint32_t *)((char *)t->mmio + FORCEWAKE_MT);
-	uint32_t bit = 1 << t->bit;
+	const uint32_t bit = 1 << t->bit;
+	volatile uint32_t *forcewake_mt =
+		(volatile uint32_t *)((char *)t->mmio + FORCEWAKE_MT);
 
 	while (1) {
 		*forcewake_mt = bit << 16 | bit;
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux