Skip to content

Commit

Permalink
[ARM] 4454/1: Use word accesses in Versatile PCI config reads
Browse files Browse the repository at this point in the history
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: Andrzej Zaborowski <[email protected]>
Acked-by: Paul Brook <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
balrog-kun authored and Russell King committed Jul 2, 2007
1 parent a38d618 commit 756813c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm/mach-versatile/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh
} else {
switch (size) {
case 1:
v = __raw_readb(addr);
v = __raw_readl(addr);
if (where & 2) v >>= 16;
if (where & 1) v >>= 8;
v &= 0xff;
break;

case 2:
Expand Down

0 comments on commit 756813c

Please sign in to comment.