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
This commit is contained in:
erictian 2010-05-05 05:21:38 +00:00
parent b9d5a7f1dc
commit 15cc67e616
6 changed files with 45 additions and 12 deletions
MdeModulePkg
Bus/Usb
UsbKbDxe
UsbMassStorageDxe
UsbMouseAbsolutePointerDxe
UsbMouseDxe
Universal/Disk
DiskIoDxe
PartitionDxe

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -125,7 +125,9 @@ DiskIoDriverBindingStart (
{
EFI_STATUS Status;
DISK_IO_PRIVATE_DATA *Private;
EFI_TPL OldTpl;
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Private = NULL;
//
@ -140,7 +142,7 @@ DiskIoDriverBindingStart (
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
return Status;
goto ErrorExit1;
}
//
@ -177,6 +179,8 @@ ErrorExit:
);
}
ErrorExit1:
gBS->RestoreTPL (OldTpl);
return Status;
}

@ -194,7 +194,9 @@ PartitionDriverBindingStart (
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
PARTITION_DETECT_ROUTINE *Routine;
BOOLEAN MediaPresent;
EFI_TPL OldTpl;
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Check RemainingDevicePath validation
//
@ -204,7 +206,8 @@ PartitionDriverBindingStart (
// if yes, return EFI_SUCCESS
//
if (IsDevicePathEnd (RemainingDevicePath)) {
return EFI_SUCCESS;
Status = EFI_SUCCESS;
goto Exit;
}
}
@ -217,7 +220,7 @@ PartitionDriverBindingStart (
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
return Status;
goto Exit;
}
//
// Get the Device Path Protocol on ControllerHandle's handle
@ -231,7 +234,7 @@ PartitionDriverBindingStart (
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
return Status;
goto Exit;
}
Status = gBS->OpenProtocol (
@ -249,7 +252,7 @@ PartitionDriverBindingStart (
This->DriverBindingHandle,
ControllerHandle
);
return Status;
goto Exit;
}
OpenStatus = Status;
@ -312,6 +315,8 @@ PartitionDriverBindingStart (
);
}
Exit:
gBS->RestoreTPL (OldTpl);
return Status;
}