[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MdHKCg90fc0UJ45wXYPn=F-dcLhDrv2sO-=VP6k4=UqLw@mail.gmail.com>
Date: Fri, 6 Feb 2026 07:19:33 -0800
From: Bartosz Golaszewski <brgl@...nel.org>
To: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
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 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.
> +{
> + struct mode_info *info;
> + struct mode_info *next;
> +
These could be on the same line.
> + 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.
> + 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.
Bartosz
Powered by blists - more mailing lists