diff options
author | Olof Johansson <[email protected]> | 2005-06-13 15:52:27 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2005-06-13 20:58:58 -0700 |
commit | f797f9cc5485b50c35c106b462e1bc432ec37f90 (patch) | |
tree | 283443fcdeb709c768ed5cd481203459b5222441 /net/lapb/lapb_timer.c | |
parent | a3c77c67a443e631febf708bb0c376caede31657 (diff) |
[PATCH] Fix PCI BAR size interpretation on 64-bit arches
On 64-bit machines, PCI_BASE_ADDRESS_MEM_MASK and other mask constants
passed to pci_size() are 64-bit (for example ~0x0fUL). However, pci_size
does comparisons between the u32 arguments and the mask, which will fail
even though any result from pci_size is still just 32-bit.
Changing the mask argument to u32 seems the obvious thing to do, since all
arithmetic in the function is 32-bit and having a larger mask makes no
sense.
This triggered on a PPC64 system here where an adapter (VGA, as it
happened) had a memory region base of 0xfe000000 and a sz of the same,
matching the if (max == maxbase ...) test at the bottom of pci_size but
failing the mask comparison. Quite a corner case which I guess explains
why we haven't seen it until now.
Signed-off-by: Olof Johansson <[email protected]>
Acked-by: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions