<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/MdeModulePkg/Universal/SerialDxe, branch dependabot/github_actions/github/codeql-action-4</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2021-12-07T17:24:28+00:00</updated>
<entry>
<title>MdeModulePkg: Apply uncrustify changes</title>
<updated>2021-12-07T17:24:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2021-12-05T22:54:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=1436aea4d5707e672672a11bda72be2c63c936c3'/>
<id>urn:sha1:1436aea4d5707e672672a11bda72be2c63c936c3</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the MdeModulePkg package

Cc: Andrew Fish &lt;afish@apple.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg SerialDxe.inf: Fix wrong FILE_GUID format</title>
<updated>2019-09-17T07:10:25+00:00</updated>
<author>
<name>Liming Gao</name>
<email>liming.gao@intel.com</email>
</author>
<published>2019-09-17T06:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9790f62be1aa5ee9460d4c4ec8c720919523bb62'/>
<id>urn:sha1:9790f62be1aa5ee9460d4c4ec8c720919523bb62</id>
<content type='text'>
Fix regression issue caused by 0d85e67714e31e0dbe4241ab2ebb7c423aba174d

Cc: Hao A Wu &lt;hao.a.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Signed-off-by: Liming Gao &lt;liming.gao@intel.com&gt;
Reviewed-by: Hao A Wu &lt;hao.a.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SerialDxe: Update the file Guid in SerialDxe.inf</title>
<updated>2019-09-17T01:37:26+00:00</updated>
<author>
<name>Shenglei Zhang</name>
<email>shenglei.zhang@intel.com</email>
</author>
<published>2019-09-05T05:41:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=0d85e67714e31e0dbe4241ab2ebb7c423aba174d'/>
<id>urn:sha1:0d85e67714e31e0dbe4241ab2ebb7c423aba174d</id>
<content type='text'>
FILE GUID in MdeModulePkg\Universal\SerialDxe\SerialDxe.inf is
same to the one gEdkiiSerialPortLibVendorGuid.
Its FILE GUID should be updated to another value.
https://bugzilla.tianocore.org/show_bug.cgi?id=2144

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Hao A Wu &lt;hao.a.wu@intel.com&gt;
Signed-off-by: Shenglei Zhang &lt;shenglei.zhang@intel.com&gt;
Reviewed-by: Hao A Wu &lt;hao.a.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUID</title>
<updated>2019-06-14T19:26:28+00:00</updated>
<author>
<name>Anthony PERARD</name>
<email>anthony.perard@citrix.com</email>
</author>
<published>2019-06-06T13:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=cf78c9d18a81cb289fe1bfaebf07c164da6c520f'/>
<id>urn:sha1:cf78c9d18a81cb289fe1bfaebf07c164da6c520f</id>
<content type='text'>
SERIAL_DXE_FILE_GUID is used in different places, create a single
define that other can use. Also fix SerialDxe to actually use
EDKII_SERIAL_PORT_LIB_VENDOR_GUID in the device path instead of the
FILE_GUID.

Suggested-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Anthony PERARD &lt;anthony.perard@citrix.com&gt;
Message-Id: &lt;20190606131459.1464-2-anthony.perard@citrix.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Reviewed-by: Hao A Wu &lt;hao.a.wu@intel.com&gt;
Tested-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Replace BSD License with BSD+Patent License</title>
<updated>2019-04-09T17:58:08+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2019-04-03T23:05:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9d510e61fceee7b92955ef9a3c20343752d8ce3f'/>
<id>urn:sha1:9d510e61fceee7b92955ef9a3c20343752d8ce3f</id>
<content type='text'>
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Hao Wu &lt;hao.a.wu@intel.com&gt;
Reviewed-by: Jian J Wang &lt;jian.j.wang@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Clean up source files</title>
<updated>2018-06-28T03:19:45+00:00</updated>
<author>
<name>Liming Gao</name>
<email>liming.gao@intel.com</email>
</author>
<published>2018-06-27T13:08:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=d1102dba7210b95e41d06c2338a22ba6af248645'/>
<id>urn:sha1:d1102dba7210b95e41d06c2338a22ba6af248645</id>
<content type='text'>
1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao &lt;liming.gao@intel.com&gt;
Reviewed-by: Star Zeng &lt;star.zeng@intel.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SerialDxe: Do not fail reset when SetAttributes is not supported</title>
<updated>2017-11-30T01:11:53+00:00</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@linaro.org</email>
</author>
<published>2017-11-29T17:28:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7ce5af40c98b17aef5a512b7823dd51ecdfbd2fe'/>
<id>urn:sha1:7ce5af40c98b17aef5a512b7823dd51ecdfbd2fe</id>
<content type='text'>
After commit 91cc526b15 "MdeModulePkg/SerialDxe: Fix not able to change
serial attributes", serial is initialized using the reset method that
will call SetAttributes.

However, SetAttributes may return EFI_INVALID_PARAMETER when a driver
does not support some parameters. This will be propagated by the reset
function and lead to UEFI failing to get the console setup.

For instance, this is the case when using the Xen console driver.

Fix it by introspecting the result and return EFI_SUCCESS when the
SetAttributes report an invalid parameter (i.e EFI_INVALID_PARAMETER).

Contributed-under: Tianocore Contribution Agreement 1.1
Signed-off-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Reviewed-by: Star Zeng &lt;star.zeng@intel.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SerialDxe: Fix return valued in SerialSetAttributes</title>
<updated>2017-11-30T01:11:49+00:00</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@linaro.org</email>
</author>
<published>2017-11-29T17:28:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=13d378fc82d4c10eff48bec383cd679cec6c4fdb'/>
<id>urn:sha1:13d378fc82d4c10eff48bec383cd679cec6c4fdb</id>
<content type='text'>
SerialSetAttributes is meant to match the behavior of the function
EFI_SERIAL_IO_PROTOCOL.SetAttributes() in the UEFI spec (v2.7). This
means the function can only return:
    - EFI_SUCCESS
    - EFI_INVALID_PARAMETER
    - EFI_DEVICE_ERROR

