From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: Amarula patchwork <linux-amarula@amarulasolutions.com>,
michael@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Daniel Vetter <daniel@ffwll.ch>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
David Airlie <airlied@gmail.com>,
Frieder Schrempf <frieder.schrempf@kontron.de>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Jonas Karlman <jonas@kwiboo.se>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org
Subject: [PATCH v3 02/10] drm/bridge: Fix a use case in the bridge disable logic
Date: Thu, 30 Nov 2023 15:16:19 +0100 [thread overview]
Message-ID: <20231130141705.1796672-3-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20231130141705.1796672-1-dario.binacchi@amarulasolutions.com>
The patch fixes the code for finding the next bridge with the
"pre_enable_prev_first" flag set to false. In case this condition is
not verified, i. e. there is no subsequent bridge with the flag set to
false, the whole bridge list is traversed, invalidating the "next"
variable.
The use of a new iteration variable (i. e. "iter") ensures that the value
of the "next" variable is not invalidated.
Fixes: 4fb912e5e190 ("drm/bridge: Introduce pre_enable_prev_first to alter bridge init order")
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
(no changes since v1)
drivers/gpu/drm/drm_bridge.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index f66bf4925dd8..2e5781bf192e 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -662,7 +662,7 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
struct drm_atomic_state *old_state)
{
struct drm_encoder *encoder;
- struct drm_bridge *next, *limit;
+ struct drm_bridge *iter, *next, *limit;
if (!bridge)
return;
@@ -680,14 +680,15 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
* was enabled first, so disabled last
*/
limit = next;
+ iter = next;
/* Find the next bridge that has NOT requested
* prev to be enabled first / disabled last
*/
- list_for_each_entry_from(next, &encoder->bridge_chain,
+ list_for_each_entry_from(iter, &encoder->bridge_chain,
chain_node) {
- if (!next->pre_enable_prev_first) {
- next = list_prev_entry(next, chain_node);
+ if (!iter->pre_enable_prev_first) {
+ next = list_prev_entry(iter, chain_node);
limit = next;
break;
}
--
2.43.0
next prev parent reply other threads:[~2023-11-30 14:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 14:16 [PATCH v3 00/10] Add displays support for bsh-smm-s2/pro boards Dario Binacchi
2023-11-30 14:16 ` [PATCH v3 01/10] drm/bridge: Fix bridge disable logic Dario Binacchi
2023-11-30 14:16 ` Dario Binacchi [this message]
2023-11-30 14:16 ` [PATCH v3 03/10] drm: bridge: samsung-dsim: enter display mode in the enable() callback Dario Binacchi
2023-11-30 14:16 ` [PATCH v3 04/10] drm: bridge: samsung-dsim: complete the CLKLANE_STOP setting Dario Binacchi
2023-11-30 14:16 ` [PATCH v3 05/10] dt-bindings: display: panel: Add synaptics r63353 panel controller Dario Binacchi
2023-11-30 14:16 ` [PATCH v3 06/10] drm/panel: Add Synaptics R63353 panel driver Dario Binacchi
2023-12-05 8:07 ` Neil Armstrong
2023-11-30 14:16 ` [PATCH v3 07/10] dt-bindings: display: panel: Add Ilitek ili9805 panel controller Dario Binacchi
2023-12-03 16:59 ` Krzysztof Kozlowski
2023-11-30 14:16 ` [PATCH v3 08/10] drm/panel: Add Ilitek ILI9805 panel driver Dario Binacchi
2023-12-05 8:10 ` Neil Armstrong
2023-11-30 14:16 ` [PATCH v3 09/10] drm/panel: ilitek-ili9805: add support for Tianma TM041XDHG01 panel Dario Binacchi
2023-12-05 8:10 ` Neil Armstrong
2023-11-30 14:16 ` [PATCH v3 10/10] arm64: dts: imx8mn-bsh-smm-s2/pro: add display setup Dario Binacchi
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=20231130141705.1796672-3-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=frieder.schrempf@kontron.de \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=michael@amarulasolutions.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®