From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hermes Wu <hermes.wu@ite.com.tw>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sasha Levin <sashal@kernel.org>,
andrzej.hajda@intel.com, neil.armstrong@linaro.org,
rfoss@kernel.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.13 30/34] drm/bridge: it6505: fix HDCP CTS KSV list wait timer
Date: Sun, 26 Jan 2025 09:53:06 -0500 [thread overview]
Message-ID: <20250126145310.926311-30-sashal@kernel.org> (raw)
In-Reply-To: <20250126145310.926311-1-sashal@kernel.org>
From: Hermes Wu <hermes.wu@ite.com.tw>
[ Upstream commit 9f9eef9ec1a2b57d95a86fe81df758e8253a7766 ]
HDCP must disabled encryption and restart authentication after
waiting KSV for 5s.
The original method uses a counter in a waitting loop that may
wait much longer than it is supposed to.
Use time_after() for KSV wait timeout.
Signed-off-by: Hermes Wu <hermes.wu@ite.com.tw>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241230-v7-upstream-v7-9-e0fdd4844703@ite.corp-partner.google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/bridge/ite-it6505.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 1daa069d71f73..427b32aee6ff3 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -2061,12 +2061,13 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work)
struct it6505 *it6505 = container_of(work, struct it6505,
hdcp_wait_ksv_list);
struct device *dev = it6505->dev;
- unsigned int timeout = 5000;
- u8 bstatus = 0;
+ u8 bstatus;
bool ksv_list_check;
+ /* 1B-04 wait ksv list for 5s */
+ unsigned long timeout = jiffies +
+ msecs_to_jiffies(5000) + 1;
- timeout /= 20;
- while (timeout > 0) {
+ for (;;) {
if (!it6505_get_sink_hpd_status(it6505))
return;
@@ -2075,13 +2076,12 @@ static void it6505_hdcp_wait_ksv_list(struct work_struct *work)
if (bstatus & DP_BSTATUS_READY)
break;
- msleep(20);
- timeout--;
- }
+ if (time_after(jiffies, timeout)) {
+ DRM_DEV_DEBUG_DRIVER(dev, "KSV list wait timeout");
+ goto timeout;
+ }
- if (timeout == 0) {
- DRM_DEV_DEBUG_DRIVER(dev, "timeout and ksv list wait failed");
- goto timeout;
+ msleep(20);
}
ksv_list_check = it6505_hdcp_part2_ksvlist_check(it6505);
--
2.39.5
next prev parent reply other threads:[~2025-01-26 14:54 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 14:52 [PATCH AUTOSEL 6.13 01/34] drm/virtio: New fence for every plane update Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 02/34] drm: Add panel backlight quirks Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 03/34] drm/amd/display: Add support for minimum backlight quirk Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 04/34] drm: panel-backlight-quirks: Add Framework 13 matte panel Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 05/34] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 06/34] nvkm/gsp: correctly advance the read pointer of GSP message queue Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 07/34] nvkm: correctly calculate the available space of the GSP cmdq buffer Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 08/34] drm/tests: hdmi: handle empty modes in find_preferred_mode() Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 09/34] drm/tests: hdmi: return meaningful value from set_connector_edid() Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 10/34] drm/amd/display: Populate chroma prefetch parameters, DET buffer fix Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 11/34] drm/amd/display: Overwriting dualDPP UBF values before usage Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 12/34] printk: Fix signed integer overflow when defining LOG_BUF_LEN_MAX Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 13/34] drm/msm/dpu: filter out too wide modes if no 3dmux is present Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 14/34] drm/connector: add mutex to protect ELD from concurrent access Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 15/34] drm/bridge: anx7625: use eld_mutex to protect access to connector->eld Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 16/34] drm/bridge: ite-it66121: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 17/34] drm/amd/display: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 18/34] drm/exynos: hdmi: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 19/34] drm/msm/dp: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 20/34] drm/radeon: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 21/34] drm/sti: hdmi: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 22/34] drm/vc4: " Sasha Levin
2025-01-26 14:52 ` [PATCH AUTOSEL 6.13 23/34] drm/amd/display: Fix Mode Cutoff in DSC Passthrough to DP2.1 Monitor Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 24/34] drm/amdgpu: Don't enable sdma 4.4.5 CTXEMPTY interrupt Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 25/34] drm/amdkfd: Queue interrupt work to different CPU Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 26/34] drm/bridge: it6505: Change definition MAX_HDCP_DOWN_STREAM_COUNT Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 27/34] drm/bridge: it6505: fix HDCP Bstatus check Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 28/34] drm/bridge: it6505: fix HDCP encryption when R0 ready Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 29/34] drm/bridge: it6505: fix HDCP CTS compare V matching Sasha Levin
2025-01-26 14:53 ` Sasha Levin [this message]
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 31/34] safesetid: check size of policy writes Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 32/34] drm/amd/display: Increase sanitizer frame larger than limit when compile testing with clang Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 33/34] drm/amd/display: Limit Scaling Ratio on DCN3.01 Sasha Levin
2025-01-26 14:53 ` [PATCH AUTOSEL 6.13 34/34] ring-buffer: Make reading page consistent with the code logic 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=20250126145310.926311-30-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hermes.wu@ite.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/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