[USBEHCI]

- Initialize the new queue head before inserting it into the asynchronous schedule list, and add a memory barrier to ensure this order. The list can be read by the host controller at any time, so the new item must be valid when inserted. See EHCI spec section 4.8.1.

svn path=/trunk/; revision=63686
This commit is contained in:
Thomas Faber 2014-07-05 15:30:22 +00:00
parent 3166e6a066
commit a2e82498a2

View file

@ -478,14 +478,6 @@ CUSBQueue::LinkQueueHead(
//ASSERT(IsListEmpty(&HeadQueueHead->LinkedQueueHeads));
InsertTailList(&HeadQueueHead->LinkedQueueHeads, &NewQueueHead->LinkedQueueHeads);
//
// Update HLP for Previous QueueHead, which should be the last in list.
//
Entry = NewQueueHead->LinkedQueueHeads.Blink;
LastQueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
//ASSERT(LastQueueHead == HeadQueueHead);
LastQueueHead->HorizontalLinkPointer = (NewQueueHead->PhysicalAddr | QH_TYPE_QH);
//
// Update HLP for NewQueueHead to point to next, which should be the HeadQueueHead
//
@ -494,6 +486,16 @@ CUSBQueue::LinkQueueHead(
//ASSERT(NextQueueHead == HeadQueueHead);
NewQueueHead->HorizontalLinkPointer = (NextQueueHead->PhysicalAddr | QH_TYPE_QH);
_ReadWriteBarrier();
//
// Update HLP for Previous QueueHead, which should be the last in list.
//
Entry = NewQueueHead->LinkedQueueHeads.Blink;
LastQueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
//ASSERT(LastQueueHead == HeadQueueHead);
LastQueueHead->HorizontalLinkPointer = (NewQueueHead->PhysicalAddr | QH_TYPE_QH);
//
// head queue head must be halted
//