ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: ksummit-discuss@lists.linuxfoundation.org,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	"vegard.nossum@gmail.com" <vegard.nossum@gmail.com>,
	"rafael.j.wysocki" <rafael.j.wysocki@intel.com>,
	Valentin Rothberg <valentinrothberg@gmail.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] Addressing complex dependencies and semantics (v2)
Date: Thu, 28 Jul 2016 16:36:12 +0200	[thread overview]
Message-ID: <2009358.bQttlyPll1@vostro.rjw.lan> (raw)
In-Reply-To: <cf4ea315-fcbc-a7f5-758a-298cfac321e8@xs4all.nl>

On Thursday, July 28, 2016 12:54:47 PM Hans Verkuil wrote:
> 
> On 07/28/2016 12:41 PM, Laurent Pinchart wrote:
> > On Thursday 28 Jul 2016 02:54:56 Rafael J. Wysocki wrote:
> >> On Wednesday, July 27, 2016 09:20:40 PM Luis R. Rodriguez wrote:
> >>> On Wed, Jul 27, 2016 at 07:03:46PM +0100, Mark Brown wrote:
> >>>> On Wed, Jul 27, 2016 at 07:58:29PM +0200, Luis R. Rodriguez wrote:
> >>>>> On Wed, Jul 27, 2016 at 06:26:36PM +0100, Mark Brown wrote:
> >>>>>>> to help enable asynchronous probe, however for built-in devices
> >>>>>>> this requires very specific platform knowledge otherwise using
> >>>>>>> async probe will blow up your kernel -- if you get it right
> >>>>>>> though, using async probe can help with
> >>>>>>
> >>>>>> I'm not sure what specific platform knowledge you're thinking of
> >>>>>> here? We have coverage for most things in the form of deferred probe
> >>>>>> (messy though it is).
> >>>>>
> >>>>> Deferred probe is a complete a hack and sub-optimal. Being able to
> >>>>> address
> >>>>
> >>>> Sure, I don't think anyone disagrees on that but it does mean we don't
> >>>> actually blow up easily like we used to - it's messy but it does get
> >>>> there safely.
> >>>
> >>> Good point, without learning from the past we would otherwise expect
> >>> this is just a sloppy situation, so indeed deferred probe had its
> >>> merits, and we're at least now safe. The goal here is then how to
> >>> do this better, optimized and make it a non-hack.
> > 
> > Let's not demonize deferred probing, I think it's a good safety net to be used 
> > as a last resort when everything else failed. The problem is that we're using 
> > it as our primary mean to order initialization, and that leads to all sorts of 
> > inefficient behaviours at boot time.
> > 
> >> Well, my patchset uses deferred probing, so it won't help much here I guess.
> >>
> >>>> I was specifically querying your statement that things would blow up.
> >>>
> >>> In practice this varies as it depends on the device driver or component,
> >>> but the general theme seems to be "relying on something which is not
> >>> yet available".
> >>
> >> Not only that.
> >>
> >> There also is a "relying on something that is not a direct ancestor of the
> >> device you care about" angle of that.
> >>
> >> The device hierarchy as we know it is insufficient for representing
> >> dependencies beyond parent-child and that really is part of the problem,
> >> and a significant one IMO.
> > 
> > That's the core of the issue.
> > 
> > Linux has traditionally represented the device hierarchy from a control bus 
> > point of view, both in the driver model and in DT. We know other dependencies 
> > exist (data bus access, clocks, regulators, power domains, ...), and we try to 
> > address them with various heuristics.
> > 
> > One problem with those other dependencies is that they can't always be 
> > expressed as a tree and may a graph instead. Worse, in some cases, the graph 
> > can be cyclic (I've recently been told about an external I2C-based PLL that 
> > takes an input clock and generates an output clock, with the input clock being 
> > produced by an on-SoC sound device and the output clock being used by the same 
> > sound device). Even when individual resource trees or graphs are not cyclic, 
> > combining them in a global dependency graph will often result in cycles. The 
> > challenge is to find a proper way to both express the dependency graph and 
> > break the cycles.
> > 
> 
> Do we need to capture 100% of all the weird and wonderful dependencies? I think
> (speaking for the media subsystem) that the vast majority of the dependencies
> are pretty simple trees without cycles. Being able to capture that would be a
> huge help. The remaining more complex devices could still fall back on deferred
> probe, I'd say.
> 
> I'm never very keen on creating complex code to cater to a small percentage of
> problem cases.

The problem I'm interested in (and the patches posted are designed to help
address) is specifically when the dependency graph is not a tree.  However,
I don't think it is necessary to cover cycles in a generic way (as they should
be rare enough).

