// For those devices behind hub, we get its attach/detach event by hooking Get_Port_Status request at control transfer for those hub.\r
//\r
ParentRouteChart.Dword = 0;\r
- XhcPollPortStatusChange (Xhc, ParentRouteChart, PortNumber, PortStatus);\r
+ Status = XhcPollPortStatusChange (Xhc, ParentRouteChart, PortNumber, PortStatus);\r
+\r
+ //\r
+ // Force resetting the port by clearing the USB_PORT_STAT_C_RESET bit in PortChangeStatus\r
+ // when XhcPollPortStatusChange fails\r
+ //\r
+ if (EFI_ERROR (Status)) {\r
+ PortStatus->PortChangeStatus &= ~(USB_PORT_STAT_C_RESET);\r
+ Status = EFI_SUCCESS;\r
+ }\r
\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r