From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 7/7] vga-switcheroo: Remove unused interfaces
Date: Thu, 09 Jul 2026 09:32:56 +0000 [thread overview]
Message-ID: <20260709093256.540B11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709092215.168172-8-tzimmermann@suse.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but `vga_switchto_stage2()` leaves the switcheroo system permanently disabled if the hardware switch handler fails. The active client's state is not restored, permanently corrupting the subsystem's state machine.
--
--- Patch [7]: [PATCH v2 7/7] vga-switcheroo: Remove unused interfaces ---
commit ef7b188cece6d285e2c3384cc1c77c0b8424b231
Author: Thomas Zimmermann <tzimmermann@suse.de>
vga-switcheroo: Remove unused interfaces
This commit removes unused interfaces that implemented pre_switch and
post_switch functionality. It specifically removes
vga_switcheroo_client_fb_set() and the reprobe callback from client ops,
cleaning up obsolete code referencing fbdev.
> diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
> --- a/drivers/gpu/vga/vga_switcheroo.c
> +++ b/drivers/gpu/vga/vga_switcheroo.c
[ ... ]
> @@ -735,10 +712,6 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
>
> if (new_client->ops->pre_switch)
> new_client->ops->pre_switch(new_client->pdev);
> -#if defined(CONFIG_FB)
> - else if (new_client->fb_info)
> - fb_switch_outputs(new_client->fb_info);
> -#endif
>
> 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 does this error path leave the switcheroo
system permanently disabled if the hardware switch handler fails?
Earlier in vga_switchto_stage2(), the active client is marked inactive
(active->active = false) and the audio state might be set to OFF. If
vgasr_priv.handler->switchto() fails, the code returns early without restoring
active->active.
Because the active state is not restored, will find_active_client()
subsequently return NULL, causing future switch requests to silently abort
and leaving the subsystem in a corrupted state?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709092215.168172-1-tzimmermann@suse.de?part=7
next prev parent reply other threads:[~2026-07-09 9:32 UTC|newest]
Thread overview: 14+ 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 ` [PATCH v2 1/7] drm/edid: Include <linux/fb.h> 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 ` [PATCH v2 3/7] vga_switcheroo: Add pre_switch callback to client ops Thomas Zimmermann
2026-07-09 9:16 ` [PATCH v2 4/7] vga_switcheroo: Add post_switch " Thomas Zimmermann
2026-07-09 9:31 ` sashiko-bot
2026-07-09 9:16 ` [PATCH v2 5/7] drm: Implement struct vga_switcheroo_client_ops.pre_switch 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 ` [PATCH v2 7/7] vga-switcheroo: Remove unused interfaces Thomas Zimmermann
2026-07-09 9:32 ` sashiko-bot [this message]
2026-07-18 19:08 ` [PATCH v2 0/7] vga_switcheroo, drm: Push fbcon handling into DRM clients Helge Deller
2026-07-20 11:58 ` Thomas Zimmermann
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=20260709093256.540B11F000E9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox