Browse Source

[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 years ago
parent
commit
4f362a032b
1 changed files with 0 additions and 7 deletions
  1. 0
    7
      src/interface/efi/efi_driver.c

+ 0
- 7
src/interface/efi/efi_driver.c View File

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

Loading…
Cancel
Save