[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MegAtTRvrxXRc1uQLn2F2-DMip-aFwz-q1JbOkny_8dWg@mail.gmail.com>
Date: Mon, 1 Dec 2025 18:53:14 +0100
From: Bartosz Golaszewski <brgl@...nel.org>
To: Shivendra Pratap <shivendra.pratap@....qualcomm.com>
Cc: Sebastian Reichel <sre@...nel.org>, Bartosz Golaszewski <bgolasze@...cinc.com>,
Bjorn Andersson <andersson@...nel.org>, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v20 2/2] power: reset: reboot-mode: Expose sysfs for
registered reboot_modes
On Mon, Dec 1, 2025 at 6:43 PM Shivendra Pratap
<shivendra.pratap@....qualcomm.com> wrote:
>
> >> @@ -132,9 +186,13 @@ int reboot_mode_unregister(struct reboot_mode_driver *reboot)
> >> struct mode_info *info;
> >>
> >> unregister_reboot_notifier(&reboot->reboot_notifier);
> >> + if (device_is_registered(&reboot->reboot_mode_device))
> >> + device_unregister(&reboot->reboot_mode_device);
> >
> > If you bail out of reboot_mode_register_device(), you don't need the
> > above check anymore because the device could
>
> We wanted to continue on failure, as per reviews.
>
You're probably referring to this bit:
--
On that note, I would argue that aborting the registration of
reboot-modes, just because we failed to create the convenient "debug"
interface, doesn't make sense. I think it would be better to just
continue even when create_reboot_mode_device() returns an error.
--
Anything in sysfs is not "debug". It if is, then it should go into
debugfs instead.
Trying to register a sysfs object with the same name will result in a
WARN() splat from sysfs core. I'd say we should definitely return an
error if sysfs registration fails and just make sure it can't by
assigning a unique name.
Bartosz
Powered by blists - more mailing lists