]> git.baikalelectronics.ru Git - kernel.git/commit
PNPACPI: compute Address Space length rather than using _LEN
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Tue, 27 Apr 2010 20:45:38 +0000 (14:45 -0600)
committerLen Brown <len.brown@intel.com>
Thu, 29 Apr 2010 01:44:49 +0000 (21:44 -0400)
commitf1bd00a0395463f6107198848adfec0d824ba549
tree743df688cd8554f32eff514148dd31509d8055ae
parente81baa679f43df02ace8c3263b53c767d714f2cd
PNPACPI: 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 dd83138e06e and replaces it 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: Len Brown <len.brown@intel.com>
drivers/pnp/pnpacpi/rsparser.c