public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/SerialDxe: Do not fail reset when SetAttributes is not supported
@ 2017-10-18 10:19 Julien Grall
  2017-10-18 12:11 ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2017-10-18 10:19 UTC (permalink / raw)
  To: star.zeng, eric.dong, pankaj.bansal, lersek, leif.lindholm
  Cc: edk2-devel, Julien Grall

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 not be supported by the driver and will
return an error (i.e RETURN_UNSUPPORTED) that will be propagate 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 instropecting the result and return RETURN_SUCCESS when the
driver report it is not supported (i.e RETURN_UNSUPPORTED).

Contributed-under: Tianocore Contribution Agreement 1.1
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 MdeModulePkg/Universal/SerialDxe/SerialIo.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c
index ebcd927263..4253e0b8ea 100644
--- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c
+++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c
@@ -238,6 +238,12 @@ SerialReset (
                    (UINT8) This->Mode->DataBits,
                    (EFI_STOP_BITS_TYPE) This->Mode->StopBits
                    );
+  //
+  // The serial device may not support SetAttributes.
+  // Set the status to RETURN_SUCCESS to prevent later failure.
+  //
+  if ( Status == RETURN_UNSUPPORTED )
+      return RETURN_SUCCESS;
 
   return Status;
 }
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-24  5:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 10:19 [PATCH] MdeModulePkg/SerialDxe: Do not fail reset when SetAttributes is not supported Julien Grall
2017-10-18 12:11 ` Laszlo Ersek
2017-10-19  3:03   ` Ni, Ruiyu
2017-10-24  5:43     ` Zeng, Star
2017-10-23 17:27   ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox