All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Felipe Balbi <balbi@ti.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC/PATCH 2/2] of: allow for boolean flags to have value
Date: Thu, 5 Feb 2015 10:34:12 -0800	[thread overview]
Message-ID: <20150205183411.GC25235@atomide.com> (raw)
In-Reply-To: <20150205182240.GD20735@leverpostej>

* Mark Rutland <mark.rutland@arm.com> [150205 10:26]:
> On Thu, Feb 05, 2015 at 06:01:06PM +0000, Felipe Balbi wrote:
> > allowing values to boolean flags lets us setup
> > defaults on DTSI which can get disabled later
> > at board DTS if, for whatever reason, board can't
> > use that default.
> > 
> > One such example is DM81xx EVM where we can't use
> > MUSB's multipoint feature even though SoC supports
> > it. Something at the board level prevents us from
> > using the feature.
> > 
> > Instead of removing "multipoint;" from DTSI and
> > adding it to all board DTS just so we can remove
> > it from our quirky board seems like overkill when
> > we could just add:
> > 
> > 	multipoint = <0>;
> > 
> > to that quirky board's DTS.
> > 
> > Note that the description here is but one example
> > and it's likely many others have faced something
> > similar.
> > 
> 
> While I appreciate that adding and removing properties in this way is
> painful, I think that this must be dealt with at DTB compile-time rather
> than kernel run-time.
> 
> There are codebases other than Linux which parse DTs, and not all
> drivers call of_property_read_bool to parse boolean properties, an awful
> lot still just check of_find_property. Additionally, some bindings
> _explicitly_ state boolean properties are empty and have no value, which
> this extension would break.
> 
> I think that this patch only adds to the inconsistency we currently
> have, and given that, I would rather not have this extension to
> of_property_read_bool.
> 
> Arguably of_proeprty_read_bool should warn if it encounters a non-empty
> property.

How about a WARN_ON there as in that case the value will always
be set to 1 in kernel even if specified as 0 in the .dts file?

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCH 2/2] of: allow for boolean flags to have value
Date: Thu, 5 Feb 2015 10:34:12 -0800	[thread overview]
Message-ID: <20150205183411.GC25235@atomide.com> (raw)
In-Reply-To: <20150205182240.GD20735@leverpostej>

* Mark Rutland <mark.rutland@arm.com> [150205 10:26]:
> On Thu, Feb 05, 2015 at 06:01:06PM +0000, Felipe Balbi wrote:
> > allowing values to boolean flags lets us setup
> > defaults on DTSI which can get disabled later
> > at board DTS if, for whatever reason, board can't
> > use that default.
> > 
> > One such example is DM81xx EVM where we can't use
> > MUSB's multipoint feature even though SoC supports
> > it. Something at the board level prevents us from
> > using the feature.
> > 
> > Instead of removing "multipoint;" from DTSI and
> > adding it to all board DTS just so we can remove
> > it from our quirky board seems like overkill when
> > we could just add:
> > 
> > 	multipoint = <0>;
> > 
> > to that quirky board's DTS.
> > 
> > Note that the description here is but one example
> > and it's likely many others have faced something
> > similar.
> > 
> 
> While I appreciate that adding and removing properties in this way is
> painful, I think that this must be dealt with at DTB compile-time rather
> than kernel run-time.
> 
> There are codebases other than Linux which parse DTs, and not all
> drivers call of_property_read_bool to parse boolean properties, an awful
> lot still just check of_find_property. Additionally, some bindings
> _explicitly_ state boolean properties are empty and have no value, which
> this extension would break.
> 
> I think that this patch only adds to the inconsistency we currently
> have, and given that, I would rather not have this extension to
> of_property_read_bool.
> 
> Arguably of_proeprty_read_bool should warn if it encounters a non-empty
> property.

How about a WARN_ON there as in that case the value will always
be set to 1 in kernel even if specified as 0 in the .dts file?

Regards,

Tony

  reply	other threads:[~2015-02-05 18:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 18:01 [RFC/PATCH 1/2] of: move of_property_read_bool further down Felipe Balbi
2015-02-05 18:01 ` Felipe Balbi
     [not found] ` <1423159266-25561-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2015-02-05 18:01   ` [RFC/PATCH 2/2] of: allow for boolean flags to have value Felipe Balbi
2015-02-05 18:01     ` Felipe Balbi
2015-02-05 18:16     ` Arnd Bergmann
2015-02-05 18:16       ` Arnd Bergmann
     [not found]     ` <1423159266-25561-2-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2015-02-05 18:22       ` Mark Rutland
2015-02-05 18:22         ` Mark Rutland
2015-02-05 18:34         ` Tony Lindgren [this message]
2015-02-05 18:34           ` Tony Lindgren
2015-02-05 18:39       ` Uwe Kleine-König
2015-02-05 18:39         ` Uwe Kleine-König

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=20150205183411.GC25235@atomide.com \
    --to=tony@atomide.com \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    /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.