dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Lubomir Rintel <lkundrak@v3.sk>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Peter Rosin <peda@axentia.se>
Subject: Re: Armada DRM: bridge with componentized devices
Date: Wed, 9 Jan 2019 09:30:52 +0000	[thread overview]
Message-ID: <20190109093052.GX11171@n2100.armlinux.org.uk> (raw)
In-Reply-To: <CAJZ5v0jOY44u77O8RuDJL+b3uD6u_Meco7Gv6RUmiPtSbwpciA@mail.gmail.com>

On Wed, Jan 09, 2019 at 10:24:01AM +0100, Rafael J. Wysocki wrote:
> On Wed, Jan 9, 2019 at 10:13 AM Andrzej Hajda <a.hajda@samsung.com> wrote:
> >
> > +CC: Rafael J. Wysocki <rafael@kernel.org>
> >
> > On 08.01.2019 16:07, Russell King - ARM Linux wrote:
> > > On Tue, Jan 08, 2019 at 03:33:54PM +0100, Andrzej Hajda wrote:
> > >> On 08.01.2019 14:21, Russell King - ARM Linux wrote:
> > >>> On Tue, Jan 08, 2019 at 01:27:56PM +0100, Andrzej Hajda wrote:
> > >>>> On 08.01.2019 12:38, Russell King - ARM Linux wrote:
> > >>>>> On Tue, Jan 08, 2019 at 12:25:34PM +0100, Andrzej Hajda wrote:
> > >>>>>> Issues with device links have nothing to do with hotplugging, they are
> > >>>>>> generic - lifetime of the objects (drm_bridge, drm_panel) is just
> > >>>>>> slightly different of lifetime of device links, and this is racy even if
> > >>>>>> you do not want hotplugging. Moreover since drm_dev is not device (has
> > >>>>>> no associated struct device) assuming we can reuse its parent to create
> > >>>>>> device link results in circular dependencies.
> > >>>>> How about having the device links created depending on whether the
> > >>>>> main drm driver wants them or not - that would mean that Exynos
> > >>>>> could continue avoiding them, but others that want them can have
> > >>>>> the links?
> > >>>> That should be OK for Exynos. But regardless of Exynos device_links at
> > >>>> the current state will not work correctly with bridges/panels as I
> > >>>> described earlier.
> > >>> However, I'm not sure you're correct with your interpretation of the
> > >>> documentation.  Firstly, the documentation says:
> > >>>
> > >>>    Another example for an inconsistent state would be a device link that
> > >>>    represents a driver presence dependency, yet is added from the consumer's
> > >>>    ->probe callback while the supplier hasn't probed yet: Had the driver core
> > >>>    known about the device link earlier, it wouldn't have probed the consumer
> > >>>    in the first place. The onus is thus on the consumer to check presence of
> > >>>    the supplier after adding the link, and defer probing on non-presence.
> > >>>
> > >>> This is fine - if we add the device link from of_drm_find_bridge(), we
> > >>> will be in the consumer's ->probe function, and the supplier must have
> > >>> been probed for us to find the struct drm_bridge.
> > >>
> > >> Supplier usually is registered in it's probe time, so there is short
> > >> period of time when supplier is available, but the probe is not yet
> > >> finished - quite unsafe, but not impossible, especially if there exists
> > >> some kind of notifications about resource appearance (MIPI-DSI case).
> > > At some point during the supplier probe, the resource becomes available
> > > to consumers.  At that point, device links can be setup before the
> > > supplier has finished probing.  So any driver that provides resources
> > > to another driver will, at some point during the provider's probe,
> > > make resources available, and therefore be a candidate for device links
> > > to be created _before_ the probe function has returned.
> > >
> > > What is a problem is if the provider publishes resources, and then fails
> > > its probe function, causing the resource to disappear.
> >
> >
> > But creating link to not-probed provider is still incorrect usage from
> > device_links framework PoV, and my tests showed indeed that device link
> > created before end of provider's probe does not work at all - and since
> > it is stated in the documentation I guess it is by design.
> 
> Yes, it is.

