diff mbox series

[4/4] drm/dp_mst: Release disconnected connectors when resume

Message ID 20210720160342.11415-5-Wayne.Lin@amd.com (mailing list archive)
State New, archived
Headers show
Series Unregister mst connectors when hotplug | expand

Commit Message

Lin, Wayne July 20, 2021, 4:03 p.m. UTC
[why]
When resume, we will reprobe the topology to detect any changes during
suspend. If we unplug a branch device during suspend and then resume, we
can eventually unregister child connectors of this branch device because
we call drm_dp_mst_topology_put_mstb() in drm_dp_port_set_pdt().
However, we don't unregister connectors for end devices which is
disconnected during suspend. e.g. Unplug a SST monitor during
suspend then resume. We won't unregister this connector which is no
longer exist in the topology.

[How]
Unregister connectors for disconnected end devices when resume.

Cc: stable@vger.kernel.org
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 85a959427247..0b04ea65cb8e 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2478,6 +2478,12 @@  drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb,
 		 drm_dp_mst_is_end_device(port->pdt, port->mcs))
 		drm_dp_mst_port_add_connector(mstb, port);
 
+	if (port->connector && port->pdt == DP_PEER_DEVICE_NONE) {
+		drm_connector_unregister(port->connector);
+		drm_connector_put(port->connector);
+		port->connector = NULL;
+	}
+
 	if (send_link_addr && port->mstb) {
 		ret = drm_dp_send_link_address(mgr, port->mstb);
 		if (ret == 1) /* MSTB below us changed */