[PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620

Diogo Ivo posted 4 patches 4 weeks ago
arch/arm64/boot/dts/nvidia/tegra210-smaug.dts |  2 ++
drivers/firmware/psci/psci.c                  |  8 +++---
drivers/mfd/max77620.c                        | 36 ++++++++++++++++++++-------
3 files changed, 34 insertions(+), 12 deletions(-)
[PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Diogo Ivo 4 weeks ago
This series migrates PSCI and MAX77620 poweroff handling to the
sys-off framework and fixes shutdown on the Pixel C (Smaug).

The first two patches replace legacy pm_power_off usage in the PSCI
and MAX77620 drivers with sys-off handlers. Besides aligning both
drivers with the modern poweroff infrastructure, this removes the
global callback dependency and allows multiple handlers to coexist
with explicit priorities.

The remaining patches address shutdown on the Pixel C. Although the
platform exposes PSCI firmware, its SYSTEM_OFF implementation is not
functional:

    __dead2 void tegra_system_off(void)
    {
            ERROR("Tegra System Off: operation not handled.\n");
            panic();
    }

Downstream kernels instead rely on the MAX77620 PMIC to perform the
shutdown sequence. To mirror that behavior upstream, register the
MAX77620 handler with higher priority than PSCI on Smaug systems and
mark the PMIC as the system power controller in device tree.

Patch overview:
  1. firmware: psci: switch SYSTEM_OFF to sys-off handler API
  2. mfd: max77620: convert poweroff support to sys-off API
  3. mfd: max77620: override PSCI poweroff handler on Smaug
  4. arm64: dts: tegra: smaug: mark MAX77620 as system power controller

Tested on a Pixel C, where poweroff now completes successfully
instead of hanging in PSCI firmware.

Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
---
Diogo Ivo (4):
      firmware: psci: switch SYSTEM_OFF to sys-off handler API
      mfd: max77620: convert poweroff support to sys-off API
      mfd: max77620: override PSCI poweroff handler on Pixel C
      arm64: tegra: smaug: mark MAX77620 as system power controller

 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts |  2 ++
 drivers/firmware/psci/psci.c                  |  8 +++---
 drivers/mfd/max77620.c                        | 36 ++++++++++++++++++++-------
 3 files changed, 34 insertions(+), 12 deletions(-)
---
base-commit: f327c8ef8a6905ee97b62e42d808603c5b759418
change-id: 20260514-smaug-poweroff-9626c5501bbc

Best regards,
--  
Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Thierry Reding 2 weeks ago
From: Thierry Reding <treding@nvidia.com>


On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
> This series migrates PSCI and MAX77620 poweroff handling to the
> sys-off framework and fixes shutdown on the Pixel C (Smaug).
> 
> The first two patches replace legacy pm_power_off usage in the PSCI
> and MAX77620 drivers with sys-off handlers. Besides aligning both
> drivers with the modern poweroff infrastructure, this removes the
> global callback dependency and allows multiple handlers to coexist
> with explicit priorities.
> 
> [...]

Applied, thanks!

[4/4] arm64: tegra: smaug: mark MAX77620 as system power controller
      commit: ec36d6d5960cf75bea780a639db346cac42fab9c

Best regards,
-- 
Thierry Reding <treding@nvidia.com>
Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Lee Jones 3 weeks, 1 day ago
On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
> This series migrates PSCI and MAX77620 poweroff handling to the
> sys-off framework and fixes shutdown on the Pixel C (Smaug).
> 
> The first two patches replace legacy pm_power_off usage in the PSCI
> and MAX77620 drivers with sys-off handlers. Besides aligning both
> drivers with the modern poweroff infrastructure, this removes the
> global callback dependency and allows multiple handlers to coexist
> with explicit priorities.
> 
> [...]

Applied, thanks!

[2/4] mfd: max77620: convert poweroff support to sys-off API
      commit: 1ada6d7f88063dd6fd92d74d0b803875b695fe01
[3/4] mfd: max77620: override PSCI poweroff handler on Pixel C
      commit: ea3f90bcc8524c6d514f6b8183cc202b79b082be

--
Lee Jones [李琼斯]

Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Diogo Ivo 3 weeks, 1 day ago
Hi Lee,

On 5/20/26 18:25, Lee Jones wrote:
> On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
>> This series migrates PSCI and MAX77620 poweroff handling to the
>> sys-off framework and fixes shutdown on the Pixel C (Smaug).
>>
>> The first two patches replace legacy pm_power_off usage in the PSCI
>> and MAX77620 drivers with sys-off handlers. Besides aligning both
>> drivers with the modern poweroff infrastructure, this removes the
>> global callback dependency and allows multiple handlers to coexist
>> with explicit priorities.
>>
>> [...]
> 
> Applied, thanks!

Thanks for applying the patches! Just a question and an observation:

  - I'm assuming you were ok with merging [2/4] despite the possible
    deadlock since this risk is already present in mainline in the same
    form so we're not actually making things worse, is that so?

  - The observation is that the comment about overriding PSCI is only
    true after (and if) a reworked [1/4] is actually merged.
    If it isn't then patch [3/4] is actually working around another handler
    in soc/tegra/pmc.c where a handler that only does work for the Nexus
    7 is actually registered at FIRMWARE level for all platforms that
    probe that driver (I will send out a patch shortly to only register
    the handler on the Nexus 7).

Best regards,
Diogo

> [2/4] mfd: max77620: convert poweroff support to sys-off API
>        commit: 1ada6d7f88063dd6fd92d74d0b803875b695fe01
> [3/4] mfd: max77620: override PSCI poweroff handler on Pixel C
>        commit: ea3f90bcc8524c6d514f6b8183cc202b79b082be
> 
> --
> Lee Jones [李琼斯]
> 
Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Lee Jones 3 weeks, 1 day ago
On Thu, 21 May 2026, Diogo Ivo wrote:

> Hi Lee,
> 
> On 5/20/26 18:25, Lee Jones wrote:
> > On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
> > > This series migrates PSCI and MAX77620 poweroff handling to the
> > > sys-off framework and fixes shutdown on the Pixel C (Smaug).
> > > 
> > > The first two patches replace legacy pm_power_off usage in the PSCI
> > > and MAX77620 drivers with sys-off handlers. Besides aligning both
> > > drivers with the modern poweroff infrastructure, this removes the
> > > global callback dependency and allows multiple handlers to coexist
> > > with explicit priorities.
> > > 
> > > [...]
> > 
> > Applied, thanks!
> 
> Thanks for applying the patches! Just a question and an observation:
> 
>  - I'm assuming you were ok with merging [2/4] despite the possible
>    deadlock since this risk is already present in mainline in the same
>    form so we're not actually making things worse, is that so?

Did you see the text below?

Both patches 2 and 3 are applied.

>  - The observation is that the comment about overriding PSCI is only
>    true after (and if) a reworked [1/4] is actually merged.
>    If it isn't then patch [3/4] is actually working around another handler
>    in soc/tegra/pmc.c where a handler that only does work for the Nexus
>    7 is actually registered at FIRMWARE level for all platforms that
>    probe that driver (I will send out a patch shortly to only register
>    the handler on the Nexus 7).

I assume the other patches will be applied soon.

If this causes some kind of issue - let me know later on in the cycle
and I'll remove whatever patches you ask me to.

-- 
Lee Jones
Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Diogo Ivo 3 weeks ago

On 5/21/26 12:41, Lee Jones wrote:
> On Thu, 21 May 2026, Diogo Ivo wrote:
> 
>> Hi Lee,
>>
>> On 5/20/26 18:25, Lee Jones wrote:
>>> On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
>>>> This series migrates PSCI and MAX77620 poweroff handling to the
>>>> sys-off framework and fixes shutdown on the Pixel C (Smaug).
>>>>
>>>> The first two patches replace legacy pm_power_off usage in the PSCI
>>>> and MAX77620 drivers with sys-off handlers. Besides aligning both
>>>> drivers with the modern poweroff infrastructure, this removes the
>>>> global callback dependency and allows multiple handlers to coexist
>>>> with explicit priorities.
>>>>
>>>> [...]
>>>
>>> Applied, thanks!
>>
>> Thanks for applying the patches! Just a question and an observation:
>>
>>   - I'm assuming you were ok with merging [2/4] despite the possible
>>     deadlock since this risk is already present in mainline in the same
>>     form so we're not actually making things worse, is that so?
> 
> Did you see the text below?

Yes, but patch 3 is not addressing the possible deadlock hence my
question.

> Both patches 2 and 3 are applied.
> 
>>   - The observation is that the comment about overriding PSCI is only
>>     true after (and if) a reworked [1/4] is actually merged.
>>     If it isn't then patch [3/4] is actually working around another handler
>>     in soc/tegra/pmc.c where a handler that only does work for the Nexus
>>     7 is actually registered at FIRMWARE level for all platforms that
>>     probe that driver (I will send out a patch shortly to only register
>>     the handler on the Nexus 7).
> 
> I assume the other patches will be applied soon.
>
> If this causes some kind of issue - let me know later on in the cycle
> and I'll remove whatever patches you ask me to.

The PSCI patch [1/4] has a fundamental issue and needs a respin to be
applied.

In connection with this it might then become easier to quirk the PSCI
driver rather than the PMIC driver, so for the moment I'll ask you to
drop [3/4] until I propose the changes to the PSCI maintainers and see
the feedback and at that point we can either completely drop [3/4] or
reapply it; sorry for the noise.

Best regards,
Diogo
Re: (subset) [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620
Posted by Lee Jones 3 weeks ago
On Thu, 21 May 2026, Diogo Ivo wrote:

> 
> 
> On 5/21/26 12:41, Lee Jones wrote:
> > On Thu, 21 May 2026, Diogo Ivo wrote:
> > 
> > > Hi Lee,
> > > 
> > > On 5/20/26 18:25, Lee Jones wrote:
> > > > On Thu, 14 May 2026 16:47:18 +0200, Diogo Ivo wrote:
> > > > > This series migrates PSCI and MAX77620 poweroff handling to the
> > > > > sys-off framework and fixes shutdown on the Pixel C (Smaug).
> > > > > 
> > > > > The first two patches replace legacy pm_power_off usage in the PSCI
> > > > > and MAX77620 drivers with sys-off handlers. Besides aligning both
> > > > > drivers with the modern poweroff infrastructure, this removes the
> > > > > global callback dependency and allows multiple handlers to coexist
> > > > > with explicit priorities.
> > > > > 
> > > > > [...]
> > > > 
> > > > Applied, thanks!
> > > 
> > > Thanks for applying the patches! Just a question and an observation:
> > > 
> > >   - I'm assuming you were ok with merging [2/4] despite the possible
> > >     deadlock since this risk is already present in mainline in the same
> > >     form so we're not actually making things worse, is that so?
> > 
> > Did you see the text below?
> 
> Yes, but patch 3 is not addressing the possible deadlock hence my
> question.
> 
> > Both patches 2 and 3 are applied.
> > 
> > >   - The observation is that the comment about overriding PSCI is only
> > >     true after (and if) a reworked [1/4] is actually merged.
> > >     If it isn't then patch [3/4] is actually working around another handler
> > >     in soc/tegra/pmc.c where a handler that only does work for the Nexus
> > >     7 is actually registered at FIRMWARE level for all platforms that
> > >     probe that driver (I will send out a patch shortly to only register
> > >     the handler on the Nexus 7).
> > 
> > I assume the other patches will be applied soon.
> > 
> > If this causes some kind of issue - let me know later on in the cycle
> > and I'll remove whatever patches you ask me to.
> 
> The PSCI patch [1/4] has a fundamental issue and needs a respin to be
> applied.
> 
> In connection with this it might then become easier to quirk the PSCI
> driver rather than the PMIC driver, so for the moment I'll ask you to
> drop [3/4] until I propose the changes to the PSCI maintainers and see
> the feedback and at that point we can either completely drop [3/4] or
> reapply it; sorry for the noise.

Done.

-- 
Lee Jones