All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/8] ARM: make xscale iwmmxt code multiplatform aware
Date: Fri, 13 Mar 2015 17:50:10 +0100	[thread overview]
Message-ID: <201503131750.10885.arnd@arndb.de> (raw)
In-Reply-To: <20150309173736.GB8656@n2100.arm.linux.org.uk>

On Monday 09 March 2015, Russell King - ARM Linux wrote:
> On Wed, Mar 04, 2015 at 03:38:29PM +0100, Arnd Bergmann wrote:
> > On Wednesday 04 March 2015 15:12:02 Robert Jarzmik wrote:
> > > Arnd Bergmann <arnd@arndb.de> writes:
> > 
> > > 
> > > I'm not sure I understand this patch fully, so take with caution my comment.
> > > If I'm not mistaken, the former behavior was for pxa3xx:
> > >  - cpu_is_xscale() -> false
> > >  - cpu_is_xsc3() -> true
> > >  => this implied PMD_BIT4 was set
> > > 
> > > With your patch :
> > >  - cpu_is_xscale() -> true
> > >  - cpu_is_xsc3() -> true
> > >  => this implied PMD_BIT4 is not set
> > > 
> > > I like the new meaning for cpu_is_*(), but is the change of PMD_BIT4 the goal of
> > > this patch (the piece in [1]) ?
> > 
> > > > -     if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ && !cpu_is_xscale())
> > > > +     if (cpu_architecture() <= CPU_ARCH_ARMv5TEJ &&
> > > > +         !cpu_is_xscale() && !cpu_is_xsc3())
> > > >               prot |= PMD_BIT4;
> > > >  
> > > >       pgd += pgd_index(addr);
> > 
> > I tried to not change the behavior here, and I think you missed this part:
> > 
> > -#if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3)
> > +#if !defined(CONFIG_CPU_XSCALE)
> >  #define        cpu_is_xscale() 0
> >  #else
> > -#define        cpu_is_xscale() 1
> >  ...
> > 
> > This means that previously, cpu_is_xscale() returned true for pxa3xx,
> > while now it returns false, and I added the "&& !cpu_is_xsc3()" to
> > keep the logic the same as before.
> 
> Please don't do stuff like this.  It's really easy for it to be buggy.
> 
> Before your change, cpu_is_xscale() returns true for _any_ Xscale CPU,
> whether it's v1, v2 or v3.  After your change, it only returns true for
> v1 and v2 CPUs.  So now the macro is mis-named, and is misleading.
> 
> Either rename the macro, or keep the existing behaviour, or do something
> smarter like:
> 
> #define cpu_is_xscale() (cpu_is_xsc1_2() || cpu_is_xsc3())
> 
> defining cpu_is_xsc1_2() to be your new version of cpu_is_xscale().

I've made a new version with a cpu_is_xscale_family() macro, will post
that as a reply here.

I'm still undecided about what it should return for mohawk though, as
the previous behavior was not well-defined in that case. I ended up
picking the other approach in the second version, but would be thankful
for any kind of guidance regarding whether mohawk should or should not
clear PMD_BIT4.

	Arnd

  reply	other threads:[~2015-03-13 16:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 13:29 [PATCH 0/8] ARM: MMP multiplatform support Arnd Bergmann
2015-02-27 13:29 ` [PATCH 1/8] mtd: nand: pxa3xx: disable DMA support on MMP Arnd Bergmann
2015-02-27 13:29 ` [PATCH 2/8] clk: mmp: stop using platform headers Arnd Bergmann
2015-02-27 13:29 ` [PATCH 3/8] ARM: make xscale iwmmxt code multiplatform aware Arnd Bergmann
2015-02-27 17:53   ` Rob Herring
2015-02-27 19:20     ` Arnd Bergmann
2015-03-04 14:12   ` Robert Jarzmik
2015-03-04 14:38     ` Arnd Bergmann
2015-03-04 17:30       ` Robert Jarzmik
2015-03-09 17:37       ` Russell King - ARM Linux
2015-03-13 16:50         ` Arnd Bergmann [this message]
2015-03-13 16:56           ` [PATCH v2] " Arnd Bergmann
2015-02-27 13:29 ` [PATCH 4/8] ARM: mohawk: allow building with MMU disabled Arnd Bergmann
2015-02-27 13:29 ` [PATCH 5/8] ARM: mmp: remove remaining legacy pxa-dma support Arnd Bergmann
2015-02-27 13:30 ` Arnd Bergmann
2015-02-27 13:31 ` [PATCH 6/8] ARM: mmp: make all header files local Arnd Bergmann
2015-02-27 13:31 ` [PATCH 7/8] ARM: mmp: make plat-pxa build standalone Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201503131750.10885.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.