usb_raw: acquire_sem with B_KILL_CAN_INTERRUPT.

This way, applications blocked in usb_raw can actually be killed,
instead of "hanging" until the USB device is removed or the
transfer finishes.

Improves a number of USB tickets, but does not really "fix"
any of the underlying problems that lead to this happening.
This commit is contained in:
Augustin Cavalier 2022-01-26 17:03:28 -05:00
parent e20a08d1c2
commit d7f7aadf98

View File

@ -730,7 +730,10 @@ usb_raw_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
break;
}
acquire_sem(device->notify);
status = acquire_sem_etc(device->notify, 1, B_KILL_CAN_INTERRUPT, 0);
if (status != B_OK)
return status;
command.control.status = device->status;
command.control.length = device->actual_length;
deviceLocker.Unlock();
@ -851,7 +854,10 @@ usb_raw_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
break;
}
acquire_sem(device->notify);
status = acquire_sem_etc(device->notify, 1, B_KILL_CAN_INTERRUPT, 0);
if (status != B_OK)
return status;
command.transfer.status = device->status;
command.transfer.length = device->actual_length;
deviceLocker.Unlock();