I am trying to get variable services hosted on a UFS device and running into TPL related issues. The variable and PCD code have locks that raise the TPL to NOTIFY prior to calling into the FVB instance and the UFS driver has a few raise tpl calls that increase the TPL to TPL_CALLBACK. This is causing a failure as you can’t do a RaiseTPL to CALLBACK when current TPL is NOTIFY.

 

The UEFI specification states that both BlockIO and Variable services should only be called at <= TPL_CALLBACK.

 

I see a couple options.

 

  1. Change the locks to TPL_CALLBACK which seems to keep things in line with the UEFI spec but may introduce race conditions if that higher lock was blocking things
  2. Change the raise tpl in the UFS driver to TPL_NOTIFY. This is how the eMMC driver is written.

 

I am leaning towards option 2 but wanted to get some feedback prior to pushing a patch.

 

Thanks,

Jeff