dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <Hermes.Wu@ite.com.tw>
To: <dan.carpenter@linaro.org>
Cc: <dri-devel@lists.freedesktop.org>
Subject: RE: [bug report] drm/bridge: it6505: fix HDCP CTS compare V matching
Date: Wed, 8 Jan 2025 09:23:49 +0000	[thread overview]
Message-ID: <ba425ad51b584812aabdb55d7d472c59@ite.com.tw> (raw)
In-Reply-To: <b1cc3aab-d5c5-4e61-b270-24c2b28df217@stanley.mountain>

Hi Dan Carpenter,
>
>-----Original Message-----
>From: Dan Carpenter <dan.carpenter@linaro.org> 
>Sent: Wednesday, January 8, 2025 5:14 PM
>To: Hermes Wu (吳佳宏) <Hermes.Wu@ite.com.tw>
>Cc: dri-devel@lists.freedesktop.org
>Subject: [bug report] drm/bridge: it6505: fix HDCP CTS compare V matching
>
>Hello Hermes Wu,
>
>Commit 0989c02c7a5c ("drm/bridge: it6505: fix HDCP CTS compare V
>matching") from Dec 30, 2024 (linux-next), leads to the following Smatch static checker warning:
>
>	drivers/gpu/drm/bridge/ite-it6505.c:2253 it6505_hdcp_part2_ksvlist_check()
>	warn: ignoring unreachable code.
>
>drivers/gpu/drm/bridge/ite-it6505.c
>    2230 static bool it6505_hdcp_part2_ksvlist_check(struct it6505 *it6505)
>    2231 {
>    2232         struct device *dev = it6505->dev;
>    2233         u8 av[5][4], bv[5][4];
>    2234         int i, err, retry;
>    2235 
>    2236         i = it6505_setup_sha1_input(it6505, it6505->sha1_input);
>    2237         if (i <= 0) {
>    2238                 dev_err(dev, "SHA-1 Input length error %d", i);
>    2239                 return false;
>    2240         }
>    2241 
>    2242         it6505_sha1_digest(it6505, it6505->sha1_input, i, (u8 *)av);
>    2243         /*1B-05 V' must retry 3 times */
>    2244         for (retry = 0; retry < 3; retry++) {
>    2245                 err = it6505_get_dpcd(it6505, DP_AUX_HDCP_V_PRIME(0), (u8 *)bv,
>    2246                                       sizeof(bv));
>    2247 
>    2248                 if (err < 0) {
>    2249                         dev_err(dev, "Read V' value Fail %d", retry);
>    2250                         continue;
>    2251                 }
>    2252 
>--> 2253                 for (i = 0; i < 5; i++) {
>
>This looks like a loop from 0-4.
>
>    2254                         if (bv[i][3] != av[i][0] || bv[i][2] != av[i][1] ||
>    2255                             av[i][1] != av[i][2] || bv[i][0] != av[i][3])
>    2256                                 break;
>    2257 
>    2258                         DRM_DEV_DEBUG_DRIVER(dev, "V' all match!! %d, %d", retry, i);
>    2259                         return true;
>
>But it is a "loop" from 0-0.

I have fix this in following,

https://lore.kernel.org/all/20250108-fix-hdcp-v-comp-v1-1-9404811825cd@ite.com.tw/

Thanks a lot.

>    2260                 }
>    2261         }
>    2262 
>    2263         DRM_DEV_DEBUG_DRIVER(dev, "V' NOT match!! %d", retry);
>    2264         return false;
>    2265 }
>
>regards,
>dan carpenter
>

BR,
Hermes


      reply	other threads:[~2025-01-08  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  9:13 [bug report] drm/bridge: it6505: fix HDCP CTS compare V matching Dan Carpenter
2025-01-08  9:23 ` Hermes.Wu [this message]

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=ba425ad51b584812aabdb55d7d472c59@ite.com.tw \
    --to=hermes.wu@ite.com.tw \
    --cc=dan.carpenter@linaro.org \
    --cc=dri-devel@lists.freedesktop.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