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)
Wed, Oct 7, 5:07 PM
Unknown Object (File)
Tue, Oct 6, 8:11 PM
Unknown Object (File)
Tue, Oct 6, 1:28 AM
Unknown Object (File)
Sat, Oct 3, 8:42 AM
Unknown Object (File)
Sat, Oct 3, 1:52 AM
Unknown Object (File)
Fri, Oct 2, 6:54 PM
Unknown Object (File)
Thu, Oct 1, 8:47 AM
Unknown Object (File)
Wed, Sep 30, 6:22 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.