From: Ruiyu Ni Date: Mon, 9 May 2016 03:21:25 +0000 (+0800) Subject: MdeModulePkg/PciSioSerialDxe: Do not flush the UART X-Git-Tag: edk2-stable201903~7092^2~25 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9c0dc0b01a79666c3ba8aa0c69ad92131aada113 MdeModulePkg/PciSioSerialDxe: Do not flush the UART The patch aligns to the IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe driver not flush the UART in Reset() and SetAttributes() function. It was found the flush causes hang on certain PCI serial devices. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Eric Jin --- diff --git a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c index f1870f3a1b..cce61d7a23 100644 --- a/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c +++ b/MdeModulePkg/Bus/Pci/PciSioSerialDxe/SerialIo.c @@ -1,7 +1,7 @@ /** @file SerialIo implementation for PCI or SIO UARTs. -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -442,27 +442,6 @@ SerialReceiveTransmit ( return EFI_SUCCESS; } -/** - Flush the serial hardware transmit FIFO and shift register. - - @param SerialDevice The device to flush. -**/ -VOID -SerialFlushTransmitFifo ( - SERIAL_DEV *SerialDevice - ) -{ - SERIAL_PORT_LSR Lsr; - - // - // Wait for the serial port to be ready, to make sure both the transmit FIFO - // and shift register empty. - // - do { - Lsr.Data = READ_LSR (SerialDevice); - } while (Lsr.Bits.Temt == 0); -} - // // Interface Functions // @@ -503,8 +482,6 @@ SerialReset ( Tpl = gBS->RaiseTPL (TPL_NOTIFY); - SerialFlushTransmitFifo (SerialDevice); - // // Make sure DLAB is 0. // @@ -683,8 +660,6 @@ SerialSetAttributes ( Tpl = gBS->RaiseTPL (TPL_NOTIFY); - SerialFlushTransmitFifo (SerialDevice); - // // Put serial port on Divisor Latch Mode //