Hi Ard,

Thank you! Is "1/4" a mistake or did I miss the other 3? :)
Comments inline.

On 17. Feb 2023, at 12:12, Ard Biesheuvel <ardb@kernel.org> wrote:

The Unicode collation protocols, however, are different: loading the
driver will fail if neither of those are present. So they are not
TO_START protocols, and they need to be mentioned in the DEPEX so that
the DXE core will not dispatch the driver before the producers of the
prerequisite protocols have been dispatched. Also, mark them as
SOMETIMES_CONSUMES, as only one of the two is required.

Right. FatPkg solves this by probing for the protocol in Start() [1], which should guarantee that all entry points have been executed first, right? I'd prefer a universal and consistent solution to the issue and this looks fine, honestly.

[1]
https://github.com/tianocore/edk2/blob/02fcfdce1e5ce86f1951191883e7e30de5aa08be/FatPkg/EnhancedFatDxe/Fat.c#L381
https://github.com/tianocore/edk2/blob/02fcfdce1e5ce86f1951191883e7e30de5aa08be/FatPkg/EnhancedFatDxe/Fat.inf#L19

-  MODULE_TYPE                    = UEFI_DRIVER
+  MODULE_TYPE                    = DXE_DRIVER

Is it not unidiomatic to use the UEFI Driver Binding model (UEFI) in a DXE driver (UEFI PI)?

+[Depex]
+  gEfiUnicodeCollationProtocolGuid OR gEfiUnicodeCollation2ProtocolGuid

Hmm, this will have the side effect that Ext4Dxe may load before (some of) the architectural protocols, right (modulo implicit dependencies via the UC protocols)? This would need some careful analysis, or we need to add all of the architectural protocols to preserve the old behaviour.

Best regards,
Marvin