Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "usb: gadget: uvc: rework pump worker to avoid while loop"

This reverts commit bb00788bd62778ef80a97d67a0e3c569ac6be06f.

Based on review comments, it was applied too soon and needs more work.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20231005081716.GA13853@pendragon.ideasonboard.com
Cc: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+6 -14
+6 -14
drivers/usb/gadget/function/uvc_video.c
··· 397 397 bool buf_done; 398 398 int ret; 399 399 400 - if (video->ep->enabled && uvc->state == UVC_STATE_STREAMING) { 400 + while (video->ep->enabled && uvc->state == UVC_STATE_STREAMING) { 401 401 /* 402 402 * Retrieve the first available USB request, protected by the 403 403 * request lock. ··· 409 409 } 410 410 req = list_first_entry(&video->req_free, struct usb_request, 411 411 list); 412 - if (!req) { 413 - spin_unlock_irqrestore(&video->req_lock, flags); 414 - return; 415 - } 416 - 417 412 list_del(&req->list); 418 413 spin_unlock_irqrestore(&video->req_lock, flags); 419 414 ··· 437 442 * further. 438 443 */ 439 444 spin_unlock_irqrestore(&queue->irqlock, flags); 440 - goto out; 445 + break; 441 446 } 442 447 443 448 /* ··· 470 475 /* Queue the USB request */ 471 476 ret = uvcg_video_ep_queue(video, req); 472 477 spin_unlock_irqrestore(&queue->irqlock, flags); 478 + 473 479 if (ret < 0) { 474 480 uvcg_queue_cancel(queue, 0); 475 - goto out; 481 + break; 476 482 } 477 483 478 484 /* Endpoint now owns the request */ 479 485 req = NULL; 480 486 video->req_int_count++; 481 - } else { 482 - return; 483 487 } 484 488 485 - if (uvc->state == UVC_STATE_STREAMING) 486 - queue_work(video->async_wq, &video->pump); 489 + if (!req) 490 + return; 487 491 488 - return; 489 - out: 490 492 spin_lock_irqsave(&video->req_lock, flags); 491 493 list_add_tail(&req->list, &video->req_free); 492 494 spin_unlock_irqrestore(&video->req_lock, flags);