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

On Fri, May 31, 2019 at 5:27 PM David Collins <collinsd@codeaurora.org> wrote:
>
> 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.

Do you use the simple-framebuffer binding which provides for keeping necessary clocks and regulators on? With that, the dependency information is already in DT.

> 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.

IMO, this part of the problem should be solved with priorities for driver probing. It's not uncommon to want to bring up the display ASAP (in cases the bootloader didn't) or ensure serial port is brought up before other drivers (to reduce the need for earlycon). I'd be open to a DT property that serves as a hint (and only a hint). However, bringing up the dependencies is still a separate problem.

> 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.

We should stop pretending that late_initcall_sync is a marker at all. This includes disabling clocks and regulators and any deferred probe handling.

I'm just repeating myself here. This isn't a new problem and there's been several attempts to address it all of which get similar feedback and go nowhere. I'm doubtful that folks have read the past proposal discussions. In fact, this is the 2nd dependency property proposal in the last month or so.

Rob

      reply	other threads:[~2019-06-10 21:17 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
2019-06-10 21:17   ` Rob Herring [this message]

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='CAL_JsqLtZYQLz=quF8t5E2r8rOErNsJRgJMVbYfHjs8xgoO1GQ@mail.gmail.com' \
    --to=robh+dt@kernel.org \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.