]> git.baikalelectronics.ru Git - kernel.git/commit
x86/PCI: compute Address Space length rather than using _LEN
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Tue, 27 Apr 2010 20:45:43 +0000 (14:45 -0600)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 28 Apr 2010 16:17:45 +0000 (09:17 -0700)
commit3b27b78a00fe94171a279d9013353b088233839a
tree8a8114da4840e84ba60050b953123168aefc2dcf
parentf638760705d49a095dfec2e949dc93f93825ebeb
x86/PCI: compute Address Space length rather than using _LEN

ACPI _CRS Address Space Descriptors have _MIN, _MAX, and _LEN.  Linux has
been computing Address Spaces as [_MIN to _MIN + _LEN - 1].  Based on the
tests in the bug reports below, Windows apparently uses [_MIN to _MAX].

Per spec (ACPI 4.0, Table 6-40), for _CRS fixed-size, fixed location
descriptors, "_LEN must be (_MAX - _MIN + 1)", and when that's true, it
doesn't matter which way we compute the end.  But of course, there are
BIOSes that don't follow this rule, and we're better off if Linux handles
those exceptions the same way as Windows.

This patch makes Linux use [_MIN to _MAX], as Windows seems to do.  This
effectively reverts 4ce24ced95 and c8ea43e99a and replaces them with
simpler code.

    https://bugzilla.kernel.org/show_bug.cgi?id=14337 (round)
    https://bugzilla.kernel.org/show_bug.cgi?id=15480 (truncate)

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/x86/pci/acpi.c