* [PATCH v4 00/14] Add HPD support for Rockchip Analogix DP
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
This series improves the HPD (Hotplug Detect) interrupt handling in
the Analogix DP driver to enable reliable native HPD pin detection on
Rockchip platforms, and introduces platform-specific HPD detection
schemes with fine-grained interrupt control.
On Rockchip platforms, the Analogix DP native HPD pin IRQ requires the
DP controller to remain powered, clocked and initialized to generate
plug/unplug interrupts. The previous driver enabled/disabled IRQ during
bridge enable/disable, which left no HPD detection when the display
pipeline was inactive. Additionally, the interrupt mute/unmute/clear
routines operated on all HPD interrupt bits unconditionally, lacking
the granularity needed for per-event control.
The series reorganizes IRQ and pm_runtime management into bind/unbind,
adds IRQF_ONESHOT to eliminate read-modify-write races on interrupt
mask registers between hardirq and threaded handlers, converts the
interrupt type detection to a bitmask-based scheme for fine-grained
mute/unmute/clear operations, and configures Rockchip platforms to use
the HOTPLUG_CHG interrupt with a 2ms HPD deglitch setting for better
stability.
Furthermore, the next bridge is now resolved into bridge->next_bridge
instead of the platform data field, the forced connected-status logic
is restricted to panel endpoints based on the bridge chain, and HPD
events from downstream bridges (e.g. display-connector with hpd-gpios)
are handled through the .hpd_notify callback.
Tested on RK3576 with both native HPD pin and GPIO HPD configurations.
Native HPD pin mode:
&edp {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&edp_txm0_pins>;
};
GPIO HPD mode:
&edp {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&edp0_hpd>;
hpd-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;
};
&pinctrl {
edp {
edp0_hpd: edp0-hpd {
rockchip,pins = <4 RK_PC1 0 &pcfg_pull_none>;
};
};
};
Display-connector mode (DP connector without HPD GPIO):
&edp_out_conn {
remote-endpoint = <&dp_con_in>;
};
dp-con {
compatible = "dp-connector";
label = "DP OUT";
type = "full-size";
port {
dp_con_in: endpoint {
remote-endpoint = <&edp_out_conn>;
};
};
};
Display-connector mode (DP connector with HPD GPIO):
dp-con {
compatible = "dp-connector";
label = "DP OUT";
type = "full-size";
pinctrl-0 = <&edp0_hpd>;
pinctrl-names = "default";
hpd-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;
port {
dp_con_in: endpoint {
remote-endpoint = <&edp_out_conn>;
};
};
};
All four configurations detect cable plug/unplug events correctly.
Damon Ding (14):
drm/bridge: analogix_dp: Return bitmask from
analogix_dp_get_irq_type()
drm/bridge: analogix_dp: Check all negative return values for
&analogix_dp_device.irq
drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling
drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ
bitmask
drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept
irq bitmask
drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt()
drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD
drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin
detection
drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data
field
drm/bridge: analogix_dp: Restrict forced connected status to panel
endpoints
drm/bridge: analogix_dp: Handle HPD notification from downstream
bridge
MAINTAINERS: Add entry for Analogix DP controller bridge
MAINTAINERS | 11 ++
.../drm/bridge/analogix/analogix_dp_core.c | 153 ++++++++++++-----
.../drm/bridge/analogix/analogix_dp_core.h | 13 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 156 ++++++++++++------
drivers/gpu/drm/exynos/exynos_dp.c | 15 +-
include/drm/bridge/analogix_dp.h | 1 -
6 files changed, 233 insertions(+), 116 deletions(-)
---
Changes in v2:
- Split IRQ enable/disable logic, handle native HPD pin and
GPIO/force-HPD modes separately to avoid unbalanced enable_irq()
calls.(Sashiko)
- Add separate patch for IRQF_ONESHOT to resolve interrupt mask issues
triggered by interrupt preemption.(Sashiko)
- Update commit messages to align with newly added IRQF_ONESHOT related
commit.
- Move ANALOGIX_DP_HPD_DEGLITCH_L/ANALOGIX_DP_HPD_DEGLITCH_H configs to
analogix_dp_reset().
- Add new patch to restrict the forced connected-status shortcut to
panel endpoints only, allowing DP connector bridges to rely on HPD
detection. (Reported by Heiko Stuebner)
- Add new patch to handle HPD notification from downstream bridges
(e.g., display-connector with hpd-gpios).
Changes in v3:
- Reorder the series: convert the IRQ handling to a bitmask and add
IRQF_ONESHOT before moving IRQ enable/disable to bind/unbind.
- Add new patch to check all negative return values for
&analogix_dp_device.irq and propagate the actual error code.(Sashiko)
- Rename macro HPD_IRQ to HPD_IRQ_ALL to avoid confusion with the
DP specification IRQ_HPD, extract the irq_type-to-register bit
mapping into a shared helper, and drop the unused
COMMON_INT_4_HPD_IRQ macro.
- Simplify commit messages across the series.
- Add new patch to use bridge->next_bridge instead of the plat_data
field, resolving the next bridge in
analogix_dp_aux_done_probing().(Suggested by Heiko Stuebner)
- Report panel endpoints as always connected from
analogix_dp_get_plug_in_status() via force_connected_mode, computed
from the bridge chain at attach time.
- Determine the hpd notify mode from DRM_BRIDGE_OP_HPD on downstream
bridges that lack DRM_BRIDGE_OP_DETECT.
- Add a MAINTAINERS entry for the Analogix DP controller bridge.
Changes in v4:
- Add Tested-by tag from Heiko.
- Rebase onto latest tree, picking up the two related patch series [0][1].
[0] https://lore.kernel.org/all/20260915-drm-bridge-drm_panel-cleanup-v4-0-30401d9406f3@bootlin.com/
[1] https://lore.kernel.org/all/20260916-drm-bridge-every-panel-v3-0-83afb4f1a707@bootlin.com/
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH v4 00/14] Add HPD support for Rockchip Analogix DP
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
This series improves the HPD (Hotplug Detect) interrupt handling in
the Analogix DP driver to enable reliable native HPD pin detection on
Rockchip platforms, and introduces platform-specific HPD detection
schemes with fine-grained interrupt control.
On Rockchip platforms, the Analogix DP native HPD pin IRQ requires the
DP controller to remain powered, clocked and initialized to generate
plug/unplug interrupts. The previous driver enabled/disabled IRQ during
bridge enable/disable, which left no HPD detection when the display
pipeline was inactive. Additionally, the interrupt mute/unmute/clear
routines operated on all HPD interrupt bits unconditionally, lacking
the granularity needed for per-event control.
The series reorganizes IRQ and pm_runtime management into bind/unbind,
adds IRQF_ONESHOT to eliminate read-modify-write races on interrupt
mask registers between hardirq and threaded handlers, converts the
interrupt type detection to a bitmask-based scheme for fine-grained
mute/unmute/clear operations, and configures Rockchip platforms to use
the HOTPLUG_CHG interrupt with a 2ms HPD deglitch setting for better
stability.
Furthermore, the next bridge is now resolved into bridge->next_bridge
instead of the platform data field, the forced connected-status logic
is restricted to panel endpoints based on the bridge chain, and HPD
events from downstream bridges (e.g. display-connector with hpd-gpios)
are handled through the .hpd_notify callback.
Tested on RK3576 with both native HPD pin and GPIO HPD configurations.
Native HPD pin mode:
&edp {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&edp_txm0_pins>;
};
GPIO HPD mode:
&edp {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&edp0_hpd>;
hpd-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;
};
&pinctrl {
edp {
edp0_hpd: edp0-hpd {
rockchip,pins = <4 RK_PC1 0 &pcfg_pull_none>;
};
};
};
Display-connector mode (DP connector without HPD GPIO):
&edp_out_conn {
remote-endpoint = <&dp_con_in>;
};
dp-con {
compatible = "dp-connector";
label = "DP OUT";
type = "full-size";
port {
dp_con_in: endpoint {
remote-endpoint = <&edp_out_conn>;
};
};
};
Display-connector mode (DP connector with HPD GPIO):
dp-con {
compatible = "dp-connector";
label = "DP OUT";
type = "full-size";
pinctrl-0 = <&edp0_hpd>;
pinctrl-names = "default";
hpd-gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_HIGH>;
port {
dp_con_in: endpoint {
remote-endpoint = <&edp_out_conn>;
};
};
};
All four configurations detect cable plug/unplug events correctly.
Damon Ding (14):
drm/bridge: analogix_dp: Return bitmask from
analogix_dp_get_irq_type()
drm/bridge: analogix_dp: Check all negative return values for
&analogix_dp_device.irq
drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling
drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ
bitmask
drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept
irq bitmask
drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt()
drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD
drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin
detection
drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data
field
drm/bridge: analogix_dp: Restrict forced connected status to panel
endpoints
drm/bridge: analogix_dp: Handle HPD notification from downstream
bridge
MAINTAINERS: Add entry for Analogix DP controller bridge
MAINTAINERS | 11 ++
.../drm/bridge/analogix/analogix_dp_core.c | 153 ++++++++++++-----
.../drm/bridge/analogix/analogix_dp_core.h | 13 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 156 ++++++++++++------
drivers/gpu/drm/exynos/exynos_dp.c | 15 +-
include/drm/bridge/analogix_dp.h | 1 -
6 files changed, 233 insertions(+), 116 deletions(-)
---
Changes in v2:
- Split IRQ enable/disable logic, handle native HPD pin and
GPIO/force-HPD modes separately to avoid unbalanced enable_irq()
calls.(Sashiko)
- Add separate patch for IRQF_ONESHOT to resolve interrupt mask issues
triggered by interrupt preemption.(Sashiko)
- Update commit messages to align with newly added IRQF_ONESHOT related
commit.
- Move ANALOGIX_DP_HPD_DEGLITCH_L/ANALOGIX_DP_HPD_DEGLITCH_H configs to
analogix_dp_reset().
- Add new patch to restrict the forced connected-status shortcut to
panel endpoints only, allowing DP connector bridges to rely on HPD
detection. (Reported by Heiko Stuebner)
- Add new patch to handle HPD notification from downstream bridges
(e.g., display-connector with hpd-gpios).
Changes in v3:
- Reorder the series: convert the IRQ handling to a bitmask and add
IRQF_ONESHOT before moving IRQ enable/disable to bind/unbind.
- Add new patch to check all negative return values for
&analogix_dp_device.irq and propagate the actual error code.(Sashiko)
- Rename macro HPD_IRQ to HPD_IRQ_ALL to avoid confusion with the
DP specification IRQ_HPD, extract the irq_type-to-register bit
mapping into a shared helper, and drop the unused
COMMON_INT_4_HPD_IRQ macro.
- Simplify commit messages across the series.
- Add new patch to use bridge->next_bridge instead of the plat_data
field, resolving the next bridge in
analogix_dp_aux_done_probing().(Suggested by Heiko Stuebner)
- Report panel endpoints as always connected from
analogix_dp_get_plug_in_status() via force_connected_mode, computed
from the bridge chain at attach time.
- Determine the hpd notify mode from DRM_BRIDGE_OP_HPD on downstream
bridges that lack DRM_BRIDGE_OP_DETECT.
- Add a MAINTAINERS entry for the Analogix DP controller bridge.
Changes in v4:
- Add Tested-by tag from Heiko.
- Rebase onto latest tree, picking up the two related patch series [0][1].
[0] https://lore.kernel.org/all/20260915-drm-bridge-drm_panel-cleanup-v4-0-30401d9406f3@bootlin.com/
[1] https://lore.kernel.org/all/20260916-drm-bridge-every-panel-v3-0-83afb4f1a707@bootlin.com/
--
2.34.1
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH v4 01/14] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type()
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Analogix DP controllers support two sets of interrupts for hotplug
detection: HOTPLUG_CHG, and the pair PLUG / HPD_LOST. The current
driver logic relies on PLUG/HPD_LOST and does not consume HOTPLUG_CHG,
nor does it check for INT_HPD for IRQ_HPD events.
The existing analogix_dp_get_irq_type() returns on the first matched
interrupt flag. This causes the hardirq handler to unconditionally mute
all HPD interrupts, including HOTPLUG_CHG and INT_HPD, creating a
limitation for future extensions.
To prepare fine-grained interrupt handling, convert the return type
from enum dp_irq_type to a u32 bitmask. Accumulate all pending
interrupt flags instead of returning early, and add detection for
DP_IRQ_TYPE_IRQ_HPD. Remove DP_IRQ_TYPE_UNKNOWN sentinel; use zero
to indicate no pending interrupts, which simplifies code and
facilitates future extension for additional interrupt types.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 8 ++++----
.../gpu/drm/bridge/analogix/analogix_dp_core.h | 4 ++--
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 18 ++++++++++--------
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 6df6963740d2..079f2f01f33b 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -701,10 +701,10 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
irqreturn_t ret = IRQ_NONE;
- enum dp_irq_type irq_type;
+ u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
+ if (irq_type) {
analogix_dp_mute_hpd_interrupt(dp);
ret = IRQ_WAKE_THREAD;
}
@@ -715,7 +715,7 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
- enum dp_irq_type irq_type;
+ u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
@@ -725,7 +725,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
drm_helper_hpd_irq_event(dp->drm_dev);
}
- if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
+ if (irq_type) {
analogix_dp_clear_hotplug_interrupts(dp);
analogix_dp_unmute_hpd_interrupt(dp);
}
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 4560597604ad..3f40d95757c5 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -120,7 +120,7 @@ enum dp_irq_type {
DP_IRQ_TYPE_HP_CABLE_IN = BIT(0),
DP_IRQ_TYPE_HP_CABLE_OUT = BIT(1),
DP_IRQ_TYPE_HP_CHANGE = BIT(2),
- DP_IRQ_TYPE_UNKNOWN = BIT(3),
+ DP_IRQ_TYPE_IRQ_HPD = BIT(3),
};
struct video_info {
@@ -195,7 +195,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
int analogix_dp_init_analog_func(struct analogix_dp_device *dp);
void analogix_dp_init_hpd(struct analogix_dp_device *dp);
void analogix_dp_force_hpd(struct analogix_dp_device *dp);
-enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp);
+u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp);
void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp);
void analogix_dp_reset_aux(struct analogix_dp_device *dp);
void analogix_dp_init_aux(struct analogix_dp_device *dp);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index c1344a3f013a..49c1961e4326 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -412,8 +412,9 @@ void analogix_dp_force_hpd(struct analogix_dp_device *dp)
writel(reg, dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
}
-enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp)
+u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp)
{
+ u32 irq_type = 0;
u32 reg;
if (dp->hpd_gpiod) {
@@ -425,17 +426,18 @@ enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp)
} else {
/* Parse hotplug interrupt status register */
reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
-
if (reg & PLUG)
- return DP_IRQ_TYPE_HP_CABLE_IN;
-
+ irq_type |= DP_IRQ_TYPE_HP_CABLE_IN;
if (reg & HPD_LOST)
- return DP_IRQ_TYPE_HP_CABLE_OUT;
-
+ irq_type |= DP_IRQ_TYPE_HP_CABLE_OUT;
if (reg & HOTPLUG_CHG)
- return DP_IRQ_TYPE_HP_CHANGE;
+ irq_type |= DP_IRQ_TYPE_HP_CHANGE;
+
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA);
+ if (reg & INT_HPD)
+ irq_type |= DP_IRQ_TYPE_IRQ_HPD;
- return DP_IRQ_TYPE_UNKNOWN;
+ return irq_type;
}
}
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 01/14] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type()
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Analogix DP controllers support two sets of interrupts for hotplug
detection: HOTPLUG_CHG, and the pair PLUG / HPD_LOST. The current
driver logic relies on PLUG/HPD_LOST and does not consume HOTPLUG_CHG,
nor does it check for INT_HPD for IRQ_HPD events.
The existing analogix_dp_get_irq_type() returns on the first matched
interrupt flag. This causes the hardirq handler to unconditionally mute
all HPD interrupts, including HOTPLUG_CHG and INT_HPD, creating a
limitation for future extensions.
To prepare fine-grained interrupt handling, convert the return type
from enum dp_irq_type to a u32 bitmask. Accumulate all pending
interrupt flags instead of returning early, and add detection for
DP_IRQ_TYPE_IRQ_HPD. Remove DP_IRQ_TYPE_UNKNOWN sentinel; use zero
to indicate no pending interrupts, which simplifies code and
facilitates future extension for additional interrupt types.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 8 ++++----
.../gpu/drm/bridge/analogix/analogix_dp_core.h | 4 ++--
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 18 ++++++++++--------
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 6df6963740d2..079f2f01f33b 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -701,10 +701,10 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
irqreturn_t ret = IRQ_NONE;
- enum dp_irq_type irq_type;
+ u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
+ if (irq_type) {
analogix_dp_mute_hpd_interrupt(dp);
ret = IRQ_WAKE_THREAD;
}
@@ -715,7 +715,7 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
- enum dp_irq_type irq_type;
+ u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
@@ -725,7 +725,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
drm_helper_hpd_irq_event(dp->drm_dev);
}
- if (irq_type != DP_IRQ_TYPE_UNKNOWN) {
+ if (irq_type) {
analogix_dp_clear_hotplug_interrupts(dp);
analogix_dp_unmute_hpd_interrupt(dp);
}
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 4560597604ad..3f40d95757c5 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -120,7 +120,7 @@ enum dp_irq_type {
DP_IRQ_TYPE_HP_CABLE_IN = BIT(0),
DP_IRQ_TYPE_HP_CABLE_OUT = BIT(1),
DP_IRQ_TYPE_HP_CHANGE = BIT(2),
- DP_IRQ_TYPE_UNKNOWN = BIT(3),
+ DP_IRQ_TYPE_IRQ_HPD = BIT(3),
};
struct video_info {
@@ -195,7 +195,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
int analogix_dp_init_analog_func(struct analogix_dp_device *dp);
void analogix_dp_init_hpd(struct analogix_dp_device *dp);
void analogix_dp_force_hpd(struct analogix_dp_device *dp);
-enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp);
+u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp);
void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp);
void analogix_dp_reset_aux(struct analogix_dp_device *dp);
void analogix_dp_init_aux(struct analogix_dp_device *dp);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index c1344a3f013a..49c1961e4326 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -412,8 +412,9 @@ void analogix_dp_force_hpd(struct analogix_dp_device *dp)
writel(reg, dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
}
-enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp)
+u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp)
{
+ u32 irq_type = 0;
u32 reg;
if (dp->hpd_gpiod) {
@@ -425,17 +426,18 @@ enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp)
} else {
/* Parse hotplug interrupt status register */
reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
-
if (reg & PLUG)
- return DP_IRQ_TYPE_HP_CABLE_IN;
-
+ irq_type |= DP_IRQ_TYPE_HP_CABLE_IN;
if (reg & HPD_LOST)
- return DP_IRQ_TYPE_HP_CABLE_OUT;
-
+ irq_type |= DP_IRQ_TYPE_HP_CABLE_OUT;
if (reg & HOTPLUG_CHG)
- return DP_IRQ_TYPE_HP_CHANGE;
+ irq_type |= DP_IRQ_TYPE_HP_CHANGE;
+
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA);
+ if (reg & INT_HPD)
+ irq_type |= DP_IRQ_TYPE_IRQ_HPD;
- return DP_IRQ_TYPE_UNKNOWN;
+ return irq_type;
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 02/14] drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding, Sashiko
Currently only -ENXIO is checked for dp->irq from gpiod_to_irq(),
which ignores other possible error codes like -EPROBE_DEFER, -ENOENT.
Check for any negative value instead, and propagate the actual error
code rather than hardcoding -ENODEV.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/all/20260804083307.84ECA1F000E9@smtp.kernel.org/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 079f2f01f33b..27c9a764e25f 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1480,9 +1480,9 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
irq_flags = IRQF_NO_AUTOEN;
}
- if (dp->irq == -ENXIO) {
+ if (dp->irq < 0) {
dev_err(&pdev->dev, "failed to get irq\n");
- return ERR_PTR(-ENODEV);
+ return ERR_PTR(dp->irq);
}
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 02/14] drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding, Sashiko
Currently only -ENXIO is checked for dp->irq from gpiod_to_irq(),
which ignores other possible error codes like -EPROBE_DEFER, -ENOENT.
Check for any negative value instead, and propagate the actual error
code rather than hardcoding -ENODEV.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/all/20260804083307.84ECA1F000E9@smtp.kernel.org/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 079f2f01f33b..27c9a764e25f 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1480,9 +1480,9 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
irq_flags = IRQF_NO_AUTOEN;
}
- if (dp->irq == -ENXIO) {
+ if (dp->irq < 0) {
dev_err(&pdev->dev, "failed to get irq\n");
- return ERR_PTR(-ENODEV);
+ return ERR_PTR(dp->irq);
}
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 03/14] drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The threaded IRQ is requested without IRQF_ONESHOT, allowing hardirq to
preempt the threaded handler. This creates a read-modify-write race on
HPD interrupt mask registers between the hardirq mute and thread unmute
operations.
Add IRQF_ONESHOT to keep the IRQ line masked during thread execution,
which eliminates the race and makes the per-event mute/unmute calls in
hardirq and thread handlers redundant. Move interrupt status clearing
to the beginning of the threaded handler, before
drm_helper_hpd_irq_event(), to avoid losing events that arrive during
the event handling.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Split out a separate commit to improve the return value checking for
&analogix_dp_device.irq.(Sashiko)
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 27c9a764e25f..974be5b702dc 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -704,10 +704,8 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type) {
- analogix_dp_mute_hpd_interrupt(dp);
+ if (irq_type)
ret = IRQ_WAKE_THREAD;
- }
return ret;
}
@@ -718,6 +716,9 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
+ if (irq_type)
+ analogix_dp_clear_hotplug_interrupts(dp);
+
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
dev_dbg(dp->dev, "Detected cable status changed!\n");
@@ -725,11 +726,6 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
drm_helper_hpd_irq_event(dp->drm_dev);
}
- if (irq_type) {
- analogix_dp_clear_hotplug_interrupts(dp);
- analogix_dp_unmute_hpd_interrupt(dp);
- }
-
return IRQ_HANDLED;
}
@@ -1474,10 +1470,11 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
* that we can get the current state of the GPIO.
*/
dp->irq = gpiod_to_irq(dp->hpd_gpiod);
- irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN;
+ irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN |
+ IRQF_ONESHOT;
} else {
dp->irq = platform_get_irq(pdev, 0);
- irq_flags = IRQF_NO_AUTOEN;
+ irq_flags = IRQF_NO_AUTOEN | IRQF_ONESHOT;
}
if (dp->irq < 0) {
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 03/14] drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The threaded IRQ is requested without IRQF_ONESHOT, allowing hardirq to
preempt the threaded handler. This creates a read-modify-write race on
HPD interrupt mask registers between the hardirq mute and thread unmute
operations.
Add IRQF_ONESHOT to keep the IRQ line masked during thread execution,
which eliminates the race and makes the per-event mute/unmute calls in
hardirq and thread handlers redundant. Move interrupt status clearing
to the beginning of the threaded handler, before
drm_helper_hpd_irq_event(), to avoid losing events that arrive during
the event handling.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Split out a separate commit to improve the return value checking for
&analogix_dp_device.irq.(Sashiko)
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 27c9a764e25f..974be5b702dc 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -704,10 +704,8 @@ static irqreturn_t analogix_dp_hardirq(int irq, void *arg)
u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type) {
- analogix_dp_mute_hpd_interrupt(dp);
+ if (irq_type)
ret = IRQ_WAKE_THREAD;
- }
return ret;
}
@@ -718,6 +716,9 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
u32 irq_type;
irq_type = analogix_dp_get_irq_type(dp);
+ if (irq_type)
+ analogix_dp_clear_hotplug_interrupts(dp);
+
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
dev_dbg(dp->dev, "Detected cable status changed!\n");
@@ -725,11 +726,6 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
drm_helper_hpd_irq_event(dp->drm_dev);
}
- if (irq_type) {
- analogix_dp_clear_hotplug_interrupts(dp);
- analogix_dp_unmute_hpd_interrupt(dp);
- }
-
return IRQ_HANDLED;
}
@@ -1474,10 +1470,11 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
* that we can get the current state of the GPIO.
*/
dp->irq = gpiod_to_irq(dp->hpd_gpiod);
- irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN;
+ irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_AUTOEN |
+ IRQF_ONESHOT;
} else {
dp->irq = platform_get_irq(pdev, 0);
- irq_flags = IRQF_NO_AUTOEN;
+ irq_flags = IRQF_NO_AUTOEN | IRQF_ONESHOT;
}
if (dp->irq < 0) {
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 04/14] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Update analogix_dp_clear_hotplug_interrupts() to take an irq_type
bitmask argument. Instead of clearing all hotplug interrupt bits
unconditionally, only clear the interrupt flags corresponding to the
triggered events.
Pass the detected IRQ bitmask from the irq thread handler, and use the
full HPD_IRQ_ALL mask during HPD initialization.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Add separate patch for IRQF_ONESHOT to resolve interrupt mask issues
triggered by interrupt preemption.(Sashiko)
Changes in v3:
- Rename newly added macro HPD_IRQ to HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 2 +-
.../drm/bridge/analogix/analogix_dp_core.h | 2 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 28 +++++++++++++------
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 974be5b702dc..f88e3263ba0e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -717,7 +717,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type)
- analogix_dp_clear_hotplug_interrupts(dp);
+ analogix_dp_clear_hotplug_interrupts(dp, irq_type);
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 3f40d95757c5..88fa538a5949 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -196,7 +196,7 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp);
void analogix_dp_init_hpd(struct analogix_dp_device *dp);
void analogix_dp_force_hpd(struct analogix_dp_device *dp);
u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp);
-void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp);
+void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type);
void analogix_dp_reset_aux(struct analogix_dp_device *dp);
void analogix_dp_init_aux(struct analogix_dp_device *dp);
int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 49c1961e4326..2c1d4655114b 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -24,6 +24,11 @@
#define COMMON_INT_MASK_4 (HOTPLUG_CHG | HPD_LOST | PLUG)
#define INT_STA_MASK INT_HPD
+#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
+ DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
+#define COMMON_INT_4_HPD_IRQ (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
+ DP_IRQ_TYPE_HP_CHANGE)
+
void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable)
{
u32 reg;
@@ -375,18 +380,25 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
return 0;
}
-void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp)
+void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg = 0;
- if (dp->hpd_gpiod)
+ if (dp->hpd_gpiod || !irq_type)
return;
- reg = HOTPLUG_CHG | HPD_LOST | PLUG;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
+ if (irq_type & COMMON_INT_4_HPD_IRQ) {
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
+ reg |= PLUG;
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
+ reg |= HPD_LOST;
+ if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
+ reg |= HOTPLUG_CHG;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
+ }
- reg = INT_HPD;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA);
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD)
+ writel(INT_HPD, dp->reg_base + ANALOGIX_DP_INT_STA);
}
void analogix_dp_init_hpd(struct analogix_dp_device *dp)
@@ -396,7 +408,7 @@ void analogix_dp_init_hpd(struct analogix_dp_device *dp)
if (dp->hpd_gpiod)
return;
- analogix_dp_clear_hotplug_interrupts(dp);
+ analogix_dp_clear_hotplug_interrupts(dp, HPD_IRQ_ALL);
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
reg &= ~(F_HPD | HPD_CTRL);
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 04/14] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Update analogix_dp_clear_hotplug_interrupts() to take an irq_type
bitmask argument. Instead of clearing all hotplug interrupt bits
unconditionally, only clear the interrupt flags corresponding to the
triggered events.
Pass the detected IRQ bitmask from the irq thread handler, and use the
full HPD_IRQ_ALL mask during HPD initialization.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Add separate patch for IRQF_ONESHOT to resolve interrupt mask issues
triggered by interrupt preemption.(Sashiko)
Changes in v3:
- Rename newly added macro HPD_IRQ to HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 2 +-
.../drm/bridge/analogix/analogix_dp_core.h | 2 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 28 +++++++++++++------
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 974be5b702dc..f88e3263ba0e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -717,7 +717,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type)
- analogix_dp_clear_hotplug_interrupts(dp);
+ analogix_dp_clear_hotplug_interrupts(dp, irq_type);
if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 3f40d95757c5..88fa538a5949 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -196,7 +196,7 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp);
void analogix_dp_init_hpd(struct analogix_dp_device *dp);
void analogix_dp_force_hpd(struct analogix_dp_device *dp);
u32 analogix_dp_get_irq_type(struct analogix_dp_device *dp);
-void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp);
+void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type);
void analogix_dp_reset_aux(struct analogix_dp_device *dp);
void analogix_dp_init_aux(struct analogix_dp_device *dp);
int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 49c1961e4326..2c1d4655114b 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -24,6 +24,11 @@
#define COMMON_INT_MASK_4 (HOTPLUG_CHG | HPD_LOST | PLUG)
#define INT_STA_MASK INT_HPD
+#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
+ DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
+#define COMMON_INT_4_HPD_IRQ (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
+ DP_IRQ_TYPE_HP_CHANGE)
+
void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable)
{
u32 reg;
@@ -375,18 +380,25 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
return 0;
}
-void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp)
+void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg = 0;
- if (dp->hpd_gpiod)
+ if (dp->hpd_gpiod || !irq_type)
return;
- reg = HOTPLUG_CHG | HPD_LOST | PLUG;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
+ if (irq_type & COMMON_INT_4_HPD_IRQ) {
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
+ reg |= PLUG;
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
+ reg |= HPD_LOST;
+ if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
+ reg |= HOTPLUG_CHG;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
+ }
- reg = INT_HPD;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA);
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD)
+ writel(INT_HPD, dp->reg_base + ANALOGIX_DP_INT_STA);
}
void analogix_dp_init_hpd(struct analogix_dp_device *dp)
@@ -396,7 +408,7 @@ void analogix_dp_init_hpd(struct analogix_dp_device *dp)
if (dp->hpd_gpiod)
return;
- analogix_dp_clear_hotplug_interrupts(dp);
+ analogix_dp_clear_hotplug_interrupts(dp, HPD_IRQ_ALL);
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
reg &= ~(F_HPD | HPD_CTRL);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 05/14] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Update the HPD interrupt mute/unmute routines to accept an irq_type
bitmask parameter, allowing selective per-bit mask control instead of
operating on all HPD interrupt bits unconditionally.
With IRQF_ONESHOT handling IRQ line masking during threaded handler
execution, these helpers are no longer needed in the runtime IRQ path.
They are retained for init-time use by analogix_dp_config_interrupt()
to configure platform-specific HPD interrupt masks.
Also extract the irq_type-to-COMMON_INT_STA_4 bit mapping into a shared
helper to avoid duplication in the clear/mute/unmute paths, and drop
the now unused COMMON_INT_4_HPD_IRQ macro.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Update commit messages to align with newly added IRQF_ONESHOT related
commit.
Changes in v3:
- Extract the irq_type bit mapping into a shared helper and document
the mask register polarity once.
- Drop the unused COMMON_INT_4_HPD_IRQ macro.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.h | 4 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 80 ++++++++++++-------
2 files changed, 55 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 88fa538a5949..6a3566b2e8de 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -185,8 +185,8 @@ void analogix_dp_init_interrupt(struct analogix_dp_device *dp);
void analogix_dp_reset(struct analogix_dp_device *dp);
void analogix_dp_swreset(struct analogix_dp_device *dp);
void analogix_dp_config_interrupt(struct analogix_dp_device *dp);
-void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp);
-void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp);
+void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type);
+void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type);
int analogix_dp_wait_pll_locked(struct analogix_dp_device *dp);
void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable);
void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 2c1d4655114b..6ac03a1aa512 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -26,8 +26,20 @@
#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
-#define COMMON_INT_4_HPD_IRQ (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
- DP_IRQ_TYPE_HP_CHANGE)
+
+static u32 analogix_dp_irq_type_to_common_int_sta4(u32 irq_type)
+{
+ u32 reg = 0;
+
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
+ reg |= PLUG;
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
+ reg |= HPD_LOST;
+ if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
+ reg |= HOTPLUG_CHG;
+
+ return reg;
+}
void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable)
{
@@ -196,30 +208,50 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
}
-void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp)
+/*
+ * Both ANALOGIX_DP_COMMON_INT_MASK_4 and ANALOGIX_DP_INT_STA_MASK use
+ * 0 to mask and 1 to unmask the corresponding interrupt sources.
+ */
+void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg, mask;
- /* 0: mask, 1: unmask */
- reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
- reg &= ~COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ if (!irq_type)
+ return;
- reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
- reg &= ~INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ mask = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (mask) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ reg &= ~mask;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ }
+
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ reg &= ~INT_HPD;
+ writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ }
}
-void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp)
+void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg, mask;
- /* 0: mask, 1: unmask */
- reg = COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ if (!irq_type)
+ return;
- reg = INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ mask = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (mask) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ reg |= mask;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ }
+
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ reg |= INT_HPD;
+ writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ }
}
int analogix_dp_wait_pll_locked(struct analogix_dp_device *dp)
@@ -382,20 +414,14 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg = 0;
+ u32 reg;
if (dp->hpd_gpiod || !irq_type)
return;
- if (irq_type & COMMON_INT_4_HPD_IRQ) {
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
- reg |= PLUG;
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
- reg |= HPD_LOST;
- if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
- reg |= HOTPLUG_CHG;
+ reg = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (reg)
writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
- }
if (irq_type & DP_IRQ_TYPE_IRQ_HPD)
writel(INT_HPD, dp->reg_base + ANALOGIX_DP_INT_STA);
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 05/14] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Update the HPD interrupt mute/unmute routines to accept an irq_type
bitmask parameter, allowing selective per-bit mask control instead of
operating on all HPD interrupt bits unconditionally.
With IRQF_ONESHOT handling IRQ line masking during threaded handler
execution, these helpers are no longer needed in the runtime IRQ path.
They are retained for init-time use by analogix_dp_config_interrupt()
to configure platform-specific HPD interrupt masks.
Also extract the irq_type-to-COMMON_INT_STA_4 bit mapping into a shared
helper to avoid duplication in the clear/mute/unmute paths, and drop
the now unused COMMON_INT_4_HPD_IRQ macro.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Update commit messages to align with newly added IRQF_ONESHOT related
commit.
Changes in v3:
- Extract the irq_type bit mapping into a shared helper and document
the mask register polarity once.
- Drop the unused COMMON_INT_4_HPD_IRQ macro.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.h | 4 +-
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 80 ++++++++++++-------
2 files changed, 55 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 88fa538a5949..6a3566b2e8de 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -185,8 +185,8 @@ void analogix_dp_init_interrupt(struct analogix_dp_device *dp);
void analogix_dp_reset(struct analogix_dp_device *dp);
void analogix_dp_swreset(struct analogix_dp_device *dp);
void analogix_dp_config_interrupt(struct analogix_dp_device *dp);
-void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp);
-void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp);
+void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type);
+void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type);
int analogix_dp_wait_pll_locked(struct analogix_dp_device *dp);
void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable);
void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 2c1d4655114b..6ac03a1aa512 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -26,8 +26,20 @@
#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
-#define COMMON_INT_4_HPD_IRQ (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
- DP_IRQ_TYPE_HP_CHANGE)
+
+static u32 analogix_dp_irq_type_to_common_int_sta4(u32 irq_type)
+{
+ u32 reg = 0;
+
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
+ reg |= PLUG;
+ if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
+ reg |= HPD_LOST;
+ if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
+ reg |= HOTPLUG_CHG;
+
+ return reg;
+}
void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable)
{
@@ -196,30 +208,50 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
}
-void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp)
+/*
+ * Both ANALOGIX_DP_COMMON_INT_MASK_4 and ANALOGIX_DP_INT_STA_MASK use
+ * 0 to mask and 1 to unmask the corresponding interrupt sources.
+ */
+void analogix_dp_mute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg, mask;
- /* 0: mask, 1: unmask */
- reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
- reg &= ~COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ if (!irq_type)
+ return;
- reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
- reg &= ~INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ mask = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (mask) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ reg &= ~mask;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ }
+
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ reg &= ~INT_HPD;
+ writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ }
}
-void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp)
+void analogix_dp_unmute_hpd_interrupt(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg;
+ u32 reg, mask;
- /* 0: mask, 1: unmask */
- reg = COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ if (!irq_type)
+ return;
- reg = INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ mask = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (mask) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ reg |= mask;
+ writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ }
+
+ if (irq_type & DP_IRQ_TYPE_IRQ_HPD) {
+ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ reg |= INT_HPD;
+ writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ }
}
int analogix_dp_wait_pll_locked(struct analogix_dp_device *dp)
@@ -382,20 +414,14 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq_type)
{
- u32 reg = 0;
+ u32 reg;
if (dp->hpd_gpiod || !irq_type)
return;
- if (irq_type & COMMON_INT_4_HPD_IRQ) {
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN)
- reg |= PLUG;
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT)
- reg |= HPD_LOST;
- if (irq_type & DP_IRQ_TYPE_HP_CHANGE)
- reg |= HOTPLUG_CHG;
+ reg = analogix_dp_irq_type_to_common_int_sta4(irq_type);
+ if (reg)
writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
- }
if (irq_type & DP_IRQ_TYPE_IRQ_HPD)
writel(INT_HPD, dp->reg_base + ANALOGIX_DP_INT_STA);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 06/14] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt()
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Remove local COMMON_INT_MASK and INT_STA_MASK macros. These constants
are only used once inside this function and bring no reuse benefit.
Replace open-coded register writes for COMMON_INT_MASK_1~3 with
direct writel(0) calls.
Leverage analogix_dp_unmute_hpd_interrupt() using the full HPD_IRQ_ALL
mask to initialize HPD interrupt state, removing duplicated register
handling.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Replace macro HPD_IRQ with HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 25 +++----------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 6ac03a1aa512..0f1406e4a5d3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -18,12 +18,6 @@
#include "analogix_dp_core.h"
#include "analogix_dp_reg.h"
-#define COMMON_INT_MASK_1 0
-#define COMMON_INT_MASK_2 0
-#define COMMON_INT_MASK_3 0
-#define COMMON_INT_MASK_4 (HOTPLUG_CHG | HPD_LOST | PLUG)
-#define INT_STA_MASK INT_HPD
-
#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
@@ -189,23 +183,12 @@ void analogix_dp_swreset(struct analogix_dp_device *dp)
void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
{
- u32 reg;
-
/* 0: mask, 1: unmask */
- reg = COMMON_INT_MASK_1;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_1);
-
- reg = COMMON_INT_MASK_2;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
-
- reg = COMMON_INT_MASK_3;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
-
- reg = COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_1);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- reg = INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
}
/*
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 06/14] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt()
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Remove local COMMON_INT_MASK and INT_STA_MASK macros. These constants
are only used once inside this function and bring no reuse benefit.
Replace open-coded register writes for COMMON_INT_MASK_1~3 with
direct writel(0) calls.
Leverage analogix_dp_unmute_hpd_interrupt() using the full HPD_IRQ_ALL
mask to initialize HPD interrupt state, removing duplicated register
handling.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Replace macro HPD_IRQ with HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 25 +++----------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 6ac03a1aa512..0f1406e4a5d3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -18,12 +18,6 @@
#include "analogix_dp_core.h"
#include "analogix_dp_reg.h"
-#define COMMON_INT_MASK_1 0
-#define COMMON_INT_MASK_2 0
-#define COMMON_INT_MASK_3 0
-#define COMMON_INT_MASK_4 (HOTPLUG_CHG | HPD_LOST | PLUG)
-#define INT_STA_MASK INT_HPD
-
#define HPD_IRQ_ALL (DP_IRQ_TYPE_HP_CABLE_IN | DP_IRQ_TYPE_HP_CABLE_OUT | \
DP_IRQ_TYPE_HP_CHANGE | DP_IRQ_TYPE_IRQ_HPD)
@@ -189,23 +183,12 @@ void analogix_dp_swreset(struct analogix_dp_device *dp)
void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
{
- u32 reg;
-
/* 0: mask, 1: unmask */
- reg = COMMON_INT_MASK_1;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_1);
-
- reg = COMMON_INT_MASK_2;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
-
- reg = COMMON_INT_MASK_3;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
-
- reg = COMMON_INT_MASK_4;
- writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_4);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_1);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
+ writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- reg = INT_STA_MASK;
- writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA_MASK);
+ analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 07/14] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The Analogix DP controller provides two sets of interrupt sources for
hotplug detection: HOTPLUG_CHG for any HPD level change, and the
PLUG/HPD_LOST pair for connect/disconnect transitions respectively.
On Rockchip platforms, configure the HPD deglitch filter and use
HOTPLUG_CHG interrupt for hotplug detection. Other platforms retain the
original PLUG + HPD_LOST scheme with unchanged deglitch values.
Move the HPD deglitch configuration into analogix_dp_reset() so that
platform-specific values are set alongside the existing register
defaults in a single location. Update the threaded IRQ handler to check
the corresponding interrupt flag based on platform type.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Move ANALOGIX_DP_HPD_DEGLITCH_L/ANALOGIX_DP_HPD_DEGLITCH_H configs to
analogix_dp_reset().
Changes in v3:
- Modify the commit msg.
- Replace macro HPD_IRQ with HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 9 ++++++--
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 22 ++++++++++++++++---
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index f88e3263ba0e..287fc16125ef 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -714,13 +714,18 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
u32 irq_type;
+ bool hpd_detected;
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
- irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
+ if (!dp->hpd_gpiod && analogix_dp_is_rockchip(dp->plat_data->dev_type))
+ hpd_detected = irq_type & DP_IRQ_TYPE_HP_CHANGE;
+ else
+ hpd_detected = (irq_type & DP_IRQ_TYPE_HP_CABLE_IN) ||
+ (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT);
+ if (hpd_detected) {
dev_dbg(dp->dev, "Detected cable status changed!\n");
if (dp->drm_dev)
drm_helper_hpd_irq_event(dp->drm_dev);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 0f1406e4a5d3..025da25463a8 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -160,8 +160,13 @@ void analogix_dp_reset(struct analogix_dp_device *dp)
writel(0x0, dp->reg_base + ANALOGIX_DP_PKT_SEND_CTL);
writel(0x0, dp->reg_base + ANALOGIX_DP_HDCP_CTL);
- writel(0x5e, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
- writel(0x1a, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ if (analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
+ writel(0x80, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
+ writel(0xbb, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ } else {
+ writel(0x5e, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
+ writel(0x1a, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ }
writel(0x10, dp->reg_base + ANALOGIX_DP_LINK_DEBUG_CTL);
@@ -188,7 +193,18 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
+ /*
+ * Either HOTPLUG_CHG interrupt or PLUG + HPD_LOST interrupt
+ * pair can be used to implement hotplug detection.
+ *
+ * On Rockchip platforms, configuring HPD deglitch to 2ms and
+ * using HOTPLUG_CHG interrupt for hotplug detection is proven
+ * as a better solution via engineering verification.
+ */
+ if (analogix_dp_is_rockchip(dp->plat_data->dev_type))
+ analogix_dp_unmute_hpd_interrupt(dp, DP_IRQ_TYPE_HP_CHANGE);
+ else
+ analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
}
/*
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 07/14] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The Analogix DP controller provides two sets of interrupt sources for
hotplug detection: HOTPLUG_CHG for any HPD level change, and the
PLUG/HPD_LOST pair for connect/disconnect transitions respectively.
On Rockchip platforms, configure the HPD deglitch filter and use
HOTPLUG_CHG interrupt for hotplug detection. Other platforms retain the
original PLUG + HPD_LOST scheme with unchanged deglitch values.
Move the HPD deglitch configuration into analogix_dp_reset() so that
platform-specific values are set alongside the existing register
defaults in a single location. Update the threaded IRQ handler to check
the corresponding interrupt flag based on platform type.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Move ANALOGIX_DP_HPD_DEGLITCH_L/ANALOGIX_DP_HPD_DEGLITCH_H configs to
analogix_dp_reset().
Changes in v3:
- Modify the commit msg.
- Replace macro HPD_IRQ with HPD_IRQ_ALL.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 9 ++++++--
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 22 ++++++++++++++++---
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index f88e3263ba0e..287fc16125ef 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -714,13 +714,18 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
{
struct analogix_dp_device *dp = arg;
u32 irq_type;
+ bool hpd_detected;
irq_type = analogix_dp_get_irq_type(dp);
if (irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
- if (irq_type & DP_IRQ_TYPE_HP_CABLE_IN ||
- irq_type & DP_IRQ_TYPE_HP_CABLE_OUT) {
+ if (!dp->hpd_gpiod && analogix_dp_is_rockchip(dp->plat_data->dev_type))
+ hpd_detected = irq_type & DP_IRQ_TYPE_HP_CHANGE;
+ else
+ hpd_detected = (irq_type & DP_IRQ_TYPE_HP_CABLE_IN) ||
+ (irq_type & DP_IRQ_TYPE_HP_CABLE_OUT);
+ if (hpd_detected) {
dev_dbg(dp->dev, "Detected cable status changed!\n");
if (dp->drm_dev)
drm_helper_hpd_irq_event(dp->drm_dev);
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 0f1406e4a5d3..025da25463a8 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -160,8 +160,13 @@ void analogix_dp_reset(struct analogix_dp_device *dp)
writel(0x0, dp->reg_base + ANALOGIX_DP_PKT_SEND_CTL);
writel(0x0, dp->reg_base + ANALOGIX_DP_HDCP_CTL);
- writel(0x5e, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
- writel(0x1a, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ if (analogix_dp_is_rockchip(dp->plat_data->dev_type)) {
+ writel(0x80, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
+ writel(0xbb, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ } else {
+ writel(0x5e, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_L);
+ writel(0x1a, dp->reg_base + ANALOGIX_DP_HPD_DEGLITCH_H);
+ }
writel(0x10, dp->reg_base + ANALOGIX_DP_LINK_DEBUG_CTL);
@@ -188,7 +193,18 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
+ /*
+ * Either HOTPLUG_CHG interrupt or PLUG + HPD_LOST interrupt
+ * pair can be used to implement hotplug detection.
+ *
+ * On Rockchip platforms, configuring HPD deglitch to 2ms and
+ * using HOTPLUG_CHG interrupt for hotplug detection is proven
+ * as a better solution via engineering verification.
+ */
+ if (analogix_dp_is_rockchip(dp->plat_data->dev_type))
+ analogix_dp_unmute_hpd_interrupt(dp, DP_IRQ_TYPE_HP_CHANGE);
+ else
+ analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 08/14] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
GPIO HPD does not rely on DP controller internal native HPD interrupts.
Skip native HPD register manipulations to avoid irrelevant operations.
Move the hpd_gpiod guard to its caller so the helper operates purely on
the given bitmask, and mute all native HPD interrupts for GPIO mode.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Adapt to the newly added IRQF_ONESHOT related commit and expand the
commit msg.
Changes in v3:
- Reorganize the branch layout for hpd_gpiod check.
- Simplify the commit msg.
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 287fc16125ef..b92d28546192 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -717,7 +717,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
bool hpd_detected;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type)
+ if (!dp->hpd_gpiod && irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
if (!dp->hpd_gpiod && analogix_dp_is_rockchip(dp->plat_data->dev_type))
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 025da25463a8..af5e5a8ec88d 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -193,6 +193,11 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
+ if (dp->hpd_gpiod) {
+ analogix_dp_mute_hpd_interrupt(dp, HPD_IRQ_ALL);
+ return;
+ }
+
/*
* Either HOTPLUG_CHG interrupt or PLUG + HPD_LOST interrupt
* pair can be used to implement hotplug detection.
@@ -415,7 +420,7 @@ void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq
{
u32 reg;
- if (dp->hpd_gpiod || !irq_type)
+ if (!irq_type)
return;
reg = analogix_dp_irq_type_to_common_int_sta4(irq_type);
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 08/14] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
GPIO HPD does not rely on DP controller internal native HPD interrupts.
Skip native HPD register manipulations to avoid irrelevant operations.
Move the hpd_gpiod guard to its caller so the helper operates purely on
the given bitmask, and mute all native HPD interrupts for GPIO mode.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Adapt to the newly added IRQF_ONESHOT related commit and expand the
commit msg.
Changes in v3:
- Reorganize the branch layout for hpd_gpiod check.
- Simplify the commit msg.
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 287fc16125ef..b92d28546192 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -717,7 +717,7 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg)
bool hpd_detected;
irq_type = analogix_dp_get_irq_type(dp);
- if (irq_type)
+ if (!dp->hpd_gpiod && irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
if (!dp->hpd_gpiod && analogix_dp_is_rockchip(dp->plat_data->dev_type))
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index 025da25463a8..af5e5a8ec88d 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -193,6 +193,11 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
+ if (dp->hpd_gpiod) {
+ analogix_dp_mute_hpd_interrupt(dp, HPD_IRQ_ALL);
+ return;
+ }
+
/*
* Either HOTPLUG_CHG interrupt or PLUG + HPD_LOST interrupt
* pair can be used to implement hotplug detection.
@@ -415,7 +420,7 @@ void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp, u32 irq
{
u32 reg;
- if (dp->hpd_gpiod || !irq_type)
+ if (!irq_type)
return;
reg = analogix_dp_irq_type_to_common_int_sta4(irq_type);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 09/14] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Move enable_irq()/disable_irq() from bridge enable/disable handlers
into analogix_dp_bind()/analogix_dp_unbind(). This keeps the IRQ
active throughout the device lifecycle rather than only during display
activity, which is a prerequisite for supporting HPD detection while
the display pipeline is inactive.
This is safe because the HPD interrupt sources are now managed
explicitly:
- Native HPD interrupt generation depends on the controller's power
domain and clock. When runtime PM has suspended the device, the
controller cannot produce interrupts, so the hardirq is never
entered on an unpowered device.
- For GPIO HPD mode, the native HPD interrupts are muted in
analogix_dp_config_interrupt(), and the hardirq reads only the GPIO
line via gpiod_get_value(), which is safe while the controller is
suspended.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Move this patch after mute/unmute related modification and detail the
commit msg.
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index b92d28546192..addd319719de 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1018,7 +1018,6 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
goto out_dp_init;
}
- enable_irq(dp->irq);
return 0;
out_dp_init:
@@ -1160,8 +1159,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
return;
- disable_irq(dp->irq);
-
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
pm_runtime_put_sync(dp->dev);
@@ -1574,6 +1571,8 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ enable_irq(dp->irq);
+
return 0;
err_unregister_aux:
@@ -1585,6 +1584,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
+ disable_irq(dp->irq);
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 09/14] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Move enable_irq()/disable_irq() from bridge enable/disable handlers
into analogix_dp_bind()/analogix_dp_unbind(). This keeps the IRQ
active throughout the device lifecycle rather than only during display
activity, which is a prerequisite for supporting HPD detection while
the display pipeline is inactive.
This is safe because the HPD interrupt sources are now managed
explicitly:
- Native HPD interrupt generation depends on the controller's power
domain and clock. When runtime PM has suspended the device, the
controller cannot produce interrupts, so the hardirq is never
entered on an unpowered device.
- For GPIO HPD mode, the native HPD interrupts are muted in
analogix_dp_config_interrupt(), and the hardirq reads only the GPIO
line via gpiod_get_value(), which is safe while the controller is
suspended.
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Move this patch after mute/unmute related modification and detail the
commit msg.
Changes in v4:
- Add Tested-by tag.
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index b92d28546192..addd319719de 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1018,7 +1018,6 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
goto out_dp_init;
}
- enable_irq(dp->irq);
return 0;
out_dp_init:
@@ -1160,8 +1159,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
if (dp->dpms_mode != DRM_MODE_DPMS_ON)
return;
- disable_irq(dp->irq);
-
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
pm_runtime_put_sync(dp->dev);
@@ -1574,6 +1571,8 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ enable_irq(dp->irq);
+
return 0;
err_unregister_aux:
@@ -1585,6 +1584,7 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
+ disable_irq(dp->irq);
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 10/14] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
On Rockchip platforms, the Analogix DP native HPD pin IRQ requires the
DP controller to remain powered and clocked to generate plug/unplug
interrupts. Without a runtime PM reference, the controller suspends
when the display pipeline is inactive, disabling HPD detection.
Acquire a runtime PM reference in analogix_dp_bind() and release it in
analogix_dp_unbind() for native HPD pin mode. This keeps the controller
alive throughout the device lifecycle for continuous hotplug detection.
Persistent power is only necessary for native HPD pin mode. It is not
required for force-HPD or GPIO HPD modes, where hotplug detection does
not depend on the DP controller's internal interrupt logic. Add helper
analogix_dp_require_pm_for_hpd_irq() to identify Rockchip native HPD
pin configurations (non-GPIO, non-force-HPD).
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Split IRQ enable/disable logic, handle native HPD pin and
GPIO/force-HPD modes separately to avoid unbalanced enable_irq()
calls.(Sashiko)
Changes in v3:
- Modify the commit msg according to the previous commit for moving IRQ
enabling/disabling.
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index addd319719de..38857508d939 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -39,6 +39,12 @@
static const bool verify_fast_training;
+static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
+{
+ return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
+ !dp->force_hpd;
+}
+
static void analogix_dp_init_dp(struct analogix_dp_device *dp)
{
analogix_dp_reset(dp);
@@ -1571,6 +1577,12 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ if (analogix_dp_require_pm_for_hpd_irq(dp)) {
+ ret = pm_runtime_resume_and_get(dp->dev);
+ if (ret)
+ goto err_unregister_aux;
+ }
+
enable_irq(dp->irq);
return 0;
@@ -1585,6 +1597,10 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
disable_irq(dp->irq);
+
+ if (analogix_dp_require_pm_for_hpd_irq(dp))
+ pm_runtime_put_sync(dp->dev);
+
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 10/14] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
On Rockchip platforms, the Analogix DP native HPD pin IRQ requires the
DP controller to remain powered and clocked to generate plug/unplug
interrupts. Without a runtime PM reference, the controller suspends
when the display pipeline is inactive, disabling HPD detection.
Acquire a runtime PM reference in analogix_dp_bind() and release it in
analogix_dp_unbind() for native HPD pin mode. This keeps the controller
alive throughout the device lifecycle for continuous hotplug detection.
Persistent power is only necessary for native HPD pin mode. It is not
required for force-HPD or GPIO HPD modes, where hotplug detection does
not depend on the DP controller's internal interrupt logic. Add helper
analogix_dp_require_pm_for_hpd_irq() to identify Rockchip native HPD
pin configurations (non-GPIO, non-force-HPD).
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v2:
- Split IRQ enable/disable logic, handle native HPD pin and
GPIO/force-HPD modes separately to avoid unbalanced enable_irq()
calls.(Sashiko)
Changes in v3:
- Modify the commit msg according to the previous commit for moving IRQ
enabling/disabling.
Changes in v4:
- Add Tested-by tag.
---
.../gpu/drm/bridge/analogix/analogix_dp_core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index addd319719de..38857508d939 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -39,6 +39,12 @@
static const bool verify_fast_training;
+static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
+{
+ return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
+ !dp->force_hpd;
+}
+
static void analogix_dp_init_dp(struct analogix_dp_device *dp)
{
analogix_dp_reset(dp);
@@ -1571,6 +1577,12 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
goto err_unregister_aux;
}
+ if (analogix_dp_require_pm_for_hpd_irq(dp)) {
+ ret = pm_runtime_resume_and_get(dp->dev);
+ if (ret)
+ goto err_unregister_aux;
+ }
+
enable_irq(dp->irq);
return 0;
@@ -1585,6 +1597,10 @@ EXPORT_SYMBOL_GPL(analogix_dp_bind);
void analogix_dp_unbind(struct analogix_dp_device *dp)
{
disable_irq(dp->irq);
+
+ if (analogix_dp_require_pm_for_hpd_irq(dp))
+ pm_runtime_put_sync(dp->dev);
+
drm_dp_aux_unregister(&dp->aux);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The DRM bridge core provides a standard next_bridge field in struct
drm_bridge for chaining downstream bridges. Use dp->bridge.next_bridge
consistently inside the analogix_dp driver and drop the separate
dp->plat_data->next_bridge field.
The next bridge is now resolved in analogix_dp_aux_done_probing(): for
Exynos platforms with legacy display-timings a display mode bridge is
created and used directly, skipping the endpoint lookup; otherwise the
remote endpoint bridge (panel or bridge) is looked up via
of_drm_get_bridge_by_endpoint().
The reference returned by of_drm_get_bridge_by_endpoint() is transferred
to bridge->next_bridge, and an explicit reference is taken for the
devm-managed display mode bridge; the bridge core automatically puts
bridge->next_bridge at bridge destroy time, pairing with both.
Suggested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 44 +++++++++----------
drivers/gpu/drm/exynos/exynos_dp.c | 15 +------
include/drm/bridge/analogix_dp.h | 1 -
3 files changed, 23 insertions(+), 37 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 38857508d939..853b6a6a7fe4 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -21,6 +21,7 @@
#include <linux/platform_device.h>
#include <drm/bridge/analogix_dp.h>
+#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/display/drm_dp_aux_bus.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
@@ -32,6 +33,8 @@
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
+#include <video/of_display_timing.h>
+
#include "analogix_dp_core.h"
#include "analogix_dp_reg.h"
@@ -909,7 +912,7 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->plat_data->next_bridge)
+ if (dp->bridge.next_bridge)
return connector_status_connected;
if (!analogix_dp_detect_hpd(dp))
@@ -930,8 +933,8 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (dp->plat_data->next_bridge) {
- ret = drm_bridge_attach(dp->encoder, dp->plat_data->next_bridge, bridge,
+ if (dp->bridge.next_bridge) {
+ ret = drm_bridge_attach(dp->encoder, dp->bridge.next_bridge, bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
@@ -1655,37 +1658,34 @@ struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp)
}
EXPORT_SYMBOL_GPL(analogix_dp_get_aux);
-static void analogix_dp_put_bridge(void *data)
-{
- drm_bridge_put(data);
-}
-
static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
{
struct analogix_dp_device *dp = to_dp(aux);
struct analogix_dp_plat_data *plat_data = dp->plat_data;
+ struct drm_bridge *bridge = &dp->bridge, *next_bridge;
int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
- int ret;
+
+ if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
+ next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
+ DRM_MODE_CONNECTOR_eDP);
+ if (IS_ERR(next_bridge))
+ return PTR_ERR(next_bridge);
+ bridge->next_bridge = drm_bridge_get(next_bridge);
+
+ return component_add(dp->dev, plat_data->ops);
+ }
/*
* If of_drm_get_bridge_by_endpoint() returns -ENODEV, there may be no
* valid panel or bridge nodes. The driver should go on for the
* driver-free bridge or the DP mode applications.
*/
- plat_data->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node,
- port, 0);
- if (IS_ERR(plat_data->next_bridge)) {
- if (PTR_ERR(plat_data->next_bridge) == -ENODEV)
- plat_data->next_bridge = NULL;
+ bridge->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node, port, 0);
+ if (IS_ERR(bridge->next_bridge)) {
+ if (PTR_ERR(bridge->next_bridge) == -ENODEV)
+ bridge->next_bridge = NULL;
else
- return PTR_ERR(plat_data->next_bridge);
- }
-
- if (plat_data->next_bridge) {
- ret = devm_add_action_or_reset(dp->dev, analogix_dp_put_bridge,
- plat_data->next_bridge);
- if (ret)
- return ret;
+ return PTR_ERR(bridge->next_bridge);
}
return component_add(dp->dev, plat_data->ops);
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 82c238829921..b1e130278ecc 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -14,12 +14,10 @@
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <video/of_display_timing.h>
#include <video/of_videomode.h>
#include <video/videomode.h>
#include <drm/bridge/analogix_dp.h>
-#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_bridge_connector.h>
@@ -161,14 +159,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
*/
platform_set_drvdata(pdev, dp);
- if (of_get_display_timings(dev->of_node)) {
- dp->plat_data.next_bridge = devm_drm_of_display_mode_bridge(dp->dev,
- dp->dev->of_node,
- DRM_MODE_CONNECTOR_eDP);
- if (IS_ERR(dp->plat_data.next_bridge))
- return PTR_ERR(dp->plat_data.next_bridge);
- }
-
/* The remote port can be either a panel or a bridge */
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
@@ -179,10 +169,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- if (dp->plat_data.next_bridge)
- return component_add(&pdev->dev, &exynos_dp_ops);
- else
- return analogix_dp_finish_probe(dp->adp);
+ return analogix_dp_finish_probe(dp->adp);
}
static void exynos_dp_remove(struct platform_device *pdev)
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 6033137b651e..f152ca8c3218 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -35,7 +35,6 @@ static inline bool analogix_dp_is_rockchip(enum analogix_dp_devtype type)
struct analogix_dp_plat_data {
enum analogix_dp_devtype dev_type;
- struct drm_bridge *next_bridge;
struct drm_encoder *encoder;
struct drm_connector *connector;
const struct component_ops *ops;
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
The DRM bridge core provides a standard next_bridge field in struct
drm_bridge for chaining downstream bridges. Use dp->bridge.next_bridge
consistently inside the analogix_dp driver and drop the separate
dp->plat_data->next_bridge field.
The next bridge is now resolved in analogix_dp_aux_done_probing(): for
Exynos platforms with legacy display-timings a display mode bridge is
created and used directly, skipping the endpoint lookup; otherwise the
remote endpoint bridge (panel or bridge) is looked up via
of_drm_get_bridge_by_endpoint().
The reference returned by of_drm_get_bridge_by_endpoint() is transferred
to bridge->next_bridge, and an explicit reference is taken for the
devm-managed display mode bridge; the bridge core automatically puts
bridge->next_bridge at bridge destroy time, pairing with both.
Suggested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 44 +++++++++----------
drivers/gpu/drm/exynos/exynos_dp.c | 15 +------
include/drm/bridge/analogix_dp.h | 1 -
3 files changed, 23 insertions(+), 37 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 38857508d939..853b6a6a7fe4 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -21,6 +21,7 @@
#include <linux/platform_device.h>
#include <drm/bridge/analogix_dp.h>
+#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/display/drm_dp_aux_bus.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
@@ -32,6 +33,8 @@
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
+#include <video/of_display_timing.h>
+
#include "analogix_dp_core.h"
#include "analogix_dp_reg.h"
@@ -909,7 +912,7 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->plat_data->next_bridge)
+ if (dp->bridge.next_bridge)
return connector_status_connected;
if (!analogix_dp_detect_hpd(dp))
@@ -930,8 +933,8 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (dp->plat_data->next_bridge) {
- ret = drm_bridge_attach(dp->encoder, dp->plat_data->next_bridge, bridge,
+ if (dp->bridge.next_bridge) {
+ ret = drm_bridge_attach(dp->encoder, dp->bridge.next_bridge, bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
@@ -1655,37 +1658,34 @@ struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp)
}
EXPORT_SYMBOL_GPL(analogix_dp_get_aux);
-static void analogix_dp_put_bridge(void *data)
-{
- drm_bridge_put(data);
-}
-
static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
{
struct analogix_dp_device *dp = to_dp(aux);
struct analogix_dp_plat_data *plat_data = dp->plat_data;
+ struct drm_bridge *bridge = &dp->bridge, *next_bridge;
int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
- int ret;
+
+ if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
+ next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
+ DRM_MODE_CONNECTOR_eDP);
+ if (IS_ERR(next_bridge))
+ return PTR_ERR(next_bridge);
+ bridge->next_bridge = drm_bridge_get(next_bridge);
+
+ return component_add(dp->dev, plat_data->ops);
+ }
/*
* If of_drm_get_bridge_by_endpoint() returns -ENODEV, there may be no
* valid panel or bridge nodes. The driver should go on for the
* driver-free bridge or the DP mode applications.
*/
- plat_data->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node,
- port, 0);
- if (IS_ERR(plat_data->next_bridge)) {
- if (PTR_ERR(plat_data->next_bridge) == -ENODEV)
- plat_data->next_bridge = NULL;
+ bridge->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node, port, 0);
+ if (IS_ERR(bridge->next_bridge)) {
+ if (PTR_ERR(bridge->next_bridge) == -ENODEV)
+ bridge->next_bridge = NULL;
else
- return PTR_ERR(plat_data->next_bridge);
- }
-
- if (plat_data->next_bridge) {
- ret = devm_add_action_or_reset(dp->dev, analogix_dp_put_bridge,
- plat_data->next_bridge);
- if (ret)
- return ret;
+ return PTR_ERR(bridge->next_bridge);
}
return component_add(dp->dev, plat_data->ops);
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c
index 82c238829921..b1e130278ecc 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -14,12 +14,10 @@
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#include <video/of_display_timing.h>
#include <video/of_videomode.h>
#include <video/videomode.h>
#include <drm/bridge/analogix_dp.h>
-#include <drm/bridge/of-display-mode-bridge.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_bridge_connector.h>
@@ -161,14 +159,6 @@ static int exynos_dp_probe(struct platform_device *pdev)
*/
platform_set_drvdata(pdev, dp);
- if (of_get_display_timings(dev->of_node)) {
- dp->plat_data.next_bridge = devm_drm_of_display_mode_bridge(dp->dev,
- dp->dev->of_node,
- DRM_MODE_CONNECTOR_eDP);
- if (IS_ERR(dp->plat_data.next_bridge))
- return PTR_ERR(dp->plat_data.next_bridge);
- }
-
/* The remote port can be either a panel or a bridge */
dp->plat_data.dev_type = EXYNOS_DP;
dp->plat_data.power_on = exynos_dp_poweron;
@@ -179,10 +169,7 @@ static int exynos_dp_probe(struct platform_device *pdev)
if (IS_ERR(dp->adp))
return PTR_ERR(dp->adp);
- if (dp->plat_data.next_bridge)
- return component_add(&pdev->dev, &exynos_dp_ops);
- else
- return analogix_dp_finish_probe(dp->adp);
+ return analogix_dp_finish_probe(dp->adp);
}
static void exynos_dp_remove(struct platform_device *pdev)
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 6033137b651e..f152ca8c3218 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -35,7 +35,6 @@ static inline bool analogix_dp_is_rockchip(enum analogix_dp_devtype type)
struct analogix_dp_plat_data {
enum analogix_dp_devtype dev_type;
- struct drm_bridge *next_bridge;
struct drm_encoder *encoder;
struct drm_connector *connector;
const struct component_ops *ops;
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 12/14] drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Limit the shortcut which unconditionally returns connected status when
a next bridge exists. Only apply this logic if the last bridge in the
chain is a panel and the bridges attached after Analogix DP bridge lack
DRM_BRIDGE_OP_DETECT, which called 'force_connected_mode'. For all
other cases, rely on analogix_dp_detect_hpd() to report accurate
hotplug state.
Background for the special handling:
- If the chain ends with a DP connector bridge, the connector relies
on Analogix DP to perform detection. We must avoid hardcoding
connected status here.
- For intermediate bridges such as PS8625 / PTN3460 without detect
support [1], historically the bridge connector defaults to connected
via drm_helper_probe_detect() when no per-bridge detect callback
exists.
[1] https://lore.kernel.org/all/4939d55e-b560-4235-8295-adf8e48d9b74@samsung.com/
Reported-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5209243.oAaWjsssbx@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Add missing drm_bridge_put() after drm_bridge_chain_get_last_bridge()
to fix a reference count leak.(Sashiko)
- Report panel endpoints as always connected from
analogix_dp_get_plug_in_status() via newly added
&analogix_dp_device.force_connected_mode.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 30 +++++++++++++++++--
.../drm/bridge/analogix/analogix_dp_core.h | 1 +
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 3 ++
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 853b6a6a7fe4..df898f314254 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -912,15 +912,30 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->bridge.next_bridge)
- return connector_status_connected;
-
if (!analogix_dp_detect_hpd(dp))
status = connector_status_connected;
return status;
}
+static bool analogix_dp_bridge_force_connected(struct analogix_dp_device *dp)
+{
+ struct drm_bridge *last_bridge;
+ bool force_connected = false;
+
+ drm_for_each_bridge_in_chain_from(dp->bridge.next_bridge, bridge) {
+ if (bridge->ops & DRM_BRIDGE_OP_DETECT)
+ return false;
+ }
+
+ last_bridge = drm_bridge_chain_get_last_bridge(dp->encoder);
+ if (last_bridge)
+ force_connected = drm_bridge_is_panel(last_bridge);
+ drm_bridge_put(last_bridge);
+
+ return force_connected;
+}
+
static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
@@ -940,6 +955,15 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
return ret;
}
+
+ /*
+ * Only assume connected when the bridge chain ends with a panel.
+ * Panel bridges lack a detect callback and historically rely on
+ * this shortcut. For other next bridge types (e.g., DP connector
+ * bridges), fall back to analogix_dp_detect_hpd() to report
+ * accurate hotplug state.
+ */
+ dp->force_connected_mode = analogix_dp_bridge_force_connected(dp);
}
return 0;
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 6a3566b2e8de..5f5698c73d88 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -170,6 +170,7 @@ struct analogix_dp_device {
bool force_hpd;
bool fast_train_enable;
bool psr_supported;
+ bool force_connected_mode;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index af5e5a8ec88d..abbcdba1a438 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -533,6 +533,9 @@ int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp)
{
u32 reg;
+ if (dp->force_connected_mode)
+ return 0;
+
if (dp->hpd_gpiod) {
if (gpiod_get_value(dp->hpd_gpiod))
return 0;
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 12/14] drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Limit the shortcut which unconditionally returns connected status when
a next bridge exists. Only apply this logic if the last bridge in the
chain is a panel and the bridges attached after Analogix DP bridge lack
DRM_BRIDGE_OP_DETECT, which called 'force_connected_mode'. For all
other cases, rely on analogix_dp_detect_hpd() to report accurate
hotplug state.
Background for the special handling:
- If the chain ends with a DP connector bridge, the connector relies
on Analogix DP to perform detection. We must avoid hardcoding
connected status here.
- For intermediate bridges such as PS8625 / PTN3460 without detect
support [1], historically the bridge connector defaults to connected
via drm_helper_probe_detect() when no per-bridge detect callback
exists.
[1] https://lore.kernel.org/all/4939d55e-b560-4235-8295-adf8e48d9b74@samsung.com/
Reported-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5209243.oAaWjsssbx@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Add missing drm_bridge_put() after drm_bridge_chain_get_last_bridge()
to fix a reference count leak.(Sashiko)
- Report panel endpoints as always connected from
analogix_dp_get_plug_in_status() via newly added
&analogix_dp_device.force_connected_mode.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 30 +++++++++++++++++--
.../drm/bridge/analogix/analogix_dp_core.h | 1 +
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 3 ++
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 853b6a6a7fe4..df898f314254 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -912,15 +912,30 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
struct analogix_dp_device *dp = to_dp(bridge);
enum drm_connector_status status = connector_status_disconnected;
- if (dp->bridge.next_bridge)
- return connector_status_connected;
-
if (!analogix_dp_detect_hpd(dp))
status = connector_status_connected;
return status;
}
+static bool analogix_dp_bridge_force_connected(struct analogix_dp_device *dp)
+{
+ struct drm_bridge *last_bridge;
+ bool force_connected = false;
+
+ drm_for_each_bridge_in_chain_from(dp->bridge.next_bridge, bridge) {
+ if (bridge->ops & DRM_BRIDGE_OP_DETECT)
+ return false;
+ }
+
+ last_bridge = drm_bridge_chain_get_last_bridge(dp->encoder);
+ if (last_bridge)
+ force_connected = drm_bridge_is_panel(last_bridge);
+ drm_bridge_put(last_bridge);
+
+ return force_connected;
+}
+
static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
@@ -940,6 +955,15 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
return ret;
}
+
+ /*
+ * Only assume connected when the bridge chain ends with a panel.
+ * Panel bridges lack a detect callback and historically rely on
+ * this shortcut. For other next bridge types (e.g., DP connector
+ * bridges), fall back to analogix_dp_detect_hpd() to report
+ * accurate hotplug state.
+ */
+ dp->force_connected_mode = analogix_dp_bridge_force_connected(dp);
}
return 0;
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 6a3566b2e8de..5f5698c73d88 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -170,6 +170,7 @@ struct analogix_dp_device {
bool force_hpd;
bool fast_train_enable;
bool psr_supported;
+ bool force_connected_mode;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index af5e5a8ec88d..abbcdba1a438 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -533,6 +533,9 @@ int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp)
{
u32 reg;
+ if (dp->force_connected_mode)
+ return 0;
+
if (dp->hpd_gpiod) {
if (gpiod_get_value(dp->hpd_gpiod))
return 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 13/14] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
When the display pipeline includes a display-connector bridge with
hpd-gpios configured, the connector's hotplug status is managed by the
display-connector bridge through its GPIO, not by the Analogix DP
controller's native HPD. In this configuration, the DP controller's
internal HPD polling in analogix_dp_detect_hpd() does not reflect the
actual connection state.
At attach time, detect whether a downstream bridge provides HPD events
(DRM_BRIDGE_OP_HPD) while none of them provides detection
(DRM_BRIDGE_OP_DETECT). When found, switch to hpd notify mode: cache
the connection status reported through the .hpd_notify callback, mute
the controller's native HPD interrupts and skip their initialization,
and trust the cached status instead of polling the typically
unconnected native HPD pin.
Suggested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Introduce hpd_notify_mode flag to skip native HPD operations when
HPD comes from a downstream bridge.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 27 ++++++++++++++++++-
.../drm/bridge/analogix/analogix_dp_core.h | 2 ++
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 7 +++--
3 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index df898f314254..90245d55d1d2 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -45,7 +45,7 @@ static const bool verify_fast_training;
static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
{
return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
- !dp->force_hpd;
+ !dp->force_hpd && !dp->hpd_notify_mode;
}
static void analogix_dp_init_dp(struct analogix_dp_device *dp)
@@ -936,6 +936,21 @@ static bool analogix_dp_bridge_force_connected(struct analogix_dp_device *dp)
return force_connected;
}
+static bool analogix_dp_has_downstream_hpd(struct analogix_dp_device *dp)
+{
+ bool hpd_bridge = false;
+
+ drm_for_each_bridge_in_chain_from(dp->bridge.next_bridge, bridge) {
+ if (bridge->ops & DRM_BRIDGE_OP_DETECT)
+ return false;
+
+ if (bridge->ops & DRM_BRIDGE_OP_HPD)
+ hpd_bridge = true;
+ }
+
+ return hpd_bridge;
+}
+
static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
@@ -964,6 +979,7 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
* accurate hotplug state.
*/
dp->force_connected_mode = analogix_dp_bridge_force_connected(dp);
+ dp->hpd_notify_mode = analogix_dp_has_downstream_hpd(dp);
}
return 0;
@@ -1260,6 +1276,14 @@ static void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge,
DRM_ERROR("Failed to enable psr (%d)\n", ret);
}
+static void analogix_dp_bridge_notify(struct drm_bridge *bridge, struct drm_connector *connector,
+ enum drm_connector_status status)
+{
+ struct analogix_dp_device *dp = to_dp(bridge);
+
+ dp->connection_notified = (status == connector_status_connected);
+}
+
static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -1272,6 +1296,7 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.attach = analogix_dp_bridge_attach,
.edid_read = analogix_dp_bridge_edid_read,
.detect = analogix_dp_bridge_detect,
+ .hpd_notify = analogix_dp_bridge_notify,
};
static int analogix_dp_dt_parse_lanes_map(struct analogix_dp_device *dp)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 5f5698c73d88..9f25fb6545ad 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -171,6 +171,8 @@ struct analogix_dp_device {
bool fast_train_enable;
bool psr_supported;
bool force_connected_mode;
+ bool hpd_notify_mode;
+ bool connection_notified;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index abbcdba1a438..4c5e18d40dad 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -193,7 +193,7 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- if (dp->hpd_gpiod) {
+ if (dp->hpd_gpiod || dp->hpd_notify_mode) {
analogix_dp_mute_hpd_interrupt(dp, HPD_IRQ_ALL);
return;
}
@@ -435,7 +435,7 @@ void analogix_dp_init_hpd(struct analogix_dp_device *dp)
{
u32 reg;
- if (dp->hpd_gpiod)
+ if (dp->hpd_gpiod || dp->hpd_notify_mode)
return;
analogix_dp_clear_hotplug_interrupts(dp, HPD_IRQ_ALL);
@@ -539,6 +539,9 @@ int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp)
if (dp->hpd_gpiod) {
if (gpiod_get_value(dp->hpd_gpiod))
return 0;
+ } else if (dp->hpd_notify_mode) {
+ if (dp->connection_notified)
+ return 0;
} else {
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
if (reg & HPD_STATUS)
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 13/14] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
When the display pipeline includes a display-connector bridge with
hpd-gpios configured, the connector's hotplug status is managed by the
display-connector bridge through its GPIO, not by the Analogix DP
controller's native HPD. In this configuration, the DP controller's
internal HPD polling in analogix_dp_detect_hpd() does not reflect the
actual connection state.
At attach time, detect whether a downstream bridge provides HPD events
(DRM_BRIDGE_OP_HPD) while none of them provides detection
(DRM_BRIDGE_OP_DETECT). When found, switch to hpd notify mode: cache
the connection status reported through the .hpd_notify callback, mute
the controller's native HPD interrupts and skip their initialization,
and trust the cached status instead of polling the typically
unconnected native HPD pin.
Suggested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
Changes in v3:
- Introduce hpd_notify_mode flag to skip native HPD operations when
HPD comes from a downstream bridge.
Changes in v4:
- Add Tested-by tag.
---
.../drm/bridge/analogix/analogix_dp_core.c | 27 ++++++++++++++++++-
.../drm/bridge/analogix/analogix_dp_core.h | 2 ++
.../gpu/drm/bridge/analogix/analogix_dp_reg.c | 7 +++--
3 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index df898f314254..90245d55d1d2 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -45,7 +45,7 @@ static const bool verify_fast_training;
static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
{
return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
- !dp->force_hpd;
+ !dp->force_hpd && !dp->hpd_notify_mode;
}
static void analogix_dp_init_dp(struct analogix_dp_device *dp)
@@ -936,6 +936,21 @@ static bool analogix_dp_bridge_force_connected(struct analogix_dp_device *dp)
return force_connected;
}
+static bool analogix_dp_has_downstream_hpd(struct analogix_dp_device *dp)
+{
+ bool hpd_bridge = false;
+
+ drm_for_each_bridge_in_chain_from(dp->bridge.next_bridge, bridge) {
+ if (bridge->ops & DRM_BRIDGE_OP_DETECT)
+ return false;
+
+ if (bridge->ops & DRM_BRIDGE_OP_HPD)
+ hpd_bridge = true;
+ }
+
+ return hpd_bridge;
+}
+
static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
@@ -964,6 +979,7 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
* accurate hotplug state.
*/
dp->force_connected_mode = analogix_dp_bridge_force_connected(dp);
+ dp->hpd_notify_mode = analogix_dp_has_downstream_hpd(dp);
}
return 0;
@@ -1260,6 +1276,14 @@ static void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge,
DRM_ERROR("Failed to enable psr (%d)\n", ret);
}
+static void analogix_dp_bridge_notify(struct drm_bridge *bridge, struct drm_connector *connector,
+ enum drm_connector_status status)
+{
+ struct analogix_dp_device *dp = to_dp(bridge);
+
+ dp->connection_notified = (status == connector_status_connected);
+}
+
static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -1272,6 +1296,7 @@ static const struct drm_bridge_funcs analogix_dp_bridge_funcs = {
.attach = analogix_dp_bridge_attach,
.edid_read = analogix_dp_bridge_edid_read,
.detect = analogix_dp_bridge_detect,
+ .hpd_notify = analogix_dp_bridge_notify,
};
static int analogix_dp_dt_parse_lanes_map(struct analogix_dp_device *dp)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
index 5f5698c73d88..9f25fb6545ad 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
@@ -171,6 +171,8 @@ struct analogix_dp_device {
bool fast_train_enable;
bool psr_supported;
bool force_connected_mode;
+ bool hpd_notify_mode;
+ bool connection_notified;
u8 dpcd[DP_RECEIVER_CAP_SIZE];
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
index abbcdba1a438..4c5e18d40dad 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
@@ -193,7 +193,7 @@ void analogix_dp_config_interrupt(struct analogix_dp_device *dp)
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_2);
writel(0, dp->reg_base + ANALOGIX_DP_COMMON_INT_MASK_3);
- if (dp->hpd_gpiod) {
+ if (dp->hpd_gpiod || dp->hpd_notify_mode) {
analogix_dp_mute_hpd_interrupt(dp, HPD_IRQ_ALL);
return;
}
@@ -435,7 +435,7 @@ void analogix_dp_init_hpd(struct analogix_dp_device *dp)
{
u32 reg;
- if (dp->hpd_gpiod)
+ if (dp->hpd_gpiod || dp->hpd_notify_mode)
return;
analogix_dp_clear_hotplug_interrupts(dp, HPD_IRQ_ALL);
@@ -539,6 +539,9 @@ int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp)
if (dp->hpd_gpiod) {
if (gpiod_get_value(dp->hpd_gpiod))
return 0;
+ } else if (dp->hpd_notify_mode) {
+ if (dp->connection_notified)
+ return 0;
} else {
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
if (reg & HPD_STATUS)
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 14/14] MAINTAINERS: Add entry for Analogix DP controller bridge
2026-10-19 8:58 ` Damon Ding
@ 2026-10-19 8:58 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Add a MAINTAINERS entry for the Analogix DP controller bridge, covering
the core bridge driver, its register helpers, the public header and the
DT binding, so that get_maintainer.pl routes related patches correctly.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
MAINTAINERS | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index a08087fb6e67..6518cbbd578c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8037,6 +8037,17 @@ S: Supported
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: drivers/gpu/drm/sun4i/sun8i*
+DRM DRIVER FOR ANALOGIX DISPLAYPORT BRIDGE
+M: Damon Ding <damon.ding@rock-chips.com>
+L: dri-devel@lists.freedesktop.org
+S: Maintained
+T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F: Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
+F: drivers/gpu/drm/bridge/analogix/Kconfig
+F: drivers/gpu/drm/bridge/analogix/Makefile
+F: drivers/gpu/drm/bridge/analogix/analogix_dp_*
+F: include/drm/bridge/analogix_dp.h
+
DRM DRIVER FOR APPLE TOUCH BARS
M: Aun-Ali Zaidi <admin@kodeit.net>
M: Aditya Garg <aditya.garg@linux.dev>
--
2.34.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH v4 14/14] MAINTAINERS: Add entry for Analogix DP controller bridge
@ 2026-10-19 8:58 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-19 8:58 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
Dmitry Baryshkov, linux-kernel, dri-devel, linux-arm-kernel,
linux-samsung-soc, linux-rockchip, Damon Ding
Add a MAINTAINERS entry for the Analogix DP controller bridge, covering
the core bridge driver, its register helpers, the public header and the
DT binding, so that get_maintainer.pl routes related patches correctly.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
MAINTAINERS | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index a08087fb6e67..6518cbbd578c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8037,6 +8037,17 @@ S: Supported
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: drivers/gpu/drm/sun4i/sun8i*
+DRM DRIVER FOR ANALOGIX DISPLAYPORT BRIDGE
+M: Damon Ding <damon.ding@rock-chips.com>
+L: dri-devel@lists.freedesktop.org
+S: Maintained
+T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F: Documentation/devicetree/bindings/display/bridge/analogix,dp.yaml
+F: drivers/gpu/drm/bridge/analogix/Kconfig
+F: drivers/gpu/drm/bridge/analogix/Makefile
+F: drivers/gpu/drm/bridge/analogix/analogix_dp_*
+F: include/drm/bridge/analogix_dp.h
+
DRM DRIVER FOR APPLE TOUCH BARS
M: Aun-Ali Zaidi <admin@kodeit.net>
M: Aditya Garg <aditya.garg@linux.dev>
--
2.34.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* Re: [PATCH v4 02/14] drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:04 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:04 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/bridge: analogix_dp: unsigned dp->irq < 0 check in analogix_dp_probe()
--
commit fcbed20d54db2072c70e2845510fbc672a7f0240
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq
This commit updates analogix_dp_probe() to check for any negative return
value in dp->irq rather than only -ENXIO, and propagates the error code
instead of returning -ENODEV.
Link: https://lore.kernel.org/all/20260804083307.84ECA1F000E9@smtp.kernel.org/
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 079f2f01f33b0..27c9a764e25fa 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -1480,9 +1480,9 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
> irq_flags = IRQF_NO_AUTOEN;
> }
>
> - if (dp->irq == -ENXIO) {
> + if (dp->irq < 0) {
> dev_err(&pdev->dev, "failed to get irq\n");
> - return ERR_PTR(-ENODEV);
> + return ERR_PTR(dp->irq);
> }
>
> ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
[Severity: High]
Can dp->irq < 0 ever be true here? In struct analogix_dp_device in
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h, irq is declared as
unsigned int:
struct analogix_dp_device {
...
struct clk *clock;
unsigned int irq;
void __iomem *reg_base;
When gpiod_to_irq() or platform_get_irq() returns a negative error code
(such as -EPROBE_DEFER, -ENOENT, or -ENXIO) in analogix_dp_probe(), the
value is stored in the unsigned dp->irq field.
Because dp->irq is unsigned, the dp->irq < 0 comparison is always false.
All negative error codes bypass this check and are passed as large
unsigned values to devm_request_threaded_irq(), which fails with -EINVAL
instead of propagating the original error code (breaking probe deferral).
Additionally, on 64-bit systems, passing an unsigned int to ERR_PTR()
zero-extends it to long rather than sign-extending it.
Would it make sense to change irq to int in struct analogix_dp_device, or
assign the return value of gpiod_to_irq() and platform_get_irq() to ret
first and check ret < 0 before storing it in dp->irq?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=2
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:12 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:12 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] drm/bridge: analogix_dp: leak of timings in analogix_dp_aux_done_probing()
- [Low] drm/bridge: analogix_dp: missing Kconfig selects for display mode bridge
--
commit a6bc11591ee5c87dfb3184d18836932fc5960d45
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
This commit replaces dp->plat_data->next_bridge with dp->bridge.next_bridge
in the analogix_dp driver and moves the Exynos display-timings bridge setup
from exynos_dp_probe() into analogix_dp_aux_done_probing().
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 38857508d9392..853b6a6a7fe4d 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
[ ... ]
> @@ -1655,37 +1658,34 @@ struct drm_dp_aux *analogix_dp_get_aux(struct analogix_dp_device *dp)
> }
> EXPORT_SYMBOL_GPL(analogix_dp_get_aux);
>
> -static void analogix_dp_put_bridge(void *data)
> -{
> - drm_bridge_put(data);
> -}
> -
> static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
> {
> struct analogix_dp_device *dp = to_dp(aux);
> struct analogix_dp_plat_data *plat_data = dp->plat_data;
> + struct drm_bridge *bridge = &dp->bridge, *next_bridge;
> int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
> - int ret;
> +
> + if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
> + next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
> + DRM_MODE_CONNECTOR_eDP);
[Severity: Low]
Will moving of_get_display_timings() and devm_drm_of_display_mode_bridge()
into analogix_dp_aux_done_probing() cause undefined symbol errors at link
time when CONFIG_DRM_EXYNOS_DP is not enabled?
Previously these calls lived in drivers/gpu/drm/exynos/exynos_dp.c under
CONFIG_DRM_EXYNOS_DP, where DRM_EXYNOS_DP selects DRM_OF_DISPLAY_MODE_BRIDGE
and DRM_EXYNOS selects VIDEOMODE_HELPERS.
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c is built under
CONFIG_DRM_ANALOGIX_DP, which only selects DRM_DISPLAY_DP_AUX_BUS:
drivers/gpu/drm/bridge/analogix/Kconfig:
config DRM_ANALOGIX_DP
tristate
depends on DRM
depends on OF
select DRM_DISPLAY_DP_AUX_BUS
Because plat_data->dev_type == EXYNOS_DP is evaluated at runtime, the
compiler emits references to both devm_drm_of_display_mode_bridge() (which
has no stub in include/drm/bridge/of-display-mode-bridge.h) and
of_get_display_timings() (declared whenever CONFIG_OF is enabled, while
drivers/video/of_display_timing.o requires CONFIG_VIDEOMODE_HELPERS).
Configurations such as CONFIG_ROCKCHIP_ANALOGIX_DP without
CONFIG_DRM_EXYNOS_DP, or CONFIG_DRM_ANALOGIX_DP=y with CONFIG_DRM_EXYNOS=m,
will fail to link unless DRM_ANALOGIX_DP selects DRM_OF_DISPLAY_MODE_BRIDGE
and VIDEOMODE_HELPERS (or stubs are provided).
[Severity: Medium]
Also in analogix_dp_aux_done_probing(), does calling
of_get_display_timings(dp->dev->of_node) directly in the condition leak the
allocated struct display_timings?
In drivers/video/of_display_timing.c, of_get_display_timings() allocates
struct display_timings, disp->timings, and each struct display_timing entry,
expecting the caller to free them with display_timings_release():
drivers/video/of_display_timing.c:of_get_display_timings() {
...
timings_np = of_get_child_by_name(np, "display-timings");
if (!timings_np) {
pr_err("%pOF: could not find display-timings node\n", np);
return NULL;
}
disp = kzalloc_obj(*disp);
...
}
Because the returned pointer is not saved or passed to
display_timings_release(), those allocations are leaked on Exynos DP boards
with a display-timings node (and devm_drm_of_display_mode_bridge() will
parse the node a second time via of_get_drm_display_mode()). In addition,
when no display-timings child node is present on Exynos boards using a panel
or bridge endpoint, of_get_display_timings() prints a spurious error message.
> + if (IS_ERR(next_bridge))
> + return PTR_ERR(next_bridge);
> + bridge->next_bridge = drm_bridge_get(next_bridge);
> +
> + return component_add(dp->dev, plat_data->ops);
> + }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=11
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 13/14] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:16 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:16 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/bridge: analogix_dp: race on dp->connection_notified in analogix_dp_bridge_notify()
--
commit e243ae0110d3bc583be1aa034e4af8955ad61137
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Handle HPD notification from downstream bridge
This commit handles hotplug notifications from a downstream bridge that
supports HPD events (DRM_BRIDGE_OP_HPD) when no downstream bridge provides
detection (DRM_BRIDGE_OP_DETECT). It caches the status passed to the
bridge's .hpd_notify callback and uses it in analogix_dp_get_plug_in_status()
while muting and skipping native HPD initialization.
Link: https://lore.kernel.org/all/5609825.iZASKD2KPV@diego/
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index df898f3142549..90245d55d1d2c 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
[ ... ]
> @@ -1260,6 +1276,14 @@ static void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge,
> DRM_ERROR("Failed to enable psr (%d)\n", ret);
> }
>
> +static void analogix_dp_bridge_notify(struct drm_bridge *bridge, struct drm_connector *connector,
> + enum drm_connector_status status)
> +{
> + struct analogix_dp_device *dp = to_dp(bridge);
> +
> + dp->connection_notified = (status == connector_status_connected);
> +}
[Severity: Medium]
Can a concurrent connector probe overwrite a downstream HPD notification here
and cause the hotplug transition to be lost?
When dp->hpd_notify_mode is enabled, drm_bridge_connector_init() sets
bridge_connector->bridge_detect to the Analogix DP bridge and
bridge_connector->bridge_hpd to the downstream bridge.
In the connector detection path (for example via drm_mode_getconnector(),
drm_client_modeset_probe(), or status_store()),
drm_bridge_connector_detect_ctx() holds dev->mode_config.mutex, calls
detect->funcs->detect() which reads dp->connection_notified via:
analogix_dp_bridge_detect()
-> analogix_dp_detect_hpd()
-> analogix_dp_get_plug_in_status()
and then feeds that return value back into drm_bridge_connector_hpd_notify():
drivers/gpu/drm/display/drm_bridge_connector.c:drm_bridge_connector_detect_ctx() {
...
if (detect)
status = detect->funcs->detect(detect, connector);
...
drm_bridge_connector_hpd_notify(connector, status);
}
Meanwhile, when a downstream HPD event arrives via drm_bridge_hpd_notify(),
drm_bridge_connector_handle_hpd() releases dev->mode_config.mutex before
calling drm_bridge_connector_hpd_notify():
drivers/gpu/drm/display/drm_bridge_connector.c:drm_bridge_connector_handle_hpd() {
...
mutex_lock(&dev->mode_config.mutex);
connector->status = status;
mutex_unlock(&dev->mode_config.mutex);
drm_bridge_connector_hpd_notify(connector, status);
drm_kms_helper_connector_hotplug_event(connector);
}
If these two paths interleave:
1. drm_bridge_connector_handle_hpd() updates connector->status and unlocks
dev->mode_config.mutex.
2. A concurrent probe enters drm_bridge_connector_detect_ctx() under
dev->mode_config.mutex and calls analogix_dp_bridge_detect(), reading the
stale dp->connection_notified value.
3. drm_bridge_connector_handle_hpd() calls drm_bridge_connector_hpd_notify()
-> analogix_dp_bridge_notify(), setting dp->connection_notified to the new
status, and then waits on dev->mode_config.mutex inside
drm_kms_helper_connector_hotplug_event().
4. drm_bridge_connector_detect_ctx() finishes and calls
drm_bridge_connector_hpd_notify() -> analogix_dp_bridge_notify() with the
stale status it read in step 2, clobbering dp->connection_notified.
When drm_kms_helper_connector_hotplug_event() (or userspace handling the
hotplug event) subsequently probes the connector,
analogix_dp_get_plug_in_status() will see the stale dp->connection_notified
value and the hotplug state change is lost.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=13
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 09/14] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:17 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:17 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/bridge: analogix_dp: unclocked IRQ MMIO after moving enable_irq() to bind
- [High] drm/bridge: analogix_dp: IRQ left enabled with dangling drm_dev on bind failure
--
commit f05b45f646c93eccaff985e6b484d109024db4f2
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind
This commit moves enable_irq() and disable_irq() from the bridge enable
and disable handlers into analogix_dp_bind() and analogix_dp_unbind() so
that the IRQ remains active across the bound lifetime of the bridge.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index b92d285461926..addd319719de4 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -1018,7 +1018,6 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
> goto out_dp_init;
> }
>
> - enable_irq(dp->irq);
> return 0;
>
> out_dp_init:
> @@ -1160,8 +1159,6 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
> if (dp->dpms_mode != DRM_MODE_DPMS_ON)
> return;
>
> - disable_irq(dp->irq);
> -
> analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
>
> pm_runtime_put_sync(dp->dev);
[Severity: High]
Can removing disable_irq(dp->irq) before pm_runtime_put_sync(dp->dev) allow
analogix_dp_hardirq() or analogix_dp_irq_thread() to perform MMIO accesses on
dp->reg_base after analogix_dp_suspend() has gated the clocks?
Previously, disable_irq(dp->irq) synchronized any in-flight hardirq or
scheduled threaded handler before pm_runtime_put_sync(dp->dev) ran
analogix_dp_suspend():
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_suspend() {
phy_power_off(dp->phy);
if (dp->plat_data->power_off)
dp->plat_data->power_off(dp->plat_data);
clk_disable_unprepare(dp->clock);
return 0;
}
In native HPD configurations (!dp->hpd_gpiod), analogix_dp_resume() ->
analogix_dp_init_dp() -> analogix_dp_config_interrupt() unmasks HPD
interrupts in the controller registers. If an HPD interrupt fires shortly
before runtime suspend (for example, right before analogix_dp_bridge_disable(),
before the out_dp_init error path in analogix_dp_set_bridge(), or when the
autosuspend timer expires after analogix_dpaux_transfer()),
analogix_dp_hardirq() returns IRQ_WAKE_THREAD without holding a runtime PM
reference.
If analogix_dp_suspend() then gates dp->pclk and dp->clock before
analogix_dp_irq_thread() runs, analogix_dp_irq_thread() will access
ANALOGIX_DP_COMMON_INT_STA_4 and ANALOGIX_DP_INT_STA while the controller is
unclocked:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_irq_thread() {
...
irq_type = analogix_dp_get_irq_type(dp);
if (!dp->hpd_gpiod && irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
...
}
Even with the later patches in this series ("drm/bridge: analogix_dp: Manage
pm runtime and IRQ for native HPD pin detection" and "drm/bridge: analogix_dp:
Handle HPD notification from downstream bridge"),
analogix_dp_require_pm_for_hpd_irq() only keeps runtime PM active during bind
for Rockchip when !dp->hpd_gpiod && !dp->force_hpd && !dp->hpd_notify_mode.
Exynos native-HPD boards (EXYNOS_DP with !dp->hpd_gpiod) and Rockchip
force-hpd boards (!dp->hpd_gpiod && dp->force_hpd, where
analogix_dp_config_interrupt() still unmutes DP_IRQ_TYPE_HP_CHANGE and
analogix_dp_force_hpd() toggles HPD_STATUS) can still runtime-suspend with
dp->irq enabled and unsynchronized.
> @@ -1574,6 +1571,8 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
> goto err_unregister_aux;
> }
>
> + enable_irq(dp->irq);
> +
> return 0;
[Severity: High]
What happens if a caller of analogix_dp_bind() fails after analogix_dp_bind()
returns 0?
Both rockchip_dp_bind() and exynos_dp_bind() call drm_bridge_connector_init()
immediately after analogix_dp_bind(), and neither calls analogix_dp_unbind()
if drm_bridge_connector_init() fails:
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c:rockchip_dp_bind() {
...
ret = analogix_dp_bind(dp->adp, drm_dev);
if (ret)
goto err_cleanup_encoder;
connector = drm_bridge_connector_init(dp->drm_dev, dp->plat_data.encoder);
if (IS_ERR(connector)) {
ret = PTR_ERR(connector);
dev_err(dp->dev, "Failed to initialize bridge_connector\n");
goto err_cleanup_encoder;
}
return 0;
err_cleanup_encoder:
dp->encoder.encoder.funcs->destroy(&dp->encoder.encoder);
return ret;
}
drivers/gpu/drm/exynos/exynos_dp.c:exynos_dp_bind() {
...
ret = analogix_dp_bind(dp->adp, dp->drm_dev);
if (ret) {
dp->encoder.funcs->destroy(&dp->encoder);
return ret;
}
connector = drm_bridge_connector_init(dp->drm_dev, dp->plat_data.encoder);
if (IS_ERR(connector)) {
ret = PTR_ERR(connector);
dev_err(dp->dev, "Failed to initialize bridge_connector\n");
return ret;
}
...
}
Because component_bind_all() only unbinds previously bound components when a
component's bind callback fails, the master bind path frees drm_dev via
drm_dev_put() while dp->irq remains enabled and dp->drm_dev still points to
the freed drm_device (and in the follow-up commit "drm/bridge: analogix_dp:
Manage pm runtime and IRQ for native HPD pin detection", runtime PM also
remains active).
If an HPD interrupt fires afterwards, wouldn't analogix_dp_irq_thread() pass
the freed dp->drm_dev pointer to drm_helper_hpd_irq_event()?
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_irq_thread() {
...
if (hpd_detected) {
dev_dbg(dp->dev, "Detected cable status changed!\n");
if (dp->drm_dev)
drm_helper_hpd_irq_event(dp->drm_dev);
}
...
}
[ ... ]
>
>
>
>
完美。
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=9
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 12/14] drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:25 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:25 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/bridge: analogix_dp: force_connected_mode breaks analogix_dp_detect_hpd()
- [High] drm/bridge: analogix_dp: unclocked MMIO access in analogix_dp_bridge_detect()
--
commit 3f124dede2fd813765bd376dfd69c3031ce42a2c
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints
This commit restricts the forced connected status in the Analogix DP bridge
driver so that it only applies when the bridge chain ends with a panel and no
downstream bridge supports DRM_BRIDGE_OP_DETECT, relying on
analogix_dp_detect_hpd() for other configurations.
Link: https://lore.kernel.org/all/5209243.oAaWjsssbx@diego/
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index 853b6a6a7fe4d..df898f3142549 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -912,15 +912,30 @@ analogix_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *conne
> struct analogix_dp_device *dp = to_dp(bridge);
> enum drm_connector_status status = connector_status_disconnected;
>
> - if (dp->bridge.next_bridge)
> - return connector_status_connected;
> -
> if (!analogix_dp_detect_hpd(dp))
> status = connector_status_connected;
>
> return status;
> }
>
> +static bool analogix_dp_bridge_force_connected(struct analogix_dp_device *dp)
> +{
> + struct drm_bridge *last_bridge;
> + bool force_connected = false;
> +
> + drm_for_each_bridge_in_chain_from(dp->bridge.next_bridge, bridge) {
> + if (bridge->ops & DRM_BRIDGE_OP_DETECT)
> + return false;
> + }
> +
> + last_bridge = drm_bridge_chain_get_last_bridge(dp->encoder);
> + if (last_bridge)
> + force_connected = drm_bridge_is_panel(last_bridge);
> + drm_bridge_put(last_bridge);
[Severity: High]
What happens on Exynos boards with a legacy display-timings node (such as
exynos5250-smdk5250.dts and exynos5420-smdk5420.dts) or on non-panel endpoints
when analogix_dp_bridge_detect() runs while the controller is
runtime-suspended?
In analogix_dp_aux_done_probing(), Exynos boards with display-timings attach a
bridge created via devm_drm_of_display_mode_bridge():
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_aux_done_probing() {
if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
DRM_MODE_CONNECTOR_eDP);
if (IS_ERR(next_bridge))
return PTR_ERR(next_bridge);
bridge->next_bridge = drm_bridge_get(next_bridge);
return component_add(dp->dev, plat_data->ops);
}
}
Because devm_drm_of_display_mode_bridge() uses of_display_mode_bridge_funcs
rather than panel_bridge_bridge_funcs, drm_bridge_is_panel(last_bridge)
returns false and dp->force_connected_mode is set to false.
In analogix_dp_bind(), a runtime PM reference is only kept when
analogix_dp_require_pm_for_hpd_irq(dp) is true:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_require_pm_for_hpd_irq() {
return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
!dp->force_hpd;
}
On Exynos platforms (and on any non-panel endpoint with force-hpd), the DP
controller remains runtime-suspended with dp->clock disabled when the display
is off.
Unlike analogix_dp_set_bridge(), analogix_dpaux_transfer(), and
analogix_dpaux_wait_hpd_asserted(), analogix_dp_bridge_detect() does not call
pm_runtime_get_sync(dp->dev). When drm_bridge_connector_detect_ctx() calls
analogix_dp_bridge_detect() -> analogix_dp_detect_hpd() ->
analogix_dp_get_plug_in_status() while the display is disabled, won't
readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3) (and analogix_dp_force_hpd())
access unclocked MMIO registers and cause an external abort?
[ ... ]
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index af5e5a8ec88d6..abbcdba1a4385 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> @@ -533,6 +533,9 @@ int analogix_dp_get_plug_in_status(struct analogix_dp_device *dp)
> {
> u32 reg;
>
> + if (dp->force_connected_mode)
> + return 0;
> +
> if (dp->hpd_gpiod) {
> if (gpiod_get_value(dp->hpd_gpiod))
> return 0;
[Severity: High]
Does returning 0 early in analogix_dp_get_plug_in_status() when
dp->force_connected_mode is true break hardware HPD handling in
analogix_dp_detect_hpd() and analogix_dpaux_wait_hpd_asserted() for eDP
panels?
In analogix_dp_detect_hpd() (called from analogix_dp_set_bridge() during
bridge .atomic_enable and from analogix_dpaux_transfer() during AUX
transfers), the loop checks analogix_dp_get_plug_in_status(dp) before reaching
the dp->force_hpd fallback:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_detect_hpd() {
while (timeout_loop < DP_TIMEOUT_LOOP_COUNT) {
if (analogix_dp_get_plug_in_status(dp) == 0)
return 0;
timeout_loop++;
usleep_range(1000, 1100);
}
...
if (!dp->force_hpd)
return -ETIMEDOUT;
...
analogix_dp_force_hpd(dp);
}
Because dp->force_connected_mode is true for panel endpoints,
analogix_dp_get_plug_in_status(dp) now always returns 0 on the first
iteration. As a result, analogix_dp_detect_hpd() returns 0 immediately without
ever calling analogix_dp_force_hpd(dp) to set F_HPD | HPD_CTRL in
ANALOGIX_DP_SYS_CTL_3. On eDP panel boards that use the force-hpd DT property,
hardware HPD_STATUS(RO) remains 0 after analogix_dp_init_dp(), which prevents
the AUX channel hardware from working.
In addition, for eDP panels with a physical HPD line (!dp->force_hpd), both
analogix_dp_detect_hpd() and analogix_dpaux_wait_hpd_asserted():
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dpaux_wait_hpd_asserted() {
...
ret = readx_poll_timeout(analogix_dp_get_plug_in_status, dp, val, !val,
wait_us / 100, wait_us);
}
will return immediately without polling dp->hpd_gpiod or HPD_STATUS to wait
for the panel to assert HPD after power-on. Should the force_connected_mode
check be kept in analogix_dp_bridge_detect() instead of
analogix_dp_get_plug_in_status()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=12
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 10/14] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection
2026-10-19 8:58 ` Damon Ding
(?)
@ 2026-10-19 9:28 ` sashiko-bot
-1 siblings, 0 replies; 44+ messages in thread
From: sashiko-bot @ 2026-10-19 9:28 UTC (permalink / raw)
To: Damon Ding; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] drm/bridge: analogix_dp: AUX powered down after analogix_dp_bridge_disable()
- [High] drm/bridge: analogix_dp: unmasked native IRQ active across runtime suspend
- [Medium] drm/bridge: analogix_dp: analogix_dp_require_pm_for_hpd_irq() blocks eDP runtime suspend
- [Medium] drm/bridge: analogix_dp: missing DRM_BRIDGE_OP_HPD in analogix_dp_bind()
--
commit 084692aff33ec03020fcf182af076977c2df993a
Author: Damon Ding <damon.ding@rock-chips.com>
drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection
This commit acquires a runtime PM reference in analogix_dp_bind() and
releases it in analogix_dp_unbind() for Rockchip native HPD pin mode so
the DP controller stays powered and clocked to detect hotplug interrupts
while the display pipeline is inactive.
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index addd319719de4..38857508d9392 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -39,6 +39,12 @@
>
> static const bool verify_fast_training;
>
> +static bool analogix_dp_require_pm_for_hpd_irq(struct analogix_dp_device *dp)
> +{
> + return analogix_dp_is_rockchip(dp->plat_data->dev_type) && !dp->hpd_gpiod &&
> + !dp->force_hpd;
> +}
[Severity: Medium]
Does analogix_dp_require_pm_for_hpd_irq() also return true on Rockchip boards
with a fixed eDP panel that do not specify force-hpd or hpd-gpios in Device
Tree (such as rk3399-gru-kevin.dts, rk3399-gru-bob.dts,
rk3399-sapphire-excavator.dts, and rk3288-veyron-jaq/jerry/minnie/tiger.dts)?
On those systems, analogix_dp_bridge_detect() unconditionally returns
connector_status_connected when dp->plat_data->next_bridge is present:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_bridge_detect() {
if (dp->plat_data->next_bridge)
return connector_status_connected;
}
Later in the series, commit "drm/bridge: analogix_dp: Handle HPD notification
from downstream bridge" adds !dp->hpd_notify_mode to
analogix_dp_require_pm_for_hpd_irq(), and commit "drm/bridge: analogix_dp:
Restrict forced connected status to panel endpoints" introduces
dp->force_connected_mode for fixed panel endpoints where
analogix_dp_get_plug_in_status() unconditionally returns 0. However,
analogix_dp_require_pm_for_hpd_irq() is not updated to exclude
dp->force_connected_mode (or dp->plat_data->next_bridge here).
Because analogix_dp_bind() holds a runtime PM reference until
analogix_dp_unbind(), pm_runtime_put_sync(dp->dev) in
analogix_dp_bridge_disable() only drops the usage counter from 2 to 1 during
DPMS off. Doesn't this prevent rockchip_dp_suspend() and
analogix_dp_suspend() from running when the screen is blanked, leaving the DP
PHY, dp->clock, dp->pclk, and the SoC power domain (RK3399_PD_EDP /
RK3288_PD_VIO) powered on and leaving DP_IRQ_TYPE_HP_CHANGE unmuted while
panel_edp_suspend() turns off the panel power supply?
> +
> static void analogix_dp_init_dp(struct analogix_dp_device *dp)
> {
> analogix_dp_reset(dp);
> @@ -1571,6 +1577,12 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
> goto err_unregister_aux;
> }
>
> + if (analogix_dp_require_pm_for_hpd_irq(dp)) {
> + ret = pm_runtime_resume_and_get(dp->dev);
> + if (ret)
> + goto err_unregister_aux;
> + }
[Severity: High]
When analogix_dp_require_pm_for_hpd_irq(dp) is true, can DisplayPort AUX
transactions fail after the bridge has been enabled and then disabled (for
example, on DPMS off or cable unplug and replug)?
In analogix_dp_bridge_disable(), disabling the bridge powers down all
internal analog blocks before dropping its runtime PM reference:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_bridge_disable() {
...
analogix_dp_set_analog_power_down(dp, POWER_ALL, 1);
pm_runtime_put_sync(dp->dev);
...
}
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:analogix_dp_set_analog_power_down() {
...
case POWER_ALL:
if (enable) {
reg = DP_ALL_PD;
writel(reg, dp->reg_base + phy_pd_addr);
} else {
...
}
Writing DP_ALL_PD (0xff) to ANALOGIX_DP_PD asserts both RK_AUX_PD (BIT(5))
and DP_INC_BG (BIT(7), the internal PHY bandgap on Rockchip).
Previously, pm_runtime_put_sync(dp->dev) in analogix_dp_bridge_disable()
dropped the usage count to 0 and suspended the device, so the next AUX
transfer in analogix_dpaux_transfer() called pm_runtime_get_sync(dp->dev),
running analogix_dp_resume() -> rockchip_dp_poweron() and
analogix_dp_init_dp() -> analogix_dp_init_aux() to reset the controller and
clear ANALOGIX_DP_PD.
With the persistent runtime PM reference held in analogix_dp_bind(),
pm_runtime_put_sync(dp->dev) in analogix_dp_bridge_disable() only decrements
the usage count from 2 to 1, keeping dp->dev in RPM_ACTIVE. When a sink is
subsequently probed while dpms_mode is DRM_MODE_DPMS_OFF:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dpaux_transfer() {
...
pm_runtime_get_sync(dp->dev);
ret = analogix_dp_detect_hpd(dp);
if (ret)
goto out;
ret = analogix_dp_transfer(dp, msg);
...
}
pm_runtime_get_sync(dp->dev) is a no-op because dp->dev is already active, so
analogix_dp_transfer() attempts AUX transactions while ANALOGIX_DP_PD is still
DP_ALL_PD (0xff). Even when analogix_dp_transfer() times out after 500 ms and
calls analogix_dp_init_aux(dp) in its aux_error path, analogix_dp_init_aux()
only clears AUX_BLOCK (RK_AUX_PD) and leaves DP_INC_BG asserted. Should
analogix_dp_bridge_disable() or analogix_dpaux_transfer() keep the AUX block
and bandgap powered when the controller remains runtime-active?
[Severity: Medium]
Also, will native HPD interrupts actually be processed by
drm_helper_hpd_irq_event() without DRM_BRIDGE_OP_HPD set in bridge->ops?
Earlier in analogix_dp_bind(), bridge->ops is initialized to:
bridge->ops = DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_DETECT;
Both rockchip_dp_bind() and exynos_dp_bind() create the connector via
drm_bridge_connector_init():
drivers/gpu/drm/display/drm_bridge_connector.c:drm_bridge_connector_init() {
...
if (bridge_connector->bridge_hpd)
connector->polled = DRM_CONNECTOR_POLL_HPD;
else if (bridge_connector->bridge_detect)
connector->polled = DRM_CONNECTOR_POLL_CONNECT
| DRM_CONNECTOR_POLL_DISCONNECT;
...
}
In native HPD pin mode (and internal hpd_gpiod mode), no bridge in the chain
sets DRM_BRIDGE_OP_HPD, so bridge_connector->bridge_hpd is NULL and
connector->polled does not have DRM_CONNECTOR_POLL_HPD set. When the HPD IRQ
fires and analogix_dp_irq_thread() calls drm_helper_hpd_irq_event(dp->drm_dev),
drm_helper_hpd_irq_event() skips any connector without DRM_CONNECTOR_POLL_HPD:
drivers/gpu/drm/drm_probe_helper.c:drm_helper_hpd_irq_event() {
...
drm_for_each_connector_iter(connector, &conn_iter) {
/* Only handle HPD capable connectors. */
if (!(connector->polled & DRM_CONNECTOR_POLL_HPD))
continue;
...
}
Doesn't this cause native HPD interrupts to be ignored and fall back to the
10-second periodic poll worker?
> +
> enable_irq(dp->irq);
[Severity: High]
Is it safe to unconditionally call enable_irq(dp->irq) here when
analogix_dp_require_pm_for_hpd_irq(dp) is false and !dp->hpd_gpiod (for
example, when dp->force_hpd is true on Rockchip, or on EXYNOS_DP without
hpd-gpios)?
In those configurations, dp->irq is the native DP controller interrupt, and
dp->dev is allowed to runtime-suspend. Whenever dp->dev runtime-resumes (such
as in analogix_dpaux_transfer() or analogix_dp_set_bridge()),
analogix_dp_init_dp() calls analogix_dp_config_interrupt():
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c:analogix_dp_config_interrupt() {
if (dp->hpd_gpiod) {
analogix_dp_mute_hpd_interrupt(dp, HPD_IRQ_ALL);
return;
}
if (analogix_dp_is_rockchip(dp->plat_data->dev_type))
analogix_dp_unmute_hpd_interrupt(dp, DP_IRQ_TYPE_HP_CHANGE);
else
analogix_dp_unmute_hpd_interrupt(dp, HPD_IRQ_ALL);
}
Because analogix_dp_config_interrupt() does not check dp->force_hpd, it
unmasks the controller's HPD interrupts. In force-HPD mode,
analogix_dp_init_hpd() clears F_HPD | HPD_CTRL in ANALOGIX_DP_SYS_CTL_3 and
analogix_dp_detect_hpd() calls analogix_dp_force_hpd() to set F_HPD |
HPD_CTRL, generating HPD transitions that fire the unmasked controller
interrupt.
Furthermore, because analogix_dp_suspend() does not disable or synchronize
dp->irq before disabling dp->pclk and dp->clock, if analogix_dp_hardirq()
wakes analogix_dp_irq_thread() right before dp->dev runtime-suspends (at the
end of analogix_dpaux_transfer() or in analogix_dp_bridge_disable()),
analogix_dp_irq_thread() will access the controller registers while unclocked:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:analogix_dp_irq_thread() {
...
irq_type = analogix_dp_get_irq_type(dp);
if (!dp->hpd_gpiod && irq_type)
analogix_dp_clear_hotplug_interrupts(dp, irq_type);
...
}
Can this cause unclocked MMIO reads and writes to ANALOGIX_DP_COMMON_INT_STA_4
and ANALOGIX_DP_INT_STA (resulting in a synchronous external abort / SError
on ARM/ARM64) as well as spurious hotplug events?
>
> return 0;
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261019085836.3065008-1-damon.ding@rock-chips.com?part=10
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-19 8:58 ` Damon Ding
@ 2026-10-20 5:36 ` kernel test robot
-1 siblings, 0 replies; 44+ messages in thread
From: kernel test robot @ 2026-10-20 5:36 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm/drm-next next-20261019]
[cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
All errors (new ones prefixed by >>):
nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
vim +1669 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
1660
1661 static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
1662 {
1663 struct analogix_dp_device *dp = to_dp(aux);
1664 struct analogix_dp_plat_data *plat_data = dp->plat_data;
1665 struct drm_bridge *bridge = &dp->bridge, *next_bridge;
1666 int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
1667
1668 if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
> 1669 next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
1670 DRM_MODE_CONNECTOR_eDP);
1671 if (IS_ERR(next_bridge))
1672 return PTR_ERR(next_bridge);
1673 bridge->next_bridge = drm_bridge_get(next_bridge);
1674
1675 return component_add(dp->dev, plat_data->ops);
1676 }
1677
1678 /*
1679 * If of_drm_get_bridge_by_endpoint() returns -ENODEV, there may be no
1680 * valid panel or bridge nodes. The driver should go on for the
1681 * driver-free bridge or the DP mode applications.
1682 */
1683 bridge->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node, port, 0);
1684 if (IS_ERR(bridge->next_bridge)) {
1685 if (PTR_ERR(bridge->next_bridge) == -ENODEV)
1686 bridge->next_bridge = NULL;
1687 else
1688 return PTR_ERR(bridge->next_bridge);
1689 }
1690
1691 return component_add(dp->dev, plat_data->ops);
1692 }
1693
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
@ 2026-10-20 5:36 ` kernel test robot
0 siblings, 0 replies; 44+ messages in thread
From: kernel test robot @ 2026-10-20 5:36 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm/drm-next next-20261019]
[cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
All errors (new ones prefixed by >>):
nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
vim +1669 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
1660
1661 static int analogix_dp_aux_done_probing(struct drm_dp_aux *aux)
1662 {
1663 struct analogix_dp_device *dp = to_dp(aux);
1664 struct analogix_dp_plat_data *plat_data = dp->plat_data;
1665 struct drm_bridge *bridge = &dp->bridge, *next_bridge;
1666 int port = plat_data->dev_type == EXYNOS_DP ? 0 : 1;
1667
1668 if (plat_data->dev_type == EXYNOS_DP && of_get_display_timings(dp->dev->of_node)) {
> 1669 next_bridge = devm_drm_of_display_mode_bridge(dp->dev, dp->dev->of_node,
1670 DRM_MODE_CONNECTOR_eDP);
1671 if (IS_ERR(next_bridge))
1672 return PTR_ERR(next_bridge);
1673 bridge->next_bridge = drm_bridge_get(next_bridge);
1674
1675 return component_add(dp->dev, plat_data->ops);
1676 }
1677
1678 /*
1679 * If of_drm_get_bridge_by_endpoint() returns -ENODEV, there may be no
1680 * valid panel or bridge nodes. The driver should go on for the
1681 * driver-free bridge or the DP mode applications.
1682 */
1683 bridge->next_bridge = of_drm_get_bridge_by_endpoint(dp->dev->of_node, port, 0);
1684 if (IS_ERR(bridge->next_bridge)) {
1685 if (PTR_ERR(bridge->next_bridge) == -ENODEV)
1686 bridge->next_bridge = NULL;
1687 else
1688 return PTR_ERR(bridge->next_bridge);
1689 }
1690
1691 return component_add(dp->dev, plat_data->ops);
1692 }
1693
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-19 8:58 ` Damon Ding
@ 2026-10-20 5:37 ` kernel test robot
-1 siblings, 0 replies; 44+ messages in thread
From: kernel test robot @ 2026-10-20 5:37 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm/drm-next]
[cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
config: parisc-randconfig-1001-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201323.RdqouIbq-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201323.RdqouIbq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610201323.RdqouIbq-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/gpu/drm/bridge/analogix/analogix_dp.ko: symbol 'devm_drm_of_display_mode_bridge' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
@ 2026-10-20 5:37 ` kernel test robot
0 siblings, 0 replies; 44+ messages in thread
From: kernel test robot @ 2026-10-20 5:37 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Heiko Stuebner
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Hi Damon,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm/drm-next]
[cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
config: parisc-randconfig-1001-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201323.RdqouIbq-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201323.RdqouIbq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610201323.RdqouIbq-lkp@intel.com/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: drivers/gpu/drm/bridge/analogix/analogix_dp.ko: symbol 'devm_drm_of_display_mode_bridge' undefined!
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-20 5:36 ` kernel test robot
@ 2026-10-20 10:38 ` Heiko Stübner
-1 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2026-10-20 10:38 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
kernel test robot
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Am Dienstag, 20. Oktober 2026, 07:36:21 Mitteleuropäische Sommerzeit schrieb kernel test robot:
> Hi Damon,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on drm-misc/drm-misc-next]
> [also build test ERROR on drm/drm-next next-20261019]
> [cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
> base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
> patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
> patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
> config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
> compiler: nios2-linux-gcc (GCC) 11.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
> >> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
> >> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
I guess the Rockchip kconfig for the Analogix-DP also needs a
select DRM_OF_DISPLAY_MODE_BRIDGE
similar to exynos and imx.
Heiko
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
@ 2026-10-20 10:38 ` Heiko Stübner
0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2026-10-20 10:38 UTC (permalink / raw)
To: Damon Ding, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
kernel test robot
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip, Damon Ding
Am Dienstag, 20. Oktober 2026, 07:36:21 Mitteleuropäische Sommerzeit schrieb kernel test robot:
> Hi Damon,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on drm-misc/drm-misc-next]
> [also build test ERROR on drm/drm-next next-20261019]
> [cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
> base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
> patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
> patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
> config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
> compiler: nios2-linux-gcc (GCC) 11.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
> >> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
> >> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
I guess the Rockchip kconfig for the Analogix-DP also needs a
select DRM_OF_DISPLAY_MODE_BRIDGE
similar to exynos and imx.
Heiko
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
2026-10-20 10:38 ` Heiko Stübner
@ 2026-10-20 11:42 ` Damon Ding
-1 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-20 11:42 UTC (permalink / raw)
To: Heiko Stübner, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
kernel test robot
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 10/20/2026 6:38 PM, Heiko Stübner wrote:
> Am Dienstag, 20. Oktober 2026, 07:36:21 Mitteleuropäische Sommerzeit schrieb kernel test robot:
>> Hi Damon,
>>
>> kernel test robot noticed the following build errors:
>>
>> [auto build test ERROR on drm-misc/drm-misc-next]
>> [also build test ERROR on drm/drm-next next-20261019]
>> [cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>> And when submitting patch, we suggest to use '--base' as documented in
>> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
>> base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
>> patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
>> patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
>> config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
>> compiler: nios2-linux-gcc (GCC) 11.5.0
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>> nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
>>>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
>>>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
>
> I guess the Rockchip kconfig for the Analogix-DP also needs a
>
> select DRM_OF_DISPLAY_MODE_BRIDGE
>
> similar to exynos and imx.
>
Will fix in v5. Also refine patches 9-13 as suggested by sashiko.
Best regards,
Damon
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
@ 2026-10-20 11:42 ` Damon Ding
0 siblings, 0 replies; 44+ messages in thread
From: Damon Ding @ 2026-10-20 11:42 UTC (permalink / raw)
To: Heiko Stübner, Andrzej Hajda, Neil Armstrong, Robert Foss,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Jingoo Han, Inki Dae, Seung-Woo Kim, Kyungmin Park,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar,
kernel test robot
Cc: oe-kbuild-all, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Luca Ceresoli, Dmitry Baryshkov, linux-kernel, dri-devel,
linux-arm-kernel, linux-samsung-soc, linux-rockchip
Hi Heiko,
On 10/20/2026 6:38 PM, Heiko Stübner wrote:
> Am Dienstag, 20. Oktober 2026, 07:36:21 Mitteleuropäische Sommerzeit schrieb kernel test robot:
>> Hi Damon,
>>
>> kernel test robot noticed the following build errors:
>>
>> [auto build test ERROR on drm-misc/drm-misc-next]
>> [also build test ERROR on drm/drm-next next-20261019]
>> [cannot apply to daeinki-drm-exynos/exynos-drm-next linus/master v7.3]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>> And when submitting patch, we suggest to use '--base' as documented in
>> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/Damon-Ding/drm-bridge-analogix_dp-Return-bitmask-from-analogix_dp_get_irq_type/20261019-165823
>> base: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
>> patch link: https://lore.kernel.org/r/20261019085836.3065008-12-damon.ding%40rock-chips.com
>> patch subject: [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field
>> config: nios2-randconfig-1000-20261020 (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/config)
>> compiler: nios2-linux-gcc (GCC) 11.5.0
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261020/202610201309.w3JSXlP5-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202610201309.w3JSXlP5-lkp@intel.com/
>>
>> All errors (new ones prefixed by >>):
>>
>> nios2-linux-ld: drivers/gpu/drm/bridge/analogix/analogix_dp_core.o: in function `analogix_dp_aux_done_probing':
>>>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): undefined reference to `devm_drm_of_display_mode_bridge'
>>>> drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1669:(.text+0xb80): relocation truncated to fit: R_NIOS2_CALL26 against `devm_drm_of_display_mode_bridge'
>
> I guess the Rockchip kconfig for the Analogix-DP also needs a
>
> select DRM_OF_DISPLAY_MODE_BRIDGE
>
> similar to exynos and imx.
>
Will fix in v5. Also refine patches 9-13 as suggested by sashiko.
Best regards,
Damon
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 44+ messages in thread
end of thread, other threads:[~2026-10-20 11:43 UTC | newest]
Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 8:58 [PATCH v4 00/14] Add HPD support for Rockchip Analogix DP Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 01/14] drm/bridge: analogix_dp: Return bitmask from analogix_dp_get_irq_type() Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 02/14] drm/bridge: analogix_dp: Check all negative return values for &analogix_dp_device.irq Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:04 ` sashiko-bot
2026-10-19 8:58 ` [PATCH v4 03/14] drm/bridge: analogix_dp: Add IRQF_ONESHOT and simplify IRQ handling Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 04/14] drm/bridge: analogix_dp: Extend clear_hotplug_interrupts to accept IRQ bitmask Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 05/14] drm/bridge: analogix_dp: Extend mute/unmute HPD interrupts to accept irq bitmask Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 06/14] drm/bridge: analogix_dp: Simplify analogix_dp_config_interrupt() Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 07/14] drm/bridge: analogix_dp: Use platform-specific HPD detection scheme Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 08/14] drm/bridge: analogix_dp: Skip native HPD interrupt ops for GPIO HPD Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 8:58 ` [PATCH v4 09/14] drm/bridge: analogix_dp: Move IRQ enable/disable to bind/unbind Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:17 ` sashiko-bot
2026-10-19 8:58 ` [PATCH v4 10/14] drm/bridge: analogix_dp: Manage pm runtime and IRQ for native HPD pin detection Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:28 ` sashiko-bot
2026-10-19 8:58 ` [PATCH v4 11/14] drm/bridge: analogix_dp: Use bridge->next_bridge instead of plat_data field Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:12 ` sashiko-bot
2026-10-20 5:36 ` kernel test robot
2026-10-20 5:36 ` kernel test robot
2026-10-20 10:38 ` Heiko Stübner
2026-10-20 10:38 ` Heiko Stübner
2026-10-20 11:42 ` Damon Ding
2026-10-20 11:42 ` Damon Ding
2026-10-20 5:37 ` kernel test robot
2026-10-20 5:37 ` kernel test robot
2026-10-19 8:58 ` [PATCH v4 12/14] drm/bridge: analogix_dp: Restrict forced connected status to panel endpoints Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:25 ` sashiko-bot
2026-10-19 8:58 ` [PATCH v4 13/14] drm/bridge: analogix_dp: Handle HPD notification from downstream bridge Damon Ding
2026-10-19 8:58 ` Damon Ding
2026-10-19 9:16 ` sashiko-bot
2026-10-19 8:58 ` [PATCH v4 14/14] MAINTAINERS: Add entry for Analogix DP controller bridge Damon Ding
2026-10-19 8:58 ` Damon Ding
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.