[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <12c9a69c-7e27-4d43-9b1b-542e735176ec@app.fastmail.com>
Date: Thu, 10 Jul 2025 17:29:36 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Shivendra Pratap" <shivendra.pratap@....qualcomm.com>,
"Bartosz Golaszewski" <bartosz.golaszewski@...aro.org>,
"Bjorn Andersson" <andersson@...nel.org>,
"Sebastian Reichel" <sre@...nel.org>, "Rob Herring" <robh@...nel.org>,
"Sudeep Holla" <sudeep.holla@....com>,
"Souvik Chakravarty" <Souvik.Chakravarty@....com>,
"Krzysztof Kozlowski" <krzk+dt@...nel.org>,
"Conor Dooley" <conor+dt@...nel.org>, "Andy Yan" <andy.yan@...k-chips.com>,
"Mark Rutland" <mark.rutland@....com>,
"Lorenzo Pieralisi" <lpieralisi@...nel.org>,
"Olof Johansson" <olof@...om.net>, "Konrad Dybcio" <konradybcio@...nel.org>,
cros-qcom-dts-watchers@...omium.org, "Vinod Koul" <vkoul@...nel.org>,
"Catalin Marinas" <catalin.marinas@....com>, "Will Deacon" <will@...nel.org>,
"Florian Fainelli" <florian.fainelli@...adcom.com>,
"Elliot Berman" <elliotb317@...il.com>
Cc: "Stephen Boyd" <swboyd@...omium.org>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
André Draszik <andre.draszik@...aro.org>,
"Alim Akhtar" <alim.akhtar@...sung.com>, linux-samsung-soc@...r.kernel.org,
"Wei Xu" <xuwei5@...ilicon.com>, linux-rockchip@...ts.infradead.org,
"Baolin Wang" <baolin.wang@...ux.alibaba.com>,
"Sen Chu" <sen.chu@...iatek.com>, "Sean Wang" <sean.wang@...iatek.com>,
"Macpaul Lin" <macpaul.lin@...iatek.com>,
"AngeloGioacchino Del Regno" <angelogioacchino.delregno@...labora.com>,
"Ray Jui" <rjui@...adcom.com>, "Scott Branden" <sbranden@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com,
"Nicolas Ferre" <nicolas.ferre@...rochip.com>,
"Alexandre Belloni" <alexandre.belloni@...tlin.com>,
"Elliot Berman" <quic_eberman@...cinc.com>,
"Srinivas Kandagatla" <srini@...nel.org>
Subject: Re: [PATCH v10 03/10] power: reset: reboot-mode: Add optional cookie argument
On Thu, Jul 10, 2025, at 11:15, Shivendra Pratap wrote:
> static int reboot_mode_notify(struct notifier_block *this,
> unsigned long mode, void *cmd)
> {
> struct reboot_mode_driver *reboot;
> - unsigned int magic;
> + struct mode_info *info;
>
> reboot = container_of(this, struct reboot_mode_driver, reboot_notifier);
> - magic = get_reboot_mode_magic(reboot, cmd);
> - if (magic)
> - reboot->write(reboot, magic);
> + info = get_reboot_mode_info(reboot, cmd);
> + if (info) {
> + if (info->is_cookie_valid) {
> + reboot->write_with_cookie(reboot, info->magic, info->cookie);
> + } else {
> + if (info->magic)
> + reboot->write(reboot, info->magic);
> + }
> + }
I don't quite see why we need two possible callbacks here, could
this be done with a single '->write' callback when you either
add another argument, or extend the existing 'magic' value
to 64 bit?
There are only a couple of drivers that provide this callback,
so it should be easy to just change them all at once.
Arnd
Powered by blists - more mailing lists