From: Ben Skeggs <bskeggs@redhat.com>
Date: Sun, 1 Feb 2015 23:08:14 +0000 (+1000)
Subject: drm/nouveau/device: post write to NV_PMC_BOOT_1 when flipping endian switch
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9fcaa149e7d264822f7ef748ca4a7af643d88ec9;p=linux.git

drm/nouveau/device: post write to NV_PMC_BOOT_1 when flipping endian switch

fdo#88868

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index 29bd539af183d..6efa8f38ff547 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -340,11 +340,13 @@ nvkm_devobj_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
 
 		/* switch mmio to cpu's native endianness */
 #ifndef __BIG_ENDIAN
-		if (ioread32_native(map + 0x000004) != 0x00000000)
+		if (ioread32_native(map + 0x000004) != 0x00000000) {
 #else
-		if (ioread32_native(map + 0x000004) == 0x00000000)
+		if (ioread32_native(map + 0x000004) == 0x00000000) {
 #endif
 			iowrite32_native(0x01000001, map + 0x000004);
+			ioread32_native(map);
+		}
 
 		/* read boot0 and strapping information */
 		boot0 = ioread32_native(map + 0x000000);