From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.7585.1676644161360033475 for ; Fri, 17 Feb 2023 06:29:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cBwnVgQl; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8497661CB6 for ; Fri, 17 Feb 2023 14:29:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57476C433D2 for ; Fri, 17 Feb 2023 14:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676644160; bh=ilGjb3j7bePUx3BOnlChTPCkfbKc9Qe73+UlIzFRMyY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cBwnVgQlgRtkMHue8t4zFIhHxvLTR/6szWC+6E2k1mqsBH6IerskPRPe+0FXZVZ4a tqr9+DQ5Ti7wvF/4I2dDit4tKka4geKdGGINTdnef54CaZIgoyFDm92Gluws2UHL/V yim0HO4pUY6+oP7vv9sFgrBPUOEIvVuhPqkcPVzib6RE4JJUkLXPqHhqiYMxyvsbEl nxc2GLDEZc4MVnDpJcbpE/Rzmo+CdVkhFX6ddP7VpngnhDlBoPSgzglOC0sa3HcYZa COOCho2K4MWcMxAZbe88sPPKj1TXF7yCK1u9s1BcpeeTVVVSs0QCm5p43crzdkKS2D XVZpyuW6Gin7w== Received: by mail-lj1-f172.google.com with SMTP id f3so1074766ljn.12 for ; Fri, 17 Feb 2023 06:29:20 -0800 (PST) X-Gm-Message-State: AO0yUKUjjVRKFtYXgylCGgoUlAa2GWf3XgDWgsCqlW1OxKz0G9a1Gigz byOjxhlVB7fHRqCSkeJVVafVp69oYxnH16c3Ytk= X-Google-Smtp-Source: AK7set8uzXyEyNJ2biJSS4noNKAN8wfB0CkqY+qC/Tcib7GNbdhe+HEi/5v1ZByL3vEFaX6BZ39BTCn6ymkVp9U0SDM= X-Received: by 2002:a05:651c:b99:b0:293:4ed3:a404 with SMTP id bg25-20020a05651c0b9900b002934ed3a404mr483199ljb.2.1676644158405; Fri, 17 Feb 2023 06:29:18 -0800 (PST) MIME-Version: 1.0 References: <20230217111200.1293369-1-ardb@kernel.org> <8AFBCC5C-C28B-4F57-9359-99CF24D42322@posteo.de> In-Reply-To: <8AFBCC5C-C28B-4F57-9359-99CF24D42322@posteo.de> From: "Ard Biesheuvel" Date: Fri, 17 Feb 2023 15:29:07 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/4] Ext4Pkg: Use depex for unicode collation protocols To: devel@edk2.groups.io, mhaeuser@posteo.de Cc: Pedro Falcato Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 17 Feb 2023 at 15:05, Marvin H=C3=A4user wrote= : > > Hi Ard, > > Thank you! Is "1/4" a mistake or did I miss the other 3? :) Oops. It was part of some RPi4 patches but I decided to send it out by itself. > Comments inline. > > On 17. Feb 2023, at 12:12, Ard Biesheuvel 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], whi= ch 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/02fcfdce1e5ce86f1951191883e7e30de5= aa08be/FatPkg/EnhancedFatDxe/Fat.c#L381 > https://github.com/tianocore/edk2/blob/02fcfdce1e5ce86f1951191883e7e30de5= aa08be/FatPkg/EnhancedFatDxe/Fat.inf#L19 > I'd prefer using existing features for this, rather than open coding it. > - MODULE_TYPE =3D UEFI_DRIVER > + MODULE_TYPE =3D DXE_DRIVER > > > Is it not unidiomatic to use the UEFI Driver Binding model (UEFI) in a DX= E driver (UEFI PI)? > Perhaps. But having a hard dependency on protocols beyond the default set defined for UEFI drivers is arguably even worse. > +[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. > The ext4 driver does nothing except install protocols in its entrypoint, and everything else that happens is under the control of the UEFI driver model, afaict.