public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: Andrei Warkentin <awarkentin@vmware.com>,
	Andrei Warkentin <andrey.warkentin@gmail.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "leif@nuviainc.com" <leif@nuviainc.com>,
	"pete@akeo.ie" <pete@akeo.ie>,
	"philmd@redhat.com" <philmd@redhat.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] Pi4: notify VPU to load xHCI firmware before XhciDxe binds
Date: Mon, 1 Jun 2020 11:44:03 +0200	[thread overview]
Message-ID: <33ce3c90-7675-19aa-c659-6f5d4d51c368@arm.com> (raw)
In-Reply-To: <BN6PR05MB341168A240AACAB7D4E40A44B98A0@BN6PR05MB3411.namprd05.prod.outlook.com>

On 6/1/20 11:37 AM, Andrei Warkentin wrote:
> Hi Ard,
> 
> The xHCI controller is initialized with its microcode by the VPU 
> firmware, if
> I understood correctly, synchronously. When RPI_MBOX_NOTIFY_XHCI_RESET 
> finishes, the XHCI controller is ready to go.
> 

I suppose there are no other agents that may consume the config space 
during this time, right?

> So this is not any more unsafe than any of the other mailbox calls. To 
> be honest, I think RpiFirmwareDxe should be cleaned up to replace the 
> useless spinlocks (there's no multiprocessing component) with a TPL 
> manip (I checked SynchonizationLib and it doesn't touch the TPL)
> 

The spinlock protects from re-entrancy: if an event callback routine 
(such as the one you are adding for PCI I/O protocol registration) 
attempts to do a firmware call while one is already in progress, it will 
fail.

But perhaps it is indeed better to run at TPL_NOTIFY level - that way, 
the calls will be ordered one after the other instead of one being shot 
down.


> Applying your other feedback now...
> 
> A
> ------------------------------------------------------------------------
> *From:* devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard 
> Biesheuvel via groups.io <ard.biesheuvel=arm.com@groups.io>
> 
>> +
>> +  Status = MailboxTransaction (Cmd->BufferHead.BufferSize, RPI_MBOX_VC_CHANNEL, &Result);
>> +
> 
> So this pokes the XHCI controller via its config space? Is it safe to do
> that without raising the TPL? What happens if another config space
> access occurs concurrently?
> 
> A


  reply	other threads:[~2020-06-01  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  3:21 [edk2-platforms][PATCH 1/1] Pi4: notify VPU to load xHCI firmware before XhciDxe binds Andrei Warkentin
2020-06-01  6:59 ` Ard Biesheuvel
2020-06-01  9:37   ` [edk2-devel] " Andrei Warkentin
2020-06-01  9:44     ` Ard Biesheuvel [this message]
2020-06-01  9:48       ` Andrei Warkentin

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=33ce3c90-7675-19aa-c659-6f5d4d51c368@arm.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