From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 4/7] vga_switcheroo: Add post_switch callback to client ops
Date: Thu, 09 Jul 2026 09:31:21 +0000 [thread overview]
Message-ID: <20260709093121.867441F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709092215.168172-5-tzimmermann@suse.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Hardware failure during mux switch leaves vga_switcheroo in an unrecoverable state with no active client.
--
--- Patch [4]: [PATCH v2 4/7] vga_switcheroo: Add post_switch callback to client ops ---
commit e87434614b85f1234ff64f6a0aeb8bd282739a69
Author: Thomas Zimmermann <tzimmermann@suse.de>
vga_switcheroo: Add post_switch callback to client ops
This patch adds a new post_switch callback to struct
vga_switcheroo_client_ops to notify clients about a completed output switch.
This callback is intended to replace the deprecated reprobe client operation.
> diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
> index bdf1e56ae8910..7b0af4a8aa7d0 100644
> --- a/drivers/gpu/vga/vga_switcheroo.c
> +++ b/drivers/gpu/vga/vga_switcheroo.c
> @@ -746,7 +746,9 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
[ ... ]
> mutex_lock(&vgasr_priv.mux_hw_lock);
> ret = vgasr_priv.handler->switchto(new_client->id);
> mutex_unlock(&vgasr_priv.mux_hw_lock);
> if (ret)
> return ret;
[Severity: High]
This is a pre-existing issue, but if the hardware switch fails and returns an
error code here, does this leave the state machine unrecoverable?
Earlier in vga_switchto_stage2(), the active client is found and its active
flag is cleared:
drivers/gpu/vga/vga_switcheroo.c:vga_switchto_stage2() {
active = find_active_client(&vgasr_priv.clients);
if (!active)
return 0;
active->active = false;
...
If vgasr_priv.handler->switchto() returns an error, the early return happens
without restoring active->active to true. This appears to leave the subsystem
with no active client, causing subsequent calls to find_active_client() to
fail and preventing any future GPU switches until a module reload or reboot.
Should the active flag be restored on this error path?
>
> - if (new_client->ops->reprobe)
> + if (new_client->ops->post_switch)
> + new_client->ops->post_switch(new_client->pdev);
> + else if (new_client->ops->reprobe)
> new_client->ops->reprobe(new_client->pdev);
>
> if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709092215.168172-1-tzimmermann@suse.de?part=4
next prev parent reply other threads:[~2026-07-09 9:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 9:15 [PATCH v2 0/7] vga_switcheroo, drm: Push fbcon handling into DRM clients Thomas Zimmermann
2026-07-09 9:15 ` Thomas Zimmermann
2026-07-09 9:15 ` [PATCH v2 1/7] drm/edid: Include <linux/fb.h> Thomas Zimmermann
2026-07-09 9:15 ` Thomas Zimmermann
2026-07-09 9:15 ` [PATCH v2 2/7] drm/client: Add acquire_outputs callback; implement for fbdev emulation Thomas Zimmermann
2026-07-09 9:15 ` Thomas Zimmermann
2026-07-09 9:15 ` [PATCH v2 3/7] vga_switcheroo: Add pre_switch callback to client ops Thomas Zimmermann
2026-07-09 9:15 ` Thomas Zimmermann
2026-07-09 9:16 ` [PATCH v2 4/7] vga_switcheroo: Add post_switch " Thomas Zimmermann
2026-07-09 9:16 ` Thomas Zimmermann
2026-07-09 9:31 ` sashiko-bot [this message]
2026-07-09 9:16 ` [PATCH v2 5/7] drm: Implement struct vga_switcheroo_client_ops.pre_switch Thomas Zimmermann
2026-07-09 9:16 ` Thomas Zimmermann
2026-07-09 9:36 ` sashiko-bot
2026-07-09 10:38 ` Thomas Zimmermann
2026-07-09 9:16 ` [PATCH v2 6/7] drm: Implement vga_switcheroo_client_ops.post_switch Thomas Zimmermann
2026-07-09 9:16 ` Thomas Zimmermann
2026-07-09 9:16 ` [PATCH v2 7/7] vga-switcheroo: Remove unused interfaces Thomas Zimmermann
2026-07-09 9:16 ` Thomas Zimmermann
2026-07-09 9:32 ` sashiko-bot
2026-07-09 11:08 ` ✓ i915.CI.BAT: success for vga_switcheroo, drm: Push fbcon handling into DRM clients (rev2) Patchwork
2026-07-10 6:15 ` ✗ i915.CI.Full: failure " Patchwork
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=20260709093121.867441F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tzimmermann@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.