[PATCH v5 6/8] drm/msm: dp: handle the IRQ_HPD events reported by USB-C
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sun Sep 20 08:13:57 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/msm/dp: missing display initialization on coalesced plug and IRQ_HPD events
--
commit de969f3016008fcb55e0b380cb8e0c733c719543
Author: Dmitry Baryshkov <dmitry.baryshkov at oss.qualcomm.com>
drm/msm: dp: handle the IRQ_HPD events reported by USB-C
This commit allows the MSM DisplayPort driver to handle IRQ_HPD events
delivered over OOB events (like USB-C AltMode).
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1559,11 +1559,12 @@ void msm_dp_bridge_hpd_notify(struct drm_bridge *bridge,
[ ... ]
> if (status == connector_status_connected) {
> - if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
> + if (hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT ||
> + event == DRM_CONNECTOR_DP_IRQ_HPD) {
> + msm_dp_irq_hpd_handle(dp);
> + } else if (hpd_link_status == ISR_HPD_REPLUG_COUNT) {
> msm_dp_hpd_unplug_handle(dp);
> msm_dp_hpd_plug_handle(dp);
> - } else if (hpd_link_status == ISR_IRQ_HPD_PULSE_COUNT) {
> - msm_dp_irq_hpd_handle(dp);
> } else {
> msm_dp_hpd_plug_handle(dp);
> }
[Severity: High]
Does this code handle coalesced connection and IRQ_HPD events correctly?
If the USB Type-C AltMode driver coalesces an initial connection and a pending
IRQ_HPD event into a single notification, msm_dp_bridge_hpd_notify() receives
both status == connector_status_connected and event ==
DRM_CONNECTOR_DP_IRQ_HPD.
The mutual exclusion block in drivers/gpu/drm/msm/dp/dp_display.c prioritizes
event == DRM_CONNECTOR_DP_IRQ_HPD, branching to msm_dp_irq_hpd_handle() and
entirely skipping msm_dp_hpd_plug_handle().
Because msm_dp_hpd_plug_handle() is skipped, dp->plugged remains false,
the DP PHY is not initialized, and AUX transfers remain disabled. The
subsequent msm_dp_irq_hpd_handle() then attempts an AUX read which immediately
fails with -ENXIO, abandoning the initialization and leaving the display
blank.
Is it possible to ensure msm_dp_hpd_plug_handle() is still called when a new
connection occurs alongside an IRQ_HPD event?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260920-hpd-irq-events-v5-0-ff1de0090c72@oss.qualcomm.com?part=6
More information about the linux-amlogic
mailing list