[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <241333dd-df8c-166a-e119-6e23cda3a876@oss.qualcomm.com>
Date: Fri, 6 Feb 2026 21:55:49 +0530
From: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
To: Bartosz Golaszewski <brgl@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-pm@...r.kernel.org, Bartosz Golaszewski <brgl@...ev.pl>,
Sebastian Reichel <sre@...nel.org>,
Bartosz Golaszewski <bgolasze@...cinc.com>,
Bjorn Andersson <andersson@...nel.org>
Subject: Re: [PATCH v23 2/2] power: reset: reboot-mode: Expose sysfs for
registered reboot_modes
On 2/6/2026 8:49 PM, Bartosz Golaszewski wrote:
> On Thu, 5 Feb 2026 18:17:14 +0100, Shivendra Pratap
> <shivendra.pratap@....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@....qualcomm.com>
>> ---
>
> There are some nits from my side below but nothing serious so LGTM anyway.
>
> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@....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
Powered by blists - more mailing lists