Переглянути джерело

[efi] Do not raise TPL within EFI_DRIVER_BINDING_PROTOCOL.Supported()

When booting some versions of the UEFI shell, our driver binding
protocol's Supported() entry point is called at TPL_NOTIFY for no
discernible reason.  Attempting to raise to TPL_CALLBACK triggers an
immediate assertion failure in the firmware.

Since our Supported() method can run at any TPL, fix by simply not
attempting to raise the TPL within this method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 роки тому
джерело
коміт
4f362a032b
1 змінених файлів з 0 додано та 7 видалено
  1. 0
    7
      src/interface/efi/efi_driver.c

+ 0
- 7
src/interface/efi/efi_driver.c Переглянути файл

@@ -95,9 +95,7 @@ struct efi_device * efidev_parent ( struct device *dev ) {
95 95
 static EFI_STATUS EFIAPI
96 96
 efi_driver_supported ( EFI_DRIVER_BINDING_PROTOCOL *driver __unused,
97 97
 		       EFI_HANDLE device, EFI_DEVICE_PATH_PROTOCOL *child ) {
98
-	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
99 98
 	struct efi_driver *efidrv;
100
-	EFI_TPL saved_tpl;
101 99
 	int rc;
102 100
 
103 101
 	DBGCP ( device, "EFIDRV %s DRIVER_SUPPORTED",
@@ -113,22 +111,17 @@ efi_driver_supported ( EFI_DRIVER_BINDING_PROTOCOL *driver __unused,
113 111
 		return EFI_ALREADY_STARTED;
114 112
 	}
115 113
 
116
-	/* Raise TPL */
117
-	saved_tpl = bs->RaiseTPL ( TPL_CALLBACK );
118
-
119 114
 	/* Look for a driver claiming to support this device */
120 115
 	for_each_table_entry ( efidrv, EFI_DRIVERS ) {
121 116
 		if ( ( rc = efidrv->supported ( device ) ) == 0 ) {
122 117
 			DBGC ( device, "EFIDRV %s has driver \"%s\"\n",
123 118
 			       efi_handle_name ( device ), efidrv->name );
124
-			bs->RestoreTPL ( saved_tpl );
125 119
 			return 0;
126 120
 		}
127 121
 	}
128 122
 	DBGCP ( device, "EFIDRV %s has no driver\n",
129 123
 		efi_handle_name ( device ) );
130 124
 
131
-	bs->RestoreTPL ( saved_tpl );
132 125
 	return EFI_UNSUPPORTED;
133 126
 }
134 127
 

Завантаження…
Відмінити
Зберегти