From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: vgaarb: pass errors from pci_set_vga_state up
Date: Wed, 18 Feb 2026 06:47:57 +1000 [thread overview]
Message-ID: <review-patch2-20260217170419.236739-3-Simon.Richter@hogyros.de> (raw)
In-Reply-To: <20260217170419.236739-3-Simon.Richter@hogyros.de>
Patch Review
This patch converts `__vga_tryget` to propagate `pci_set_vga_state` errors via `ERR_PTR`, and updates `vga_get` to handle the new error pointer returns.
> + err = pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
> + if (unlikely(err))
> + return ERR_PTR(err);
> conflict->owns &= ~match;
When `pci_set_vga_state(conflict->pdev, false, ...)` fails, the function returns immediately. At this point, VGA state for the *requesting* device has not been enabled yet, and the conflict device's `owns` bits have not been updated, so the data structures remain consistent. However, if this is not the first iteration of the `list_for_each_entry` loop, earlier iterations may have already successfully disabled VGA on other conflicting devices (via `pci_set_vga_state(false)`) and cleared their `owns` bits. Those devices have lost VGA ownership in the software state and in hardware, but the requesting device never got it. This leaves the system in a state where nobody owns VGA. Is this an acceptable outcome, or should the series attempt to roll back the changes to previously-processed conflicts?
> + if (IS_ERR(conflict))
> + {
> + rc = PTR_ERR(conflict);
> + break;
> + }
Same brace style issue. The `IS_ERR` check in `vga_get` is correct.
However, `vga_tryget()` also calls `__vga_tryget` and is **not updated** by this patch:
```c
if (__vga_tryget(vgadev, rsrc))
rc = -EBUSY;
```
After this patch, `__vga_tryget` can return `ERR_PTR(-EIO)` (or similar). Since `ERR_PTR` values are non-NULL and non-zero, this `if` evaluates to true and `vga_tryget` returns `-EBUSY` instead of the actual error code. This is a bug -- `vga_tryget` should be updated to distinguish between a real conflict (non-NULL, non-ERR pointer) and an error (ERR_PTR). Something like:
```c
conflict = __vga_tryget(vgadev, rsrc);
if (IS_ERR(conflict))
rc = PTR_ERR(conflict);
else if (conflict)
rc = -EBUSY;
```
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-17 20:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
2026-02-17 17:04 ` [PATCH 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
2026-02-17 20:47 ` Claude review: " Claude Code Review Bot
2026-02-17 17:04 ` [PATCH 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
2026-02-17 20:47 ` Claude Code Review Bot [this message]
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
2026-02-17 20:47 ` Claude review: " Claude Code Review Bot
2026-02-17 17:04 ` [PATCH 4/5] pci: check if VGA decoding was really activated Simon Richter
2026-02-17 20:47 ` Claude review: " Claude Code Review Bot
2026-02-17 17:04 ` [PATCH 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
2026-02-17 20:47 ` Claude review: " Claude Code Review Bot
2026-02-17 20:47 ` Claude review: bridges without VGA support Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-07 17:35 [PATCH v3 0/5] Bridges " Simon Richter
2026-03-07 17:35 ` [PATCH v3 2/5] vgaarb: pass errors from pci_set_vga_state() up Simon Richter
2026-03-08 22:05 ` 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-patch2-20260217170419.236739-3-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