From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Paul Hsieh <paul.hsieh@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 4.20 218/304] drm/amd/display: Add retry to read ddc_clock pin
Date: Mon, 28 Jan 2019 10:42:15 -0500 [thread overview]
Message-ID: <20190128154341.47195-218-sashal@kernel.org> (raw)
In-Reply-To: <20190128154341.47195-1-sashal@kernel.org>
From: Paul Hsieh <paul.hsieh@amd.com>
[ Upstream commit bd4905a9583c760da31ded7256dca6f71483c3dc ]
[WHY]
On customer board, there is one pluse (1v , < 1ms) on
DDC_CLK pin when plug / unplug DP cable. Driver will read
it and config DP to HDMI/DVI dongle.
[HOW]
If there is a real dongle, DDC_CLK should be always pull high.
Try to read again to recovery this special case. Retry times = 3.
Need additional 3ms to detect DP passive dongle(3 failures)
Signed-off-by: Paul Hsieh <paul.hsieh@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 23 ++++++++++++++-----
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 5141c1401889..ef1b350a45e0 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -332,7 +332,7 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)
{
enum gpio_result gpio_result;
uint32_t clock_pin = 0;
-
+ uint8_t retry = 0;
struct ddc *ddc;
enum connector_id connector_id =
@@ -361,11 +361,22 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)
return present;
}
- /* Read GPIO: DP sink is present if both clock and data pins are zero */
- /* [anaumov] in DAL2, there was no check for GPIO failure */
-
- gpio_result = dal_gpio_get_value(ddc->pin_clock, &clock_pin);
- ASSERT(gpio_result == GPIO_RESULT_OK);
+ /*
+ * Read GPIO: DP sink is present if both clock and data pins are zero
+ *
+ * [W/A] plug-unplug DP cable, sometimes customer board has
+ * one short pulse on clk_pin(1V, < 1ms). DP will be config to HDMI/DVI
+ * then monitor can't br light up. Add retry 3 times
+ * But in real passive dongle, it need additional 3ms to detect
+ */
+ do {
+ gpio_result = dal_gpio_get_value(ddc->pin_clock, &clock_pin);
+ ASSERT(gpio_result == GPIO_RESULT_OK);
+ if (clock_pin)
+ udelay(1000);
+ else
+ break;
+ } while (retry++ < 3);
present = (gpio_result == GPIO_RESULT_OK) && !clock_pin;
--
2.19.1
next prev parent reply other threads:[~2019-01-28 15:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190128154341.47195-1-sashal@kernel.org>
2019-01-28 15:38 ` [PATCH AUTOSEL 4.20 012/304] gpu: ipu-v3: image-convert: Prevent race between run and unprepare Sasha Levin
2019-01-28 15:39 ` [PATCH AUTOSEL 4.20 033/304] drm/vc4: ->x_scaling[1] should never be set to VC4_SCALING_NONE Sasha Levin
2019-01-28 15:39 ` [PATCH AUTOSEL 4.20 053/304] drm/rockchip: fix for mailbox read size Sasha Levin
2019-01-28 15:39 ` [PATCH AUTOSEL 4.20 071/304] drm: rcar-du: Fix external clock error checks Sasha Levin
2019-01-28 15:40 ` [PATCH AUTOSEL 4.20 096/304] drm: Clear state->acquire_ctx before leaving drm_atomic_helper_commit_duplicated_state() Sasha Levin
2019-01-28 15:40 ` [PATCH AUTOSEL 4.20 097/304] drm: Move drm_mode_setcrtc() local re-init to failure path Sasha Levin
2019-01-28 15:40 ` [PATCH AUTOSEL 4.20 107/304] drm/v3d: Fix prime imports of buffers from other drivers Sasha Levin
[not found] ` <20190128154341.47195-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-01-28 15:38 ` [PATCH AUTOSEL 4.20 013/304] drm/amd/display: Fix potential nullptr error Sasha Levin
2019-01-28 15:39 ` [PATCH AUTOSEL 4.20 055/304] drm/amd/display: fix gamma not being applied correctly Sasha Levin
2019-01-28 15:39 ` [PATCH AUTOSEL 4.20 056/304] drm/amd/display: calculate stream->phy_pix_clk before clock mapping Sasha Levin
2019-01-28 15:40 ` [PATCH AUTOSEL 4.20 129/304] drm/amdgpu/powerplay: fix clock stretcher limits on polaris (v2) Sasha Levin
2019-01-28 15:41 ` [PATCH AUTOSEL 4.20 161/304] drm/msm/dsi: fix dsi clock names in DSI 10nm PLL driver Sasha Levin
2019-01-28 15:41 ` [PATCH AUTOSEL 4.20 162/304] drm/msm: dpu: Only check flush register against pending flushes Sasha Levin
2019-01-28 15:42 ` Sasha Levin [this message]
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 219/304] drm/amd/display: Wait edp HPD to high in detect_sink Sasha Levin
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 221/304] drm/amd/display: fix YCbCr420 blank color Sasha Levin
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 243/304] drm/amd/display: validate extended dongle caps Sasha Levin
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 244/304] video: clps711x-fb: release disp device node in probe() Sasha Levin
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 246/304] fbdev: fbmem: behave better with small rotated displays and many CPUs Sasha Levin
2019-01-28 15:42 ` [PATCH AUTOSEL 4.20 251/304] fbdev: fbcon: Fix unregister crash when more than one framebuffer Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190128154341.47195-218-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.hsieh@amd.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox