public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeff Brasen" <jbrasen@nvidia.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: Re: Question on TPL in PCD/Variable code
Date: Thu, 2 Dec 2021 14:50:24 +0000	[thread overview]
Message-ID: <BY5PR12MB4132706A9FB52E344900400ACB699@BY5PR12MB4132.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BY5PR12MB4132E0C2AD01A8231CB71E7DCB699@BY5PR12MB4132.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 4707 bytes --]

           reply	other threads:[~2021-12-02 14:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <BY5PR12MB4132E0C2AD01A8231CB71E7DCB699@BY5PR12MB4132.namprd12.prod.outlook.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR12MB4132706A9FB52E344900400ACB699@BY5PR12MB4132.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox