From: Elliot Berman <eberman@codeaurora.org>
To: Rob Herring <robh@kernel.org>,
ebiggers@google.com, samitolvanen@google.com
Cc: Sebastian Reichel <sre@kernel.org>,
Andy Yan <andy.yan@rock-chips.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Andy Gross <agross@kernel.org>,
linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Trilok Soni <tsoni@codeaurora.org>,
Prasad Sodagudi <psodagud@codeaurora.org>
Subject: Re: [RESEND PATCH v1 2/4] dt-bindings: power: reset: Add alternate reboot mode format
Date: Wed, 26 Aug 2020 14:39:08 -0400 [thread overview]
Message-ID: <a77491b3-3917-8380-cf94-a4e3ccbbf22c@codeaurora.org> (raw)
In-Reply-To: <20200825212521.GA1346433@bogus>
On 8/25/2020 5:25 PM, Rob Herring wrote:
> On Tue, Aug 18, 2020 at 11:54:14AM -0700, Elliot Berman wrote:
>> Current reboot-mode device tree schema does not support reboot commands
>> with spaces in them [1]. Add an optional new node "reboot-mode-names"
>> and "reboot-mode-magic" which add an array of strings and u32s,
>> respectively which would permit any string in this framework.
>
> Kind of a weak justification. The intent was for the names to be a key,
> not a multi word description which your example seems to be. Is
> "dm-verity device corrupted" something Android has already standardized
> on?
+Eric/Sami to comment further
I wonder if you're thinking it's better to change the kernel_restart in
dm-verity-target.c?
Alternatively, I could respin so that spaces in the reboot cmd is
replaced with "-" in reboot_mode_notify(). This way, there is no need to
change dm-verity driver or change devicetree schema. i.e.:
@@ -44,9 +44,13 @@ static int reboot_mode_notify(struct notifier_block
*this,
{
struct reboot_mode_driver *reboot;
unsigned int magic;
+ char *reboot_cmd;
+
+ reboot_cmd = kstrdup(cmd, GFP_KERNEL);
+ strreplace(reboot_cmd, ' ', '-');
reboot = container_of(this, struct reboot_mode_driver,
reboot_notifier);
- magic = get_reboot_mode_magic(reboot, cmd);
+ magic = get_reboot_mode_magic(reboot, reboot_cmd);
if (magic)
reboot->write(reboot, magic);
>
>>
>> [1]:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/md/dm-verity-target.c?h=v5.5#n255
>>
>> Signed-off-by: Elliot Berman <eberman@codeaurora.org>
>> ---
>> .../devicetree/bindings/power/reset/reboot-mode.yaml | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
>> index a6c9102..4ea6b33 100644
>> --- a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
>> +++ b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
>> @@ -19,6 +19,9 @@ description: |
>> the bootloader what to do when the system reboots, and should be named
>> as mode-xxx = <magic> (xxx is mode name, magic should be a non-zero value).
>>
>> + reboot-mode-magic and reboot-mode-names may be used in addition/instead of
>> + mode-xxx style.
>
> It should be either/or in my opinion, not both.
OK, I can fix in the next patch.
>
>> +
>> For example, modes common Android platform are:
>> - normal: Normal reboot mode, system reboot with command "reboot".
>> - recovery: Android Recovery mode, it is a mode to format the device or update a new image.
>> @@ -32,6 +35,14 @@ properties:
>> description: |
>> Default value to set on a reboot if no command was provided.
>>
>> + reboot-mode-names:
>> + $ref: /schemas/types.yaml#/definitions/string-array
>> + description: List of reboot commands, paired with reboot-mode-magic by index
>> +
>> + reboot-mode-magic:
>
> 'reboot-modes' would align with normal patterns.
Ditto
>
>> + $ref: /schemas/types.yaml#/definitions/uint32-array
>> + description: List of reboot magic, paired with reboot-mode-names by index
>> +
>> patternProperties:
>> "^mode-.*$":
>> $ref: /schemas/types.yaml#/definitions/uint32
>> @@ -44,4 +55,10 @@ examples:
>> mode-bootloader = <2>;
>> mode-loader = <3>;
>> };
>> +
>> + - |
>> + reboot-mode {
>> + reboot-mode-names = "normal", "bootloader", "dm-verity device corrupted";
>> + reboot-mode-magic = <0x0>, <0x1>, <0xf>;
>> + };
>> ...
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
next prev parent reply other threads:[~2020-08-26 18:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 18:54 [RESEND PATCH v1 0/4] Support spaces in reboot mode framework Elliot Berman
2020-08-18 18:54 ` [RESEND PATCH v1 1/4] dt-bindings: power: reset: Convert reboot-mode to YAML Elliot Berman
2020-08-25 16:21 ` Sebastian Reichel
2020-08-18 18:54 ` [RESEND PATCH v1 2/4] dt-bindings: power: reset: Add alternate reboot mode format Elliot Berman
2020-08-25 16:23 ` Sebastian Reichel
2020-08-25 21:25 ` Rob Herring
2020-08-26 18:39 ` Elliot Berman [this message]
2020-08-18 18:54 ` [RESEND PATCH v1 3/4] power: reset: Add support for reboot mode alternate properties Elliot Berman
2020-08-18 18:54 ` [RESEND PATCH v1 4/4] arm64: dts: qcom: pm8150: Add reboot magic Elliot Berman
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=a77491b3-3917-8380-cf94-a4e3ccbbf22c@codeaurora.org \
--to=eberman@codeaurora.org \
--cc=agross@kernel.org \
--cc=andy.yan@rock-chips.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=ebiggers@google.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=psodagud@codeaurora.org \
--cc=robh@kernel.org \
--cc=samitolvanen@google.com \
--cc=sre@kernel.org \
--cc=tsoni@codeaurora.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).