Skip to content

Commit 39d3454

Browse files
author
Russell King
committed
ARM: footbridge: fix dc21285 PCI configuration accessors
Building with gcc 4.9.2 reveals a latent bug in the PCI accessors for Footbridge platforms, which causes a fatal alignment fault while accessing IO memory. Fix this by making the assembly volatile. Cc: [email protected] Signed-off-by: Russell King <[email protected]>
1 parent 5c8fe58 commit 39d3454

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/arm/mach-footbridge/dc21285.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
6565
if (addr)
6666
switch (size) {
6767
case 1:
68-
asm("ldrb %0, [%1, %2]"
68+
asm volatile("ldrb %0, [%1, %2]"
6969
: "=r" (v) : "r" (addr), "r" (where) : "cc");
7070
break;
7171
case 2:
72-
asm("ldrh %0, [%1, %2]"
72+
asm volatile("ldrh %0, [%1, %2]"
7373
: "=r" (v) : "r" (addr), "r" (where) : "cc");
7474
break;
7575
case 4:
76-
asm("ldr %0, [%1, %2]"
76+
asm volatile("ldr %0, [%1, %2]"
7777
: "=r" (v) : "r" (addr), "r" (where) : "cc");
7878
break;
7979
}
@@ -99,17 +99,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
9999
if (addr)
100100
switch (size) {
101101
case 1:
102-
asm("strb %0, [%1, %2]"
102+
asm volatile("strb %0, [%1, %2]"
103103
: : "r" (value), "r" (addr), "r" (where)
104104
: "cc");
105105
break;
106106
case 2:
107-
asm("strh %0, [%1, %2]"
107+
asm volatile("strh %0, [%1, %2]"
108108
: : "r" (value), "r" (addr), "r" (where)
109109
: "cc");
110110
break;
111111
case 4:
112-
asm("str %0, [%1, %2]"
112+
asm volatile("str %0, [%1, %2]"
113113
: : "r" (value), "r" (addr), "r" (where)
114114
: "cc");
115115
break;

0 commit comments

Comments
 (0)