summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 307d9db)
raw | patch | inline | side by side (parent: 307d9db)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Wed, 13 Nov 2019 10:40:33 +0000 (12:40 +0200) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Wed, 27 Nov 2019 12:54:18 +0000 (14:54 +0200) |
I noticed that a sleep (or print) at the wrong place in the Linux driver
breaks my DP-HDMI adapter and also another DP dongle. When that happens,
link training is ok, but there's no picture, and reading 0x200 via DPCD
gives mostly zeroes.
In mhdp_link_training(), after link training has succeeded, we do:
/* Reset PHY config */
reg32 = CDNS_PHY_COMMON_CONFIG | CDNS_PHY_TRAINING_TYPE(1);
if (!(mhdp->host.lanes_cnt & CDNS_SCRAMBLER))
reg32 |= CDNS_PHY_SCRAMBLER_BYPASS;
cdns_mhdp_reg_write(mhdp, CDNS_DPTX_PHY_CONFIG, reg32);
If I have msleep(100) after that code, the issue happens. A sleep before
that code block causes no problems. If I move the above code to
cdns_mhdp_enable(), after the call to cdns_mhdp_sst_enable(), I see no
problem.
And it looks like the other critical code part is in
cdns_mhdp_configure_video() where we enable the framer via
CDNS_DP_FRAMER_GLOBAL_CONFIG.CDNS_DP_FRAMER_EN. So a small sleep between
the "reset PHY config" code and setting FRAMER_EN causes the issue.
The issue is seen very often in jailhouse environment (perhaps due to
single-CPU?). This hack patch moves the "reset phy config" code, as a
quick fix for issue.
The root cause and proper fix are unknown.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
breaks my DP-HDMI adapter and also another DP dongle. When that happens,
link training is ok, but there's no picture, and reading 0x200 via DPCD
gives mostly zeroes.
In mhdp_link_training(), after link training has succeeded, we do:
/* Reset PHY config */
reg32 = CDNS_PHY_COMMON_CONFIG | CDNS_PHY_TRAINING_TYPE(1);
if (!(mhdp->host.lanes_cnt & CDNS_SCRAMBLER))
reg32 |= CDNS_PHY_SCRAMBLER_BYPASS;
cdns_mhdp_reg_write(mhdp, CDNS_DPTX_PHY_CONFIG, reg32);
If I have msleep(100) after that code, the issue happens. A sleep before
that code block causes no problems. If I move the above code to
cdns_mhdp_enable(), after the call to cdns_mhdp_sst_enable(), I see no
problem.
And it looks like the other critical code part is in
cdns_mhdp_configure_video() where we enable the framer via
CDNS_DP_FRAMER_GLOBAL_CONFIG.CDNS_DP_FRAMER_EN. So a small sleep between
the "reset PHY config" code and setting FRAMER_EN causes the issue.
The issue is seen very often in jailhouse environment (perhaps due to
single-CPU?). This hack patch moves the "reset phy config" code, as a
quick fix for issue.
The root cause and proper fix are unknown.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/bridge/cdns-mhdp.c | patch | blob | history |
index 935af1a8409761a3b1cc85240eb6a46848a3cc95..7057925b46c3a1a1de77faad508892d2aec25079 100644 (file)
reg32 |= CDNS_DP_WR_FAILING_EDGE_VSYNC;
cdns_mhdp_reg_write(mhdp, CDNS_DP_FRAMER_GLOBAL_CONFIG, reg32);
- /* Reset PHY config */
- reg32 = CDNS_PHY_COMMON_CONFIG | CDNS_PHY_TRAINING_TYPE(1);
- if (!mhdp->host.scrambler)
- reg32 |= CDNS_PHY_SCRAMBLER_BYPASS;
- cdns_mhdp_reg_write(mhdp, CDNS_DPTX_PHY_CONFIG, reg32);
-
return 0;
err:
/* Reset PHY config */
{
struct cdns_mhdp_device *mhdp = bridge_to_mhdp(bridge);
u32 resp;
+ u32 reg32;
dev_dbg(mhdp->dev, "bridge enable\n");
cdns_mhdp_link_up(mhdp);
cdns_mhdp_sst_enable(bridge);
+
+ /* Reset PHY config */
+ reg32 = CDNS_PHY_COMMON_CONFIG | CDNS_PHY_TRAINING_TYPE(1);
+ if (!mhdp->host.scrambler)
+ reg32 |= CDNS_PHY_SCRAMBLER_BYPASS;
+ cdns_mhdp_reg_write(mhdp, CDNS_DPTX_PHY_CONFIG, reg32);
}
static void cdns_mhdp_detach(struct drm_bridge *bridge)