The EXT4 driver implements the UEFI driver model, which means it can
consume one protocol (marked with a TO_START comment in the .INF) and
produce another (marked as BY_START). The TO_START protocols are not
prerequisites for loading and starting the module, they are simply
protocols the driver may consume when taking part in the driver model
dance.

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.

Note that this means the driver is not a UEFI_DRIVER but a DXE_DRIVER,
as UEFI drivers have a default DEPEX on the architectural protocols
only.

Cc: Pedro Falcato <pedro.falc...@gmail.com>
Cc: Marvin Häuser <mhaeu...@posteo.de>
Signed-off-by: Ard Biesheuvel <a...@kernel.org>
---
This fixes an observed failure when attempting to use this driver
Raspberry Pi4 as a builtin.

 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf 
b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
index a153fc41ccd6..1514020fa6a6 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
@@ -86,7 +86,7 @@ [Defines]
   BASE_NAME                      = Ext4Dxe
   MODULE_UNI_FILE                = Ext4Dxe.uni
   FILE_GUID                      = 75F2B676-D73B-45CB-B7C1-303C7F4E6FD6
-  MODULE_TYPE                    = UEFI_DRIVER
+  MODULE_TYPE                    = DXE_DRIVER
   VERSION_STRING                 = 1.0
 
   ENTRY_POINT                    = Ext4EntryPoint
@@ -141,9 +141,12 @@ [Protocols]
   gEfiDiskIo2ProtocolGuid               ## TO_START
   gEfiBlockIoProtocolGuid               ## TO_START
   gEfiSimpleFileSystemProtocolGuid      ## BY_START
-  gEfiUnicodeCollationProtocolGuid      ## TO_START
-  gEfiUnicodeCollation2ProtocolGuid     ## TO_START
+  gEfiUnicodeCollationProtocolGuid      ## SOMETIMES_CONSUMES
+  gEfiUnicodeCollation2ProtocolGuid     ## SOMETIMES_CONSUMES
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang           ## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang   ## 
SOMETIMES_CONSUMES
+
+[Depex]
+  gEfiUnicodeCollationProtocolGuid OR gEfiUnicodeCollation2ProtocolGuid
-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100312): https://edk2.groups.io/g/devel/message/100312
Mute This Topic: https://groups.io/mt/97025926/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to