Thanks,
Rafael

  parent reply	other threads:[~2016-07-28 14:31 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 16:50 Luis R. Rodriguez
2016-07-27 17:26 ` Mark Brown
2016-07-27 17:58   ` Luis R. Rodriguez
2016-07-27 18:03     ` Mark Brown
2016-07-27 19:20       ` Luis R. Rodriguez
2016-07-28  0:54         ` Rafael J. Wysocki
2016-07-28 10:41           ` Laurent Pinchart
2016-07-28 10:54             ` Hans Verkuil
2016-07-28 11:03               ` Laurent Pinchart
2016-07-28 11:46                 ` Jan Kara
2016-07-28 15:16                   ` Mark Brown
2016-07-28 16:00                   ` Laurent Pinchart
2016-08-02  8:32                     ` Jan Kara
2016-08-03 14:17                     ` Alexandre Belloni
2016-07-30  1:59                   ` Steven Rostedt
2016-08-01 13:12                     ` Laurent Pinchart
2016-07-28 20:12                 ` Lars-Peter Clausen
2016-07-28 20:38                   ` Mark Brown
2016-08-01 13:15                   ` Laurent Pinchart
2016-07-28 14:36               ` Rafael J. Wysocki [this message]
2016-07-29  7:33             ` Hans Verkuil
2016-08-01 13:03               ` Laurent Pinchart
2016-08-01 13:17                 ` Hans Verkuil
2016-08-04  8:22             ` Jani Nikula
2016-08-04  9:50               ` Greg KH
2016-08-04 10:20                 ` Mark Brown
2016-08-04 10:27                   ` Jani Nikula
2016-08-05  2:59                   ` Rob Herring
2016-08-05  9:01                     ` Arnd Bergmann
2016-08-05 10:54                       ` Greg KH
2016-08-05 11:31                         ` Andrzej Hajda
2016-08-05 11:58                           ` Mark Brown
2016-08-05 13:43                           ` Greg KH
2016-08-05 19:27                         ` Rob Herring
2016-08-09  8:08                 ` Daniel Vetter
2016-08-09  8:17                   ` Greg KH
2016-08-09 12:04                     ` Daniel Vetter
2016-08-04 12:37       ` Geert Uytterhoeven
2016-08-04 15:53         ` Mark Brown
2016-07-28 21:49     ` Lars-Peter Clausen
2016-07-29  3:50       ` Greg KH
2016-07-29  7:45       ` Hans Verkuil
2016-07-29  7:55         ` Lars-Peter Clausen
2016-08-01 13:06           ` Laurent Pinchart
2016-07-29 11:13         ` Mark Brown
2016-08-01 13:09           ` Laurent Pinchart
2016-08-01 13:14             ` Lars-Peter Clausen
2016-08-01 13:19               ` Laurent Pinchart
2016-08-01 13:21             ` Hans Verkuil
2016-08-01 13:26               ` Laurent Pinchart
2016-08-01 13:35                 ` Hans Verkuil
2016-08-01 13:38                   ` Laurent Pinchart
2016-08-01 13:51                     ` Hans Verkuil
2016-08-01 17:15                       ` Laurent Pinchart
2016-08-01 13:33               ` Lars-Peter Clausen
2016-08-01 13:55                 ` Mauro Carvalho Chehab
2016-08-01 14:41                   ` Lars-Peter Clausen
2016-08-01 14:44                   ` Andrzej Hajda
2016-08-01 14:54                     ` Lars-Peter Clausen
2016-08-01 15:20                       ` Mark Brown
2016-08-01 15:34                       ` Andrzej Hajda
2016-08-01 15:43                         ` Lars-Peter Clausen
2016-08-01 16:18                           ` Andrzej Hajda
2016-08-01 17:06                             ` Mark Brown
2016-08-01 18:21                               ` Lars-Peter Clausen
2016-08-02 11:45                                 ` Andrzej Hajda
2016-08-01 18:33                               ` Andrzej Hajda
2016-08-01 18:48                                 ` Mark Brown
2016-08-01 19:42                                   ` Andrzej Hajda
2016-08-01 20:05                                     ` Lars-Peter Clausen
2016-08-02  8:57                                       ` Takashi Iwai
2016-08-01 17:40                       ` Laurent Pinchart
2016-08-02  7:38                     ` Greg KH
2016-08-01 19:03           ` Luis R. Rodriguez
2016-08-02  0:01             ` Rafael J. Wysocki
2016-08-02  0:56               ` Luis R. Rodriguez
2016-08-02  1:03                 ` Dmitry Torokhov
2016-08-02  8:30                   ` Jiri Kosina
2016-08-02  9:41                 ` Hannes Reinecke
2016-08-02  9:48                   ` Jiri Kosina
2016-08-02 11:50                     ` Takashi Iwai
2016-08-09  9:57             ` Jörg Rödel
2016-08-09 16:08               ` James Bottomley
2016-08-09 16:11                 ` James Bottomley
2016-08-09 16:51                   ` Luis R. Rodriguez
2016-08-09 17:05                     ` David Woodhouse
2016-08-09 17:12                     ` James Bottomley
2016-08-09 16:53                   ` Jörg Rödel
2016-08-09 18:06               ` Luis R. Rodriguez
2016-08-10 15:21                 ` Jörg Rödel
2016-08-10 16:42                   ` Luis R. Rodriguez
2016-08-10 21:37                     ` Jörg Rödel
2016-08-12  7:33               ` Linus Walleij
2016-07-27 18:50 ` Dmitry Torokhov
2016-07-28 10:43 ` Marc Zyngier
2016-07-28 10:51 ` Laurent Pinchart
2016-07-28 23:43   ` Luis R. Rodriguez
2016-08-01 12:44     ` Laurent Pinchart
2016-07-28 11:18 ` Mauro Carvalho Chehab
2016-07-28 11:24   ` Laurent Pinchart
2016-07-28 12:25     ` Mauro Carvalho Chehab
2016-07-28 16:04       ` Laurent Pinchart
2016-07-29  0:00         ` Luis R. Rodriguez
2016-08-01 12:50           ` Laurent Pinchart
2016-08-01 20:32             ` Luis R. Rodriguez
2016-07-29 13:57 ` Andrzej Hajda
2016-09-07 16:40   ` Kevin Hilman
2016-08-01 14:03 ` Marek Szyprowski
2016-11-03 18:43   ` Laurent Pinchart
2016-11-04  6:53     ` Marek Szyprowski
2016-09-08 21:03 ` Frank Rowand

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=2009358.bQttlyPll1@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=hverkuil@xs4all.nl \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@osg.samsung.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=valentinrothberg@gmail.com \
    --cc=vegard.nossum@gmail.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