However the function SerialPortSetAttributes may also validly return
EFI_UNSUPPORTED. For instance this is the case of the Xen Console
driver.

EFI_UNSUPPORTED could be also interpreted as "One or more of the attributes
has an unsupported value". So return EFI_INVALID_PARAMETER in that case.

Lastly, to prevent another return slipping in the future, all the errors
but EFI_INVALID_PARAMETER and EFI_UNSUPPORTED will return
EFI_DEVICE_ERROR.

Contributed-under: Tianocore Contribution Agreement 1.1
Signed-off-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Reviewed-by: Star Zeng &lt;star.zeng@intel.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/SerialDxe: Describe correctly EFI_DEVICE_ERROR for SetAttributes</title>
<updated>2017-11-30T01:11:37+00:00</updated>
<author>
<name>Julien Grall</name>
<email>julien.grall@linaro.org</email>
</author>
<published>2017-11-29T17:28:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=b462f25a21e17e3daf3cec880d3de2a6193af8a2'/>
<id>urn:sha1:b462f25a21e17e3daf3cec880d3de2a6193af8a2</id>
<content type='text'>
Per the UEFIv2.7 spec, EFI_DEVICE_ERROR is returned when the serial
device is not functioning correctly. Update the description to avoid
confusion.

Contributed-under: Tianocore Contribution Agreement 1.1
Signed-off-by: Julien Grall &lt;julien.grall@linaro.org&gt;
Reviewed-by: Star Zeng &lt;star.zeng@intel.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg SerialDxe: Handle Timeout change more robustly</title>
<updated>2017-11-09T00:59:03+00:00</updated>
<author>
<name>Star Zeng</name>
<email>star.zeng@intel.com</email>
</author>
<published>2017-10-27T03:14:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a7fd8452964c1a6ffeee1fe07537cb900c0ccb07'/>
<id>urn:sha1:a7fd8452964c1a6ffeee1fe07537cb900c0ccb07</id>
<content type='text'>
https://lists.01.org/pipermail/edk2-devel/2017-October/016479.html
reported "Xen Console input very slow in recent UEFI" that appears
after 4cf3f37c87ba1f9d58072444bd735e40e4779e70 "MdeModulePkg
SerialDxe: Process timeout consistently in SerialRead".

Julien did more debugging and find out the following is happening in
TerminalConInTimerHandler (MdeModulePkg/Universal/Console/TerminalDxe)
when a character is received:
1) GetControl will return EFI_SERIAL_INPUT_BUFFER_EMPTY unset
  =&gt; Entering in the loop to fetch character from the serial
2) GetOneKeyFromSerial()
  =&gt; Return directly with the character read
3) Looping as the fifo is not full and no error
4) GetOneKeyFromSerial() -&gt; SerialRead()
  =&gt; No more character so SerialPortPoll() will return FALSE and loop
     until timeout
  =&gt; Return EFI_TIMEOUT
5) Exiting the loop from TerminalConInTimerHandler
6) Characters are printed

After some investigation, I found it is related to the Timeout value.

The Timeout is 1000000 (1s) by default to follow UEFI spec.
And the Terminal driver will recalculate and set the Timeout value
based on the properties of UART in TerminalDriverBindingStart()/
TerminalConInTimerHandler().

  SerialInTimeOut = 0;
  if (Mode-&gt;BaudRate != 0) {
    //
    // According to BAUD rate to calculate the timeout value.
    //
    SerialInTimeOut = (1 + Mode-&gt;DataBits + Mode-&gt;StopBits) *
                      2 * 1000000 / (UINTN) Mode-&gt;BaudRate;
  }

For example, based on the PCD values of PcdUartDefaultBaudRate,
PcdUartDefaultDataBits and PcdUartDefaultStopBits, SerialInTimeOut =
(1 + 8  + 1) * 2 * 1000000 / (UINTN) 115200 = 173 (us).

When SerialDxe is used,
TerminalDriverBindingStart()/TerminalConInTimerHandler() -&gt;
  SerialIo-&gt;SetAttributes() -&gt;
    SerialSetAttributes() -&gt;
      SerialPortSetAttributes()

Some implementations of SerialPortSetAttributes() could handle the
input parameters and return RETURN_SUCCESS, for example
BaseSerialPortLib16550, then Timeout value will be changed to 173 (us),
no "slow down" will be observed.
But some implementations of SerialPortSetAttributes() just return
RETURN_UNSUPPORTED, for example XenConsoleSerialPortLib, then Timeout
value will be not changed and kept 1000000 (1s), "slow down" will be
observed.

SerialPortLib instance can be enhanced to
1. Handle the input parameters and return status accordingly instead of
just returning RETURN_UNSUPPORTED in SerialPortSetAttributes().
2. Just return RETURN_SUCCESS instead of RETURN_UNSUPPORTED in
SerialPortSetAttributes() if the instance does not care the input
parameters at all.

And SerialDxe can also be enhanced like this patch to be more robust
to handle Timeout change.

Cc: Julien Grall &lt;julien.grall@linaro.org&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ruiyu Ni &lt;ruiyu.ni@intel.com&gt;
Compare against the original parameters
  Suggested-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng &lt;star.zeng@intel.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Tested-by: Julien Grall &lt;julien.grall@linaro.org&gt;
</content>
</entry>
</feed>
