Re: OptionROM driver update failing in UEFI 2.4 but works on UEFI 2.3.1


Tomas Pilar (tpilar)
 

I wouldn't be surprised if this was caused by improper memory management on unload (I actually wrote this kind of Highlander Protocol for the sfc driver). This is what I would expect the driver to do:

0. If a newer driver exists in the system, the loading driver should just exit without doing anything.
1. If the current driver finds an older driver in the system, it should only call LoadedImage->Unload() on the image handle, nothing more.
2. The old driver should perform protocol uninstallation in its Unload() function - it should clean up after itself perfectly. (This is where most of the problems will likely lie)
3. The new driver can proceed with loading as normal.

This can and should be tested by taking each driver and repeatedly loading and unloading it (the same driver) in shell - you will likely catch a few bugs this way. Then you can add tests for two different versions interacting with each other.

Cheers,
Tom

Join {discuss@edk2.groups.io to automatically receive all group messages.