diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-02-26 10:14:15 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-03-26 14:08:05 +1000 |
commit | 457e77b26428ab4a24998eecfb99f27fa4195397 (patch) | |
tree | 01c10c372b10b3c8359956e17d02e3e2e85d7d23 /drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |
parent | 420b94697722512a2c0732970dc1530197a49adb (diff) |
drm/nouveau/bios: add more checks to PRAMIN image fetching
Prevents an attempt to access VRAM on an un-posted board, which, on a
particular system with a GRID K1 installed, causes a MCE and chokes
the entire system.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/bios/base.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index 13bb829f959c..56085304a847 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c @@ -99,7 +99,17 @@ nouveau_bios_shadow_pramin(struct nouveau_bios *bios) return; } - addr = (u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8; + addr = nv_rd32(bios, 0x619f04); + if (!(addr & 0x00000008)) { + nv_debug(bios, "... not enabled\n"); + return; + } + if ( (addr & 0x00000003) != 1) { + nv_debug(bios, "... not in vram\n"); + return; + } + + addr = (u64)(addr >> 8) << 8; if (!addr) { addr = (u64)nv_rd32(bios, 0x001700) << 16; addr += 0xf0000; |