lx_emul usb: handle RPC calls after async-URBS

Prevent missing new RPC calls handed over to a Linux task
of a corresponding usb-device, while that task blocked
during enqueuing of asynchronous URBs.

Fixed genodelabs/genode#4955
This commit is contained in:
Stefan Kalkowski 2023-07-06 15:40:44 +02:00 committed by Norman Feske
parent 62a0605cf0
commit cccb763737

View File

@ -691,6 +691,15 @@ static int poll_usb_device(void * args)
handle_rpc(data);
while (check_for_urb(data->dev)) ;
while (check_for_urb_done(&data->file)) ;
/*
* we have to check for RPC handling once again,
* during asynchronous URB handling the Linux task might
* have been blocked and a new RPC entered the entrypoint
*/
handle_rpc(data);
/* check if device got removed */
if (!data->dev) {
struct usb_device * udev = find_usb_device(bus, dev);
release_device(data, udev ? 1 : 0);