Page MenuHomeFreeBSD

bhyve: usb: add a finer-grained mutex for the event thread
AcceptedPublic

Authored by kevans on Fri, Sep 18, 1:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 13, 5:37 AM
Unknown Object (File)
Mon, Oct 12, 6:26 PM
Unknown Object (File)
Mon, Oct 12, 3:04 PM
Unknown Object (File)
Mon, Oct 12, 1:20 PM
Unknown Object (File)
Sun, Oct 11, 10:01 PM
Unknown Object (File)
Sun, Oct 11, 6:33 PM
Unknown Object (File)
Sun, Oct 11, 10:18 AM
Unknown Object (File)
Sat, Oct 10, 6:24 AM

Details

Reviewers
markj
bnovkov
aokblast
Group Reviewers
bhyve
Summary

Nothing today will serialize er_enq_idx / er_events_cnt updates against
the ERDP handler recalculations. This isn't strictly a problem until
we add support for a USB passthru device (which adds another thread for
handling libusb events), but pushing it in advance makes the meatier
bits of passthru more reviewable.

Sponsored by: The FreeBSD Foundation (aokblast)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77069
Build 73952: arc lint + arc unit

Event Timeline

Seems ok, but pci_xhci_reset() resets the event fields as well. Is there a reason not to use this mutex to synchronize with those events too?

usr.sbin/bhyve/pci_xhci.c
2186

The high bits case above does touch those fields though.

kevans marked an inline comment as done.

Extend locking to ERSTBA handling and pci_xhci_reset()

This revision is now accepted and ready to land.Fri, Sep 18, 8:39 PM
bnovkov added a subscriber: bnovkov.
bnovkov added inline comments.
usr.sbin/bhyve/pci_xhci.c
268–276

Small nit.