Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp353066pxb; Wed, 14 Apr 2021 17:35:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN5Oz+q8zwqRmXqnJl4HbPJvDLAP7Ip+wzKx6nRBwjOyQ7Khul/iUyyALJXLNQ3khaYRoD X-Received: by 2002:a17:90a:fb89:: with SMTP id cp9mr807805pjb.47.1618446930109; Wed, 14 Apr 2021 17:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446930; cv=none; d=google.com; s=arc-20160816; b=dTSCu6sF7CkGewGyJYqHIj6W3KkBf+Y6mXbHvXUKJ3r0rLypNjlPfnxH05LhSXVcaR f1LS/yNBiB5SK3Bs1FSMD49wp3W8KTQ5JQNAvAbuBhR9qE1rfoqKIdr6C/EQOu1oeRiE AGMe5UD9+7wCCjXVZ4E9lD7HwxjTY8yQmebNqYwjZQMRvTlwhu4RqSuZ7HMuth/TJgB0 QPuiO7pKWuC59M4SuiGRn+f+oq+dOBPc4cCwEv9e+QoM9pZ1yb0je1PhBZdGlcgQ63gg YSH/UR7QsxKAUStQ81FUAFHdYWwhUQDtNXA6EGFdD0rNakTcuqa1k9sLmszOBZTc8Wip Bdkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=r0bzpAl7tG3hNy3+ubhna8pWO1wp4i5XGAlOvSkxKKw=; b=KPTjgvV2YeBJIUOd74QJg9rbzDUdViymRlKi7+9gqrujIgp1XgfFdZkejP3JJIt3if 8zo78vqxCJszGLwW08mpLx5XlVM73b+HjH6sfisd8sxeV79xcuqtqZDQ9y15o0uTlX39 kYBiknGFaDj/e0I74hcnuNcS7XWSANQOjRtmbNQG9ih4R9f9oIQs9Cp1u1mxhRllAIoI QS8HPltyDW83wkq43Bd7gm3Se+jiAa0TnfPLX4ZcQ7Kt7+ylO4MxRrMyYFbcy9H20jXQ /YiqCFPKcPc3jcfGEbWh6xpXTqGYg5sitxoQLAkfoZajsb8AdhhvAM/rzIvEQ1rhv6cW tt4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cf7g4bFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si1338819plk.106.2021.04.14.17.35.18; Wed, 14 Apr 2021 17:35:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cf7g4bFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349934AbhDNQs7 (ORCPT + 99 others); Wed, 14 Apr 2021 12:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbhDNQs6 (ORCPT ); Wed, 14 Apr 2021 12:48:58 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D944AC061574; Wed, 14 Apr 2021 09:48:36 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id s15so24536703edd.4; Wed, 14 Apr 2021 09:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=r0bzpAl7tG3hNy3+ubhna8pWO1wp4i5XGAlOvSkxKKw=; b=cf7g4bFZ3VAE90m8+m65I81pkq9OMgmbijW9hYrUyh015BgJquJNQIcUPC+QmqzEwE giBODc7NyhmLDWFhcdksD9uXdtP+HerXU7vV2ubNqTv7wN8dZz0Fxoyap1Ns0OGVw6Yn yV/9NUCdPbMH1XNbQAAT9eQDNtAXF1k5VobAJ/Vb35SZZBN2JFoh7LNLc+jcRZ41mdqa le6Q3JGng0UrlgKzQZXfFSgqkQE2qBtVKG2EroCLOtAr2yhPvYkvI552DUrTLK3MdB9s Tk8FLIdhce+VaeACDyJkBJy1eYjSdvEPnR5j2uZgh3RHMfv+enyDbG3/o3AjymvMKAF3 T9iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=r0bzpAl7tG3hNy3+ubhna8pWO1wp4i5XGAlOvSkxKKw=; b=MeJPrbiKfyHJLduEYlnEuO6QPj2TtTsZmnoonyEO+lmeUcA+1EONgx1MpwtIUV8oTr nCw1FCDJ420u3Pfp92A8hF0b7gAt/mr/zM0d70kb90O1juv5EnF34Vb4KpffedRaxKLR o0T7tkKYsiUaV+qM2vy6pyrzP++cmBZ7/6mCXAHGPam1+iZ6cEtHZOy3+Zt8m13dv42K hLiy1H+zcRKeCm7ZiyUbuFckbduRzqLd6fED2ZukjRQoTX9pzvVpY3PsnmXGCNynIi6A S5JFxZBX3bHnrWaT0ghx9TkLjl9RjtjLQZvIMkj2Nm3+e4yHXvNb32v0o2h7L+/wyJZQ U27Q== X-Gm-Message-State: AOAM530SGpX9lwgvmJkTSV7Lgq44W17KXNWktIDsN4ZVNOxvqBtWSLPG ulznZ3JJ50r/x3aPMIe0YQ4= X-Received: by 2002:a05:6402:84e:: with SMTP id b14mr42567828edz.194.1618418915571; Wed, 14 Apr 2021 09:48:35 -0700 (PDT) Received: from localhost ([62.96.65.119]) by smtp.gmail.com with ESMTPSA id cd14sm41455ejb.53.2021.04.14.09.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 09:48:31 -0700 (PDT) Date: Wed, 14 Apr 2021 18:49:12 +0200 From: Thierry Reding To: Lyude Paul Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, Ville =?utf-8?B?U3lyasOkbMOk?= , Jani Nikula , Rodrigo Vivi , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Hunter , "open list:DRM DRIVERS FOR NVIDIA TEGRA" , open list Subject: Re: [PATCH 03/30] drm/tegra: Don't register DP AUX channels before connectors Message-ID: References: <20210219215326.2227596-1-lyude@redhat.com> <20210219215326.2227596-4-lyude@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eiuRjVaD2c1rx8vu" Content-Disposition: inline In-Reply-To: <20210219215326.2227596-4-lyude@redhat.com> User-Agent: Mutt/2.0.6 (98f8cb83) (2021-03-06) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --eiuRjVaD2c1rx8vu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Since we're about to add a backpointer to a DP AUX channel's respective D= RM > 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. >=20 > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/tegra/dpaux.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) >=20 > 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 =3D tegra_dpaux_transfer; > dpaux->aux.dev =3D &pdev->dev; > =20 > - err =3D 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, y= et 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. 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? 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. 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 --eiuRjVaD2c1rx8vu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmB3HQUACgkQ3SOs138+ s6FCfw/+OhxXxUnm7yvFpRYVz6qtWvK3jrKBnpjwoVxK0Se6Ie1T+S0pwhbCs12U EasB8CA90aWXlZB8mW6YE5cYkNhHBba//ttCXmMKOeZTYMPax6uA0cL6K8KG8ocC WRiWKktiu7T0U0p/kDnnTWum6VoGmT8Anik8jgMB0ZWvsmD8NdX7FrZiNbCTfoTd 7VyPPrCA7dheeQyJAnJimkH0Jf7Adhadigi1w5QEEVgZRVnu8T82yW5vSt2suqaX FfMT3e3x07dfzZ75cSmjztcQ47KDu2Kt/XuY+srFfJvaRY3QSPbXSMj5cmVVBp35 LGPnR6HHFSVJ5G4vtEVErQWMUtFx3rZ7QxbpT7XPZBajFzLXD38Jdz5nNVBFcOqj mWuzXVlyV/7fb71LUW4x9KHXa2CfyUCwG/I+Ll99F3/r0Pj/h2o2OYQVkUUrB4N5 HGDrZzSqmodMu/Uljpnj2AHNhNea4w6DGgFyfFE2msHINk2ZUUJYkDrWNtZqCXRf qQo8Rpne94/b5dyL/7z5BSTdkGPNmn/EryEU+9rJKX0UJ6ifR+AF1dfxp6k/n3lS bMcK171tYk7K91Y+zZJaaHlhcUmPebZbR9QxLuHiIRuAZLeVMBrKQrid3H+z9nDI oymuuRMdr506u8OcG+g3W6GLb4VKW/XYZKHITWXy5g0fQoArBD8= =f8nJ -----END PGP SIGNATURE----- --eiuRjVaD2c1rx8vu--