Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Russell King <rmk+kernel@armlinux.org.uk>

+6 -6
+6 -6
arch/arm/mach-footbridge/dc21285.c
··· 65 65 if (addr) 66 66 switch (size) { 67 67 case 1: 68 - asm("ldrb %0, [%1, %2]" 68 + asm volatile("ldrb %0, [%1, %2]" 69 69 : "=r" (v) : "r" (addr), "r" (where) : "cc"); 70 70 break; 71 71 case 2: 72 - asm("ldrh %0, [%1, %2]" 72 + asm volatile("ldrh %0, [%1, %2]" 73 73 : "=r" (v) : "r" (addr), "r" (where) : "cc"); 74 74 break; 75 75 case 4: 76 - asm("ldr %0, [%1, %2]" 76 + asm volatile("ldr %0, [%1, %2]" 77 77 : "=r" (v) : "r" (addr), "r" (where) : "cc"); 78 78 break; 79 79 } ··· 99 99 if (addr) 100 100 switch (size) { 101 101 case 1: 102 - asm("strb %0, [%1, %2]" 102 + asm volatile("strb %0, [%1, %2]" 103 103 : : "r" (value), "r" (addr), "r" (where) 104 104 : "cc"); 105 105 break; 106 106 case 2: 107 - asm("strh %0, [%1, %2]" 107 + asm volatile("strh %0, [%1, %2]" 108 108 : : "r" (value), "r" (addr), "r" (where) 109 109 : "cc"); 110 110 break; 111 111 case 4: 112 - asm("str %0, [%1, %2]" 112 + asm volatile("str %0, [%1, %2]" 113 113 : : "r" (value), "r" (addr), "r" (where) 114 114 : "cc"); 115 115 break;