public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms 1/4] Ext4Pkg: Use depex for unicode collation protocols
@ 2023-02-17 11:12 Ard Biesheuvel
  2023-02-17 14:05 ` Marvin Häuser
  0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2023-02-17 11:12 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Pedro Falcato, Marvin Häuser

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2587 bytes --]

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.falcato@gmail.com>
Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Ard Biesheuvel <ardb@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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-02-17 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-17 11:12 [PATCH edk2-platforms 1/4] Ext4Pkg: Use depex for unicode collation protocols Ard Biesheuvel
2023-02-17 14:05 ` Marvin Häuser
2023-02-17 14:29   ` [edk2-devel] " Ard Biesheuvel
2023-02-17 14:54     ` Marvin Häuser
2023-02-17 15:17       ` Ard Biesheuvel
2023-02-17 15:38         ` Marvin Häuser
2023-02-17 17:31           ` Pedro Falcato
2023-02-17 18:01             ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox