Message ID | 20250109-fix-hdcp-v-comp-v3-1-1258edb249ab@ite.com.tw (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v3] drm/bridge: it6505: fix HDCP V match check is not performed correctly | expand |
On Thu, Jan 09, 2025 at 02:40:08PM +0800, Hermes Wu via B4 Relay wrote: > From: Hermes Wu <Hermes.wu@ite.com.tw> > > The loop of V compare is expected to iterate for 5 times > which compare V array form av[0][] to av[4][]. > It should check loop counter reach the last statement "i == 5" > before return true > > Fixes: 0989c02c7a5c ("drm/bridge: it6505: fix HDCP CTS compare V matching") > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Excuse me, where did you get that from?? I didn't r-b it (yet). > Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw> > --- > Changes in v3: > - The V value compare loop from i = 0 to i = 4 and shall exit with i == 5 > if all V element matches > - Link to v2: https://lore.kernel.org/r/20250109-fix-hdcp-v-comp-v2-1-7dce0a59523f@ite.com.tw > > Changes in v2: > - pull the check of statment "i" out of V value check loop > - Link to v1: https://lore.kernel.org/r/20250108-fix-hdcp-v-comp-v1-1-9404811825cd@ite.com.tw > --- > drivers/gpu/drm/bridge/ite-it6505.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >
hi -----Original Message----- From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Sent: Thursday, January 9, 2025 9:09 PM To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw> Cc: Andrzej Hajda <andrzej.hajda@intel.com>; Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>; Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; Jonas Karlman <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@gmail.com>; Simona Vetter <simona@ffwll.ch>; AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; Pet Weng (翁玉芬) <Pet.Weng@ite.com.tw>; Kenneth Hung (洪家倫) <Kenneth.Hung@ite.com.tw>; treapking@chromium.org Subject: Re: [PATCH v3] drm/bridge: it6505: fix HDCP V match check is not performed correctly On Thu, Jan 09, 2025 at 02:40:08PM +0800, Hermes Wu via B4 Relay wrote: > From: Hermes Wu <Hermes.wu@ite.com.tw> > > The loop of V compare is expected to iterate for 5 times which compare > V array form av[0][] to av[4][]. > It should check loop counter reach the last statement "i == 5" > before return true > > Fixes: 0989c02c7a5c ("drm/bridge: it6505: fix HDCP CTS compare V > matching") > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> >Excuse me, where did you get that from?? I didn't r-b it (yet). Sorry, I think I just missing understanding about this tag. I thought it should add if someone give advice to a path. So I add it before you r-b it, > Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw> > --- > Changes in v3: > - The V value compare loop from i = 0 to i = 4 and shall exit with i == 5 > if all V element matches > - Link to v2: > https://lore.kernel.org/r/20250109-fix-hdcp-v-comp-v2-1-7dce0a59523f@i > te.com.tw > > Changes in v2: > - pull the check of statment "i" out of V value check loop > - Link to v1: > https://lore.kernel.org/r/20250108-fix-hdcp-v-comp-v1-1-9404811825cd@i > te.com.tw > --- > drivers/gpu/drm/bridge/ite-it6505.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >-- >With best wishes >Dmitry Br. Hermes
On Fri, Jan 10, 2025 at 02:00:35AM +0000, Hermes.Wu@ite.com.tw wrote: > hi > > > -----Original Message----- > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Sent: Thursday, January 9, 2025 9:09 PM > To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw> > Cc: Andrzej Hajda <andrzej.hajda@intel.com>; Neil Armstrong <neil.armstrong@linaro.org>; Robert Foss <rfoss@kernel.org>; Laurent Pinchart <Laurent.pinchart@ideasonboard.com>; Jonas Karlman <jonas@kwiboo.se>; Jernej Skrabec <jernej.skrabec@gmail.com>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@gmail.com>; Simona Vetter <simona@ffwll.ch>; AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; Pet Weng (翁玉芬) <Pet.Weng@ite.com.tw>; Kenneth Hung (洪家倫) <Kenneth.Hung@ite.com.tw>; treapking@chromium.org > Subject: Re: [PATCH v3] drm/bridge: it6505: fix HDCP V match check is not performed correctly > > On Thu, Jan 09, 2025 at 02:40:08PM +0800, Hermes Wu via B4 Relay wrote: > > From: Hermes Wu <Hermes.wu@ite.com.tw> > > > > The loop of V compare is expected to iterate for 5 times which compare > > V array form av[0][] to av[4][]. > > It should check loop counter reach the last statement "i == 5" > > before return true > > > > Fixes: 0989c02c7a5c ("drm/bridge: it6505: fix HDCP CTS compare V > > matching") > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > >Excuse me, where did you get that from?? I didn't r-b it (yet). > > Sorry, > > I think I just missing understanding about this tag. > I thought it should add if someone give advice to a path. > > So I add it before you r-b it, Okay. Please don't add extra tags in future. The patch itself is: Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > > > Signed-off-by: Hermes Wu <Hermes.wu@ite.com.tw> > > --- > > Changes in v3: > > - The V value compare loop from i = 0 to i = 4 and shall exit with i == 5 > > if all V element matches > > - Link to v2: > > https://lore.kernel.org/r/20250109-fix-hdcp-v-comp-v2-1-7dce0a59523f@i > > te.com.tw > > > > Changes in v2: > > - pull the check of statment "i" out of V value check loop > > - Link to v1: > > https://lore.kernel.org/r/20250108-fix-hdcp-v-comp-v1-1-9404811825cd@i > > te.com.tw > > --- > > drivers/gpu/drm/bridge/ite-it6505.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > >-- > >With best wishes > >Dmitry > > Br. > Hermes
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 88ef76a37fe6accacdd343839ff2569b31b18ceb..2f82fbc0b8bf8c322c088dc257720c6825651bb8 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2250,12 +2250,13 @@ static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505) continue; } - for (i = 0; i < 5; i++) { + for (i = 0; i < 5; i++) if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] || 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); + if (i == 5) { + DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d", retry); return true; } }