nouveau.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	"open list" <linux-kernel@vger.kernel.org>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	amd-gfx@lists.freedesktop.org,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"open list:DRM DRIVERS FOR NVIDIA TEGRA"
	<linux-tegra@vger.kernel.org>, "Daniel Vetter" <daniel@ffwll.ch>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [Nouveau] [PATCH 03/30] drm/tegra: Don't register DP AUX channels before connectors
Date: Wed, 14 Apr 2021 14:17:45 -0400	[thread overview]
Message-ID: <0a64b70c89699b4e6c7aaa3ba8e75531031faa3c.camel@redhat.com> (raw)
In-Reply-To: <YHcdCAQ7Dlb2vSzn@orome.fritz.box>

On Wed, 2021-04-14 at 18:49 +0200, Thierry Reding wrote:
> On Fri, Feb 19, 2021 at 04:52:59PM -0500, Lyude Paul wrote:
> > As pointed out by the documentation for drm_dp_aux_register(),
> > drm_dp_aux_init() should be used in situations where the AUX channel for a
> > display driver can potentially be registered before it's respective DRM
> > driver. This is the case with Tegra, since the DP aux channel exists as a
> > platform device instead of being a grandchild of the DRM device.
> > 
> > Since we're about to add a backpointer to a DP AUX channel's respective
> > DRM
> > device, let's fix this so that we don't potentially allow userspace to use
> > the AUX channel before we've associated it with it's DRM connector.
> > 
> > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > ---
> >  drivers/gpu/drm/tegra/dpaux.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
> > index 105fb9cdbb3b..ea56c6ec25e4 100644
> > --- a/drivers/gpu/drm/tegra/dpaux.c
> > +++ b/drivers/gpu/drm/tegra/dpaux.c
> > @@ -534,9 +534,7 @@ static int tegra_dpaux_probe(struct platform_device
> > *pdev)
> >         dpaux->aux.transfer = tegra_dpaux_transfer;
> >         dpaux->aux.dev = &pdev->dev;
> >  
> > -       err = drm_dp_aux_register(&dpaux->aux);
> > -       if (err < 0)
> > -               return err;
> > +       drm_dp_aux_init(&dpaux->aux);
> 
> I just noticed that this change causes an error on some setups that I
> haven't seen before. The problem is that the SOR driver tries to grab a
> reference to the I2C device to make sure it doesn't go away while it has
> a pointer to it.
> 
> However, since now the I2C adapter hasn't been registered yet, I get
> this:
> 
>         [   15.013969] kobject: '(null)' (000000005c903e43): is not
> initialized, yet kobject_get() is being called.
> 
> I recall that you wanted to make this change so that a backpointer to
> the DRM device could be added (I think that's patch 15 of the series),
> but I didn't see that patch get merged, so it's a bit difficult to try
> and fix this up.

I'm pretty sure I already merged the tegra change in drm-misc-next, so if it's
causing issues you probably should send out a revert for now and I can r-b it
so we can figure out a better solution for this in the mean time

> Has the situation changed? Do we no longer need the backpointer? If we
> still want it, what's the plan for merging the change? Should I work
> under the assumption that patch will make it in sometime and try to fix
> this on top of that?

yes we do still need the backpointer - I'm just still working on getting
reviews for some of the other parts of this series, and have been on PTO/busy
with a couple of other things.

> 
> I'm thinking that perhaps we can move the I2C adapter registration into
> drm_dp_aux_init() since that's independent of the DRM device.

Yeah this makes sense for me - I can try to make this change on the next
respin of this series. What kind of setup were you able to reproduce issues on
this with btw?

>  It would
> also make a bit more sense from the Tegra driver's point of view where
> all devices would be created during the ->probe() path, and only during
> the ->init() path would the connection between DRM device and DRM DP AUX
> device be established.
> 
> Thierry

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  reply	other threads:[~2021-04-14 18:18 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 21:52 [Nouveau] [PATCH 00/30] drm: Use new DRM printk funcs (like drm_dbg_*()) in DP helpers Lyude Paul
2021-02-19 21:52 ` [Nouveau] [PATCH 01/30] drm/dp: Rewrap kdocs for struct drm_dp_aux Lyude Paul
2021-02-19 23:42   ` Randy Dunlap
2021-02-24 18:31     ` Lyude Paul
2021-02-19 21:52 ` [Nouveau] [PATCH 02/30] drm/dp: Fixup kernel docs " Lyude Paul
2021-02-19 23:39   ` Randy Dunlap
2021-02-19 21:52 ` [Nouveau] [PATCH 03/30] drm/tegra: Don't register DP AUX channels before connectors Lyude Paul
2021-04-14 16:49   ` Thierry Reding
2021-04-14 18:17     ` Lyude Paul [this message]
2021-02-19 21:53 ` [Nouveau] [PATCH 04/30] drm/bridge/tc358767: Don't register DP AUX channel until bridge is attached Lyude Paul
2021-03-19 14:27   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 05/30] drm/bridge/cdns-mhdp8546: Register DP aux channel with userspace Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 06/30] drm/bridge/ti-sn65dsi86: (Un)register aux device on bridge attach/detach Lyude Paul
2021-02-21 18:11   ` Laurent Pinchart
2021-02-19 21:53 ` [Nouveau] [PATCH 07/30] drm/bridge/analogix/anx78xx: Add missing drm_dp_aux_unregister() call Lyude Paul
2021-03-19 14:28   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 08/30] drm/bridge/analogix/anx78xx: Setup encoder before registering connector Lyude Paul
2021-03-19 14:35   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 09/30] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach() Lyude Paul
2021-03-19 14:37   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 10/30] drm/bridge/analogix/anx6345: Add missing drm_dp_aux_unregister() call Lyude Paul
2021-03-19 14:39   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 11/30] drm/bridge/analogix/anx6345: Don't link encoder until after connector registration Lyude Paul
2021-03-19 14:43   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 12/30] drm/bridge/analogix/anx6345: Cleanup on errors in anx6345_bridge_attach() Lyude Paul
2021-03-19 14:44   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 13/30] drm/bridge/analogix/dp_core: Unregister DP AUX channel on error in analogix_dp_probe() Lyude Paul
2021-03-19 14:45   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 14/30] drm/nouveau/kms/nv50-: Move AUX adapter reg to connector late register/early unregister Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 15/30] drm/dp: Add backpointer to drm_device in drm_dp_aux Lyude Paul
2021-02-21 18:21   ` Laurent Pinchart
2021-02-24 20:40     ` Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 16/30] drm/dp: Rewrap drm_dp_aux_register()/drm_dp_aux_init() kdocs Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 17/30] drm/dp: Clarify DP AUX registration time Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 18/30] drm/print: Fixup DRM_DEBUG_KMS_RATELIMITED() Lyude Paul
2021-03-19 11:30   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 19/30] drm/dp: Pass drm_dp_aux to drm_dp_link_train_clock_recovery_delay() Lyude Paul
2021-02-21 18:22   ` Laurent Pinchart
2021-02-23 14:49   ` [Nouveau] [Intel-gfx] " Rodrigo Vivi
2021-02-19 21:53 ` [Nouveau] [PATCH 20/30] drm/dp: Pass drm_dp_aux to drm_dp*_link_train_channel_eq_delay() Lyude Paul
2021-02-21 18:23   ` Laurent Pinchart
2021-02-19 21:53 ` [Nouveau] [PATCH 21/30] drm/dp: Always print aux channel name in logs Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 22/30] drm/dp_dual_mode: Pass drm_device to drm_dp_dual_mode_detect() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 23/30] drm/dp_dual_mode: Pass drm_device to drm_dp_dual_mode_set_tmds_output() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 24/30] drm/dp_dual_mode: Pass drm_device to drm_dp_dual_mode_max_tmds_clock() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 25/30] drm/dp_dual_mode: Pass drm_device to drm_dp_dual_mode_get_tmds_output() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 26/30] drm/dp_dual_mode: Pass drm_device to drm_lspcon_(get|set)_mode() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 27/30] drm/dp_mst: Pass drm_dp_mst_topology_mgr to drm_dp_get_vc_payload_bw() Lyude Paul
2021-03-19 11:35   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 28/30] drm/dp: Convert drm_dp_helper.c to using drm_err/drm_dbg_*() Lyude Paul
2021-03-19 11:39   ` Robert Foss
2021-02-19 21:53 ` [Nouveau] [PATCH 29/30] drm/dp_dual_mode: Convert drm_dp_dual_mode_helper.c to using drm_err/drm_dbg_kms() Lyude Paul
2021-02-19 21:53 ` [Nouveau] [PATCH 30/30] drm/dp_mst: Convert drm_dp_mst_topology.c to drm_err()/drm_dbg*() Lyude Paul
2021-03-19 11:47   ` Robert Foss

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=0a64b70c89699b4e6c7aaa3ba8e75531031faa3c.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@linux.ie \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=ville.syrjala@linux.intel.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).