From patchwork Thu Sep 8 17:06:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Miao X-Patchwork-Id: 3988 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 224D623EF7 for ; Thu, 8 Sep 2011 17:06:51 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 16EF7A1891E for ; Thu, 8 Sep 2011 17:06:51 +0000 (UTC) Received: by fxd18 with SMTP id 18so2535099fxd.11 for ; Thu, 08 Sep 2011 10:06:51 -0700 (PDT) Received: by 10.223.5.139 with SMTP id 11mr566548fav.138.1315501610913; Thu, 08 Sep 2011 10:06:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs182411lab; Thu, 8 Sep 2011 10:06:50 -0700 (PDT) Received: by 10.229.101.20 with SMTP id a20mr744808qco.222.1315501609859; Thu, 08 Sep 2011 10:06:49 -0700 (PDT) Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id a19si109418qcw.195.2011.09.08.10.06.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Sep 2011 10:06:49 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.212.50 as permitted sender) client-ip=209.85.212.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.y.miao@gmail.com designates 209.85.212.50 as permitted sender) smtp.mail=eric.y.miao@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by vws14 with SMTP id 14so143642vws.37 for ; Thu, 08 Sep 2011 10:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=safD26HTGK2MZ/zFbYjBHL+iUBvY+++JF/zEwbYQXA8=; b=O5Q7jfEVPVcKmVZbXvBmwQalTfoDffipA9Y+Ld7agECHXJ3DmjWrIlxychilVDQxWR qC01hN5DwF7cKkTsjH2k0P87keJAVicVdsk79EjzljVhPT/WBN/KBW9UzXLwt4WQ83eo qycM5bHVrJCO6PGtXKQ3q36sRLxb2E7lTYkQ0= Received: by 10.52.34.50 with SMTP id w18mr949606vdi.505.1315501609048; Thu, 08 Sep 2011 10:06:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.185.72 with HTTP; Thu, 8 Sep 2011 10:06:29 -0700 (PDT) In-Reply-To: <201109081844.21371.arnd@arndb.de> References: <1315497854-13311-1-git-send-email-dave.martin@linaro.org> <1315497854-13311-4-git-send-email-dave.martin@linaro.org> <201109081844.21371.arnd@arndb.de> From: Eric Miao Date: Thu, 8 Sep 2011 10:06:29 -0700 Message-ID: Subject: Re: [PATCH v2 3/3] ARM: pxa/pj4: Port problematic pj4 support code to v7/Thumb-2 To: Arnd Bergmann Cc: Dave Martin , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Haojian Zhuang 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: 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(); }