MdeModulePkg/NvmExpressDxe: Fix wrong queue size for async IO queues
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2118 When a packet is queued/completed for the asynchronous IO queue, the logic to roll over to the front of the queue doesn't account for actual size of the IO Submission/Completion queue. This causes a device to hang due to doorbell being outside of visible queue. An example would be if an NVMe drive only supported a queue size of 128 while the driver supports 256. Cc: Jian J Wang <jian.j.wang@intel.com> Signed-off-by: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Hao A Wu <hao.a.wu@intel.com> Acked-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
0b9ad0bc03
commit
7607174192
@@ -672,7 +672,7 @@ ProcessAsyncTaskList (
|
||||
}
|
||||
|
||||
Private->CqHdbl[QueueId].Cqh++;
|
||||
if (Private->CqHdbl[QueueId].Cqh > NVME_ASYNC_CCQ_SIZE) {
|
||||
if (Private->CqHdbl[QueueId].Cqh > MIN (NVME_ASYNC_CCQ_SIZE, Private->Cap.Mqes)) {
|
||||
Private->CqHdbl[QueueId].Cqh = 0;
|
||||
Private->Pt[QueueId] ^= 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user