X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbBusDxe%2FUsbEnumer.c;h=6b46e5c3ce4548ef91f249a29b394e9f3d31a015;hp=65eb2dd77ffa547a57f3381e3ab15083f6b5e843;hb=ecb575d9e65c9d52c17866eebba5f798f178effe;hpb=be0187bbbad2039b83b15aebf9352de27a9d3c00 diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index 65eb2dd77f..6b46e5c3ce 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -288,18 +288,24 @@ UsbConnectDriver ( // twisted TPL used. It should be no problem for us to connect // or disconnect at CALLBACK. // - OldTpl = UsbGetCurrentTpl (); - DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", OldTpl)); + + // + // Only recursively wanted usb child device + // + if (UsbBusIsWantedUsbIO (UsbIf->Device->Bus, UsbIf)) { + OldTpl = UsbGetCurrentTpl (); + DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", OldTpl)); - gBS->RestoreTPL (TPL_CALLBACK); + gBS->RestoreTPL (TPL_CALLBACK); - Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); - UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); + Status = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE); + UsbIf->IsManaged = (BOOLEAN)!EFI_ERROR (Status); - DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", UsbGetCurrentTpl())); - ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK); + DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", UsbGetCurrentTpl())); + ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK); - gBS->RaiseTPL (OldTpl); + gBS->RaiseTPL (OldTpl); + } } return Status;