From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/i915/edp: Check supported link rates DPCD read
Date: Thu, 04 Jun 2026 16:24:48 +1000 [thread overview]
Message-ID: <review-patch1-20260529145759.1640646-1-n.zhandarovich@fintech.ru> (raw)
In-Reply-To: <20260529145759.1640646-1-n.zhandarovich@fintech.ru>
Patch Review
**Correctness: Good**
The switch from `drm_dp_dpcd_read()` (returns bytes read or negative error) to `drm_dp_dpcd_read_data()` (returns 0 on success, negative on error, also handles short reads as `-EPROTO`) is the right call. It catches both outright failures *and* short reads, which the original code did not handle at all.
The `memset` fallback is elegant — it reuses the existing `rate == 0 → break` logic at line 4828 of the current tree:
```c
rate = le16_to_cpu(sink_rates[i]) * 200 / 10;
if (rate == 0)
break;
```
This means `num_sink_rates` will be set to 0, which is the correct fallback.
**Minor observation:**
The `memset` on failure is technically redundant given `drm_dp_dpcd_read_data()`'s implementation. Looking at the function (drm_dp_helper.h:588-617), on the primary `drm_dp_dpcd_read()` failure path it falls through to byte-by-byte retry. If both paths fail, the buffer contents are indeterminate (partially written by the failed `drm_dp_dpcd_read()` call). So the `memset` is actually **necessary** for correctness — the buffer could contain partial/garbage data from a failed read. This is fine as-is.
**One nit:** The debug message says `"Unable to read eDP supported link rates, using default rates"` but whether "default rates" are actually used depends on what happens after `num_sink_rates` ends up as 0. Looking at the broader function (line 4845 in the tree), `num_sink_rates` is set to `i` which will be 0 after the zeroed array causes immediate break. The caller path does handle `num_sink_rates == 0` by falling back to DPCD-based rate calculation. So the message is accurate enough, though "falling back to DPCD-based rates" would be more precise. This is not worth a respin.
**Summary: Patch is correct, addresses a real (if unlikely) bug, and the implementation is clean. No blocking issues.**
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 6:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 14:57 [PATCH v2] drm/i915/edp: Check supported link rates DPCD read Nikita Zhandarovich
2026-05-29 15:16 ` Jani Nikula
2026-06-03 9:39 ` Jani Nikula
2026-06-04 6:24 ` Claude review: " Claude Code Review Bot
2026-06-04 6:24 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-29 12:09 [PATCH] " Nikita Zhandarovich
2026-06-04 6:37 ` Claude review: " Claude Code Review Bot
2026-06-04 6:37 ` Claude Code Review Bot
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=review-patch1-20260529145759.1640646-1-n.zhandarovich@fintech.ru \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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