public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Chen Gang <gang.chen.5i5j@gmail.com>
Cc: <eparis@redhat.com>, <paulmck@linux.vnet.ibm.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	<zhenglong.cai@cs2c.com.cn>, <khilman@linaro.org>,
	<ak@linux.intel.com>, <mcgrof@suse.com>, <fabf@skynet.be>,
	"dhowells@redhat.com" <dhowells@redhat.com>,
	<pefoley2@pefoley.com>, <mgorman@suse.de>, <biederm@xmission.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Jean Delvare <jdelvare@suse.de>
Subject: Re: [PATCH] init/Kconfig: Add ENDIAN attributes for all architectures using
Date: Tue, 2 Sep 2014 01:17:37 -0400	[thread overview]
Message-ID: <20140902051737.GK26632@windriver.com> (raw)
In-Reply-To: <5404A66E.509@zytor.com>

[Re: [PATCH] init/Kconfig: Add ENDIAN attributes for all architectures using] On 01/09/2014 (Mon 10:01) H. Peter Anvin wrote:

> On 09/01/2014 09:08 AM, Paul Gortmaker wrote:
> >>>
> >> diff --git a/init/Kconfig b/init/Kconfig
> >> index ac033c3..f301cc8 100644
> >> --- a/init/Kconfig
> >> +++ b/init/Kconfig
> >> @@ -23,6 +23,12 @@ config CONSTRUCTORS
> >>  config IRQ_WORK
> >>  	bool
> >>  
> >> +config CPU_LITTLE_ENDIAN
> >> +	bool
> >> +
> >> +config CPU_BIG_ENDIAN
> >> +	bool
> > 
> > Perhaps you should take a cursory look at what already exists in tree
> > before blindly trying to add more to it?
> > 
> > $ git grep CPU_BIG_ENDIAN | wc -l
> > 88
> > 
> 
> The whole point of this patchset is to make these already widely-used
> options universal across the tree.

OK, but that was not at _all_ what I thought when looking at this...

Instead I saw a well intentioned, but perhaps not fully thought out
attempt at fixing a largely irrelevant randconfig/allmodconfig of a
1990's vintage ISDN driver coming from that x86-only era, built against
an architecture that will never use or support it (microblaze).

In today's world, we'd probably not accept a new ethernet driver or
filesystem if it was incapable of handling both BE and LE (exception
being SoC ethernet physically bound to one specific CPU, of course.)
So the justification given in the commit log for expanding the scope to
better deal with the stuff found in ISDN and the like was questionable.

Secondly, I don't think it is well known that Kbuild will tolerate
multiply defined symbols of the exact same name, and since that isn't
mentioned in the commit log (as documented and/or tested), I envisioned
this breaking powerpc and other arch who already define one (or both)
of these two.  I found multi-define _is_ documented as supported in
Documentation/kbuild but I still wonder how much it is used and how
well it handles things like in powerpc, where one of them (LE?) also
lists a "select ... " line and help text under the bool.

So if we want to do this, I'd suggest a commit log that really gets
to the intended point; something along the lines of:

  --------------

  Currently we have some architectures defining their own bool for
  CPU_LITTLE_ENDIAN and/or CPU_BIG_ENDIAN.  As of 3.17-rc3 we have:

    CPU_BIG_ENDIAN: arc, arm, arm64, c6x, mips, powerpc, sh
    CPU_LITTLE_ENDIAN: m32r, mips, powerpc, sh

  Note that the scope does not cover all arch, which reduces the utility
  value of these items in generic and/or arch independent code, as
  neither may be defined, making tests on their values inconclusive.

  To fix the above, the goal is to make both items present in an arch
  independent Kconfig.  We can do this immediately without having to
  simultaneously touch the existing arch bool definitions because...

  This change was tested on a powerpc LE config since it has help text
  and a select line, and the behaviour of both before and after the
  change was found to be ...

  --------------

Also, having the suggested change Cc'd to linux-arch would be sensible,
I think.  And one might want to make it a series, showing the follow on
arch specific commits you have planned that "select" an endian, since
the maintainers may want evidence it will be carried to completion and
they also may have something additional to say (as in the case of arch/arm
where there is already CPU_ENDIAN_BE8 and CPU_ENDIAN_BE32 Kconfig items).

Paul.
--

> 
> 	-hpa
> 
> 

  parent reply	other threads:[~2014-09-02  5:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 15:46 [PATCH] init/Kconfig: Add ENDIAN attributes for all architectures using Chen Gang
2014-09-01 16:08 ` Paul Gortmaker
2014-09-01 17:01   ` H. Peter Anvin
2014-09-02  1:44     ` Chen Gang
2014-09-02  5:17     ` Paul Gortmaker [this message]
2014-09-02  6:13       ` Chen Gang
2014-09-03 11:47         ` Chen Gang
2014-09-14  9:08           ` Chen Gang
2014-09-15 13:55             ` Arnd Bergmann
2014-09-15 22:41               ` Chen Gang

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=20140902051737.GK26632@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=biederm@xmission.com \
    --cc=dhowells@redhat.com \
    --cc=eparis@redhat.com \
    --cc=fabf@skynet.be \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=jdelvare@suse.de \
    --cc=khilman@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=mgorman@suse.de \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pefoley2@pefoley.com \
    --cc=zhenglong.cai@cs2c.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox