public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrei Warkentin" <awarkentin@vmware.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.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 09:48:45 +0000	[thread overview]
Message-ID: <BN6PR05MB341119B451440CE8A906A119B98A0@BN6PR05MB3411.namprd05.prod.outlook.com> (raw)
In-Reply-To: <33ce3c90-7675-19aa-c659-6f5d4d51c368@arm.com>

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

During the time when the device handle with PciIo is published? Presumably only via the event callbacks (thus no). I see a similar approach done in ArmJunoDxe to populate MAC address into the PCI device.

I'm up for the RpiFirmwareDxe cleanup (as fas as moving to a model where the TPL is raised instead of using spinlock), but could that be done separately to this change?

A
________________________________
From: Ard Biesheuvel <ard.biesheuvel@arm.com>
Sent: Monday, June 1, 2020 4:44 AM
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

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


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

      reply	other threads:[~2020-06-01  9:48 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
2020-06-01  9:48       ` Andrei Warkentin [this message]

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=BN6PR05MB341119B451440CE8A906A119B98A0@BN6PR05MB3411.namprd05.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