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.

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)

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