linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: kettenis@openbsd.org,
	 "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>, Hector Martin <marcan@marcan.st>,
	 Rob Herring <robh+dt@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple, pinctrl
Date: Sun, 9 May 2021 12:49:33 +0200	[thread overview]
Message-ID: <CACRpkdZYD3Nq7ZmdXsk_j0CAktvx6Sbqga5B1wbwtL-5T_=vkQ@mail.gmail.com> (raw)
In-Reply-To: <c1bd67fcc0390275@bloch.sibelius.xs4all.nl>

Hi Mark,

I think we settle with this scheme you choose, so the following
is just some hints for the future.

On Sun, May 9, 2021 at 11:46 AM Mark Kettenis <mark.kettenis@xs4all.nl> wrote:

> Right.  So far it seems we don't need to set the electrical config on
> any of the pins and I don't think we've identified any bits in the
> register that change the electrical configuration.  Although there are
> some hints in the Apple device tree that there are pins that need some
> additional configuration.  But I also see some evidence that the Apple
> firmware on these devices already sets up most of the pins for us.

This is something I think you want to look closer at soon.

It will *probably* be necessary to obtain optimal power management
for the devices, but I am not sure.

What operating systems (especially Android devices under Linux)
tend to do is to reconfigure pins at runtime in order to conserve
power. When the device goes to deep sleep just waiting for an
external interrupt (such as opening the lid on a laptop or pressing
the power button on a phone) the OS tend to reconfigure the
pins into a low power state for the duration of the sleep.

A typical example is to set a bunch of lines as "floating" (tristate)
in pin control terminology "bias-high-impedance". In some cases
pins may be connected to ground depending on use case,
but in each case this is done to avoid leak currents when
sleeping.

I don't know how noticeable impact this will have on standby times,
but the lower micron silicon technology, the bigger the impact.

If possible I'd recommend that you try to intercept what MacOS
is doing with these registers when the system goes in/out of
sleep mode. I think it could be key to some power savings you
would otherwise miss.

These two modes are standardized in pin control terms as
"default" and "sleep" and each affected device driver need
to actively put the pin control state to "sleep" when the
device is going to sleep, so the philosophy is entirely
distributed, in difference from some more sledgehammer-type
OS approaches where the OS is just slamming a number
of values into the pin registers at sleep (suspend) time.

The upside to doing this fine-grained and per device is that
the sleep modes can in best case be used at runtime
to e.g. save power on an unused USB port that isn't plugged
to anything (I don't know if this is a good example).
In Linux we have the runtime PM concept to deal with
this and there are some drivers actively saving power in
this way.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-05-09 10:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 14:19 [PATCH 0/2] Apple M1 pinctrl DT bindings Mark Kettenis
2021-05-08 14:19 ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl Mark Kettenis
2021-05-08 21:09   ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple, pinctrl Linus Walleij
2021-05-08 23:02     ` Mark Kettenis
2021-05-09  0:27       ` Linus Walleij
2021-05-09  9:50         ` Tomasz Figa
2021-05-10 13:09           ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl Krzysztof Kozlowski
2021-05-09  0:18   ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple, pinctrl Linus Walleij
2021-05-09  9:46     ` Mark Kettenis
2021-05-09 10:49       ` Linus Walleij [this message]
2021-05-10 13:03   ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl Krzysztof Kozlowski
2021-05-10 17:09     ` Mark Kettenis
2021-05-10 14:01   ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple, pinctrl Rob Herring
2021-05-10 18:18     ` Rob Herring
2021-05-10 14:19   ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl Rob Herring
2021-05-10 17:06     ` Mark Kettenis
2021-05-19 23:27       ` [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple, pinctrl Linus Walleij
2021-05-20 11:22         ` Mark Kettenis
2021-05-08 14:19 ` [PATCH 2/2] arm64: apple: Add pinctrl nodes Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACRpkdZYD3Nq7ZmdXsk_j0CAktvx6Sbqga5B1wbwtL-5T_=vkQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kettenis@openbsd.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=mark.kettenis@xs4all.nl \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).