Commit 756813ca authored by Andrzej Zaborowski's avatar Andrzej Zaborowski Committed by Russell King

[ARM] 4454/1: Use word accesses in Versatile PCI config reads

ARM Versatile PCI config reads of one byte width have the lowest two
bits of the address cleared and result in reading from a wrong place
in the config space.  This change is to use word size accesses like it is done for halfword reads.

Byte reads are used for retrieving the IRQ number of a PCI device and the problem was not exposed until 2.6.20 because the value read was discarded in drivers/pci/setup-irq.c (recently fixed).
Signed-off-by: default avatarAndrzej Zaborowski <andrew@openedhand.com>
Acked-by: default avatarPaul Brook <paul@codesourcery.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent a38d6181
...@@ -117,7 +117,10 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh ...@@ -117,7 +117,10 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh
} else { } else {
switch (size) { switch (size) {
case 1: case 1:
v = __raw_readb(addr); v = __raw_readl(addr);
if (where & 2) v >>= 16;
if (where & 1) v >>= 8;
v &= 0xff;
break; break;
case 2: case 2:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment