devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Sebastian Reichel" <sre@kernel.org>,
	"open list:THERMAL" <linux-pm@vger.kernel.org>,
	devicetree@vger.kernel.org, "Lee Jones" <lee.jones@linaro.org>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH RFC 0/3] reset: syscon-reboot: add "reg" property support
Date: Fri, 12 Nov 2021 16:18:25 -0600	[thread overview]
Message-ID: <CAL_JsqL5qJZz8K7330cOhV8x86097LUE7oFNx5Qu3M4XLL+gMg@mail.gmail.com> (raw)
In-Reply-To: <20211102152207.11891-1-zajec5@gmail.com>

On Tue, Nov 2, 2021 at 10:22 AM Rafał Miłecki <zajec5@gmail.com> wrote:
>
> From: Rafał Miłecki <rafal@milecki.pl>
>
> During my work on MFD binding for Broadcom's TWD block I received
> comment from Rob saying that "syscon-reboot" should use "reg" property.
> I'm not sure if my understanding & implementation are correct so I'm
> sending this RFC.
>
> What bothers me is non-standard "reg" property usage. Treating it as a
> simple (unsigned) integer number means different logic when it comes to
> ranges.

It shouldn't be. The idea is that 'reg' works like normal. See below.

> Consider this example:
>
> timer@400 {
>         compatible = "simple-mfd", "syscon";
>         reg = <0x400 0x3c>;
>         ranges;

ranges = <0 0x400 0x100>; // Just guessing for size

>
>         #address-cells = <1>;
>         #size-cells = <1>;
>
>         reboot@434 {

reboot@34

Just reading 'reg' is fine, but really, Linux should be either getting
the translated address or have a function to get the offset from the
parent base. IOW, it should also work if you just changed 'reg' to
'<0x434 0x4>'.

>                 compatible = "syscon-reboot";
>                 reg = <0x34 0x4>;
>                 mask = <0x1>;
>         };
> };
>
> I've reboot@434 node with reg 0x34. Also 0x4 is ignored but must be
> present because of of MFD addressing.
>
> Please review this idea / binding / implementation.
>
> Rafał Miłecki (3):
>   dt-bindings: power: reset: syscon-reboot: use non-deprecated example
>   dt-bindings: power: reset: syscon-reboot: add "reg" property
>   power: reset: syscon-reboot: support "reg" property
>
>  .../bindings/power/reset/syscon-reboot.yaml   | 28 +++++++++++++------
>  drivers/power/reset/syscon-reboot.c           |  9 ++++--
>  2 files changed, 26 insertions(+), 11 deletions(-)
>
> --
> 2.31.1
>

  parent reply	other threads:[~2021-11-12 22:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 15:22 [PATCH RFC 0/3] reset: syscon-reboot: add "reg" property support Rafał Miłecki
2021-11-02 15:22 ` [PATCH RFC 1/3] dt-bindings: power: reset: syscon-reboot: use non-deprecated example Rafał Miłecki
2021-11-12 19:33   ` Rob Herring
2021-11-02 15:22 ` [PATCH RFC 2/3] dt-bindings: power: reset: syscon-reboot: add "reg" property Rafał Miłecki
2021-11-12 19:34   ` Rob Herring
2021-11-02 15:22 ` [PATCH RFC 3/3] power: reset: syscon-reboot: support " Rafał Miłecki
2021-11-02 15:26 ` [PATCH RFC 0/3] reset: syscon-reboot: add "reg" property support Rafał Miłecki
2021-11-12 22:18 ` Rob Herring [this message]
2021-11-12 22:23   ` Rafał Miłecki
2021-11-12 22:32     ` Rob Herring
2021-12-02 17:21       ` Sebastian Reichel
2021-12-02 17:23         ` Rafał Miłecki

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=CAL_JsqL5qJZz8K7330cOhV8x86097LUE7oFNx5Qu3M4XLL+gMg@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rafal@milecki.pl \
    --cc=sre@kernel.org \
    --cc=wim@linux-watchdog.org \
    --cc=zajec5@gmail.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;
as well as URLs for NNTP newsgroup(s).