VirtualBox

Changeset 50031 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jan 8, 2014 12:06:11 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91489
Message:

AHCI: Fix race which can cause a hang during suspend

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r50018 r50031  
    446446    /** Flag whether this port is hot plug capable. */
    447447    bool                            fHotpluggable;
    448     /** Flag whether the I/O thread idles. */
    449     volatile bool                   fAsyncIOThreadIdle;
    450448    /** Flag whether the port is in redo task mode. */
    451449    volatile bool                   fRedo;
     
    65476545                 * Couldn't find anything in either the AHCI or SATA spec which
    65486546                 * indicates what should be done if the FIS is not read successfully.
    6549                  * The closes thing is in the state machine, stating that the device
     6547                 * The closest thing is in the state machine, stating that the device
    65506548                 * should go into idle state again (SATA spec 1.0 chapter 8.7.1).
    65516549                 * Do the same here and ignore any corrupt FIS types, after all
     
    67886786        pHlp->pfnPrintf(pHlp, "PortTasksFinished=%#x\n", pThisPort->u32TasksFinished);
    67896787        pHlp->pfnPrintf(pHlp, "PortQueuedTasksFinished=%#x\n", pThisPort->u32QueuedTasksFinished);
    6790         pHlp->pfnPrintf(pHlp, "PortAsyncIoThreadIdle=%RTbool\n", pThisPort->fAsyncIOThreadIdle);
    67916788        pHlp->pfnPrintf(pHlp, "\n");
    67926789    }
     
    68086805    PAHCI pThis = PDMINS_2_DATA(pDevIns, PAHCI);
    68096806
     6807    if (pThis->cThreadsActive)
     6808        return false;
     6809
    68106810    for (uint32_t i = 0; i < RT_ELEMENTS(pThis->ahciPort); i++)
    68116811    {
     
    68136813        if (pThisPort->pDrvBase)
    68146814        {
    6815             bool fFinished;
    6816             if (pThisPort->fAsyncInterface)
    6817                 fFinished = (pThisPort->cTasksActive == 0);
    6818             else
    6819                 fFinished = ((pThisPort->cTasksActive == 0) && (pThisPort->fAsyncIOThreadIdle));
    6820             if (!fFinished)
     6815            if (   (pThisPort->cTasksActive != 0)
     6816                || (pThisPort->u32TasksNew != 0))
    68216817               return false;
    68226818        }
     
    82228218        pAhciPort->IMountNotify.pfnMountNotify          = ahciR3MountNotify;
    82238219        pAhciPort->IMountNotify.pfnUnmountNotify        = ahciR3UnmountNotify;
    8224         pAhciPort->fAsyncIOThreadIdle                   = true;
    82258220
    82268221        /* Query per port configuration options if available. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette