]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/bios: fix a bit shift error introduced by a8f030c
authorSergei Antonov <saproj@gmail.com>
Tue, 15 Apr 2014 21:18:37 +0000 (23:18 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 18 Apr 2014 03:15:18 +0000 (13:15 +1000)
commit212b25093d8e60a91e020f20900ccc268f6a5784
treeacdf119610e40bcea51ac79039eb2ec8289eba2d
parent7ad39fbbcfbd6194252f4ffdeedccddc5ad5c0ba
drm/nouveau/bios: fix a bit shift error introduced by a8f030c

Commit a8f030ca28456dd390df0a7207d0b654239b5cf5 added two checks applied to a
value received from nv_rd32(bios, 0x619f04). But after this new piece of code
is executed, the addr local variable does not hold the same value it used to
hold before the commit. Here is what is was assigned in the original code:
(u64)(nv_rd32(bios, 0x619f04) & 0xffffff00) << 8
in the committed code it ends up with this value:
(u64)(nv_rd32(bios, 0x619f04) >> 8) << 8
These expressions are obviously not equivalent.

My Nvidia video card does not show anything on the display when I boot a
kernel containing this commit.

The patch fixes the code so that the new checks are still done, but the
side effect of an incorrect addr value is gone.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/bios/base.c