From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panel: novatek-nt36672a: Convert to mipi_dsi_*_multi() helpers
Date: Wed, 04 Mar 2026 07:58:47 +1000 [thread overview]
Message-ID: <review-patch1-20260303035508.8288-1-chintanlike@gmail.com> (raw)
In-Reply-To: <20260303035508.8288-1-chintanlike@gmail.com>
Patch Review
**nt36672a_send_cmds conversion** - The switch from `mipi_dsi_dcs_write(pinfo->link, cmd->data[0], cmd->data + 1, 1)` to `mipi_dsi_dcs_write_buffer_multi(dsi_ctx, cmd->data, sizeof(cmd->data))` is semantically equivalent. Good.
**Behavioral change in unprepare error path** - This is the main concern. In the new code at lines 111-116:
```c
nt36672a_send_cmds(&dsi_ctx, pinfo->desc->off_cmds,
pinfo->desc->num_off_cmds);
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
/* Reset error to continue power-down even if display off failed */
dsi_ctx.accum_err = 0;
```
If `nt36672a_send_cmds()` fails (setting `accum_err`), then `mipi_dsi_dcs_set_display_off_multi()` will be a no-op because all `_multi` helpers bail out early when `accum_err != 0`. The `accum_err = 0` reset comes *after* `set_display_off_multi`, so it doesn't help. In the original code, `set_display_off` was always attempted independently regardless of whether off_cmds succeeded. For a power-down path, you generally want to try everything. The reset should be moved *before* `set_display_off_multi`:
```c
nt36672a_send_cmds(&dsi_ctx, pinfo->desc->off_cmds,
pinfo->desc->num_off_cmds);
/* Reset error to continue power-down even if off cmds failed */
dsi_ctx.accum_err = 0;
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
```
Or alternatively, reset `accum_err` both before `set_display_off_multi` and after it, to also handle its failure.
**120ms sleep uses plain `msleep()` instead of `mipi_dsi_msleep()`** (line 119) - This is actually correct behavior here, since the 120ms delay must always occur unconditionally during power-down regardless of prior errors. Good.
**nt36672a_panel_prepare error path** - The pattern of seeding `accum_err` from `nt36672a_panel_power_on()` at line 158 is a good use of the multi context:
```c
dsi_ctx.accum_err = nt36672a_panel_power_on(pinfo);
```
The error cleanup at lines 177-178 preserves the original behavior:
```c
if (dsi_ctx.accum_err < 0)
gpiod_set_value(pinfo->reset_gpio, 0);
```
Note: the original `poweroff:` label also set the GPIO to 0, which appears to be a pre-existing issue (this de-asserts reset rather than re-asserting it, so it's effectively a no-op after a successful `power_on`). Not introduced by this patch.
**Lost error context** - The original code had specific `dev_err` messages like `"failed to send DCS off cmds: %d"` and `"set_display_off cmd failed ret = %d"`. These are all removed. While the low-level `_multi` helpers do log transport-level errors, the higher-level context (which operation was being attempted) is lost. This is typical for multi conversions and generally accepted, but worth noting.
**nt36672a_panel_power_off** - Dropping the error code from the log message (line 101-102):
```c
if (regulator_bulk_disable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies) < 0)
dev_err(panel->dev, "regulator_bulk_disable failed\n");
```
Minor nit: the original included `%d` with the error code, which can be useful for debugging. Consider preserving it:
```c
int ret = regulator_bulk_disable(...);
if (ret)
dev_err(panel->dev, "regulator_bulk_disable failed %d\n", ret);
```
**Summary**: The conversion is mostly correct. The one issue that should be fixed before merging is the `accum_err` reset placement in `nt36672a_panel_unprepare()`, which causes `set_display_off` to be skipped when `send_cmds` fails. Move the reset before `set_display_off_multi()` to preserve the original always-try-everything power-down behavior.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-03 21:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 3:55 [PATCH v2] drm/panel: novatek-nt36672a: Convert to mipi_dsi_*_multi() helpers Chintan Patel
2026-03-03 21:58 ` Claude review: " Claude Code Review Bot
2026-03-03 21:58 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-02-23 4:34 [PATCH] " Chintan Patel
2026-02-24 0:48 ` Claude review: " Claude Code Review Bot
2026-02-24 0:48 ` 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-20260303035508.8288-1-chintanlike@gmail.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