LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Peter Rosin <peda@axentia.se>,
	Martyn Welch <martyn.welch@collabora.co.uk>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kern,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Kukjin Kim <kgene@kernel.org>,
	Peter Senna Tschudin <peter.senna@collabora.com>,
	Martin Donnelly <martin.donnelly@ge.com>,
	linux-arm-msm@vger.kernel.org, Jyri Sarha <jsarha@ti.com>,
	el.org@freedesktop.org, Matthias Brugger <matthias.bgg@gmail.com>,
	Vincent Abriou <vincent.abriou@st.com>,
	linux-arm-kernel@lists.infradead.org,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH 00/24] device link, bridge supplier <-> drm device
Date: Mon, 30 Apr 2018 17:18:03 +0200	[thread overview]
Message-ID: <20180430151803.GN12521@phenom.ffwll.local> (raw)
In-Reply-To: <1881012.XPHlTWYXH6@avalon>

On Fri, Apr 27, 2018 at 01:40:21AM +0300, Laurent Pinchart wrote:
> Hi Peter,
> 
> Thank you for the patches.
> 
> On Friday, 27 April 2018 01:31:15 EEST Peter Rosin wrote:
> > Hi!
> > 
> > It was noted by Russel King [1] that bridges (not using components)
> > might disappear unexpectedly if the owner of the bridge was unbound.
> > Jyri Sarha had previously noted the same thing with panels [2]. Jyri
> > came up with using device links to resolve the panel issue, which
> > was also my (independent) reaction to the note from Russel.
> > 
> > This series builds up to the addition of that link in the last
> > patch, but in my opinion the other 23 patches do have merit on their
> > own.
> > 
> > The last patch needs testing, while the others look trivial. That
> > said, I might have missed some subtlety.
> 
> I don't think this is the way to go. We have a real lifetime management 
> problem with bridges, and device links are just trying to hide the problem 
> under the carpet. They will further corner us by making a real fix much more 
> difficult to implement. I'll try to comment further in the next few days on 
> what I think a better solution would be, but in a nutshell I believe that 
> drm_bridge objects need to be refcounted, with a .release() operation to free 
> the bridge resources when the reference count drops to zero. This shouldn't be 
> difficult to implement and I'm willing to help.

I agree that refcounting is the proper fix if bridges can be
hot-unplugged, independently of the overall drm_device.

And yes retro-shoehorning refcounting is "fun", but it's also not
impossible. I've done it a few times by now in drm.

Otoh, refcounting has a pretty serious cost - we're still blowing up
drm_framebuffer refcounting in corner cases at shocking regularity, and
that's something that's been refcounted for years by now. As long as we
don't have a clearly defined need to make bridges hotpluggable then I
think not paying the hefty bill just yet is the correct technical
decision. This patch series here looks like a reasonable way to tie the
lifetimes together a bit more closely and should fix the bugs we have
right now.

Cheers, Daniel

PS: Yes there's cases where you can hotplug display blocks on a SoC. To my
knowledge they're all covered by hotplugging the entire drm_device (plus
all the statically associated bits like drm_bridge/crtc/plane/encoder).
And we're already working on fixing up drm_device to at least make it
possible to write a correct hot-unpluggable driver in theory. We'll see
whether anyone manages to pull that off in practice :-)

