lkml.org 
[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 096/120] ARM: footbridge: fix dc21285 PCI configuration accessors
    Date
    From: Russell King <rmk+kernel@armlinux.org.uk>

    commit 39d3454c3513840eb123b3913fda6903e45ce671 upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    arch/arm/mach-footbridge/dc21285.c | 12 ++++++------
    1 file changed, 6 insertions(+), 6 deletions(-)

    --- a/arch/arm/mach-footbridge/dc21285.c
    +++ b/arch/arm/mach-footbridge/dc21285.c
    @@ -65,15 +65,15 @@ dc21285_read_config(struct pci_bus *bus,
    if (addr)
    switch (size) {
    case 1:
    - asm("ldrb %0, [%1, %2]"
    + asm volatile("ldrb %0, [%1, %2]"
    : "=r" (v) : "r" (addr), "r" (where) : "cc");
    break;
    case 2:
    - asm("ldrh %0, [%1, %2]"
    + asm volatile("ldrh %0, [%1, %2]"
    : "=r" (v) : "r" (addr), "r" (where) : "cc");
    break;
    case 4:
    - asm("ldr %0, [%1, %2]"
    + asm volatile("ldr %0, [%1, %2]"
    : "=r" (v) : "r" (addr), "r" (where) : "cc");
    break;
    }
    @@ -99,17 +99,17 @@ dc21285_write_config(struct pci_bus *bus
    if (addr)
    switch (size) {
    case 1:
    - asm("strb %0, [%1, %2]"
    + asm volatile("strb %0, [%1, %2]"
    : : "r" (value), "r" (addr), "r" (where)
    : "cc");
    break;
    case 2:
    - asm("strh %0, [%1, %2]"
    + asm volatile("strh %0, [%1, %2]"
    : : "r" (value), "r" (addr), "r" (where)
    : "cc");
    break;
    case 4:
    - asm("str %0, [%1, %2]"
    + asm volatile("str %0, [%1, %2]"
    : : "r" (value), "r" (addr), "r" (where)
    : "cc");
    break;

    \
     
     \ /
      Last update: 2021-02-08 18:38    [W:3.824 / U:1.808 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site