Bjorn Helgaas 8f38eaca55 PCI: fix P2P bridge I/O port window sign extension
On P2P bridges with 32-bit I/O decoding, we incorrectly sign-extended
windows starting at 0x80000000 or above.  In "base |= (io_base_hi << 16)",
"io_base_hi" is promoted to a signed int before being extended to an
unsigned long.

This would cause a window starting at I/O address 0x80000000 to be
treated as though it started at 0xffffffff80008000 instead, which
should cause "no compatible bridge window" errors when we enumerate
devices using that I/O space.

The mmio and mmio_pref casts are not strictly necessary, but without
them, correctness depends on the types of the PCI_MEMORY_RANGE_MASK and
PCI_PREF_RANGE_MASK constants, which are not obvious from reading the
local code.

Found by Coverity (CID 138747 and CID 138748).

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-06-20 17:28:53 -06:00
..
2012-01-06 12:10:34 -08:00
2012-05-21 16:24:54 -07:00
2012-06-20 10:44:35 -06:00
2012-05-21 16:24:54 -07:00
2012-02-27 12:16:55 -08:00
2010-07-30 09:47:22 -07:00
2009-07-12 12:22:34 -07:00
2012-04-06 17:54:53 -07:00