Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3af9e40c authored by Andrew Chant's avatar Andrew Chant
Browse files

usblib: fix race & delay waiting for perms on open

in usb_device_open, if permission is denied for a USB
device node, the current code retries read-only, then sleeps
for a second before retrying.

If the permission was changed to +rw between the two file opens,
the device could be inadvertently opened read-only.

Also, change the polling interval to 100ms.  1s is a long wait
for a function on the critical path of a user interaction.

Bug: 68337205
Bug: 68782236

Test: with debug messages enabled, connected & disconnected
a USB audio headset.  Saw the writeable file descriptor
returned.

Change-Id: I06048cc2c09bf6ed1abada5d12b5559be768fbaf
parent dbef1eeb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment