From: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Sebastian Reichel <sre@kernel.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-pm@vger.kernel.org,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: Re: [PATCH 1/2] Documentation: ABI: Add sysfs-class-reboot-mode-reboot_modes
Date: Tue, 18 Nov 2025 22:07:51 +0530 [thread overview]
Message-ID: <1ddb483e-3c09-ff45-9d36-cf29a40ba55d@oss.qualcomm.com> (raw)
In-Reply-To: <virjbkkpdmufx2midadzwiml4boyuxtokikcvupswapwehnv65@d2ppyiaeti22>
On 11/18/2025 2:18 AM, Bjorn Andersson wrote:
> On Sun, Nov 16, 2025 at 07:44:24PM +0200, Dmitry Baryshkov wrote:
>> On Sun, Nov 16, 2025 at 08:49:47PM +0530, Shivendra Pratap wrote:
>>> Add ABI documentation for /sys/class/reboot-mode/*/reboot_modes, a
>>> read-only sysfs attribute exposing the list of supported reboot-mode
>>> arguments. This file is created by reboot-mode framework and provides a
>>> user-readable interface to query available reboot-mode arguments.
>>>
>>> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>>> Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
>>> ---
>>> .../testing/sysfs-class-reboot-mode-reboot_modes | 39 ++++++++++++++++++++++
>>> 1 file changed, 39 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..28280ffe9bf962ef9d2136ea5d7c6aef77c4bd34
>>> --- /dev/null
>>> +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes
>>> @@ -0,0 +1,39 @@
>>> +What: /sys/class/reboot-mode/<driver>/reboot_modes
>>> +Date: November 2025
>>> +KernelVersion: 6.18.0-rc5
>>> +Contact: linux-pm@vger.kernel.org
>>> + Description:
>>> + This interface exposes the reboot-mode arguments
>>> + registered with the reboot-mode framework. It is
>>> + a read-only interface and provides a space
>>> + separated list of reboot-mode arguments supported
>>> + on the current platform.
>>> + Example:
>>> + recovery fastboot bootloader
>>> +
>>> + The exact sysfs path may vary depending on the
>>> + name of the driver that registers the arguments.
>>> + Example:
>>> + /sys/class/reboot-mode/nvmem-reboot-mode/reboot_modes
>>> + /sys/class/reboot-mode/syscon-reboot-mode/reboot_modes
>>> + /sys/class/reboot-mode/qcom-pon/reboot_modes
>>
>> This part is obvious, isn't it?
>>
>>> +
>>> + The supported arguments can be used by userspace
>>> + to invoke device reset using the reboot() system
>>> + call, with the "argument" as string to "*arg"
>>> + parameter along with LINUX_REBOOT_CMD_RESTART2.
>>> + Example:
>>> + reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
>>> + LINUX_REBOOT_CMD_RESTART2, "bootloader");
>>
>> So, does one need to write a tool for invoking reboot with the corerct
>> set of args?
>
> Here's an implementation of such tool
> https://github.com/systemd/systemd/blob/main/src/shared/reboot-util.c#L80
Should i include this link for an example of existing tools or i just add
add a line saying that such tools are already available?
>
> Many other implementations of reboot provides the same.
>
>> If we are adding a sysfs interface, wouldn't it be logical
>> to also add another sysfs file, setting the argument?
>>
>
> The inclusion of the example indicates that we need to expose it in an
> accessible form, but I don't think we should, as it's already a
> widespread standard interface.
>
> As such, I don't think the example adds any value, but it would be
> valuable to clarify that this is a standard interface.
ok. Will remove this example of reboot syscall and add a line to
indicate that this is standard interface.
thanks,
Shivendra
next prev parent reply other threads:[~2025-11-18 16:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 15:19 [PATCH 0/2] reboot-mode: Expose sysfs for registered reboot modes Shivendra Pratap
2025-11-16 15:19 ` [PATCH 1/2] Documentation: ABI: Add sysfs-class-reboot-mode-reboot_modes Shivendra Pratap
2025-11-16 17:44 ` Dmitry Baryshkov
2025-11-17 5:40 ` Shivendra Pratap
2025-11-17 20:48 ` Bjorn Andersson
2025-11-18 16:37 ` Shivendra Pratap [this message]
2025-11-19 3:22 ` Bjorn Andersson
2025-11-16 15:19 ` [PATCH 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes Shivendra Pratap
2025-11-17 13:25 ` Bartosz Golaszewski
2025-11-17 17:52 ` Shivendra Pratap
2025-11-17 13:03 ` [PATCH 0/2] reboot-mode: Expose sysfs for registered reboot modes Bartosz Golaszewski
2025-11-17 18:05 ` Shivendra Pratap
2025-11-18 10:00 ` Bartosz Golaszewski
2025-11-18 14:20 ` Shivendra Pratap
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=1ddb483e-3c09-ff45-9d36-cf29a40ba55d@oss.qualcomm.com \
--to=shivendra.pratap@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.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 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.