public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, mateusz.albecki@intel.com
Cc: Michael Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Load Serial driver earlier in DXE
Date: Sun, 25 Feb 2024 17:31:51 +0100	[thread overview]
Message-ID: <c2eba314-1a53-4bf3-1894-f74e87b23aac@redhat.com> (raw)
In-Reply-To: <7a99d4e0-9fbb-9c9c-b82a-6425e1b9c9ea@redhat.com>

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-02-25 16:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 12:10 [edk2-devel] [PATCH 0/1] EDK2 Serial driver UART debug print enablement Borzeszkowski, Alan
2024-02-20 12:10 ` [edk2-devel] [PATCH 1/1] MdeModulePkg: Load Serial driver earlier in DXE Borzeszkowski, Alan
2024-02-20 17:11   ` Michael D Kinney
2024-02-21 17:15     ` Borzeszkowski, Alan
2024-02-21 20:59       ` Michael D Kinney
2024-02-21 21:59       ` Laszlo Ersek
2024-02-23 15:50         ` Albecki, Mateusz
2024-02-23 22:30           ` Michael D Kinney
2024-02-25 16:18           ` Laszlo Ersek
2024-02-25 16:31             ` Laszlo Ersek [this message]
2024-02-26 15:13               ` Albecki, Mateusz
2024-02-26 15:37                 ` Laszlo Ersek
2024-02-27 17:15                   ` Albecki, Mateusz
2024-02-28 10:12                     ` Laszlo Ersek
2024-02-28 16:27                       ` Albecki, Mateusz
2024-02-29  7:48                         ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2eba314-1a53-4bf3-1894-f74e87b23aac@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox