All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, sean@poorly.run, tiwai@suse.com,
	patrik.r.jakobsson@gmail.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, sashiko-reviews@lists.linux.dev,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 02/11] drm/udl: Do not use URB completion handler for error cleanup
Date: Thu, 19 Nov 2026 15:02:14 +0100	[thread overview]
Message-ID: <20261119142114.152052-3-tzimmermann@suse.de> (raw)
In-Reply-To: <20261119142114.152052-1-tzimmermann@suse.de>

Call udl_put_urb() to release an URB back into the URB cache. Replace
udl_urb_completion() in error-handling code.

The URB completion handler runs in interrupt context after the USB
subsystem has processed an URB. Do not call it from udl's error-handling
logic.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/udl/udl_drv.h      | 1 -
 drivers/gpu/drm/udl/udl_main.c     | 4 ++--
 drivers/gpu/drm/udl/udl_modeset.c  | 2 +-
 drivers/gpu/drm/udl/udl_transfer.c | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 9535e9c59950..68c5a5feb6f3 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -77,7 +77,6 @@ void udl_put_urb(struct urb *urb);
 
 int udl_submit_urb(struct udl_device *udl, struct urb *urb, size_t len);
 void udl_sync_pending_urbs(struct udl_device *udl);
-void udl_urb_completion(struct urb *urb);
 
 int udl_init(struct udl_device *udl);
 
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index 936fb6565bdb..77b0bc560422 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -147,7 +147,7 @@ int udl_select_std_channel(struct udl_device *udl)
 	return ret < 0 ? ret : 0;
 }
 
-void udl_urb_completion(struct urb *urb)
+static void udl_urb_completion(struct urb *urb)
 {
 	/* sync/async unlink faults aren't errors */
 	if (urb->status) {
@@ -312,7 +312,7 @@ int udl_submit_urb(struct udl_device *udl, struct urb *urb, size_t len)
 	ret = usb_submit_urb(urb, GFP_ATOMIC);
  error:
 	if (ret) {
-		udl_urb_completion(urb); /* because no one else will */
+		udl_put_urb(urb);
 		DRM_ERROR("usb_submit_urb error %x\n", ret);
 	}
 	return ret;
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index d8a617e2d2ea..bbba1dee8e4f 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -243,7 +243,7 @@ static int udl_handle_damage(struct drm_framebuffer *fb,
 		len = cmd - (char *)urb->transfer_buffer;
 		ret = udl_submit_urb(udl, urb, len);
 	} else {
-		udl_urb_completion(urb);
+		udl_put_urb(urb);
 	}
 
 	return 0;
diff --git a/drivers/gpu/drm/udl/udl_transfer.c b/drivers/gpu/drm/udl/udl_transfer.c
index 7d670b3a5293..de8e673d1efa 100644
--- a/drivers/gpu/drm/udl/udl_transfer.c
+++ b/drivers/gpu/drm/udl/udl_transfer.c
@@ -183,7 +183,7 @@ int udl_render_hline(struct udl_device *udl, int log_bpp, struct urb **urb_ptr,
 
 	if (WARN_ON(!(log_bpp == 1 || log_bpp == 2))) {
 		/* need to finish URB at error from this function */
-		udl_urb_completion(urb);
+		udl_put_urb(urb);
 		return -EINVAL;
 	}
 
-- 
2.56.0


  parent reply	other threads:[~2026-11-19 14:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 14:02 [PATCH 00/11] drm/udl: Rework URB allocation Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 01/11] drm/udl: Release URB in udl_put_urb() Thomas Zimmermann
2026-11-19 17:03   ` Jie Feng
2026-11-19 14:02 ` Thomas Zimmermann [this message]
2026-11-19 14:02 ` [PATCH 03/11] drm/udl: Store per-URB allocation length in struct urb_node Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 04/11] drm/udl: Allocate bulk URBs in helper functions Thomas Zimmermann
2026-11-19 16:38   ` Jie Feng
2026-11-20 12:49     ` Thomas Zimmermann
2026-11-20 16:15       ` Jie Feng
2026-11-19 14:02 ` [PATCH 05/11] drm/udl: Free " Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 06/11] drm/udl: Rework the error handling in udl_submit_urb() Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 07/11] drm/udl: Managed cleanup of URB cache Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 08/11] drm/udl: Track number of URBs in flight Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 09/11] drm/udl: Synchronize pending URBs on each frame Thomas Zimmermann
2026-11-20  6:50   ` Jie Feng
2026-11-20 12:52     ` Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 10/11] drm/udl: Allocate URBs on demand Thomas Zimmermann
2026-11-19 14:47   ` sashiko-bot
2026-11-19 18:05     ` Thomas Zimmermann
2026-11-20  6:54   ` Jie Feng
2026-11-20 13:01     ` Thomas Zimmermann
2026-11-19 14:02 ` [PATCH 11/11] drm/udl: Implement URB cache as LIFO stack 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=20261119142114.152052-3-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tiwai@suse.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 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.