public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types
Date: Thu, 04 Jun 2026 11:57:42 +1000	[thread overview]
Message-ID: <review-patch2-20260603033532.164-3-kernel@airkyi.com> (raw)
In-Reply-To: <20260603033532.164-3-kernel@airkyi.com>

Patch Review

**Status: BUG — NULL pointer dereference on RK3506**

The design is sound: the monolithic `dw_mipi_dsi_phy_get_timing()` is refactored into per-DPHY-type callbacks (`dw_mipi_dsi_phy_rk3288_get_timing` for the table-based RK3288/RK3399 DPHY, and `dw_mipi_dsi_phy_px30_get_timing` with fixed values for PX30 and successors). The dispatch function unconditionally dereferences the callback:

```c
static int
dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps,
			   struct dw_mipi_dsi_dphy_timing *timing)
{
	struct dw_mipi_dsi_rockchip *dsi = priv_data;

	return dsi->cdata->dphy_get_timing(dsi, lane_mbps, timing);
}
```

**`rk3506_chip_data` does not set `.dphy_get_timing`**, so `dsi->cdata->dphy_get_timing` is NULL on RK3506. This will cause a kernel oops. Looking at the applied tree at line 1716-1727:

```c
static const struct rockchip_dw_dsi_chip_data rk3506_chip_data[] = {
	{
		...
		.max_data_lanes = 2,
		.max_bit_rate_per_lane = 1500000000UL,
		/* .dphy_get_timing is missing! */
	},
	{ /* sentinel */ }
};
```

Every other chip_data entry has `.dphy_get_timing` set. RK3506 should presumably use `dw_mipi_dsi_phy_px30_get_timing` given it's a newer SoC, consistent with the pattern used for RK3128, RK3368, RK3568, and RV1126.

**Other notes on this patch:**

The forward declaration `struct dw_mipi_dsi_rockchip;` before `struct rockchip_dw_dsi_chip_data` is necessary and correctly placed.

The PX30 fixed timing values (`clk_lp2hs=0x40, clk_hs2lp=0x40, data_lp2hs=0x10, data_hs2lp=0x14`) are just magic numbers with no explanation of where they come from — a brief comment referencing the specific hardware documentation or downstream source would help reviewers, but the commit message does mention "fixed timing configuration" for PX30, so this is minor.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-06-04  1:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03  3:35 [PATCH v2 0/3] DSI Controller improvements for Rockchip platforms Chaoyi Chen
2026-06-03  3:35 ` [PATCH v2 1/3] drm/rockchip: dsi: Add maximum per lane bit rate calculation Chaoyi Chen
2026-06-04  1:57   ` Claude review: " Claude Code Review Bot
2026-06-03  3:35 ` [PATCH v2 2/3] drm/rockchip: dsi: Add dphy_get_timing support for multiple PHY types Chaoyi Chen
2026-06-04  1:57   ` Claude Code Review Bot [this message]
2026-06-03  3:35 ` [PATCH v2 3/3] drm/rockchip: dsi: Relax the lane rate margin requirements Chaoyi Chen
2026-06-04  1:57   ` Claude review: " Claude Code Review Bot
2026-06-04  1:57 ` Claude review: DSI Controller improvements for Rockchip platforms 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-20260603033532.164-3-kernel@airkyi.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