[edk2-devel] [edk2-platforms][PATCH 1/1] Pi4: notify VPU to load xHCI firmware before XhciDxe binds

Andrei Warkentin awarkentin at vmware.com
Mon Jun 1 09:48:45 UTC 2020


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 at arm.com>
Sent: Monday, June 1, 2020 4:44 AM
To: Andrei Warkentin <awarkentin at vmware.com>; Andrei Warkentin <andrey.warkentin at gmail.com>; devel at edk2.groups.io <devel at edk2.groups.io>
Cc: leif at nuviainc.com <leif at nuviainc.com>; pete at akeo.ie <pete at akeo.ie>; philmd at redhat.com <philmd at 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 at edk2.groups.io <devel at edk2.groups.io> on behalf of Ard
> Biesheuvel via groups.io <ard.biesheuvel=arm.com at 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60496): https://edk2.groups.io/g/devel/message/60496
Mute This Topic: https://groups.io/mt/74596471/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200601/a71e0456/attachment.htm>


More information about the edk2-devel-archive mailing list