diff options
author | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-05 05:21:38 +0000 |
---|---|---|
committer | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-05 05:21:38 +0000 |
commit | 15cc67e616cad2dad3d3b6f9ba1cba856b5de414 (patch) | |
tree | 66fac7dfc66e6fa93ad43b5e67f51a6f86ae8982 /MdeModulePkg/Bus | |
parent | b9d5a7f1dc0079ad269bfdcde28cd958b50cf4ed (diff) | |
download | edk2-platforms-15cc67e616cad2dad3d3b6f9ba1cba856b5de414.tar.xz |
raise TPL to TPL_CALLBACK level at DriverBindingStart() for all usb-related modules, which prevent DriverBindingStop() from being invoked when DriverBindingStart() runs.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10460 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
4 files changed, 31 insertions, 7 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c index 2733d562d7..278c2da19a 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c @@ -154,7 +154,9 @@ USBKeyboardDriverBindingStart ( UINT8 PollingInterval;
UINT8 PacketSize;
BOOLEAN Found;
+ EFI_TPL OldTpl;
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Open USB I/O Protocol
//
@@ -167,7 +169,7 @@ USBKeyboardDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto ErrorExit1;
}
UsbKeyboardDevice = AllocateZeroPool (sizeof (USB_KB_DEV));
@@ -381,6 +383,7 @@ USBKeyboardDriverBindingStart ( FALSE
);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
//
@@ -407,6 +410,10 @@ ErrorExit: This->DriverBindingHandle,
Controller
);
+
+ErrorExit1:
+ gBS->RestoreTPL (OldTpl);
+
return Status;
}
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c index 9137075d86..f440e9fd7c 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c @@ -833,7 +833,10 @@ USBMassDriverBindingStart ( UINT8 MaxLun;
EFI_STATUS Status;
EFI_USB_IO_PROTOCOL *UsbIo;
-
+ EFI_TPL OldTpl;
+
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+
Transport = NULL;
Context = NULL;
MaxLun = 0;
@@ -842,7 +845,7 @@ USBMassDriverBindingStart ( if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitTransport (%r)\n", Status));
- return Status;
+ goto Exit;
}
if (MaxLun == 0) {
//
@@ -867,7 +870,7 @@ USBMassDriverBindingStart ( if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: OpenDevicePathProtocol By Driver (%r)\n", Status));
- return Status;
+ goto Exit;
}
Status = gBS->OpenProtocol (
@@ -887,7 +890,7 @@ USBMassDriverBindingStart ( This->DriverBindingHandle,
Controller
);
- return Status;
+ goto Exit;
}
//
@@ -911,6 +914,8 @@ USBMassDriverBindingStart ( DEBUG ((EFI_D_ERROR, "USBMassDriverBindingStart: UsbMassInitMultiLun (%r) with Maxlun=%d\n", Status, MaxLun));
}
}
+Exit:
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c index 35be8b0397..2f3cf9aae2 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c @@ -149,7 +149,9 @@ USBMouseAbsolutePointerDriverBindingStart ( UINT8 PollingInterval;
UINT8 PacketSize;
BOOLEAN Found;
+ EFI_TPL OldTpl;
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Open USB I/O Protocol
//
@@ -162,7 +164,7 @@ USBMouseAbsolutePointerDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto ErrorExit1;
}
UsbMouseAbsolutePointerDevice = AllocateZeroPool (sizeof (USB_MOUSE_ABSOLUTE_POINTER_DEV));
@@ -324,6 +326,7 @@ USBMouseAbsolutePointerDriverBindingStart ( FALSE
);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
//
@@ -348,6 +351,9 @@ ErrorExit: }
}
+ErrorExit1:
+ gBS->RestoreTPL (OldTpl);
+
return Status;
}
diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c index 8b8a21eae8..f51dbfa1cf 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c @@ -149,7 +149,9 @@ USBMouseDriverBindingStart ( UINT8 PollingInterval;
UINT8 PacketSize;
BOOLEAN Found;
+ EFI_TPL OldTpl;
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Open USB I/O Protocol
//
@@ -162,7 +164,7 @@ USBMouseDriverBindingStart ( EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
- return Status;
+ goto ErrorExit1;
}
UsbMouseDevice = AllocateZeroPool (sizeof (USB_MOUSE_DEV));
@@ -324,6 +326,8 @@ USBMouseDriverBindingStart ( FALSE
);
+ gBS->RestoreTPL (OldTpl);
+
return EFI_SUCCESS;
//
@@ -348,6 +352,8 @@ ErrorExit: }
}
+ErrorExit1:
+ gBS->RestoreTPL (OldTpl);
return Status;
}
|