Commit 39d3454c authored by Russell King's avatar Russell King

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: stable@vger.kernel.org
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 5c8fe583
...@@ -65,15 +65,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -65,15 +65,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
if (addr) if (addr)
switch (size) { switch (size) {
case 1: case 1:
asm("ldrb %0, [%1, %2]" asm volatile("ldrb %0, [%1, %2]"
: "=r" (v) : "r" (addr), "r" (where) : "cc"); : "=r" (v) : "r" (addr), "r" (where) : "cc");
break; break;
case 2: case 2:
asm("ldrh %0, [%1, %2]" asm volatile("ldrh %0, [%1, %2]"
: "=r" (v) : "r" (addr), "r" (where) : "cc"); : "=r" (v) : "r" (addr), "r" (where) : "cc");
break; break;
case 4: case 4:
asm("ldr %0, [%1, %2]" asm volatile("ldr %0, [%1, %2]"
: "=r" (v) : "r" (addr), "r" (where) : "cc"); : "=r" (v) : "r" (addr), "r" (where) : "cc");
break; break;
} }
...@@ -99,17 +99,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -99,17 +99,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
if (addr) if (addr)
switch (size) { switch (size) {
case 1: case 1:
asm("strb %0, [%1, %2]" asm volatile("strb %0, [%1, %2]"
: : "r" (value), "r" (addr), "r" (where) : : "r" (value), "r" (addr), "r" (where)
: "cc"); : "cc");
break; break;
case 2: case 2:
asm("strh %0, [%1, %2]" asm volatile("strh %0, [%1, %2]"
: : "r" (value), "r" (addr), "r" (where) : : "r" (value), "r" (addr), "r" (where)
: "cc"); : "cc");
break; break;
case 4: case 4:
asm("str %0, [%1, %2]" asm volatile("str %0, [%1, %2]"
: : "r" (value), "r" (addr), "r" (where) : : "r" (value), "r" (addr), "r" (where)
: "cc"); : "cc");
break; break;
......
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