From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EEF7C44508 for ; Wed, 15 Jul 2026 18:31:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WAtyg5Ay0+0NRb+/6N+SWeL7h8f4F9UiJEumSOuC6j8=; b=dcSuh5vLfT6x95/hkSkBa+x7Yx fHZxCjQpBQlfgCoDPZLYQSEmIEkuV9PG1hecIzgGfO2ht3XmhgCeEfZLdIPavi9t+DC3HYrB9NlIv TBV4RBPvdw/mnqlfEJx6ERX0+V1mTPXa0f+hTVznJh7qO0NRSvT+nkbk6gdSJZZVSMJrpkSmE1ONy UkKS+DZ1bGe0yhhiTcLLWef3S1yzb0FvA5bOEW7oq1cascbIE3vnxP/Pm+RmJ/QU53o74kjzFcPbF guKq+cWAk7IyNWwLZNDG/bcO45dlmB+uS7RYYGaHpTGNFHOwKuijnheEq0VFrHpKjqZY90WVvNOZR TpV0piUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wk4Oc-0000000FgHK-1VOJ; Wed, 15 Jul 2026 18:31:50 +0000 Received: from sender4-op-o11.zoho.com ([136.143.188.11]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wk4Oa-0000000FgGd-0BPz; Wed, 15 Jul 2026 18:31:49 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1784140269; cv=none; d=zohomail.com; s=zohoarc; b=mF+82Ak2xmHGgbVpn39yFo1ujKBHtUruIeLUq0wT0hxE/5VO0yqPQx/X2vQZsW2pXD5c+hXeTXHqnqG49GgFapriRA//Ut8ZOikB+NbBQ6WKuXTatdXVJ0Zv8tsFSfuekO7RFRhpR+6uiCi+nCXHhfkM+LLRtVuGnyq4++lnCn0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784140269; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=N/wiBLYHdGXZJkCg3oiCX/MSyspe/eiXGex9ftDaZcE=; b=Wq86dZDfxwLzEPjzbpEFWxu+0Bn/IBHdVt7Gplx3r/tgpwmMlScib11AeXnv4lbmBAqoprAeOviGj964g1je+zrhI3eRtNf7MS0wNXDcRtUMtLkCrmNsEvueR9Ld9Udx4yHoSX3UpeGlk8KfxYNE/GLS8rqlBb0jl5lsOfMTGbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=sebastian.reichel@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1784140269; s=zohomail; d=collabora.com; i=sebastian.reichel@collabora.com; h=Date:Date:From:From:To:To:Cc:Cc:Subject:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To:Message-Id:Reply-To; bh=N/wiBLYHdGXZJkCg3oiCX/MSyspe/eiXGex9ftDaZcE=; b=i/YH6zzu7szwG3X/T7xICxR7uKdgqUMZmCHJ1dMCpLh9NfGt+npTLJuO8Z0qTLeZ d0X+UpC7bvzAlaaAEyagubKAqouLSvOlYtfzI3FamtSP7oc8x7SH6Mb6FM1gg0K40Dr UpT6qfSnFS2y4v5ji2KXDYD1NCIpVdcdEXZjtX18= Received: by mx.zohomail.com with SMTPS id 1784140267504649.5715776031727; Wed, 15 Jul 2026 11:31:07 -0700 (PDT) Received: by venus (Postfix, from userid 1000) id 1F034180820; Wed, 15 Jul 2026 20:31:00 +0200 (CEST) Date: Wed, 15 Jul 2026 20:31:00 +0200 From: Sebastian Reichel To: Andy Yan Subject: Re: [PATCH v3 07/10] drm/bridge: synopsys: dw-dp: Add Runtime PM support Message-ID: References: <20260612-synopsys-dw-dp-improvements-v3-0-dc61e6352508@collabora.com> <20260612-synopsys-dw-dp-improvements-v3-7-dc61e6352508@collabora.com> MIME-Version: 1.0 In-Reply-To: X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-0.2.10.1.5.2/284.121.97 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260715_113148_123665_EC04ADD6 X-CRM114-Status: GOOD ( 32.45 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko =?utf-8?Q?St=C3=BCbner?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Andrzej Hajda , kernel@collabora.com, David Airlie , Simona Vetter , Rob Herring , Robert Foss , Jernej Skrabec , linux-rockchip@lists.infradead.org, Luca Ceresoli , devicetree@vger.kernel.org, Conor Dooley , Jonas Karlman , Maarten Lankhorst , Maxime Ripard , Damon Ding , yubing.zhang@rock-chips.com, linux-arm-kernel@lists.infradead.org, Dmitry Baryshkov , Neil Armstrong , Dmitry Baryshkov , Sandy Huang , Alexey Charkov , Thomas Zimmermann , Andy Yan , Krzysztof Kozlowski Content-Type: multipart/mixed; boundary="===============8346507553876677579==" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org --===============8346507553876677579== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k4oubbgopkkrgoq4" Content-Disposition: inline --k4oubbgopkkrgoq4 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v3 07/10] drm/bridge: synopsys: dw-dp: Add Runtime PM support MIME-Version: 1.0 Hello Andy, On Tue, Jul 14, 2026 at 05:01:14PM +0800, Andy Yan wrote: > Hello Sebastian, >=20 > Sebastian Reichel =E4=BA=8E2026=E5=B9= =B46=E6=9C=8813=E6=97=A5=E5=91=A8=E5=85=AD 02:01=E5=86=99=E9=81=93=EF=BC=9A >=20 > > Add runtime PM stubs to the Synopsys DesignWare DisplayPort bridge > > driver. Support is not enabled automatically and must be hooked up > > in the vendor specific glue code. > > > > Signed-off-by: Sebastian Reichel > > --- > > drivers/gpu/drm/bridge/synopsys/dw-dp.c | 27 +++++++++++++++++++++++++= ++ > > include/drm/bridge/dw_dp.h | 3 +++ > > 2 files changed, 30 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c > > b/drivers/gpu/drm/bridge/synopsys/dw-dp.c > > index 7fa38145e35c..7f4f36c61484 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c > > @@ -1465,6 +1465,8 @@ static ssize_t dw_dp_aux_transfer(struct drm_dp_a= ux > > *aux, > > if (WARN_ON(msg->size > 16)) > > return -E2BIG; > > > > + ACQUIRE(pm_runtime_active_auto, pm)(dp->dev); > > + > > switch (msg->request & ~DP_AUX_I2C_MOT) { > > case DP_AUX_NATIVE_WRITE: > > case DP_AUX_I2C_WRITE: > > @@ -1655,6 +1657,8 @@ static void dw_dp_bridge_atomic_enable(struct > > drm_bridge *bridge, > > struct drm_connector_state *conn_state; > > int ret; > > > > + pm_runtime_get_sync(dp->dev); > > + > > connector =3D drm_atomic_get_new_connector_for_encoder(state, > > bridge->encoder); > > if (!connector) { > > dev_err(dp->dev, "failed to get connector\n"); > > @@ -1709,6 +1713,7 @@ static void dw_dp_bridge_atomic_disable(struct > > drm_bridge *bridge, > > dw_dp_link_disable(dp); > > bitmap_zero(dp->sdp_reg_bank, SDP_REG_BANK_SIZE); > > dw_dp_reset(dp); > > + pm_runtime_put_autosuspend(dp->dev); > > } > > > > static bool dw_dp_hpd_detect_link(struct dw_dp *dp, struct drm_connect= or > > *connector) > > @@ -1729,6 +1734,8 @@ static enum drm_connector_status > > dw_dp_bridge_detect(struct drm_bridge *bridge, > > { > > struct dw_dp *dp =3D bridge_to_dp(bridge); > > > > + ACQUIRE(pm_runtime_active_auto, pm)(dp->dev); > > >=20 > This may not work correctly. Per the DW-DP TRM, the " HPD_HOT_PLUG > bit is asserted only after the sink is attached and holds HPD high > for at least 100ms". Consequently, reading this bit within 100ms > after resuming runtime_pm may fail to detect the status. I've > verified this behavior on a Rock 5B board=E2=80=94the HPD bit remains > unreadable at this point. >=20 > +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c > @@ -1761,12 +1761,17 @@ static enum drm_connector_status > dw_dp_bridge_detect(struct drm_bridge *bridge, >=20 > ACQUIRE(pm_runtime_active_auto, pm)(dp->dev); >=20 > - if (!dw_dp_hpd_detect(dp)) > + if (!dw_dp_hpd_detect(dp)) { > + printk(KERN_DEBUG "%s no hpd\n", __func__); > return connector_status_disconnected; > + } >=20 > - if (!dw_dp_hpd_detect_link(dp, connector)) > + if (!dw_dp_hpd_detect_link(dp, connector)) { > + printk(KERN_DEBUG "%s no link\n", __func__); > return connector_status_disconnected; > + } >=20 > + printk(KERN_DEBUG "%s connected\n", __func__); > return connector_status_connected; > } >=20 > @@ -2149,6 +2154,7 @@ static irqreturn_t dw_dp_irq(int irq, void *data) > u32 value; >=20 > regmap_read(dp->regmap, DW_DP_GENERAL_INTERRUPT, &value); > + printk(KERN_DEBUG "%s value: %d\n", __func__, value); > if (!value) > return IRQ_NONE; >=20 > bootup > [ 5.218035] panthor fb000000.gpu: [drm] Using Transparent Hugepage > [ 5.219073] [drm] Initialized panthor 1.9.0 for fb000000.gpu on minor 1 > [ 7.953973] r8169 0004:41:00.0 enP4p65s0: Link is Up - 1Gbps/Full - fl= ow > control off > [ 8.601273] dw_dp_rockchip_runtime_resume ret: 0 > [ 8.702748] dw_dp_irq value: 1 // (HPD irq 100 100ms after > runtime_resume) > [ 8.714236] dw_dp_irq value: 2 > [ 8.714775] dw_dp_irq value: 2 > [ 8.715201] dw_dp_irq value: 2 > [ 8.715710] dw_dp_irq value: 2 > [ 8.715744] dw_dp_bridge_detect connected > [ 9.226752] dw_dp_rockchip_runtime_suspend >=20 >=20 > Then run modetest: >=20 > # modetest > trying to open device '/dev/dri/card1'... is not a KMS device > trying to open device '/dev/dri/card0'... done > opened device `RockChip Soc DRM` on driver `rockchip` (version 1.0.0 at 0) > Encoders: > id crtc type possible crtcs possible clones > 86 0 TMDS 0x00000004 0x00000001 > 88 0 TMDS 0x00000001 0x00000002 > 92 0 TMDS 0x00000002 0x00000004 >=20 > Connectors: > id encoder status name size (mm) modes > encoders > 87 0 disconnected DP-1 0x0 0 86 > props: > 1 EDID: >=20 > [ 13.809398] rockchip-pm-domain > fd8d8000.power-management:power-controller: sync_state() pending due to > fdee0000.hdmi_receiver > [ 29.225506] dw_dp_rockchip_runtime_resume ret: 0 > [ 29.225940] dw_dp_bridge_detect no hpd // no HPD read here > [ 29.326986] dw_dp_irq value: 1 // HPD irq ater > 100ms > [ 29.346609] dw_dp_irq value: 2 > [ 29.347150] dw_dp_irq value: 2 > [ 29.347578] dw_dp_irq value: 2 > [ 29.348092] dw_dp_irq value: 2 >=20 >=20 > if I add a mdelay(110) after ACQUIRE pm_runtime, the hdp can be read. > index 02ca7fe725876..5959e79eb3e2b 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c > @@ -1760,7 +1760,7 @@ static enum drm_connector_status > dw_dp_bridge_detect(struct drm_bridge *bridge, > struct dw_dp *dp =3D bridge_to_dp(bridge); >=20 > ACQUIRE(pm_runtime_active_auto, pm)(dp->dev); > - > + mdelay(110); Interesting, I did not notice this issue with the Sige 5 (RK3576). Thanks for not just reporting it to not work, but also figuring out what is going on :) I will add an msleep(110); in the next version. Greetings, -- Sebastian --k4oubbgopkkrgoq4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmpX0eMACgkQ2O7X88g7 +proiw//TpC4KRIooalLSV6qAZujhx/NZeM1RZgdMyLHA8A5+uvrO4uhjIrPPivv zUqwAU90nbdoVNt8zyKhjwpabHHXtrh2wxwMjesYOYO1SLNDgLvF7IrUYdOfXzJA 00hzJglxvIB5aJllxCzSkrP2WpNEqjrBpL3QfuzObOc/qd9yq/Z/OmNh6HTWsmFi 6lASNypyehhXPwwgyP8brI7Nb+w7IaemGTEAbOMkbxDZ1VnBOLde0BKCsLyKwZV0 jtSEozTs8Hzh6Wfpu66oklAsxZhp64lbYDNpOtYb5YsBeyoy56D4mR1++hYXcIxf tr0TaiVMSEwa32cX1YEg2ZaDGz+odB+nGdiPffg3+2UhNQoae/qxrpmRpgvTWijW Wz5YqfGmFs/s/iR10Osxwy3YBY/mKScp81F6S4Lv191vDCfs+9j5wYArv/52m7zf hPUbiy0k2SRTgt0VSmHly81fQRTzM1VUamYBTzdy0Gik5EsYwRZSggLip8aWHlct tQHNgpu8iOhaDP9aEu19HMQtKF1ppHBPJPIREBT19JOyr4Shv18IzGbBNjrZuQU5 nO94Xviw9otQpWfWGdvHgXSgsWIkgNLGuHrgOQK3YZF0V9N9/C4cCqSf3N6vFqUu rqHu9882Hg7u63fDL0KVTrVGzfg+FH6MNF1N5mHwKthNiCkbPHM= =fomM -----END PGP SIGNATURE----- --k4oubbgopkkrgoq4-- --===============8346507553876677579== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip --===============8346507553876677579==--