From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/i915: handle failure from vga_get_uninterruptible()
Date: Mon, 09 Mar 2026 08:44:57 +1000 [thread overview]
Message-ID: <review-patch1-20260306152413.758919-2-Simon.Richter@hogyros.de> (raw)
In-Reply-To: <20260306152413.758919-2-Simon.Richter@hogyros.de>
Patch Review
**Note:** The cover letter subject says "handle failure from vga_get()" but the patch subject says "vga_get_uninterruptible()" — the patch subject is more accurate.
**Changes in `intel_vga_disable()`:**
The `goto skip` pattern is used correctly here. When `vga_get_uninterruptible()` fails, the code skips the `outb()`/`inb()` VGA register accesses and the matching `vga_put()`, but still performs the MMIO write to `VGA_DISP_DISABLE`:
```c
err = vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
if (err)
goto skip;
outb(0x01, VGA_SEQ_I);
sr1 = inb(VGA_SEQ_D);
outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
vga_put(pdev, VGA_RSRC_LEGACY_IO);
udelay(300);
skip:
intel_de_write(display, vga_reg, VGA_DISP_DISABLE);
```
This is correct — the `VGA_DISP_DISABLE` write goes through MMIO (not legacy I/O), so it must still happen regardless of VGA arbitration status. The `udelay(300)` is also correctly skipped since it's only needed after the VGA sequencer register write.
**Changes in `intel_vga_reset_io_mem()`:**
The early `return` on error is clean and appropriate here, since the entire function body is about touching VGA legacy I/O registers:
```c
err = vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
if (err)
return;
```
The added comment explaining the rationale is helpful:
```c
* We ignore this issue if we can't access the VGA registers, because
* neither can vgacon.
```
**Minor nits (non-blocking):**
- The `err` variable is declared but only used for a single check-and-branch. This is fine and follows kernel convention.
- The comment in `intel_vga_disable()` could start with a capital letter ("If the VGA ports...") per kernel comment style, but this is truly trivial.
**Verdict:** Patch looks correct and ready to apply. The error handling logic is sound, the skip/return patterns are appropriate for each call site, and the comments explain the reasoning well.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-08 22:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 15:23 [PATCH 5.3-6.19 0/1] Avoid oops on illegal VGA register access Simon Richter
2026-03-06 15:23 ` [PATCH 1/1] drm/i915: handle failure from vga_get_uninterruptible() Simon Richter
2026-03-08 22:44 ` Claude Code Review Bot [this message]
2026-03-08 22:44 ` Claude review: Avoid oops on illegal VGA register access 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-20260306152413.758919-2-Simon.Richter@hogyros.de \
--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