Hi Experts,
     Now I meet a bad usb disk which may cause bios post hang. After tracing, I 
find it is dead loop in a while() condition.
     This usb disk's decriptor is as below, we could find that it reports it 
has 3 endpoints, but it only report one of them. And when usb core function 
sets config,  in function XhcInitializeEndpointContext(), usb core function 
will try to find all the endpoints, but it cannot meet the wanted type data to 
exit, so it dead loop there. I see in UDK revision 14863, file UsbDesc.c has 
been patched(MdeModulePkg/UsbBus: Stop parsing descriptor if some of descriptor 
fields are invalid).  
     So we should do more patch under this condition? 
     Waiting your suggestion.
     Thank you.
     
  
  
09 02 22 00 01 01 00 80 32    // CFG IFs=1
 
09 04 00 00 03 FF 01 01 00    // IF No=0 AS=0 EPs=3
 
09 21 10 01 21 01 22 43 00    // HID
 
07 05 81 03 08 00 02              // EP
 
 
 
    while (EpDesc->DescriptorType != USB_DESC_TYPE_ENDPOINT) {  // 
XhcInitializeEndpointContext(), line 2607
      EpDesc = (USB_ENDPOINT_DESCRIPTOR *)((UINTN)EpDesc + EpDesc->Length);
    }
 
 

  
  
  
  
  ------------------
  BR
 winddy_zhang
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to