summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-03-02 17:33:15 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-03-03 15:49:15 +0800
commitcd626ef0fbc93d22c01245d3cdc55ddcfb85d7cd (patch)
tree580f8e19aa02c0bf8a4c339a9e7d677b8210079f /MdeModulePkg
parente149055310f418c9655bd6e03b888fd22a2874a6 (diff)
downloadedk2-cd626ef0fbc93d22c01245d3cdc55ddcfb85d7cd.zip
edk2-cd626ef0fbc93d22c01245d3cdc55ddcfb85d7cd.tar.gz
edk2-cd626ef0fbc93d22c01245d3cdc55ddcfb85d7cd.tar.bz2
MdeModulePkg/UsbMass: remove unnecessary RestoreTPL() call
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
index d212960..dd4b3a5 100644
--- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
+++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
@@ -691,7 +691,6 @@ UsbBootDetectMedia (
EFI_BLOCK_IO_MEDIA OldMedia;
EFI_BLOCK_IO_MEDIA *Media;
UINT8 CmdSet;
- EFI_TPL OldTpl;
EFI_STATUS Status;
Media = &UsbMass->BlockIoMedia;
@@ -740,11 +739,10 @@ ON_ERROR:
(Media->LastBlock != OldMedia.LastBlock)) {
//
- // This function is called by Block I/O Protocol APIs, which run at TPL_NOTIFY.
- // Here we temporarily restore TPL to TPL_CALLBACK to invoke ReinstallProtocolInterface().
- //
- OldTpl = EfiGetCurrentTpl ();
- gBS->RestoreTPL (TPL_CALLBACK);
+ // This function is called from:
+ // Block I/O Protocol APIs, which run at TPL_CALLBACK.
+ // DriverBindingStart(), which raises to TPL_CALLBACK.
+ ASSERT (EfiGetCurrentTpl () == TPL_CALLBACK);
gBS->ReinstallProtocolInterface (
UsbMass->Controller,
@@ -753,9 +751,6 @@ ON_ERROR:
&UsbMass->BlockIo
);
- ASSERT (EfiGetCurrentTpl () == TPL_CALLBACK);
- gBS->RaiseTPL (OldTpl);
-
//
// Update MediaId after reinstalling Block I/O Protocol.
//