* [PATCH 1/3] drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity
2026-11-27 16:18 ` [PATCH 0/3] drm/bridge: inno-hdmi: Fix sync polarity, hotplug and DDC adapter Michal Wilczynski
@ 2026-11-27 16:18 ` Michal Wilczynski
2026-11-27 16:19 ` [PATCH 2/3] drm/bridge: inno-hdmi: Report hotplug through drm_bridge_hpd_notify() Michal Wilczynski
2026-11-27 16:19 ` [PATCH 3/3] drm/bridge: inno-hdmi: Don't give the DDC adapter an OF node Michal Wilczynski
2 siblings, 0 replies; 5+ messages in thread
From: Michal Wilczynski @ 2026-11-27 16:18 UTC (permalink / raw)
To: Andy Yan, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Yakir Yang,
Dmitry Baryshkov, Heiko Stuebner
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Chaoyi Chen, Maud Spierings, Byron Stanoszek,
Dominique Belhachemi, Owen O'Hehir, Michal Wilczynski
v_HSYNC_POLARITY() and v_VSYNC_POLARITY() write the wrong bits: the
hardware puts HSYNC in bit 2 and VSYNC in bit 3, the macros do the
opposite. Most CEA modes drive both syncs with the same polarity so it
goes unnoticed; it only shows up on modes where the two differ.
Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Reported-by: Maud Spierings <maud_spierings@murena.io>
Closes: https://lore.kernel.org/all/e780ecb8-918f-4816-99c8-b69b10b25a18@murena.io/
Reported-by: Byron Stanoszek <gandalf@winds.org>
Closes: https://lore.kernel.org/all/b8b046ee-c574-3e16-6079-2fc415633dae@winds.org/
Suggested-by: Dominique Belhachemi <db@domibel.de>
Tested-by: Maud Spierings <maud_spierings@murena.io>
Tested-by: Byron Stanoszek <gandalf@winds.org>
Tested-by: Owen O'Hehir <oo.hehir@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c
index 4d9d06d0419646f00142f984b797e810df37779a..3bdcacf3cbc8427c8420eac9a37e3ecb79682414 100644
--- a/drivers/gpu/drm/bridge/inno-hdmi.c
+++ b/drivers/gpu/drm/bridge/inno-hdmi.c
@@ -122,8 +122,8 @@ enum {
#define v_VIDEO_MUTE(n) ((n) << 0)
#define HDMI_VIDEO_TIMING_CTL 0x08
-#define v_HSYNC_POLARITY(n) ((n) << 3)
-#define v_VSYNC_POLARITY(n) ((n) << 2)
+#define v_VSYNC_POLARITY(n) ((n) << 3)
+#define v_HSYNC_POLARITY(n) ((n) << 2)
#define v_INETLACE(n) ((n) << 1)
#define v_EXTERANL_VIDEO(n) ((n) << 0)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/3] drm/bridge: inno-hdmi: Report hotplug through drm_bridge_hpd_notify()
2026-11-27 16:18 ` [PATCH 0/3] drm/bridge: inno-hdmi: Fix sync polarity, hotplug and DDC adapter Michal Wilczynski
2026-11-27 16:18 ` [PATCH 1/3] drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity Michal Wilczynski
@ 2026-11-27 16:19 ` Michal Wilczynski
2026-11-27 16:27 ` sashiko-bot
2026-11-27 16:19 ` [PATCH 3/3] drm/bridge: inno-hdmi: Don't give the DDC adapter an OF node Michal Wilczynski
2 siblings, 1 reply; 5+ messages in thread
From: Michal Wilczynski @ 2026-11-27 16:19 UTC (permalink / raw)
To: Andy Yan, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Yakir Yang,
Dmitry Baryshkov, Heiko Stuebner
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Chaoyi Chen, Maud Spierings, Byron Stanoszek,
Dominique Belhachemi, Owen O'Hehir, Michal Wilczynski
inno_hdmi_irq() passes hdmi->bridge.dev to drm_helper_hpd_irq_event(),
which dereferences it in its first statement:
if (!dev->mode_config.poll_enabled)
bridge.dev is assigned only by drm_bridge_attach(), but inno_hdmi_bind()
unmutes the hotplug interrupt in inno_hdmi_init_hw() and installs the
handler well before it attaches the bridge:
inno_hdmi_init_hw(hdmi); /* unmutes hotplug */
devm_request_threaded_irq(...); /* handler goes live */
...
hdmi->bridge.ddc = inno_hdmi_i2c_adapter(hdmi);
devm_drm_bridge_add(dev, &hdmi->bridge);
drm_bridge_attach(...); /* bridge.dev set here */
The bridge is allocated by devm_drm_bridge_alloc(), which kzalloc()s it,
so bridge.dev is NULL for all of that window, and a hotplug event
arriving in it enters drm_helper_hpd_irq_event(NULL).
Before the conversion to a bridge the ordering was safe:
inno_hdmi_register() called drmm_connector_hdmi_init(), which set
connector.dev, before the interrupt was requested.
Report hotplug with drm_bridge_hpd_notify() instead. The bridge already
sets DRM_BRIDGE_OP_HPD, and the helper only calls into the connector
while HPD is enabled, under bridge->hpd_mutex, so it does not need
bridge.dev. Unlike a NULL check, it also stays safe against
drm_bridge_detach() if the interrupt outlives the component bind.
hpd_mutex is initialised by drm_bridge_add(), so request the interrupt
after devm_drm_bridge_add().
Fixes: 969325a2597e ("drm/rockchip: inno-hdmi: Convert to drm bridge")
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
This was patch 2 of the JH7110 display series up to v8, and the code is
unchanged from there.
Changes in v8 of that series, prompted by a Sashiko finding on v7
patch 8, "Split probe out of bind":
https://lore.kernel.org/all/sashiko-outbox-201623@kernel.org/
- Report hotplug through drm_bridge_hpd_notify() instead of checking
bridge.dev, which also covers drm_bridge_detach() racing with the
interrupt, and request the interrupt after devm_drm_bridge_add(),
which initialises the HPD mutex. Heiko's Reviewed-by was dropped
because the approach changed.
- Link: https://lore.kernel.org/all/20261124-jh7110-clean-send-v8-2-de92635dd857@samsung.com/
Changes in v6 of that series:
- Split out of "drm/bridge: inno-hdmi: Split probe out of bind" into
its own patch (Heiko).
- Link: https://lore.kernel.org/all/20261029-jh7110-clean-send-v6-2-759594e43acf@samsung.com/
Tested on a VisionFive 2 with the display series applied: hotplug is
reported through the new path. The race itself has not been reproduced.
---
drivers/gpu/drm/bridge/inno-hdmi.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c
index 3bdcacf3cbc8427c8420eac9a37e3ecb79682414..bbc90ae9eaae04166d502c05fde52e126462b8be 100644
--- a/drivers/gpu/drm/bridge/inno-hdmi.c
+++ b/drivers/gpu/drm/bridge/inno-hdmi.c
@@ -929,7 +929,8 @@ static irqreturn_t inno_hdmi_irq(int irq, void *dev_id)
{
struct inno_hdmi *hdmi = dev_id;
- drm_helper_hpd_irq_event(hdmi->bridge.dev);
+ drm_bridge_hpd_notify(&hdmi->bridge,
+ inno_hdmi_bridge_detect(&hdmi->bridge, NULL));
return IRQ_HANDLED;
}
@@ -1104,12 +1105,6 @@ struct inno_hdmi *inno_hdmi_bind(struct device *dev,
if (irq < 0)
return ERR_PTR(irq);
- ret = devm_request_threaded_irq(dev, irq, inno_hdmi_hardirq,
- inno_hdmi_irq, IRQF_SHARED,
- dev_name(dev), hdmi);
- if (ret)
- return ERR_PTR(ret);
-
hdmi->bridge.driver_private = hdmi;
hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT |
DRM_BRIDGE_OP_EDID |
@@ -1129,6 +1124,16 @@ struct inno_hdmi *inno_hdmi_bind(struct device *dev,
if (ret)
return ERR_PTR(ret);
+ /*
+ * The hotplug handler takes the bridge's HPD mutex, which
+ * drm_bridge_add() initialises, so request the interrupt only now.
+ */
+ ret = devm_request_threaded_irq(dev, irq, inno_hdmi_hardirq,
+ inno_hdmi_irq, IRQF_SHARED,
+ dev_name(dev), hdmi);
+ if (ret)
+ return ERR_PTR(ret);
+
ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return ERR_PTR(ret);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] drm/bridge: inno-hdmi: Don't give the DDC adapter an OF node
2026-11-27 16:18 ` [PATCH 0/3] drm/bridge: inno-hdmi: Fix sync polarity, hotplug and DDC adapter Michal Wilczynski
2026-11-27 16:18 ` [PATCH 1/3] drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity Michal Wilczynski
2026-11-27 16:19 ` [PATCH 2/3] drm/bridge: inno-hdmi: Report hotplug through drm_bridge_hpd_notify() Michal Wilczynski
@ 2026-11-27 16:19 ` Michal Wilczynski
2 siblings, 0 replies; 5+ messages in thread
From: Michal Wilczynski @ 2026-11-27 16:19 UTC (permalink / raw)
To: Andy Yan, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jernej Skrabec, Luca Ceresoli, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Yakir Yang,
Dmitry Baryshkov, Heiko Stuebner
Cc: dri-devel, linux-kernel, linux-arm-kernel, linux-rockchip,
Chaoyi Chen, Maud Spierings, Byron Stanoszek,
Dominique Belhachemi, Owen O'Hehir, Michal Wilczynski
inno_hdmi_i2c_adapter() sets the DDC adapter's of_node to the HDMI
controller's node. When the adapter is registered, the I2C core then
tries to create an I2C client for every child of that node. On RK3036,
RK3128 and the JH7110 the only child is the OF graph 'ports' node, which
is not an I2C device, so each boot logs, here on the JH7110:
i2c i2c-7: of_i2c: modalias failure on .../controller/ports
i2c i2c-7: Failed to create I2C device for .../controller/ports
Nothing on the DDC bus is described in DT, and nothing looks the
adapter up by its node, so don't assign one, as dw-hdmi doesn't either.
Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Reported-by: Owen O'Hehir <oo.hehir@gmail.com>
Closes: https://lore.kernel.org/all/20261012175941.258219-1-electronicconsult1@gmail.com/
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
drivers/gpu/drm/bridge/inno-hdmi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c
index bbc90ae9eaae04166d502c05fde52e126462b8be..bf39483d483e00ccef0daefb80f6579d5c86815a 100644
--- a/drivers/gpu/drm/bridge/inno-hdmi.c
+++ b/drivers/gpu/drm/bridge/inno-hdmi.c
@@ -1044,7 +1044,6 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi)
adap = &i2c->adap;
adap->owner = THIS_MODULE;
adap->dev.parent = hdmi->dev;
- adap->dev.of_node = hdmi->dev->of_node;
adap->algo = &inno_hdmi_algorithm;
strscpy(adap->name, "Inno HDMI", sizeof(adap->name));
i2c_set_adapdata(adap, hdmi);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread