drm/bridge: it6505: fix HDCP CTS compare V matching

When HDCP negotiation with a repeater device.
Checking SHA V' matching must retry 3 times before restarting HDCP.

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-8-e0fdd4844703@ite.corp-partner.google.com
This commit is contained in:
Hermes Wu 2024-12-30 18:51:26 +08:00 committed by Dmitry Baryshkov
parent aa97239300
commit 0989c02c7a

View File

@ -2058,7 +2058,7 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505)
{ {
struct device *dev = it6505->dev; struct device *dev = it6505->dev;
u8 av[5][4], bv[5][4]; u8 av[5][4], bv[5][4];
int i, err; int i, err, retry;
i = it6505_setup_sha1_input(it6505, it6505->sha1_input); i = it6505_setup_sha1_input(it6505, it6505->sha1_input);
if (i <= 0) { if (i <= 0) {
@ -2067,22 +2067,28 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505)
} }
it6505_sha1_digest(it6505, it6505->sha1_input, i, (u8 *)av); it6505_sha1_digest(it6505, it6505->sha1_input, i, (u8 *)av);
/*1B-05 V' must retry 3 times */
for (retry = 0; retry < 3; retry++) {
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_V_PRIME(0), (u8 *)bv,
sizeof(bv));
err = it6505_get_dpcd(it6505, DP_AUX_HDCP_V_PRIME(0), (u8 *)bv, if (err < 0) {
sizeof(bv)); dev_err(dev, "Read V' value Fail %d", retry);
continue;
}
if (err < 0) { for (i = 0; i < 5; i++) {
dev_err(dev, "Read V' value Fail"); if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
return false; av[i][1] != av[i][2] || bv[i][0] != av[i][3])
break;
DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d, %d", retry, i);
return true;
}
} }
for (i = 0; i < 5; i++) DRM_DEV_DEBUG_DRIVER(dev, "V' NOT match!! %d", retry);
if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] || return false;
bv[i][1] != av[i][2] || bv[i][0] != av[i][3])
return false;
DRM_DEV_DEBUG_DRIVER(dev, "V' all match!!");
return true;
} }
static void it6505_hdcp_wait_ksv_list(struct work_struct *work) static void it6505_hdcp_wait_ksv_list(struct work_struct *work)