drm/nva3/clk: Abort when PLL doesn't lock
authorRoy Spliet <rspliet@eclipso.eu>
Thu, 21 Aug 2014 11:45:15 +0000 (13:45 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 15 Sep 2014 12:25:00 +0000 (22:25 +1000)
Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/clock/nva3.c

index c676de6d1da61d03a0e4bc31d39761f37a950063..fd00397bc15eb118116e48fd290e6b0ba809b1fa 100644 (file)
@@ -311,7 +311,11 @@ prog_pll(struct nva3_clock_priv *priv, int clk, u32 pll, int idx)
                nv_wr32(priv, coef, info->pll);
                nv_mask(priv, ctrl, 0x00000015, 0x00000015);
                nv_mask(priv, ctrl, 0x00000010, 0x00000000);
-               nv_wait(priv, ctrl, 0x00020000, 0x00020000);
+               if (!nv_wait(priv, ctrl, 0x00020000, 0x00020000)) {
+                       nv_mask(priv, ctrl, 0x00000010, 0x00000010);
+                       nv_mask(priv, src0, 0x00000101, 0x00000000);
+                       return;
+               }
                nv_mask(priv, ctrl, 0x00000010, 0x00000010);
                nv_mask(priv, ctrl, 0x00000008, 0x00000000);
                disable_clk_src(priv, src1);