Page MenuHomeFreeBSD

ufshci: check completions under the queue lock
ClosedPublic

Authored by jaeyoon on Aug 5 2026, 8:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 15, 1:08 AM
Unknown Object (File)
Tue, Oct 13, 2:30 AM
Unknown Object (File)
Mon, Oct 12, 9:14 PM
Unknown Object (File)
Mon, Oct 12, 9:07 PM
Unknown Object (File)
Mon, Oct 12, 8:40 PM
Unknown Object (File)
Mon, Oct 12, 3:29 AM
Unknown Object (File)
Wed, Oct 7, 10:15 PM
Unknown Object (File)
Wed, Oct 7, 10:07 PM
Subscribers
None

Details

Summary

The completion scan held only the recovery lock. The submit path sets
a slot to SCHEDULED and then rings the doorbell, both under the queue
lock. A scan running between those two steps saw a SCHEDULED slot with
a clear doorbell and completed a command the device had not started.
The command failed with OCS 0xf, and a reused slot could return wrong
read data.

Check the slot state and the doorbell under the queue lock. The submit
path holds it across both steps, so a half-submitted slot can no
longer be seen. Found with fio randrw verify on QEMU.

Sponsored by: Samsung Electronics

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable