Re: [EXTERNAL] Re: [edk2-discuss] 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). These are the things that I would check:

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.


On Thu, Jul 30, 2020 at 1:23 PM Laszlo Ersek <lersek@...> wrote:


On 07/27/20 11:57, UdayS via wrote:
Hi All,
SW Revision updates to my Option Rom/Driver is handled properly during
the EntryPoint i.e., using component name to get the revision info and if
existing version is older than current, then
UninstallMultipleProtocolInterfaces and unloadImage.
This seem to work in UEFI 2.3.1 but when I test the same SW in UEFI 2.4
based system, it goes for a hang.
I have been banging my around this for last couple for days and now I am
in need of some expert advice.
All suggestions are welcome..
Andrew, do you recall changes related to driver dispatch between 2.3.1
and 2.4? Not necessarily in the spec, but maybe in edk2.


Join { to automatically receive all group messages.