audk/ArmVirtPkg
Laszlo Ersek 5f0f5e90ae ArmVirtPkg/FdtPL011SerialPortLib: call PL011UartLib in all SerialPortLib APIs
With the SerialDxe change in commit 4cf3f37c87 ("MdeModulePkg SerialDxe:
Process timeout consistently in SerialRead", 2017-07-18), setting
EFI_SERIAL_INPUT_BUFFER_EMPTY in the "Control" output parameter, in the
GetControl() SerialPortLib function, is no longer a "small optimization".
Namely, due to the SerialDxe change, the GetOneKeyFromSerial() call in
TerminalDxe's TerminalConInTimerHandler() can take very long if the input
queue is empty, even if GetOneKeyFromSerial()'s return value causes the
loop to be exited right after, in the first iteration.

This issue causes a boot hang in ArmVirtQemu: with the input queue empty,
TerminalConInTimerHandler() takes so long to return that, by the time it
returns, there's another execution queued already (due to the associated
timer event being signaled meanwhile). The boot process is stuck in the
timer event handler.

Therefore even the first GetOneKeyFromSerial() iteration must be prevented
in TerminalConInTimerHandler() if the input queue is empty, and that
requires implementing GetControl() for real.

Implement the SetAttributes(), SetControl() and GetControl() APIs (of
SerialPortExtLib origin) in FdtPL011SerialPortLib with calls to matching
PL011UartLib functions. This follows the example of
"ArmPlatformPkg/Library/PL011SerialPortLib" and also matches Star's
original idea under [1].

The patch can be considered a continuation of commit ad7f6bc2e1
("ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg",
2015-11-26), based on the mailing list threads [1] [2] [3].

[1] http://mid.mail-archive.com/1447752930-32880-12-git-send-email-star.zeng@intel.com
[2] http://mid.mail-archive.com/1448243067-1880-12-git-send-email-star.zeng@intel.com
[3] http://mid.mail-archive.com/b748580c-cb51-32c9-acf9-780841ef15da@redhat.com

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Heyi Guo <guoheyi@huawei.com>
Cc: Star Zeng <star.zeng@intel.com>
Originally-suggested-by: Star Zeng <star.zeng@intel.com>
Reported-by: Brijesh Singh <brijesh.singh@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-08-17 14:13:23 +02:00
..
FdtClientDxe ArmVirtPkg/FdtClientDxe: honor memory DT node 'status' property 2017-04-04 15:24:59 +01:00
HighMemDxe ArmVirtPkg/HighMemDxe: check new regions against GCD memory space map 2017-03-21 10:41:25 +00:00
Include ArmVirtPkg/FdtClientDxe: add methods to iterate over memory nodes 2016-09-15 15:39:29 +01:00
Library ArmVirtPkg/FdtPL011SerialPortLib: call PL011UartLib in all SerialPortLib APIs 2017-08-17 14:13:23 +02:00
PlatformHasAcpiDtDxe MdeModulePkg: move PlatformHasAcpiGuid from EmbeddedPkg 2017-04-05 16:59:13 +01:00
PrePi ArmVirtPkg/PrePi: remove mSystemMemoryEnd 2016-10-24 15:57:25 +01:00
VirtioFdtDxe ArmVirtPkg/VirtFdtDxe: remove Xenio handling and rename to VirtioFdtDxe 2016-04-13 17:26:07 +02:00
XenAcpiPlatformDxe ArmVirtPkg/XenAcpiPlatformDxe: don't cast UINT64 to pointer directly 2017-03-28 13:48:39 +02:00
XenPlatformHasAcpiDtDxe MdeModulePkg: move PlatformHasAcpiGuid from EmbeddedPkg 2017-04-05 16:59:13 +01:00
XenioFdtDxe ArmVirtPkg/FdtClientDxe: report address and size cell count directly 2016-09-15 15:31:24 +01:00
ArmVirt.dsc.inc ArmVirtPkg: remove status code support 2017-07-05 16:30:26 +01:00
ArmVirtPkg.dec ArmVirtPkg/PlatformHasAcpiDtDxe: allow guest level ACPI disable override 2017-03-31 11:44:36 +01:00
ArmVirtQemu.dsc ArmVirtPkg: switch to generic ResetSystemRuntimeDxe 2017-07-03 18:49:56 +01:00
ArmVirtQemu.fdf ArmVirtPkg: factor out Rules FDF section 2016-07-12 15:19:42 +02:00
ArmVirtQemuFvMain.fdf.inc ArmVirtPkg: switch to generic ResetSystemRuntimeDxe 2017-07-03 18:49:56 +01:00
ArmVirtQemuKernel.dsc ArmVirtPkg: switch to generic ResetSystemRuntimeDxe 2017-07-03 18:49:56 +01:00
ArmVirtQemuKernel.fdf ArmVirtPkg/ArmVirtQemuKernel: increase slack space for DTB 2017-04-04 16:00:12 +01:00
ArmVirtRules.fdf.inc ArmVirtPkg: Add Ramdisk support to ArmVirtPkg platforms 2016-08-22 09:05:17 +02:00
ArmVirtXen.dsc ArmVirtPkg: switch to generic ResetSystemRuntimeDxe 2017-07-03 18:49:56 +01:00
ArmVirtXen.fdf ArmVirtPkg: switch to generic ResetSystemRuntimeDxe 2017-07-03 18:49:56 +01:00
VarStore.fdf.inc ArmVirtPkg: add FDF definition for empty varstore 2016-06-23 16:07:38 +02:00