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/bridge: display-connector: don't autoenable HPD IRQ
Date: Sat, 16 May 2026 11:28:16 +1000	[thread overview]
Message-ID: <review-patch1-20260513-dp-connector-hpd-v2-1-42f757bfcbf9@oss.qualcomm.com> (raw)
In-Reply-To: <20260513-dp-connector-hpd-v2-1-42f757bfcbf9@oss.qualcomm.com>

Patch Review

**Purpose:** Prevent the HPD IRQ from firing before the DRM connector is fully set up by using `IRQF_NO_AUTOEN` and controlling enablement via `hpd_enable`/`hpd_disable` bridge callbacks.

**Analysis:**

The change is straightforward and correct. Adding `IRQF_NO_AUTOEN` to `devm_request_threaded_irq()`:

```c
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING |
IRQF_NO_AUTOEN |
IRQF_ONESHOT,
```

ensures the IRQ starts disabled. The new callbacks:

```c
static void display_connector_hpd_enable(struct drm_bridge *bridge)
{
	struct display_connector *conn = to_display_connector(bridge);
	enable_irq(conn->hpd_irq);
}

static void display_connector_hpd_disable(struct drm_bridge *bridge)
{
	struct display_connector *conn = to_display_connector(bridge);
	disable_irq(conn->hpd_irq);
}
```

are only invoked when `DRM_BRIDGE_OP_HPD` is set in `bridge->ops`, which only happens when `conn->hpd_irq >= 0` (line 413-414), so `conn->hpd_irq` is always valid when these callbacks run.

The `enable_irq`/`disable_irq` are called under `bridge->hpd_mutex` (held by `drm_bridge_hpd_enable`/`drm_bridge_hpd_disable`). If a threaded IRQ fires immediately after `enable_irq()` and calls `drm_bridge_hpd_notify()`, that will block on the mutex in a separate thread context — no deadlock, just a brief wait. The callback `hpd_cb` is already set before `hpd_enable` is called (drm_bridge.c:1459-1460), so the notification will be properly delivered.

The Fixes tag referencing the original commit that introduced the driver is appropriate.

**No issues found.**

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-16  1:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 18:19 [PATCH v2 0/2] drm/bridge: display-connector: detect DP state if cable is plugged on boot Dmitry Baryshkov
2026-05-13 18:19 ` [PATCH v2 1/2] drm/bridge: display-connector: don't autoenable HPD IRQ Dmitry Baryshkov
2026-05-16  1:28   ` Claude Code Review Bot [this message]
2026-05-13 18:19 ` [PATCH v2 2/2] drm/bridge: display-connector: trigger initial HPD event for DP Dmitry Baryshkov
2026-05-16  1:28   ` Claude review: " Claude Code Review Bot
2026-05-16  1:28 ` Claude review: drm/bridge: display-connector: detect DP state if cable is plugged on boot Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-14  0:43 [PATCH 0/2] " Dmitry Baryshkov
2026-03-14  0:43 ` [PATCH 1/2] drm/bridge: display-connector: don't autoenable HPD IRQ Dmitry Baryshkov
2026-03-16  2:14   ` Claude review: " 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-20260513-dp-connector-hpd-v2-1-42f757bfcbf9@oss.qualcomm.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