lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230601-magnolia-liability-8cbe2e2e2d1e@spud>
Date:   Thu, 1 Jun 2023 21:03:09 +0100
From:   Conor Dooley <conor@...nel.org>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     Sean Nyekjaer <sean@...nix.com>,
        Conor Dooley <conor.dooley@...rochip.com>, robh+dt@...nel.org,
        Lee Jones <lee@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        pascal Paillet <p.paillet@...s.st.com>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] dt-bindings: mfd: stpmic1: add fsl,pmic-poweroff
 property

Not trimming any of this in case Lee wants to chime in and needs the
context...

On Thu, Jun 01, 2023 at 05:25:21PM +0200, Krzysztof Kozlowski wrote:
> On 01/06/2023 16:05, Sean Nyekjaer wrote:
> >> On 1 Jun 2023, at 09.12, Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
> >> On 24/05/2023 12:30, Sean Nyekjaer wrote:
> >>>> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@...rochip.com> wrote:
> >>>> On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote:
> >>>>>> On 23 May 2023, at 19.29, Conor Dooley <conor@...nel.org> wrote:
> >>>>>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote:
> >>>>>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@...nel.org> wrote:
> >>>>>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote:
> >>>>>>>>> Document the new optional "fsl,pmic-poweroff" property.
> >>>>>>>>>
> >>>>>>>>> Signed-off-by: Sean Nyekjaer <sean@...nix.com>
> >>>>>>>>> ---
> >>>>>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++
> >>>>>>>>> 1 file changed, 8 insertions(+)
> >>>>>>>>>
> >>>>>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>>>>>>>> index 9573e4af949e..5183a7c660d2 100644
> >>>>>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>>>>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> >>>>>>>>> @@ -26,6 +26,14 @@ properties:
> >>>>>>>>>
> >>>>>>>>> interrupt-controller: true
> >>>>>>>>>
> >>>>>>>>> +  st,pmic-poweroff:
> >>>>>>>>> +    $ref: /schemas/types.yaml#/definitions/flag
> >>>>>>>>> +    description: |
> >>>>>>>>> +      if present, configure the PMIC to shutdown all power rails when
> >>>>>>>>> +      power off sequence have finished.
> >>>>>>>>> +      Use this option if the SoC should be powered off by external power management
> >>>>>>>>> +      IC (PMIC).
> >>>>>>>>
> >>>>>>>> Just reading this description, this is sounding quite like a "software
> >>>>>>>> behaviour" type of property, which are not permitted, rather than
> >>>>>>>> describing some element of the hardware. Clearly you are trying to solve
> >>>>>>>> an actual problem though, so try re-phrasing the description (and
> >>>>>>>> property name) to focus on what exact hardware configuration it is that
> >>>>>>>> you are trying to special-case.
> >>>>>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in
> >>>>>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be
> >>>>>>>> good to look at.
> >>>>>>>
> >>>>>>> Better wording?
> >>>>>>>    Indicates that the power management IC (PMIC) is used to power off the board.
> >>>>>>>    So as the last step in the power off sequence set the SWOFF bit in the
> >>>>>>>    main control register (MAIN_CR) register, to shutdown all power rails.
> >>>>>>
> >>>>>> The description for the property that Krzysztof mentioned is
> >>>>>> samsung,s2mps11-acokb-ground:
> >>>>>>  description: |
> >>>>>>    Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so
> >>>>>>    the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the
> >>>>>>    power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes
> >>>>>>    low, the rising ACOKB will trigger power off.
> >>>>>>
> >>>>>> In other words, I am asking what (abnormal?) scenario there is that means
> >>>>>> you need the property, rather than what setting the property does.
> >>>>>> Or am I totally off, and this is the only way this PMIC works?
> >>>>>
> >>>>> Indicates that the power management IC (PMIC) turn-off condition is met
> >>>>> by setting the SWOFF bit in the main control register (MAIN_CR) register.
> >>>>> Turn-off condition can still be reached by the PONKEY input.
> >>>>>
> >>>>> ?
> >>>>>
> >>>>> I must admit I’m somewhat lost here :)
> >>>>
> >>>> Sorry about that. I'm trying to understand what is different about your
> >>>> hardware that it needs the property rather than what adding the property
> >>>> does. If you look at the samsung one, it describes both the
> >>>> configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to
> >>>> the ground") and how that is different from normal ("Usually the ACOKB is
> >>>> pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will
> >>>> trigger power off.")
> >>>>
> >>>> Looking at your datasheet, you don't have such a pin though - just the
> >>>> sw poweroff bit & the PONKEY stuff. My angle is just that I am trying
> >>>> to figure out why you need this property when it has not been needed
> >>>> before. Or why you would not always want to "shutdown all power rails
> >>>> when power-off sequence have finished". I'm sorry if these are silly
> >>>> questions.
> >>>>
> >>>
> >>> No silly questions, maybe they trick me to come up with the correct answer :D
> >>>
> >>> Basically without this, you won’t be able to power off the system
> >>> other than hitting the PONKEY.
> >>> So it’s a new feature that wasn’t supported before.
> >>> Maybe this feature should not be optional?

[1]

> >>
> >> You are still describing what driver should do with registers. What you
> >> are missing is describing real cause for this. It's exactly the same
> >> case as was with s2mps11.
> > 
> > I didn’t mention anything with registers in the patch:
> > 
> > if present, configure the PMIC to shutdown all power rails when
> > power off sequence have finished.
> > Use this option if the SoC should be powered off by external power management
> > IC (PMIC).
> > 
> > ^^ That’s is exactly what is happening if the option is enabled.
> > 
> > Do you have a suggestion wording?
> > What do you think about removing this option and make it default behaviour?
> 
> Again - you write what the driver should do ("configure the PMIC") when
> something in Linux happens ("power off sequence have finished"). Exactly
> the same case as s2mps11. Look how it was worded there. You need to find
>  the real cause, why such actions are required on which board.
> 
> Otherwise it does not warrant DT property and just perform it always.

Yeah, Sean asked that a few messages back up [1] & having looked at the
datasheet I am kinda struggling to see why you would not just always
want to do this. There does not seem to be an equivalent pin in this
PMIC as your Samsung one, so this patch isn't working around some
flaw in a board design, but rather seems to be looking to implement the
actual functionality.
I vote for do it always, obviously unless Less disagrees, and if that
causes problems we can revisit the dt property with more understanding
of whatever use case breaks if this is done unilaterally.

Cheers,
Conor.

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