]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/bios: fix fetching from acpi on certain systems
authorJan Vesely <jano.vesely@gmail.com>
Thu, 9 Apr 2015 01:34:36 +0000 (21:34 -0400)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 14 Apr 2015 07:00:59 +0000 (17:00 +1000)
commite0cb0f85915163e4426d046876b2bf18013255c4
tree8c434951d4b0d753cb35d2f45648c6e7dddbe8ea
parent4502e2d8d91eca3e92a7bb4f3bab615b9c81c096
drm/nouveau/bios: fix fetching from acpi on certain systems

nvbios_extend() returns 1 to indicate "extended the array" and 0 to
indicate the array is already big enough.  This is used by the core
shadowing code to prevent re-fetching chunks of the image that have
already been shadowed.

The ACPI fetching code may possibly need to extend this further due
to requiring fetches to happen in 4KiB chunks.

Under certain circumstances (that happen if the total image size is
a multiple of 4KiB), the memory allocated to store the shadow will
already be big enough, causing the ACPI code's nvbios_extend() call
to return 0, which is misinterpreted as a failure.

The fix is simple, accept >= 0 as a successful condition here.  The
core will have already made sure that we're not re-fetching data we
already have.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89047

v2 (Ben Skeggs):
- dropped hunk which would cause unnecessary re-fetching
- more descriptive explanation

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c