From: jsg Date: Sat, 15 Jun 2024 04:01:36 +0000 (+0000) Subject: drm/bridge: Fix improper bridge init order with pre_enable_prev_first X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=625d3866dd3252249a62ba037b7a9ebde096e993;p=openbsd 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 --- 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; } }