On 2/25/24 17:18, Laszlo Ersek wrote: > ... Ah, okay! This is the point where I re-read your steps, and now I > see the actual breakage. > > It is your step #2. > > Placing the PciSioSerialDxe driver -- which is a UEFI driver that > follows the UEFI driver model, and has a long list of dependencies on > the architectural protocols -- in the APRIORI DXE file of the firmware > volume(s) *completely violates* the DXE dispatch order. > > I wrote above: > > How do you ensure that step (4) happens *both* early enough *and* > late enough? > > You must do step (4) *late enough* for PciSioSerialDxe to have a > fleeting chance to be dispatched by the DXE dispatcher (due to arch > protocol deps), and *early enough* for your key modules to find > SERIAL_IO_PROTOCOL (from PciSioSerialDxe) via DebugLib, in order to > produce actual debug messages. > > And your step#2 is the answer to that: you violate the standard DXE > dispatch order, by *overriding* the UEFI arch protocols depex in > PciSioSerialDxe, by placing the driver in the APRIORI DXE file. > > The APRIORI DXE file is *only* appropriate to use when you have > *platform DXE* drivers that, for some reason, cannot be ordered > deterministically correctly, by way of depexes, against other platform > DXE drivers. APRIORI DXE is always a last resort; it serves as a crutch > when the DEPEX language is simply not expressive enough for a given > platform; APRIORI DXE is not license to *override* existent (and > standard!) depexes.
I've looked again at the patch. It introduces a variant of PciSioSerialDxe that is a DXE_DRIVER, and has [Depex] TRUE This means that step#2 (= APRIORI DXE) doesn't actually override a UEFI driver's depex -- therefore I must agree that step#2 in itself does not violate DXE dispatch order. However, I continue to object to step (4), that is, to ConnectController() being called by a platform module way before BDS is entered. That's not how the driver binding protocol and the ConnectController() boot service were intended, to my understanding. Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115932): https://edk2.groups.io/g/devel/message/115932 Mute This Topic: https://groups.io/mt/104469297/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-