aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2016-11-07 20:54:24 -0500
committerBen Skeggs <bskeggs@redhat.com>2016-11-16 18:50:37 -0500
commit920c58a7119bb5d23d21f361a395acb79e693521 (patch)
tree05916b06b076efaf67935fb0c507315dffe10afc
parentd91ccec63116cb90a95d48ae85a68e892e15c433 (diff)
drm/nouveau/devinit/gm200: replace while loops with PTIMER-based timeout loops
It appears to be safe to access PTIMER on an unposted board with newer chipsets. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c
index a410c0db8a08..d749278b4332 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c
@@ -26,6 +26,7 @@
26#include <subdev/bios.h> 26#include <subdev/bios.h>
27#include <subdev/bios/bit.h> 27#include <subdev/bios/bit.h>
28#include <subdev/bios/pmu.h> 28#include <subdev/bios/pmu.h>
29#include <subdev/timer.h>
29 30
30static void 31static void
31pmu_code(struct nv50_devinit *init, u32 pmu, u32 img, u32 len, bool sec) 32pmu_code(struct nv50_devinit *init, u32 pmu, u32 img, u32 len, bool sec)
@@ -128,8 +129,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post)
128 nvkm_mask(device, 0x000200, 0x00002000, 0x00000000); 129 nvkm_mask(device, 0x000200, 0x00002000, 0x00000000);
129 nvkm_mask(device, 0x000200, 0x00002000, 0x00002000); 130 nvkm_mask(device, 0x000200, 0x00002000, 0x00002000);
130 nvkm_rd32(device, 0x000200); 131 nvkm_rd32(device, 0x000200);
131 while (nvkm_rd32(device, 0x10a10c) & 0x00000006) { 132 if (nvkm_msec(device, 2000,
132 } 133 if (!(nvkm_rd32(device, 0x10a10c) & 0x00000006))
134 break;
135 ) < 0)
136 return -ETIMEDOUT;
133 } 137 }
134 138
135 ret = pmu_load(init, 0x04, post, &exec, &args); 139 ret = pmu_load(init, 0x04, post, &exec, &args);
@@ -156,8 +160,11 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post)
156 if (post) { 160 if (post) {
157 nvkm_wr32(device, 0x10a040, 0x00005000); 161 nvkm_wr32(device, 0x10a040, 0x00005000);
158 pmu_exec(init, exec); 162 pmu_exec(init, exec);
159 while (!(nvkm_rd32(device, 0x10a040) & 0x00002000)) { 163 if (nvkm_msec(device, 2000,
160 } 164 if (nvkm_rd32(device, 0x10a040) & 0x00002000)
165 break;
166 ) < 0)
167 return -ETIMEDOUT;
161 } 168 }
162 169
163 /* load and execute some other ucode image (bios therm?) */ 170 /* load and execute some other ucode image (bios therm?) */