So is the regulator support and the use of it being proposed for the CCF
all going against the design of device links?  In both those cases,
device links _can_ be created while the supplier is still in the probe
function by a consumer finding the resource.

This seems fragile by design.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-01-09  9:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  9:47 Armada DRM: bridge with componentized devices Lubomir Rintel
2019-01-03 13:11 ` Russell King - ARM Linux
2019-01-07 10:45   ` Daniel Vetter
2019-01-07 11:26     ` Andrzej Hajda
2019-01-07 16:08       ` Daniel Vetter
2019-01-07 16:27         ` Andrzej Hajda
2019-01-07 21:56           ` Daniel Vetter
2019-01-08  8:35             ` Andrzej Hajda
2019-01-08  8:47               ` Daniel Vetter
2019-01-08  9:22                 ` Andrzej Hajda
2019-01-08 10:23                   ` Russell King - ARM Linux
2019-01-08 10:32                     ` Andrzej Hajda
2019-01-08 10:24                   ` Daniel Vetter
2019-01-08 11:25                     ` Andrzej Hajda
2019-01-08 11:38                       ` Russell King - ARM Linux
2019-01-08 12:27                         ` Andrzej Hajda
2019-01-08 13:21                           ` Russell King - ARM Linux
2019-01-08 13:34                             ` Daniel Vetter
2019-01-08 14:33                             ` Andrzej Hajda
2019-01-08 15:07                               ` Russell King - ARM Linux
2019-01-08 18:07                                 ` Daniel Vetter
2019-01-09  9:12                                 ` Andrzej Hajda
2019-01-09  9:24                                   ` Rafael J. Wysocki
2019-01-09  9:30                                     ` Russell King - ARM Linux [this message]
2019-01-11 14:20                                       ` Daniel Vetter
2019-01-11 14:26                                         ` Rafael J. Wysocki
2019-01-11 14:32                                           ` Russell King - ARM Linux
2019-01-11 14:36                                             ` Daniel Vetter
2019-01-11 14:40                                               ` Rafael J. Wysocki
2019-01-11 14:36                                             ` Rafael J. Wysocki
2019-01-11 14:49                                               ` Russell King - ARM Linux
2019-01-14 12:32                                                 ` Rafael J. Wysocki
2019-01-15  0:04                                                   ` Rafael J. Wysocki
2019-01-15 22:47                                                     ` Rafael J. Wysocki
2019-01-16 18:42                                                       ` Daniel Vetter
2019-01-16 22:43                                                         ` Rafael J. Wysocki
2019-01-17 12:20                                                           ` Daniel Vetter
2019-01-18  9:36                                                             ` Lucas Stach
2019-01-18 10:03                                                               ` Rafael J. Wysocki
2019-01-18 11:06                                                                 ` Daniel Vetter
2019-01-18 11:17                                                                   ` Rafael J. Wysocki
2019-01-18 11:37                                                                     ` Rafael J. Wysocki
2019-01-18 12:57                                                                       ` Daniel Vetter
2019-01-24 11:00                                                                         ` Rafael J. Wysocki
2019-01-17 17:26                                                       ` Russell King - ARM Linux admin
2019-01-17 22:43                                                         ` Rafael J. Wysocki
2019-01-18 11:07                   ` Linus Walleij
2019-01-08 10:16               ` Russell King - ARM Linux
2019-01-08 10:31                 ` Daniel Vetter
2019-01-07 16:12     ` Russell King - ARM Linux
2019-01-07 21:55       ` Daniel Vetter
2019-01-08  0:39         ` Russell King - ARM Linux
2019-01-08 14:29           ` Liviu Dudau

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=20190109093052.GX11171@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Liviu.Dudau@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lkundrak@v3.sk \
    --cc=peda@axentia.se \
    --cc=rafael@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