drm/nouveau: don't use the default pll limits in table v2.1 on nv50+ cards
authorEmil Velikov <eeydev@nottingham.ac.uk>
Sun, 26 Sep 2010 19:26:02 +0000 (20:26 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 4 Oct 2010 23:59:34 +0000 (09:59 +1000)
This fixes issues bug 30370 and prevents another possible divide by zero on
the original nv50 cards, by returning -ENOENT

Signed-off-by: Emil Velikov <eeydev@nottingham.ac.uk>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bios.c

index c66d4567a2ed3eb30b5a7d2967c2a01c9c840d7d..53f4eba65cb91d35aa3fcbc9441defa4afe576f4 100644 (file)
@@ -4890,6 +4890,12 @@ int get_pll_limits(struct drm_device *dev, uint32_t limit_match, struct pll_lims
                                break;
                        }
 
+               if ((dev_priv->card_type >= NV_50) && (pllindex == 0)) {
+                       NV_ERROR(dev, "Register 0x%08x not found in PLL "
+                                "limits table", pll_lim->reg);
+                       return -ENOENT;
+               }
+
                pll_rec = &bios->data[plloffs + recordlen * pllindex];
 
                BIOSLOG(bios, "Loading PLL limits for reg 0x%08x\n",