> 
> > [1] https://lkml.org/lkml/2018/4/23/769
> > [2] https://www.spinics.net/lists/dri-devel/msg174275.html
> > 
> > Peter Rosin (24):
> >   drm/bridge: allow optionally specifying an .owner device
> >   drm/bridge: adv7511: provide an .owner device
> >   drm/bridge/analogix: core: specify the .owner of the bridge
> >   drm/bridge: analogix-anx78xx: provide an .owner device
> >   drm/bridge: vga-dac: provide an .owner device
> >   drm/bridge: lvds-encoder: provide an .owner device
> >   drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: provide an .owner device
> >   drm/bridge: nxp-ptn3460: provide an .owner device
> >   drm/bridge: panel: provide an .owner device
> >   drm/bridge: ps8622: provide an .owner device
> >   drm/bridge: sii902x: provide an .owner device
> >   drm/bridge: sii9234: provide an .owner device
> >   drm/bridge: sii8620: provide an .owner device
> >   drm/bridge: synopsys: provide an .owner device for the bridges
> >   drm/bridge: tc358767: provide an .owner device
> >   drm/bridge: ti-tfp410: provide an .owner device
> >   drm/exynos: mic: provide an .owner device for the bridge
> >   drm/mediatek: hdmi: provide an .owner device for the bridge
> >   drm/msm: specify the .owner of the bridges
> >   drm/rcar-du: lvds: provide an .owner device for the bridge
> >   drm/sti: provide an .owner device for the bridges
> >   drm/bridge: remove the .of_node member
> >   drm/bridge: require the .owner to be filled in on drm_bridge_attach
> >   drm/bridge: establish a link between the bridge supplier and consumer
> > 
> >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c       |  2 +-
> >  drivers/gpu/drm/bridge/analogix-anx78xx.c          |  5 +----
> >  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |  1 +
> >  drivers/gpu/drm/bridge/dumb-vga-dac.c              |  2 +-
> >  drivers/gpu/drm/bridge/lvds-encoder.c              |  2 +-
> >  .../drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c   |  2 +-
> >  drivers/gpu/drm/bridge/nxp-ptn3460.c               |  2 +-
> >  drivers/gpu/drm/bridge/panel.c                     |  4 +---
> >  drivers/gpu/drm/bridge/parade-ps8622.c             |  2 +-
> >  drivers/gpu/drm/bridge/sii902x.c                   |  2 +-
> >  drivers/gpu/drm/bridge/sii9234.c                   |  2 +-
> >  drivers/gpu/drm/bridge/sil-sii8620.c               |  2 +-
> >  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          |  4 +---
> >  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c      |  4 +---
> >  drivers/gpu/drm/bridge/tc358767.c                  |  2 +-
> >  drivers/gpu/drm/bridge/ti-tfp410.c                 |  2 +-
> >  drivers/gpu/drm/drm_bridge.c                       | 23 ++++++++++++++++++-
> >  drivers/gpu/drm/exynos/exynos_drm_mic.c            |  2 +-
> >  drivers/gpu/drm/mediatek/mtk_hdmi.c                |  2 +-
> >  drivers/gpu/drm/msm/dsi/dsi_manager.c              |  1 +
> >  drivers/gpu/drm/msm/edp/edp_bridge.c               |  1 +
> >  drivers/gpu/drm/msm/hdmi/hdmi_bridge.c             |  1 +
> >  drivers/gpu/drm/rcar-du/rcar_lvds.c                |  2 +-
> >  drivers/gpu/drm/sti/sti_dvo.c                      |  2 +-
> >  drivers/gpu/drm/sti/sti_hda.c                      |  1 +
> >  drivers/gpu/drm/sti/sti_hdmi.c                     |  1 +
> >  include/drm/drm_bridge.h                           |  8 ++++----
> >  27 files changed, 51 insertions(+), 33 deletions(-)
> 
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  parent reply	other threads:[~2018-04-30 15:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180426223215epcas2p38fe3b0b7b1ea1c8190805f9e2a89e11e@epcas2p3.samsung.com>
2018-04-26 22:31 ` Peter Rosin
2018-04-26 22:31   ` [PATCH 01/24] drm/bridge: allow optionally specifying an .owner device Peter Rosin
2018-04-26 22:31   ` [PATCH 02/24] drm/bridge: adv7511: provide " Peter Rosin
2018-04-26 22:31   ` [PATCH 03/24] drm/bridge/analogix: core: specify the .owner of the bridge Peter Rosin
2018-04-26 22:31   ` [PATCH 04/24] drm/bridge: analogix-anx78xx: provide an .owner device Peter Rosin
2018-04-26 22:31   ` [PATCH 05/24] drm/bridge: vga-dac: " Peter Rosin
2018-04-26 22:31   ` [PATCH 06/24] drm/bridge: lvds-encoder: " Peter Rosin
2018-04-26 22:31   ` [PATCH 07/24] drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: " Peter Rosin
2018-04-26 22:31   ` [PATCH 08/24] drm/bridge: nxp-ptn3460: " Peter Rosin
2018-04-26 22:31   ` [PATCH 09/24] drm/bridge: panel: " Peter Rosin
2018-04-26 22:31   ` [PATCH 10/24] drm/bridge: ps8622: " Peter Rosin
2018-04-26 22:31   ` [PATCH 11/24] drm/bridge: sii902x: " Peter Rosin
2018-04-26 22:31   ` [PATCH 12/24] drm/bridge: sii9234: " Peter Rosin
2018-04-26 22:31   ` [PATCH 13/24] drm/bridge: sii8620: " Peter Rosin
2018-04-26 22:31   ` [PATCH 14/24] drm/bridge: synopsys: provide an .owner device for the bridges Peter Rosin
2018-04-26 22:31   ` [PATCH 15/24] drm/bridge: tc358767: provide an .owner device Peter Rosin
2018-04-26 22:31   ` [PATCH 16/24] drm/bridge: ti-tfp410: " Peter Rosin
2018-04-26 22:31   ` [PATCH 17/24] drm/exynos: mic: provide an .owner device for the bridge Peter Rosin
2018-04-26 22:31   ` [PATCH 18/24] drm/mediatek: hdmi: " Peter Rosin
2018-04-26 22:31   ` [PATCH 19/24] drm/msm: specify the .owner of the bridges Peter Rosin
2018-04-26 22:31   ` [PATCH 20/24] drm/rcar-du: lvds: provide an .owner device for the bridge Peter Rosin
2018-04-26 22:31   ` [PATCH 21/24] drm/sti: provide an .owner device for the bridges Peter Rosin
2018-04-26 22:31   ` [PATCH 22/24] drm/bridge: remove the .of_node member Peter Rosin
2018-04-28  8:09     ` kbuild test robot
2018-04-30 11:14       ` Peter Rosin
2018-04-26 22:31   ` [PATCH 23/24] drm/bridge: require the .owner to be filled in on drm_bridge_attach Peter Rosin
2018-04-30 15:24     ` Daniel Vetter
2018-04-30 20:32       ` Peter Rosin
2018-04-26 22:31   ` [PATCH 24/24] drm/bridge: establish a link between the bridge supplier and consumer Peter Rosin
2018-04-30 15:32     ` Daniel Vetter
2018-04-30 21:12       ` Peter Rosin
     [not found]   ` <1881012.XPHlTWYXH6@avalon>
2018-04-26 23:09     ` [PATCH 00/24] device link, bridge supplier <-> drm device Peter Rosin
     [not found]       ` <3483427.EaMxDYJt8U@avalon>
2018-04-27  7:27         ` Peter Rosin
2018-04-30 15:18     ` Daniel Vetter [this message]
2018-04-27  7:11   ` Andrzej Hajda
2018-04-27  7:37     ` Peter Rosin
2018-04-27  7:51       ` Peter Rosin

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=20180430151803.GN12521@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=el.org@freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kern \
    --cc=martin.donnelly@ge.com \
    --cc=martyn.welch@collabora.co.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=peda@axentia.se \
    --cc=peter.senna@collabora.com \
    --cc=sw0312.kim@samsung.com \
    --cc=vincent.abriou@st.com \
    --subject='Re: [PATCH 00/24] device link, bridge supplier <-> drm device' \
    /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

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