VirtualBox

Changeset 87971 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 5, 2021 2:31:15 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143079
Message:

OHCI: Clear list enable bits on reset in order to get out of work loops faster.

File:
1 edited

Legend:

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

    r87773 r87971  
    12431243    Log(("ohci: %s reset%s\n", fNewMode == OHCI_USB_RESET ? "hardware" : "software",
    12441244         fResetOnLinux ? " (reset on linux)" : ""));
     1245
     1246    /* Clear list enable bits first, so that any processing currently in progress terminates quickly. */
     1247    pThis->ctl &= ~(OHCI_CTL_BLE | OHCI_CTL_CLE | OHCI_CTL_PLE);
    12451248
    12461249    /* Stop the bus in any case, disabling walking the lists. */
     
    37303733
    37313734    uint32_t EdAddr = pThis->bulk_head;
    3732     while (EdAddr)
     3735    while (EdAddr && (pThis->ctl & OHCI_CTL_BLE))
    37333736    {
    37343737        OHCIED Ed;
     
    37973800        }
    37983801
    3799         /* next end point */
     3802        /* Trivial loop detection. */
     3803        if (EdAddr == (Ed.NextED & ED_PTR_MASK))
     3804            break;
     3805        /* Proceed to the next endpoint. */
    38003806        EdAddr = Ed.NextED & ED_PTR_MASK;
    3801 
    38023807    }
    38033808
     
    38473852            }
    38483853        }
    3849         /* next endpoint */
     3854
     3855        /* Trivial loop detection. */
     3856        if (EdAddr == (Ed.NextED & ED_PTR_MASK))
     3857            break;
     3858        /* Proceed to the next endpoint. */
    38503859        EdAddr = Ed.NextED & ED_PTR_MASK;
    38513860    }
     
    38773886
    38783887    uint32_t EdAddr = pThis->ctrl_head;
    3879     while (EdAddr)
     3888    while (EdAddr && (pThis->ctl & OHCI_CTL_CLE))
    38803889    {
    38813890        OHCIED Ed;
     
    39133922        }
    39143923
    3915         /* next end point */
     3924        /* Trivial loop detection. */
     3925        if (EdAddr == (Ed.NextED & ED_PTR_MASK))
     3926            break;
     3927        /* Proceed to the next endpoint. */
    39163928        EdAddr = Ed.NextED & ED_PTR_MASK;
    39173929    }
     
    39533965     * Iterate the endpoint list.
    39543966     */
    3955     while (EdAddr)
     3967    while (EdAddr && (pThis->ctl & OHCI_CTL_PLE))
    39563968    {
    39573969        OHCIED Ed;
     
    40004012            }
    40014013        }
    4002         /* next end point */
     4014        /* Trivial loop detection. */
     4015        if (EdAddr == (Ed.NextED & ED_PTR_MASK))
     4016            break;
     4017        /* Proceed to the next endpoint. */
    40034018        EdAddr = Ed.NextED & ED_PTR_MASK;
    40044019    }
     
    41594174                } while (TdAddr != (Ed.TailP & ED_PTR_MASK));
    41604175            }
     4176            /* Trivial loop detection. */
     4177            if (EdAddr == (Ed.NextED & ED_PTR_MASK))
     4178                break;
     4179            /* Proceed to the next endpoint. */
    41614180            EdAddr = Ed.NextED & ED_PTR_MASK;
    41624181        }
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