linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: stefan@agner.ch (Stefan Agner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] power: reset: read priority from device tree
Date: Mon, 01 Dec 2014 23:18:47 +0100	[thread overview]
Message-ID: <3916ca2867ced70e16903d6d44aaae8f@agner.ch> (raw)
In-Reply-To: <20141201174215.GB24692@roeck-us.net>

On 2014-12-01 18:42, Guenter Roeck wrote:
> On Mon, Dec 01, 2014 at 09:38:09AM -0800, Feng Kan wrote:
>> On Mon, Dec 1, 2014 at 9:29 AM, Stefan Agner <stefan@agner.ch> wrote:
>> > On 2014-12-01 18:15, Feng Kan wrote:
>> >> On Mon, Dec 1, 2014 at 9:03 AM, Stefan Agner <stefan@agner.ch> wrote:
>> >>> This patch adds an optional property which allows to specify the
>> >>> reset source priority. This priority is used by the kernel restart
>> >>> handler call chain to sort out the proper reset/restart method.
>> >>> Depending on the power design of a board or other machine/board
>> >>> specific peculiarity, it is not possible to pick a generic priority.
>> >>>
>> >>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> >>> ---
>> >>>  Documentation/devicetree/bindings/power/reset/syscon-reboot.txt | 3 +++
>> >>>  drivers/power/reset/syscon-reboot.c                             | 5 ++++-
>> >>>  2 files changed, 7 insertions(+), 1 deletion(-)
>> >>>
>> >>> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> >>> index 1190631..ee41d9c 100644
>> >>> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> >>> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt
>> >>> @@ -11,6 +11,9 @@ Required properties:
>> >>>  - offset: offset in the register map for the reboot register (in bytes)
>> >>>  - mask: the reset value written to the reboot register (32 bit access)
>> >>>
>> >>> +Optional properties:
>> >>> +- priority: define the priority of the reset (0-255, defaults to 128)
>> >>> +
>> >>>  Default will be little endian mode, 32 bit access only.
>> >>>
>> >>>  Examples:
>> >>> diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
>> >>> index 815b901..3060d6b 100644
>> >>> --- a/drivers/power/reset/syscon-reboot.c
>> >>> +++ b/drivers/power/reset/syscon-reboot.c
>> >>> @@ -67,8 +67,11 @@ static int syscon_reboot_probe(struct platform_device *pdev)
>> >>>         if (of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask))
>> >>>                 return -EINVAL;
>> >>>
>> >>> -       ctx->restart_handler.notifier_call = syscon_restart_handle;
>> >>>         ctx->restart_handler.priority = 128;
>> >>> +       of_property_read_u32(pdev->dev.of_node, "priority",
>> >>> +                            &ctx->restart_handler.priority);
>> >>
>> >> What is this for?
>> >
>> > What do you mean? The moved line "ctx->restart_handler.notifier_call =
>> > syscon_restart_handle;"? When one reads the diff, it looks like that
>> > line was moved, in fact I tried to keep the of_property_read function
>> > calls together. But I had to move the assignation of the default
>> > priority in front of restart_handler.priority. That's what is the
>> > outcome...
>>
>> I believe Guenter explained above already. Actually this help to solve one of
>> my problem. Thanks.
> 
> Since Mark doesn't seem to be happy with the idea of making the priority
> dt-configurable, the alternative might be to just set a higher priority for
> syscon triggered resets, as suggested by Stefan. Not as flexible, but it
> should be ok for most use cases.
> 

I read the other branch of this thread too, but IMHO, this would be the
best solution for now. It's a one line change and does the job. After
all, we have that priority for a reason, it doesn't makes sense having
all of them at a common default. As mentioned in an other reply, I think
it is especially reasonable to configure the syscon-reboot driver a bit
higher, since this driver is more likely to be used for a dedicated
reboot feature provided by the SoC, which usually is the preferred one.
If it happens one day that a SoC ends up with conflicting priorities or
other priority odds, we can add the DT support then...

What do you think, can I go with that for now? (Guenter, Feng, Mark...?)

--
Stefan

  reply	other threads:[~2014-12-01 22:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 17:03 [PATCH v2 0/3] power: reset: vf610 system reset controller Stefan Agner
2014-12-01 17:03 ` [PATCH v2 1/3] power: reset: read priority from device tree Stefan Agner
2014-12-01 17:11   ` Mark Rutland
2014-12-01 17:22     ` Guenter Roeck
2014-12-01 17:24     ` Stefan Agner
2014-12-01 17:41       ` Mark Rutland
2014-12-01 17:51         ` Guenter Roeck
2014-12-01 17:59           ` Mark Rutland
2014-12-01 18:12             ` Guenter Roeck
2014-12-01 18:18               ` Mark Rutland
2014-12-01 18:50         ` Arnd Bergmann
2014-12-01 17:15   ` Feng Kan
2014-12-01 17:29     ` Stefan Agner
2014-12-01 17:38       ` Feng Kan
2014-12-01 17:42         ` Guenter Roeck
2014-12-01 22:18           ` Stefan Agner [this message]
2014-12-01 22:35             ` Guenter Roeck
2014-12-01 17:03 ` [PATCH v2 2/3] ARM: dts: vf610: add system reset controller and syscon-reboot Stefan Agner
2014-12-01 17:03 ` [PATCH v2 3/3] ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON Stefan Agner

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=3916ca2867ced70e16903d6d44aaae8f@agner.ch \
    --to=stefan@agner.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).