From 5ad70b3140f344969e4bc39510af8b5bf31b84c8 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sat, 15 Jun 2024 04:01:37 +0000 Subject: drm/bridge: Fix improper bridge init order with pre_enable_prev_first From Jagan Teki 45755ef11f0337110105d4a6a2cd6bdc278dffa0 in linux-6.6.y/6.6.33 e18aeeda0b6905c333df5a0566b99f5c84426098 in mainline linux --- sys/dev/pci/drm/drm_bridge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/pci/drm/drm_bridge.c b/sys/dev/pci/drm/drm_bridge.c index ce490620986..e02c2923e91 100644 --- a/sys/dev/pci/drm/drm_bridge.c +++ b/sys/dev/pci/drm/drm_bridge.c @@ -694,11 +694,17 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, */ list_for_each_entry_from(next, &encoder->bridge_chain, chain_node) { - if (next->pre_enable_prev_first) { + if (!next->pre_enable_prev_first) { next = list_prev_entry(next, chain_node); limit = next; break; } + + if (list_is_last(&next->chain_node, + &encoder->bridge_chain)) { + limit = next; + break; + } } /* Call these bridges in reverse order */ @@ -781,7 +787,7 @@ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge, /* Found first bridge that does NOT * request prev to be enabled first */ - limit = list_prev_entry(next, chain_node); + limit = next; break; } } -- cgit v1.2.3