Changeset 43399 in vbox
- Timestamp:
- Sep 21, 2012 2:05:51 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80882
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r43397 r43399 5606 5606 * and notifying the guest. 5607 5607 * 5608 * @returns VBox status code5608 * @returns Flag whether the given request was canceled inbetween; 5609 5609 * 5610 5610 * @param pAhciPort Pointer to the port where to request completed. … … 5613 5613 * @param fFreeReq Flag whether to free the request if it was canceled. 5614 5614 */ 5615 static intahciTransferComplete(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, int rcReq, bool fFreeReq)5615 static bool ahciTransferComplete(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, int rcReq, bool fFreeReq) 5616 5616 { 5617 5617 bool fXchg = false; 5618 5618 bool fRedo = false; 5619 bool fCanceled = false; 5619 5620 uint64_t tsNow = RTTimeMilliTS(); 5620 5621 … … 5770 5771 ("Task is not active but wasn't canceled!\n")); 5771 5772 5773 fCanceled = true; 5774 ASMAtomicXchgSize(&pAhciReq->enmTxState, AHCITXSTATE_FREE); 5775 5772 5776 if (pAhciReq->enmTxDir == AHCITXDIR_TRIM) 5773 5777 ahciTrimRangesDestroy(pAhciReq); … … 5780 5784 if (pAhciReq->enmTxDir == AHCITXDIR_FLUSH) 5781 5785 LogRel(("AHCI#%u: Canceled flush returned rc=%Rrc\n", 5786 pAhciPort->iLUN, rcReq)); 5787 else if (pAhciReq->enmTxDir == AHCITXDIR_TRIM) 5788 LogRel(("AHCI#%u: Canceled trim returned rc=%Rrc\n", 5782 5789 pAhciPort->iLUN, rcReq)); 5783 5790 else … … 5796 5803 } 5797 5804 5798 return VINF_SUCCESS;5805 return fCanceled; 5799 5806 } 5800 5807 … … 6432 6439 && RT_LIKELY(!pAhciPort->fPortReset)) 6433 6440 { 6441 bool fReqCanceled = false; 6434 6442 AHCITXDIR enmTxDir; 6435 6443 … … 6450 6458 /* Set current command slot */ 6451 6459 ASMAtomicWriteU32(&pAhciPort->u32CurrentCommandSlot, pAhciReq->uTag); 6460 pAhciPort->aCachedTasks[0] = pAhciReq; /* Make cancelling the request possible. */ 6452 6461 6453 6462 /* Mark the task as processed by the HBA if this is a queued task so that it doesn't occur in the CI register anymore. */ … … 6547 6556 } 6548 6557 6549 ahciTransferComplete(pAhciPort, pAhciReq, rc, false /* fFreeReq */);6558 fReqCanceled = ahciTransferComplete(pAhciPort, pAhciReq, rc, false /* fFreeReq */); 6550 6559 uIORequestsProcessed++; 6551 6560 STAM_PROFILE_STOP(&pAhciPort->StatProfileProcessTime, a); … … 6563 6572 #endif 6564 6573 } 6574 6575 /* 6576 * Don't process other requests if the last one was canceled, 6577 * the others are not valid anymore. 6578 */ 6579 if (fReqCanceled) 6580 break; 6565 6581 fTasksToProcess &= ~(1 << idx); 6566 6582 idx = ASMBitFirstSetU32(fTasksToProcess);
Note:
See TracChangeset
for help on using the changeset viewer.