VirtualBox

Changeset 106281 in vbox


Ignore:
Timestamp:
Oct 10, 2024 9:16:39 AM (3 months ago)
Author:
vboxsync
Message:

DevOHCI: Quick fix for deadlock when pfnAbortEpByAddr is called. Ran into it while windows 2000 was shutting down (almost finished, screen all blue, but never powering off). There is a question whether we should re-reade the endpoint descriptor after regaining the lock, but the guest is free to change it regardless of whether we're holding the lock or not, so I guess it makes little difference.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r106061 r106281  
    38883888                if (enmDir != VUSBDIRECTION_INVALID)
    38893889                {
     3890                    /* Must leave the lock here, see ohciR3ServicePeriodicList for details. */
     3891                    ohciR3Unlock(pThisCC);
    38903892                    pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
     3893                    ohciR3Lock(pThisCC);
     3894                    /** @todo should we re-read Ed here? */
    38913895                }
    38923896            }
     
    39483952               if (enmDir != VUSBDIRECTION_INVALID)
    39493953               {
     3954                   /* Must leave the lock here, see ohciR3ServicePeriodicList for details. */
     3955                   ohciR3Unlock(pThisCC);
    39503956                   pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
     3957                   ohciR3Lock(pThisCC);
     3958                   /** @todo should we re-read Ed here? */
    39513959               }
    39523960            }
     
    41124120                 * cancel outstanding URBs, if any.
    41134121                 * First we need to determine the transfer direction, which may fail(!).
     4122                 *
     4123                 * Note! We *must* leave the critsect before calling the abort function as
     4124                 *       it typically wants to send synchronous requests to the URB IO thread
     4125                 *       which will enter the critsect when responding.  ohciR3StartFrame
     4126                 *       entered the critsect and I (bird) can't immediately spot any cached
     4127                 *       state info that could get obsoleted while we're doing this (except
     4128                 *       some logging stuff).
    41144129                 */
    41154130                uint8_t uAddr  = Ed.hwinfo & ED_HWINFO_FUNCTION;
     
    41184133                if (enmDir != VUSBDIRECTION_INVALID)
    41194134                {
     4135                    ohciR3Unlock(pThisCC);
    41204136                    pThisCC->RootHub.pIRhConn->pfnAbortEpByAddr(pThisCC->RootHub.pIRhConn, uAddr, uEndPt, enmDir);
     4137                    ohciR3Lock(pThisCC);
     4138                    /** @todo should we re-read Ed here? */
    41214139                }
    41224140            }
Note: See TracChangeset for help on using the changeset viewer.

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