All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rob Herring <robh@kernel.org>, Kumar Gala <kumar.gala@linaro.org>,
	devicetree@vger.kernel.org, devicetree-spec@vger.kernel.org,
	Frank Rowand <frowand.list@gmail.com>,
	Grant Likely <grant.likely@arm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: DT case sensitivity
Date: Thu, 23 Aug 2018 07:36:50 -0500	[thread overview]
Message-ID: <20180823123650.GT24439@gate.crashing.org> (raw)
In-Reply-To: <18175413a0148f7859ab36ed9715dce7a598f318.camel@kernel.crashing.org>

On Thu, Aug 23, 2018 at 11:29:01AM +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2018-08-22 at 20:26 -0500, Rob Herring wrote:
> > On Wed, Aug 22, 2018 at 8:14 PM Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> > > 
> > > On Wed, 2018-08-22 at 19:47 -0500, Rob Herring wrote:
> > > > The default DT string handling in the kernel is node names and
> > > > compatibles are case insensitive and property names are case sensitive
> > > > (Sparc is the the only variation and is opposite). It seems only PPC
> > > > (and perhaps only Power Macs?) needs to support case insensitive
> > > > comparisons. It was probably a mistake to follow PPC for new arches
> > > > and we should have made everything case sensitive from the start. So I
> > > > have a few questions for the DT historians. :)
> > > 
> > > Open Firmware itself is insensitive.
> > 
> > Doesn't it depend on the implementation? Otherwise, how is Sparc different?
> 
> Not sure ...

The standard requires case-sensitive.

> Forth itself is insensitive for words

Not even.   http://forth.sourceforge.net/std/dpans/dpans3.htm#3.3.1.2

(Most non-ancient implementations are though).

> but maybe not for string comparisons.

Only COMPARE is standardised, and that is case-sensitive comparison.  Many
systems have other words to do case-insensitive comparisons, or words where
some runtime flag determines the case-sensitivity.

Btw.  A node name in Open Firmware is generically
  driver-name@unit-address:device-arguments
where driver-name is the part that is in the "name" property; this whole
case-sensitivity business is even worse for FDT, where you also treat the
unit address as part of the name.  In real Open Firmware the address is
compared *as a number* (or as a few numbers), so it is naturally case-
insensitive (it does not care if you write 01a0 or 01A0, or 1a0 or 000001a0
etc.)


Segher

WARNING: multiple messages have this Message-ID (diff)
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rob Herring <robh@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Kumar Gala <kumar.gala@linaro.org>,
	devicetree@vger.kernel.org, devicetree-spec@vger.kernel.org,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Grant Likely <grant.likely@arm.com>,
	Frank Rowand <frowand.list@gmail.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: DT case sensitivity
Date: Thu, 23 Aug 2018 07:36:50 -0500	[thread overview]
Message-ID: <20180823123650.GT24439@gate.crashing.org> (raw)
In-Reply-To: <18175413a0148f7859ab36ed9715dce7a598f318.camel@kernel.crashing.org>

On Thu, Aug 23, 2018 at 11:29:01AM +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2018-08-22 at 20:26 -0500, Rob Herring wrote:
> > On Wed, Aug 22, 2018 at 8:14 PM Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> > > 
> > > On Wed, 2018-08-22 at 19:47 -0500, Rob Herring wrote:
> > > > The default DT string handling in the kernel is node names and
> > > > compatibles are case insensitive and property names are case sensitive
> > > > (Sparc is the the only variation and is opposite). It seems only PPC
> > > > (and perhaps only Power Macs?) needs to support case insensitive
> > > > comparisons. It was probably a mistake to follow PPC for new arches
> > > > and we should have made everything case sensitive from the start. So I
> > > > have a few questions for the DT historians. :)
> > > 
> > > Open Firmware itself is insensitive.
> > 
> > Doesn't it depend on the implementation? Otherwise, how is Sparc different?
> 
> Not sure ...

The standard requires case-sensitive.

> Forth itself is insensitive for words

Not even.   http://forth.sourceforge.net/std/dpans/dpans3.htm#3.3.1.2

(Most non-ancient implementations are though).

> but maybe not for string comparisons.

Only COMPARE is standardised, and that is case-sensitive comparison.  Many
systems have other words to do case-insensitive comparisons, or words where
some runtime flag determines the case-sensitivity.

Btw.  A node name in Open Firmware is generically
  driver-name@unit-address:device-arguments
where driver-name is the part that is in the "name" property; this whole
case-sensitivity business is even worse for FDT, where you also treat the
unit address as part of the name.  In real Open Firmware the address is
compared *as a number* (or as a few numbers), so it is naturally case-
insensitive (it does not care if you write 01a0 or 01A0, or 1a0 or 000001a0
etc.)


Segher

  parent reply	other threads:[~2018-08-23 12:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23  0:47 DT case sensitivity Rob Herring
2018-08-23  1:03 ` Benjamin Herrenschmidt
2018-08-23  1:26   ` Rob Herring
2018-08-23  1:26     ` Rob Herring
2018-08-23  1:29     ` Benjamin Herrenschmidt
2018-08-23  1:29       ` Benjamin Herrenschmidt
2018-08-23  9:02       ` Grant Likely
2018-08-23  9:02         ` Grant Likely
2018-08-23 11:43         ` Rob Herring
2018-08-23 11:43           ` Rob Herring
2018-08-23 11:47           ` Benjamin Herrenschmidt
2018-08-23 11:47             ` Benjamin Herrenschmidt
2018-08-23 11:56             ` Grant Likely
2018-08-23 11:56               ` Grant Likely
2018-08-23 12:08             ` Rob Herring
2018-08-23 12:08               ` Rob Herring
2018-08-23 12:48               ` Grant Likely
2018-08-23 12:48                 ` Grant Likely
2018-08-23 12:36       ` Segher Boessenkool [this message]
2018-08-23 12:36         ` Segher Boessenkool
2018-08-24 15:14         ` Rob Herring
2018-08-24 15:14           ` Rob Herring
2018-08-24 16:52           ` Segher Boessenkool
2018-08-24 16:52             ` Segher Boessenkool
2018-08-23 12:19   ` Segher Boessenkool
2018-08-23 12:19     ` Segher Boessenkool
2018-08-23 21:49     ` Benjamin Herrenschmidt
2018-08-23 21:49       ` Benjamin Herrenschmidt
2018-08-24  5:39 ` Michael Ellerman

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=20180823123650.GT24439@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-spec@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@arm.com \
    --cc=kumar.gala@linaro.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=robh@kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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.