Page MenuHomeFreeBSD

ufshci: check completions under the queue lock
ClosedPublic

Authored by jaeyoon on Wed, Aug 5, 8:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 29, 3:07 PM
Unknown Object (File)
Sat, Aug 29, 3:03 PM
Unknown Object (File)
Fri, Aug 28, 12:03 AM
Unknown Object (File)
Mon, Aug 24, 8:23 PM
Unknown Object (File)
Sun, Aug 23, 10:12 PM
Unknown Object (File)
Sun, Aug 23, 11:06 AM
Unknown Object (File)
Sun, Aug 23, 11:01 AM
Unknown Object (File)
Wed, Aug 19, 7:43 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