All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>
To: Lyude Paul <lyude@redhat.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/7] drm/dp_mst: Register AUX devices for MST ports
Date: Thu, 6 Jun 2019 19:41:09 +0000	[thread overview]
Message-ID: <1acd58fd-a5e8-0f07-709a-902ea67ba760@amd.com> (raw)
In-Reply-To: <2dce5d6ea4fe1c082a14962ed21568dbfd743d70.camel@redhat.com>



On 2019-06-03 3:28 p.m., Lyude Paul wrote:
>> I'm reproducing this just by reloading i915 on a machine with some MST
>> displays connected. I uploaded a copy of the script that I use to do this
>> here:
>>
>> https://people.freedesktop.org/~lyudess/archive/06-03-2019/unloadgpumod.sh
> oops-almost forgot to mention. The argument you pass to make it reload instead
> of just unloading is --reload
> 

Thanks for the script!

So, the warning has to do with:

1. Having the aux device as a child of connector device, and
2. During driver unload, drm_connector_unregister() is called before
    drm_dp_mst_topology_put_port()

Which means that connector_unregister() will recursively remove the
child aux device, before put_port() can properly unregister it. Any
further attempts to remove after the first will throw a "not found" warning.

Call-stacks for reference:

   *drm_connector_unregister*+0x37/0x60 [drm]
   drm_connector_unregister_all+0x30/0x60 [drm]
   drm_modeset_unregister_all+0xe/0x30 [drm]
   drm_dev_unregister+0x9c/0xb0 [drm]
   i915_driver_unload+0x73/0x120 [i915]

   drm_dp_aux_unregister_devnode+0xf5/0x180 [drm_kms_helper]
   *drm_dp_mst_topology_put_port*+0x4e/0xf0 [drm_kms_helper]
   drm_dp_mst_topology_put_mstb+0x91/0x160 [drm_kms_helper]
   drm_dp_mst_topology_mgr_set_mst+0x12b/0x2b0 [drm_kms_helper]
   ? __finish_swait+0x10/0x40
   drm_dp_mst_topology_mgr_destroy+0x11/0xa0 [drm_kms_helper]
   intel_dp_encoder_flush_work+0x32/0xb0 [i915]
   intel_ddi_encoder_destroy+0x32/0x60 [i915]
   drm_mode_config_cleanup+0x51/0x2e0 [drm]
   intel_modeset_cleanup+0xc8/0x140 [i915]
   i915_driver_unload+0xa0/0x120 [i915]

A solution is to unregister the aux device immediately before the
connector device is unregistered - if we are to keep the aux device as a
child. Following current scheme with SST, it looks like
drm_connector_funcs->early_unregister() is the right place to do so.
To keep the balance, aux registration will then happen in
drm_connector_funcs->late_register(). This will leave the SDP
transaction handling part in DRM still, but pass the responsibility of
creating and removing remote (fake) aux devices to the driver.

I have a WIP patch here for you to take a look. It should apply on top
of the existing patchset:
https://pastebin.com/1YJZhL4C

I'd like to hear your thoughts, before I go and modify other drivers :)

Thanks,
Leo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-06 19:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 15:17 [PATCH 0/7] Add DP MST AUX devices sunpeng.li-5C7GfCeVMHo
2019-05-16 15:17 ` [PATCH 1/7] drm/dp: Use non-cyclic idr sunpeng.li
2019-05-16 15:18 ` [PATCH 5/7] drm/amd/display: Use connector kdev as aux device parent sunpeng.li
2019-05-16 17:21   ` Kazlauskas, Nicholas
2019-05-16 15:18 ` [PATCH 6/7] drm/bridge/analogix-anx78xx: " sunpeng.li
     [not found] ` <1558019883-12397-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2019-05-16 15:17   ` [PATCH 2/7] drm/dp_mst: Register AUX devices for MST ports sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1558019883-12397-3-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2019-05-16 21:40       ` Lyude Paul
     [not found]         ` <3e237f325a98b044231661886329a808d6701146.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-05-30 18:20           ` Li, Sun peng (Leo)
2019-06-03 19:25             ` Lyude Paul
2019-06-03 19:28               ` Lyude Paul
2019-06-06 19:41                 ` Li, Sun peng (Leo) [this message]
     [not found]                   ` <1acd58fd-a5e8-0f07-709a-902ea67ba760-5C7GfCeVMHo@public.gmane.org>
2019-06-06 21:07                     ` Lyude Paul
2019-06-27 22:21           ` Li, Sun peng (Leo)
     [not found]             ` <f800b501-422e-c7fb-ebce-bd0e1717d2b2-5C7GfCeVMHo@public.gmane.org>
2019-07-01 20:43               ` Lyude Paul
2019-05-16 15:17   ` [PATCH 3/7] drm/dp-mst: Use connector kdev as aux device parent sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1558019883-12397-4-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2019-05-16 20:23       ` Lyude Paul
2019-05-16 21:30     ` Lyude Paul
2019-05-16 15:18   ` [PATCH 4/7] drm/sysfs: Add mstpath attribute to connector devices sunpeng.li-5C7GfCeVMHo
2019-05-16 15:18   ` [PATCH 7/7] drm/nouveau: Use connector kdev as aux device parent sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1558019883-12397-8-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2019-05-16 21:40       ` Lyude Paul
2019-05-16 19:54   ` [PATCH 0/7] Add DP MST AUX devices Lyude Paul
2019-05-16 20:18     ` Lyude Paul
     [not found]     ` <2248d762446e824def09699f0ef719b9c90d0dbc.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-05-16 20:21       ` Li, Sun peng (Leo)

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=1acd58fd-a5e8-0f07-709a-902ea67ba760@amd.com \
    --to=sunpeng.li@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lyude@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.