Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174089902
D58668.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1007 B
Referenced Files
None
Subscribers
None
D58668.diff
View Options
diff --git a/sys/dev/ufshci/ufshci_req_sdb.c b/sys/dev/ufshci/ufshci_req_sdb.c
--- a/sys/dev/ufshci/ufshci_req_sdb.c
+++ b/sys/dev/ufshci/ufshci_req_sdb.c
@@ -584,16 +584,23 @@
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
for (slot = 0; slot < req_queue->num_entries; slot++) {
+ bool completed;
+
tr = hwq->act_tr[slot];
KASSERT(tr, ("there is no tracker assigned to the slot"));
/*
* When the response is delivered from the device, the doorbell
- * is cleared.
+ * is cleared. Check it under qlock so that a slot whose
+ * doorbell write is still in flight in the submit path is not
+ * mistaken for a completed one.
*/
- if (tr->slot_state == UFSHCI_SLOT_STATE_SCHEDULED &&
+ mtx_lock(&hwq->qlock);
+ completed = tr->slot_state == UFSHCI_SLOT_STATE_SCHEDULED &&
req_queue->qops.is_doorbell_cleared(req_queue->ctrlr,
- slot)) {
+ slot);
+ mtx_unlock(&hwq->qlock);
+ if (completed) {
ufshci_req_queue_complete_tracker(tr);
done = true;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 1, 1:29 PM (14 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36101288
Default Alt Text
D58668.diff (1007 B)
Attached To
Mode
D58668: ufshci: check completions under the queue lock
Attached
Detach File
Event Timeline
Log In to Comment