From: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-pm@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>,
Sebastian Reichel <sre@kernel.org>,
Bartosz Golaszewski <bgolasze@quicinc.com>,
Bjorn Andersson <andersson@kernel.org>
Subject: Re: [PATCH v23 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes
Date: Fri, 6 Feb 2026 21:55:49 +0530 [thread overview]
Message-ID: <241333dd-df8c-166a-e119-6e23cda3a876@oss.qualcomm.com> (raw)
In-Reply-To: <CAMRc=MdHKCg90fc0UJ45wXYPn=F-dcLhDrv2sO-=VP6k4=UqLw@mail.gmail.com>
On 2/6/2026 8:49 PM, Bartosz Golaszewski wrote:
> On Thu, 5 Feb 2026 18:17:14 +0100, Shivendra Pratap
> <shivendra.pratap@oss.qualcomm.com> said:
>> Currently, there is no standardized mechanism for userspace to discover
>> supported reboot modes on a platform. This limits userspace scripts, to
>> rely on hardcoded assumptions about the available reboot-modes.
>>
>> Create a class 'reboot-mode' and a device under it. Use the name of the
>> registering driver as device name. Expose a sysfs interface under this
>> device to show available reboot mode arguments.
>>
>> This results in the creation of:
>> /sys/class/reboot-mode/<driver>/reboot_modes
>>
>> This read-only sysfs file will exposes the supported reboot mode
>> arguments provided by the registering driver, enabling userspace to
>> query the list of arguments.
>>
>> Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
>> ---
>
> There are some nits from my side below but nothing serious so LGTM anyway.
>
> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>
>> +
>> +static inline void reboot_mode_release_list(struct list_head *head)
>
> I would have passed priv here as passing list_head as argument looks a bit
> weird.
Ack. thanks. Will pass priv here.
>
>> +{
>> + struct mode_info *info;
>> + struct mode_info *next;
>> +
>
> These could be on the same line.
Ack. thanks.
>
>> + sysfs_info->mode = kstrdup_const(info->mode, GFP_KERNEL);
>> + if (!sysfs_info->mode) {
>> + kfree(sysfs_info);
>> + ret = -ENOMEM;
>> + goto error;
>> + }
>> +
>> + list_add_tail(&sysfs_info->list, &priv->head);
>> + }
>> +
>> + priv->reboot_mode_device = device_create(&reboot_mode_class, NULL, 0,
>> + (void *)priv, reboot->dev->driver->name);
>> +
>
> Stray newline.
Ack. will remove this.
>
>> + if (IS_ERR(priv->reboot_mode_device)) {
>> + ret = PTR_ERR(priv->reboot_mode_device);
>> + goto error;
>> + }
>> +
>> + return 0;
>
> As I said, these are nits so fix them or not but let's get this upstream after
> v7.0-rc1.
Ack.
thanks,
Shivendra
prev parent reply other threads:[~2026-02-06 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 17:17 [PATCH v23 0/2] reboot-mode: Expose sysfs for registered reboot modes Shivendra Pratap
2026-02-05 17:17 ` [PATCH v23 1/2] Documentation: ABI: Add sysfs-class-reboot-mode-reboot_modes Shivendra Pratap
2026-02-05 17:17 ` [PATCH v23 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes Shivendra Pratap
2026-02-06 15:19 ` Bartosz Golaszewski
2026-02-06 16:25 ` Shivendra Pratap [this message]
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=241333dd-df8c-166a-e119-6e23cda3a876@oss.qualcomm.com \
--to=shivendra.pratap@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bgolasze@quicinc.com \
--cc=brgl@bgdev.pl \
--cc=brgl@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®