devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Collins <collinsd@codeaurora.org>
To: Saravana Kannan <saravanak@google.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@android.com
Subject: Re: [PATCH v1 0/5] Solve postboot supplier cleanup and optimize probe ordering
Date: Fri, 31 May 2019 16:27:10 -0700	[thread overview]
Message-ID: <bddb15c9-0195-13ca-e829-0a511595c84e@codeaurora.org> (raw)
In-Reply-To: <20190524010117.225219-1-saravanak@google.com>

Hello Saravana,

On 5/23/19 6:01 PM, Saravana Kannan wrote:
...
> Having functional dependencies explicitly called out in DT and
> automatically added before the devices are probed, provides the
> following benefits:
...
> - Supplier devices like clock providers, regulators providers, etc
>   need to keep the resources they provide active and at a particular
>   state(s) during boot up even if their current set of consumers don't
>   request the resource to be active. This is because the rest of the
>   consumers might not have probed yet and turning off the resource
>   before all the consumers have probed could lead to a hang or
>   undesired user experience.
This benefit provided by the sync_state() callback function introduced in
this series gives us a mechanism to solve a specific problem encountered
on Qualcomm Technologies, Inc. (QTI) boards when booting with drivers
compiled as modules.  QTI boards have a regulator that powers the PHYs for
display, camera, USB, UFS, and PCIe.  When these boards boot up, the boot
loader enables this regulator along with other resources in order to
display a splash screen image.  The regulator must remain enabled until
the Linux display driver has probed and made a request with the regulator
framework to keep the regulator enabled.  If the regulator is disabled
prematurely, then the screen image is corrupted and the display hardware
enters a bad state.

We have observed that when the camera driver probes before the display
driver, it performs this sequence: regulator_enable(), camera register IO,
regulator_disable().  Since it is the first consumer of the shared
regulator, the regulator is physically disabled (even though display
hardware still requires it to be enabled).  We have solved this problem
when compiling drivers statically with a downstream regulator
proxy-consumer driver.  This proxy-consumer is able to make an enable
request for the shared regulator before any other consumer.  It then
removes its request at late_initcall_sync.

Unfortunately, when drivers are compiled as modules instead of compiled
statically into the kernel image, late_initcall_sync is not a meaningful
marker of driver probe completion.  This means that our existing proxy
voting system will not work when drivers are compiled as modules.  The
sync_state() callback resolves this issue by providing a notification that
is guaranteed to arrive only after all consumers of the shared regulator
have probed.

QTI boards have other cases of shared resources such as bus bandwidth
which must remain at least at a level set by boot loaders in order to
properly support hardware blocks that are enabled before the Linux kernel
starts booting.

Take care,
David

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2019-05-31 23:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  1:01 [PATCH v1 0/5] Solve postboot supplier cleanup and optimize probe ordering Saravana Kannan
2019-05-24  1:01 ` [PATCH v1 1/5] of/platform: Speed up of_find_device_by_node() Saravana Kannan
2019-05-24 17:56   ` Frank Rowand
2019-05-24 18:17     ` Saravana Kannan
2019-05-24 18:21     ` Saravana Kannan
2019-05-25  0:12       ` Frank Rowand
2019-06-11 14:51         ` Frank Rowand
2019-06-11 20:07           ` Saravana Kannan
2019-05-24  1:01 ` [PATCH v1 2/5] driver core: Add device links support for pending links to suppliers Saravana Kannan
2019-05-24  5:48   ` Greg Kroah-Hartman
2019-05-24  1:01 ` [PATCH v1 3/5] dt-bindings: Add depends-on property Saravana Kannan
2019-05-24 15:01   ` Mark Rutland
2019-05-24 22:09     ` Saravana Kannan
2019-05-24  1:01 ` [PATCH v1 4/5] of/platform: Add functional dependency link from "depends-on" property Saravana Kannan
2019-05-24  1:01 ` [PATCH v1 5/5] driver core: Add sync_state driver/bus callback Saravana Kannan
2019-05-24  5:48   ` Greg Kroah-Hartman
2019-05-24  5:52 ` [PATCH v1 0/5] Solve postboot supplier cleanup and optimize probe ordering Greg Kroah-Hartman
2019-05-25  2:17   ` Saravana Kannan
2019-05-24 13:04 ` Rob Herring
2019-05-24 21:51   ` Saravana Kannan
2019-05-24 17:49 ` Frank Rowand
2019-05-24 21:53   ` Saravana Kannan
2019-05-25  0:16     ` Frank Rowand
2019-05-25  0:22     ` Frank Rowand
2019-05-25  0:25       ` Frank Rowand
2019-05-25  2:08         ` Saravana Kannan
2019-05-25  1:47       ` Saravana Kannan
2019-05-25  2:40     ` Frank Rowand
2019-05-25  4:04       ` Saravana Kannan
2019-06-11 14:56         ` Frank Rowand
2019-06-11 20:19           ` Saravana Kannan
2019-05-29 20:00 ` Saravana Kannan
2019-05-29 20:02   ` Saravana Kannan
2019-05-31 23:27 ` David Collins [this message]
2019-06-10 21:17   ` Rob Herring

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=bddb15c9-0195-13ca-e829-0a511595c84e@codeaurora.org \
    --to=collinsd@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    /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).