public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Simon Richter <Simon.Richter@hogyros.de>
Cc: linux-pci@vger.kernel.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/5] vgaarb: pass vga_get_uninterruptible() errors to userspace
Date: Tue, 24 Mar 2026 14:37:48 -0500	[thread overview]
Message-ID: <20260324193748.GA1149226@bhelgaas> (raw)
In-Reply-To: <20260307173538.763188-2-Simon.Richter@hogyros.de>

On Sun, Mar 08, 2026 at 02:35:34AM +0900, Simon Richter wrote:
> If VGA routing cannot be established, vga_get_uninterruptible() returns an
> error and does not increment the lock count. Pass the error on, and don't
> call vga_put() when userspace closes the handle.

I applied this, but I'm a little confused about the "don't call
vga_put() when userspace closes the handle" part.  Does that happen in
this patch and I'm just missing it?  This patch changes the "lock"
case, and the only vga_put() call I see is in the "unlock" case.

> Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
> ---
>  drivers/pci/vgaarb.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index d9383bf541e7..22b2b6ebdefd 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -1134,6 +1134,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
>  	char kbuf[64], *curr_pos;
>  	size_t remaining = count;
>  
> +	int err;
>  	int ret_val;
>  	int i;
>  
> @@ -1165,7 +1166,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
>  			goto done;
>  		}
>  
> -		vga_get_uninterruptible(pdev, io_state);
> +		err = vga_get_uninterruptible(pdev, io_state);
> +		if (err) {
> +			ret_val = err;
> +			goto done;
> +		}
>  
>  		/* Update the client's locks lists */
>  		for (i = 0; i < MAX_USER_CARDS; i++) {
> -- 
> 2.47.3
> 

  reply	other threads:[~2026-03-24 19:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-07 17:35 [PATCH v3 0/5] Bridges without VGA support Simon Richter
2026-03-07 17:35 ` [PATCH v3 1/5] vgaarb: pass vga_get_uninterruptible() errors to userspace Simon Richter
2026-03-24 19:37   ` Bjorn Helgaas [this message]
2026-03-25  6:52     ` Simon Richter
2026-03-25 18:29       ` Bjorn Helgaas
2026-03-07 17:35 ` [PATCH v3 2/5] vgaarb: pass errors from pci_set_vga_state() up Simon Richter
2026-03-10 11:37   ` Ville Syrjälä
2026-03-07 17:35 ` [PATCH v3 3/5] vgaarb: mark vga_get() and wrappers as __must_check Simon Richter
2026-03-10 20:07   ` Bjorn Helgaas
2026-03-11 22:51     ` Simon Richter
2026-03-11 23:14       ` Bjorn Helgaas
2026-03-11 23:29         ` Simon Richter
2026-03-07 17:35 ` [PATCH v3 4/5] pci: check if VGA decoding was really activated Simon Richter
2026-03-10 11:37   ` Ville Syrjälä
2026-03-10 14:08     ` Simon Richter
2026-03-10 15:19       ` Ville Syrjälä
2026-03-10 20:22   ` Bjorn Helgaas
2026-03-11  7:07     ` Simon Richter
2026-03-07 17:35 ` [PATCH v3 5/5] pci: mark pci_set_vga_state() as __must_check Simon Richter
2026-03-10 19:36   ` Bjorn Helgaas
2026-03-11 23:23     ` Simon Richter
2026-03-07 17:41 ` ✗ CI.checkpatch: warning for bridges without VGA support (rev2) Patchwork
2026-03-07 17:43 ` ✓ CI.KUnit: success " Patchwork
2026-03-24 19:34 ` [PATCH v3 0/5] Bridges without VGA support Bjorn Helgaas

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=20260324193748.GA1149226@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Simon.Richter@hogyros.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-pci@vger.kernel.org \
    /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