aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Zaborowski <balrogg@gmail.com>2007-06-26 09:31:23 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-02 08:39:35 -0400
commit756813cac1d0172e1f93d977fe8bd1cd5086be21 (patch)
tree20ed2f15ff95638ddd1c6da6e71fdfeda6b90dc7
parenta38d6181ff27824c79fc7df825164a212eff6a3f (diff)
[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: Andrzej Zaborowski <andrew@openedhand.com> Acked-by: Paul Brook <paul@codesourcery.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-versatile/pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index ba58223f12be..ca8290159432 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -117,7 +117,10 @@ static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int wh
117 } else { 117 } else {
118 switch (size) { 118 switch (size) {
119 case 1: 119 case 1:
120 v = __raw_readb(addr); 120 v = __raw_readl(addr);
121 if (where & 2) v >>= 16;
122 if (where & 1) v >>= 8;
123 v &= 0xff;
121 break; 124 break;
122 125
123 case 2: 126 case 2: