From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/hisilicon/hibmc: fix no showing when no connectors connected
Date: Fri, 13 Mar 2026 14:23:18 +1000 [thread overview]
Message-ID: <review-patch2-20260312074202.1491504-3-shiyongbang@huawei.com> (raw)
In-Reply-To: <20260312074202.1491504-3-shiyongbang@huawei.com>
Patch Review
This is the most complex patch in the series and has several issues:
**1. Comment style violation:** The multi-line comment in `hibmc_vdac_detect()` uses the wrong style for the kernel:
```c
/* If the DP connectors are disconnected, the hibmc_vdac_detect function
* must return a connected state to ensure KVM display functionality.
```
This should start with `/*` on its own line per kernel coding style (though this is a minor nit — some subsystems accept this style).
**2. Race / ordering dependency between DP and VDAC detect:** `hibmc_vdac_detect()` reads `priv->dp.phys_state` to decide whether to force VGA connected. But there's no guarantee about the order in which connectors are polled. If the VGA connector is polled/detected *before* the DP connector, `dp.phys_state` could still hold a stale value from a previous cycle (or the initial `connector_status_disconnected`). On initial boot with DP connected, `dp.phys_state` starts as `connector_status_disconnected`, so the first VGA detect would force-return connected even if DP is actually plugged in but not yet detected.
**3. `drm_connector_helper_get_modes()` usage:** The `get_modes` callback now calls `drm_connector_helper_get_modes()` which reads the EDID via the connector's DDC adapter. The old code explicitly used `drm_edid_read_ddc(connector, &vdac->adapter)`. This should work since the connector was initialized with `drm_connector_init_with_ddc(..., &vdac->adapter)`, but it's worth confirming that `drm_connector_helper_get_modes` will use this DDC adapter path.
**4. Clearing EDID when falling back:** The `drm_edid_connector_update(connector, NULL)` call when falling back to noedid modes is good — it clears stale EDID data.
**5. `drm_dp_read_sink_count` return value reuse:** In `hibmc_dp_detect()`, the variable `ret` is reused to hold both the `drm_dp_read_sink_count()` return value (which can be a negative error or a positive count) and the connector status enum. The `goto exit` path then assigns this to `dp->phys_state`. If `drm_dp_read_sink_count()` returns a negative error, the code falls through to `exit:` with `ret` set to a negative errno, which gets stored in `dp->phys_state`. While the original code had the same issue (it would return `connector_status_disconnected` by falling through), the new code stores a negative errno in `phys_state`, which is neither `connector_status_connected` nor `connector_status_disconnected`. This is a bug — the error case from `drm_dp_read_sink_count` should explicitly set `ret = connector_status_disconnected` before the goto.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-13 4:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 7:41 [PATCH RESEND drm-dp 0/4] Fix some bugs in the hibmc driver Yongbang Shi
2026-03-12 7:41 ` [PATCH RESEND drm-dp 1/4] drm/hisilicon/hibmc: add updating link cap in DP detect() Yongbang Shi
2026-03-13 4:23 ` Claude review: " Claude Code Review Bot
2026-03-12 7:42 ` [PATCH RESEND drm-dp 2/4] drm/hisilicon/hibmc: fix no showing when no connectors connected Yongbang Shi
2026-03-13 4:23 ` Claude Code Review Bot [this message]
2026-03-12 7:42 ` [PATCH RESEND drm-dp 3/4] drm/hisilicon/hibmc: move display contrl config to hibmc_probe() Yongbang Shi
2026-03-13 4:23 ` Claude review: " Claude Code Review Bot
2026-03-12 7:42 ` [PATCH RESEND drm-dp 4/4] drm/hisilicon/hibmc: use clock to look up the PLL value Yongbang Shi
2026-03-13 4:23 ` Claude review: " Claude Code Review Bot
2026-03-13 4:23 ` Claude review: Fix some bugs in the hibmc driver 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-patch2-20260312074202.1491504-3-shiyongbang@huawei.com \
--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