Page MenuHomeFreeBSD

ufshci: fix WLUN periph reference counting
ClosedPublic

Authored by jaeyoon on Wed, Aug 5, 8:00 AM.
Tags
None
Referenced Files
F170041927: D58658.diff
Thu, Sep 3, 8:24 AM
Unknown Object (File)
Tue, Sep 1, 8:23 PM
Unknown Object (File)
Tue, Sep 1, 7:08 PM
Unknown Object (File)
Tue, Sep 1, 4:26 PM
Unknown Object (File)
Tue, Sep 1, 3:41 PM
Unknown Object (File)
Tue, Sep 1, 2:02 PM
Unknown Object (File)
Sat, Aug 29, 4:08 PM
Unknown Object (File)
Sat, Aug 29, 4:04 PM
Subscribers
None

Details

Summary

The driver stored the WLUN periph pointer without holding a reference,
so the pointer went stale when the pass(4) device went away. In
addition, ufshci_sim_send_ssu() released a reference that it had never
acquired.

Define a simple ownership rule. ufshci_sim_find_periph() acquires the
periph and returns it. The cache owns one reference. The controller
destructor drops it with cam_periph_release() before taking the SIM
lock, since the release takes the CAM device lock by itself.
ufshci_sim_send_ssu() acquires its own reference and releases it when
done. Reuse the cached periph instead of searching again, so the old
reference is not leaked.

Sponsored by: Samsung Electronics

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75377
Build 72260: arc lint + arc unit