HI Hao Wu:
This exception is executed
Therefore, the modifications provided may not be applicable. Resetting a Root Hub Port cause the exception.
Although the probability is not high.So I think it still needs to be placed after the Root Hub prot reset.
//
// 4.3.1 Resetting a Root Hub Port
// 1) Write the PORTSC register with the Port Reset (PR) bit set to '1'.
//
State |= XHC_PORTSC_RESET;
XhcWriteOpReg (Xhc, Offset, State);
XhcWaitOpRegBit (Xhc, Offset, XHC_PORTSC_PRC, TRUE, XHC_GENERIC_TIMEOUT);
if ((((State & 0x1e0) >> 5) == 6) && ((State & 3) == 0)) {
//
// Usb 3.2 spec 7.5.2
// When the USB state machine is Inactive state, the device is abnormal.
// eSS.Inactive is a state where a link has failed Enhanced SuperSpeed operation.Software
// is required for warm reset intervention.This flag only applies to USB3 protocol ports.
//
State |= 0x80000000;
XhcWriteOpReg (Xhc, Offset, State);
XhcWaitOpRegBit (Xhc, Offset, XHC_PORTSC_PRC, TRUE, XHC_GENERIC_TIMEOUT);
DEBUG ((DEBUG_INFO, "Warm Reset Successful! \n"));
}
break;
Best Regards
Thanks!