From patchwork Thu Sep 8 17:06:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v2, 3/3] ARM: pxa/pj4: Port problematic pj4 support code to v7/Thumb-2 Date: Thu, 08 Sep 2011 07:06:29 -0000 From: Eric Miao X-Patchwork-Id: 113927 Message-Id: To: Arnd Bergmann Cc: Dave Martin , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, patches@linaro.org On Thu, Sep 8, 2011 at 9:44 AM, Arnd Bergmann wrote: > On Thursday 08 September 2011, Dave Martin wrote: >>         __asm__ __volatile__ ( >>                 "mcr    p15, 0, %1, c1, c0, 2\n\t" >> +#ifdef __LINUX_ARM_ARCH__ >= 7 >> +               "isb\n\t" >> +#else >>                 "mrc    p15, 0, %0, c1, c0, 2\n\t" >>                 "mov    %0, %0\n\t" >>                 "sub    pc, pc, #4\n\t" >> +#endif >>                 : "=r" (temp) : "r" (value)); >>  } > > I thought we had concluded that we don't actually need the #else > path because there is no pre-v7 support for pj4 any more. Or if isb() works fine, will the below change be cleaner: linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c index a4b1b07..dc4272d 100644 --- a/arch/arm/kernel/pj4-cp0.c +++ b/arch/arm/kernel/pj4-cp0.c @@ -62,14 +62,10 @@ static u32 __init pj4_cp_access_read(void) static void __init pj4_cp_access_write(u32 value) { - u32 temp; - __asm__ __volatile__ ( - "mcr p15, 0, %1, c1, c0, 2\n\t" - "mrc p15, 0, %0, c1, c0, 2\n\t" - "mov %0, %0\n\t" - "sub pc, pc, #4\n\t" - : "=r" (temp) : "r" (value)); + "mcr p15, 0, %0, c1, c0, 2\n\t" + : : "r" (value)); + isb(); } _______________________________________________