提交 b5db8217 编写于 作者: K Kuogee Hsieh 提交者: Zheng Zengkai

drm/msm/dp: promote irq_hpd handle to handle link training correctly

stable inclusion
from stable-v5.10.127
commit 61f8f4034c04231148e7580ae51a2a74171c04a0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XDDK

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=61f8f4034c04231148e7580ae51a2a74171c04a0

--------------------------------

[ Upstream commit 26b8d66a ]

Some dongles require link training done at irq_hpd request instead
of plugin request. This patch promote irq_hpd handler to handle link
training and setup hpd_state correctly.
Signed-off-by: NKuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: NRob Clark <robdclark@chromium.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 12704d4b
......@@ -476,10 +476,9 @@ static int dp_display_handle_irq_hpd(struct dp_display_private *dp)
sink_request = dp->link->sink_request;
if (sink_request & DS_PORT_STATUS_CHANGED) {
dp_add_event(dp, EV_USER_NOTIFICATION, false, 0);
if (dp_display_is_sink_count_zero(dp)) {
DRM_DEBUG_DP("sink count is zero, nothing to do\n");
return 0;
return -ENOTCONN;
}
return dp_display_process_hpd_high(dp);
......@@ -496,7 +495,9 @@ static int dp_display_handle_irq_hpd(struct dp_display_private *dp)
static int dp_display_usbpd_attention_cb(struct device *dev)
{
int rc = 0;
u32 sink_request;
struct dp_display_private *dp;
struct dp_usbpd *hpd;
if (!dev) {
DRM_ERROR("invalid dev\n");
......@@ -510,10 +511,26 @@ static int dp_display_usbpd_attention_cb(struct device *dev)
return -ENODEV;
}
hpd = dp->usbpd;
/* check for any test request issued by sink */
rc = dp_link_process_request(dp->link);
if (!rc)
dp_display_handle_irq_hpd(dp);
if (!rc) {
sink_request = dp->link->sink_request;
if (sink_request & DS_PORT_STATUS_CHANGED) {
/* same as unplugged */
hpd->hpd_high = 0;
dp->hpd_state = ST_DISCONNECT_PENDING;
dp_add_event(dp, EV_USER_NOTIFICATION, false, 0);
}
rc = dp_display_handle_irq_hpd(dp);
if (!rc && (sink_request & DS_PORT_STATUS_CHANGED)) {
hpd->hpd_high = 1;
dp->hpd_state = ST_CONNECT_PENDING;
}
}
return rc;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册