[Bug 252165] usb network and mii bus media status race condition

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 13 Nov 2024 21:26:53 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252165

--- Comment #38 from Ali Abdallah <ali.abdallah@suse.com> ---
(In reply to Ali Abdallah from comment #37)
The patch in comment 37 could be a bit optimized, yes! 

The usb process/request code is completely broken when it comes to different
threads sharing ue_lock (ioctl versus uether tick), the usb request code
releases the acquired lock, making ioctl thread waiting for the same lock to be
scheduled for execution, lovely!

To be more precise.

ioctly waiting for ue_lock, which is acquired by ue_tick, but then the tick
code will call at some point usbd_do_request_flags, which will release the lock
at the beginning (and then acquire it later), but in the meantime we have our
"cute" ioctl thread waken-up only to report wrong media_status value!

-- 
You are receiving this mail because:
You are the assignee for the bug.