Skip to content

Commit

Permalink
drm/nouveau/bios: add more checks to PRAMIN image fetching
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Skeggs committed Mar 26, 2014
1 parent 420b946 commit 457e77b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/gpu/drm/nouveau/core/subdev/bios/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 457e77b

Please sign in to comment.