public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: Rob Herring <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
	Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Tero Kristo <kristo@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Jon Nettleton <jon@solid-run.com>,
	Yazan Shhady <yazan.shhady@solid-run.com>,
	Rabeeh Khoury <rabeeh@solid-run.com>
Subject: Re: [PATCH 0/2] of: add support for value "false" to of_property_read_bool
Date: Wed, 13 Nov 2024 09:41:05 +0000	[thread overview]
Message-ID: <288deac4-5387-4492-9e9c-cabf77b9c0ba@solid-run.com> (raw)
In-Reply-To: <CAL_JsqJAQswTo2eWxLw62wqb-2i=_9W84_v_tW+TSW4kgNK3_A@mail.gmail.com>

Am 12.11.24 um 14:46 schrieb Rob Herring:
> On Tue, Nov 12, 2024 at 12:41 AM Josua Mayer <josua@solid-run.com> wrote:
>> Boolean type properties are usually considered true if present and false
>> when they do not exist. This works well for many in-tree board dts and
>> existing drivers.
>>
>> When users need to overrride boolean values from included dts,
>> /delete-property/ is recommend. This however does not work in overlays
>> (addons).
> As soon as someone needs to delete a non-boolean property, we're back
> to the same problem.

Properties can be reassigned any value, e.g. a driver default if needed.
It should never be necessary to delete a property,
since a suitable value may be specified instead.

Booleans have two valid values, true and false,
but somehow we cannot assign false, we can just delete the property.

> If you want to fix it, you need to fix it for any
> property.
/delete-property/ is a language keyword used during compilation.
When inspecting a .dtbo no trace of /delete-property/ is left.

Hence we can't "fix" deleting properties through overlays.
We can only "fix" (re-)assigning false to a boolean property.

>
>
>> Geert pointed out [1] that there are several invitations for using
>> strings "true" and "false" on boolean properties: [1], [2], [3].
> There's always bad examples...
>
>> Add support for a string value "false" to be considered false on boolean
>> properties by changing of_property_read_bool implementation.
> Any existing s/w will treat 'foo = "false"' as true. It's an ABI.
I was reading through the device-tree specification, it makes absolutely
no mention of a boolean type.

I believe of_property_read_bool should be capable of deriving false
from a present property.

What is up to now called bool in the kernel / device-tree,
is actually of_property_present, or conversationally of_node_has_flag.


sincerely
Josua Mayer



  reply	other threads:[~2024-11-13  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12  6:41 [PATCH 0/2] of: add support for value "false" to of_property_read_bool Josua Mayer
2024-11-12  6:41 ` [PATCH 1/2] " Josua Mayer
2024-11-12  6:52   ` Josua Mayer
2024-11-12  6:41 ` [PATCH 2/2] arm64: dts: ti: k3-am642-hummingboard-t-usb3: fix overlay boolean value Josua Mayer
2024-11-12 13:46 ` [PATCH 0/2] of: add support for value "false" to of_property_read_bool Rob Herring
2024-11-13  9:41   ` Josua Mayer [this message]
2024-11-13 10:15     ` Geert Uytterhoeven

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=288deac4-5387-4492-9e9c-cabf77b9c0ba@solid-run.com \
    --to=josua@solid-run.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jon@solid-run.com \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rabeeh@solid-run.com \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    --cc=vigneshr@ti.com \
    --cc=yazan.shhady@solid-run.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox