From nobody Mon Apr 29 09:42:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511976514793938.9430583498148; Wed, 29 Nov 2017 09:28:34 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1991020359E9C; Wed, 29 Nov 2017 09:24:08 -0800 (PST) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3263F21B00DC4 for ; Wed, 29 Nov 2017 09:24:06 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id r78so7909152wme.5 for ; Wed, 29 Nov 2017 09:28:30 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id o80sm1782687wmg.6.2017.11.29.09.28.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:28 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FB/GkuSdLB969O880F/fYyIZGRBhGZpp92IR9EbEErw=; b=CgsqNms57KT3c1LG7AOIdaABNf/hsBtni4GN0ismMs16C0+zDt380tZ/AwqtU/dC5/ 3UM2dz1eGRkOLMcadPPi9kgZpdW0stiwNvIlQyHOJf5IIj9joaJjYP7zm38SQETix245 BI68yaMi6uCwc7EquVnbkycvfhmdQPjDEoheI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FB/GkuSdLB969O880F/fYyIZGRBhGZpp92IR9EbEErw=; b=QIujneMKQY3C7D/1A1NrngkEKGK470iNcbverHSU8/tC+YEQVJAvXCE+HEnklS4+BT BmltLWXxXMxOg3JukO3GwswHlzt768seI/mvgLYyj7duQcpuZ42JhEKNx/40kwW+nzu0 dPIZSwrO6FhcQPKinmzzl4d/ZggqKyiAI1kJEbQwlOmgD3Lzap9BQYEpNFCuPwgVisr4 NaqsZ9E6+otZuVbto+cfoDWhnZaTMnUM7NI9qI+NIj9zUE6jAwRf1DNggvClPu1UR785 18OD7Sus4x928ANCqLvUao+FS3rt8P0Jx6Y10N2igwrgukOC84EOFZkfeTwJyom7T1XA MGIw== X-Gm-Message-State: AJaThX57EKJzk9cR5jSaZfKyXkoVrxXZrm4nKCuIXyqwzaULSz/kS+5y FRjHpB/aFVikjsP5Xalfaw42wNfea+E= X-Google-Smtp-Source: AGs4zMZA/IT60qtlk4xevGaWeDRdBzzmL7a/p6hUcQQINSR+0jU3/epJoB3BgaJ1Enu1n05nxNFm+w== X-Received: by 10.28.10.5 with SMTP id 5mr3060847wmk.74.1511976509280; Wed, 29 Nov 2017 09:28:29 -0800 (PST) From: Julien Grall To: star.zeng@intel.com, eric.dong@intel.com, pankaj.bansal@nxp.com, lersek@redhat.com, leif.lindholm@linaro.org Date: Wed, 29 Nov 2017 17:28:21 +0000 Message-Id: <20171129172823.2906-2-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171129172823.2906-1-julien.grall@linaro.org> References: <20171129172823.2906-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v3 1/3] MdeModulePkg/SerialDxe: Describe correctly EFI_DEVICE_ERROR for SetAttributes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edk2-devel@lists.01.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Star Zeng Reviewed-by: Star Zeng and pushed the patches at http= s://github.com/tianocore/edk2/compare/f1f7190bf3bf...7ce5af40c98b with the = typo (pointed out by Laszlo) fixed in [Patch 2/3]. --- Star, I found a prototype for SetAttributes in SerialIo.c as well and updated the description there. I decided to keep the Reviewed-by even with that change. Let me know whether it is fine for you. Changes in v3: - Modify description of EFI_DEVICE_ERROR above the prototypes for SetAttributes as well. - Add Star reviewed-by --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 4 ++-- MdePkg/Include/Protocol/SerialIo.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Uni= versal/SerialDxe/SerialIo.c index 964d0329f4..19fc889c25 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -67,7 +67,7 @@ SerialReset ( stop bits. =20 @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device could not be reset. + @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. =20 **/ EFI_STATUS @@ -265,7 +265,7 @@ SerialReset ( stop bits. =20 @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device could not be reset. + @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. =20 **/ EFI_STATUS diff --git a/MdePkg/Include/Protocol/SerialIo.h b/MdePkg/Include/Protocol/S= erialIo.h index 31cd46614e..84cb34364d 100644 --- a/MdePkg/Include/Protocol/SerialIo.h +++ b/MdePkg/Include/Protocol/SerialIo.h @@ -126,7 +126,7 @@ EFI_STATUS stop bits. =20 @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device could not be reset. + @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. =20 **/ typedef --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 09:42:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 151197651749026.749359929730872; Wed, 29 Nov 2017 09:28:37 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 652B420359E97; Wed, 29 Nov 2017 09:24:11 -0800 (PST) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ED60921B00DC4 for ; Wed, 29 Nov 2017 09:24:07 -0800 (PST) Received: by mail-wr0-x243.google.com with SMTP id s66so4097960wrc.9 for ; Wed, 29 Nov 2017 09:28:32 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id o80sm1782687wmg.6.2017.11.29.09.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:29 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h+b2F4UV2VsmFJz4c9ZSVNNffh8DIILIqBdYZl9rSvY=; b=YN9pFwRfjQ2RNk6lji7kgtTARILFQN8lQccIfz9l3K5n7jl6cfX47rgzz4e2OsKVYV 8CFcHOXNxdDlcoS/BFiQeXcmuoHdKXRsmKj/4gQ4P80YCcE0j71ZxUb3SB3+HmqquU9I 0YiKivB08kpFpYfNglzBuGfAVm8W7xblYgmyI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=h+b2F4UV2VsmFJz4c9ZSVNNffh8DIILIqBdYZl9rSvY=; b=MZb+FhNtuGdN38tVl4FonyRPV2VWXb1JE5gFXrV7QkWa7Jmb3Se8/1ohjb3RhGpnBt K2+cTAGPufRdr98xjKMBfzP2Ti0r1wtlWrDSLq1KeRSCFnMaOLQbAIfHzOZ65CAIuDbx Hm/IPX9EgfjEVBGQ8ln0/aaYT88dKFj3zkNt5TEzAUpLAFNSRF5QhXg2v1HXBiDBReWK aqtT1Y2ABZA3ginellwv8B4CIZkXX72WtYVWr3WxNvF5A+fB9KDT8Unl/SzHbgZBcTL1 SR1ppuOy6IIPba8be492WcjkiOhToYjibaYQ3tUwLJesLblF761UAIMIc4EsL/VqGmu7 UBCg== X-Gm-Message-State: AJaThX5c4Vbex8KnTsHM7lpYevySkS+1KiLyTNAxqH43ZKXaJwhFdjsK CeiGJiH5aWiB4piez+ooTEP2wQ== X-Google-Smtp-Source: AGs4zMZ05vybtNNfMU/E3kmtVtmeF4y6US/asjR5cjpJDvwEPT/VNxnUD1KpSoBwVSsgEQ49NSkGTg== X-Received: by 10.223.171.85 with SMTP id r21mr2901084wrc.182.1511976510427; Wed, 29 Nov 2017 09:28:30 -0800 (PST) From: Julien Grall To: star.zeng@intel.com, eric.dong@intel.com, pankaj.bansal@nxp.com, lersek@redhat.com, leif.lindholm@linaro.org Date: Wed, 29 Nov 2017 17:28:22 +0000 Message-Id: <20171129172823.2906-3-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171129172823.2906-1-julien.grall@linaro.org> References: <20171129172823.2906-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v3 2/3] MdeModulePkg/SerialDxe: Fix return valued in SerialSetAttributes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edk2-devel@lists.01.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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_PARAMETERR and EFI_UNSUPPORTED will return EFI_DEVICE_ERROR. Contributed-under: Tianocore Contribution Agreement 1.1 Signed-off-by: Julien Grall Reviewed-by: Star Zeng Reviewed-by: Laszlo Ersek Reviewed-by: Star Zeng and pushed the patches at http= s://github.com/tianocore/edk2/compare/f1f7190bf3bf...7ce5af40c98b with the = typo (pointed out by Laszlo) fixed in [Patch 2/3]. --- Star, I found a prototype for SetAttributes in SerialIo.c as well and updated the description there. I decided to keep the Reviewed-by even with that change. Let me know whether it is fine for you. Changes in v3: - Add description of EFI_INVALID_PARAMETER above the prototypes for SetAttributes as well. - Add Star reviewed-by --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 14 +++++++++----- MdePkg/Include/Protocol/SerialIo.h | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Uni= versal/SerialDxe/SerialIo.c index 19fc889c25..ee10ec7e05 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -66,8 +66,9 @@ SerialReset ( value of DefaultStopBits will use the device's = default number of stop bits. =20 - @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. + @retval EFI_SUCCESS The device was reset. + @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported = value. + @retval EFI_DEVICE_ERROR The serial device is not functioning corre= ctly. =20 **/ EFI_STATUS @@ -264,8 +265,9 @@ SerialReset ( value of DefaultStopBits will use the device's = default number of stop bits. =20 - @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. + @retval EFI_SUCCESS The device was reset. + @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported = value. + @retval EFI_DEVICE_ERROR The serial device is not functioning corre= ctly. =20 **/ EFI_STATUS @@ -323,8 +325,10 @@ SerialSetAttributes ( DataBits =3D OriginalDataBits; StopBits =3D OriginalStopBits; Status =3D EFI_SUCCESS; + } else if (Status =3D=3D EFI_INVALID_PARAMETER || Status =3D=3D EFI_UN= SUPPORTED) { + return EFI_INVALID_PARAMETER; } else { - return Status; + return EFI_DEVICE_ERROR; } } =20 diff --git a/MdePkg/Include/Protocol/SerialIo.h b/MdePkg/Include/Protocol/S= erialIo.h index 84cb34364d..1263dc4fe9 100644 --- a/MdePkg/Include/Protocol/SerialIo.h +++ b/MdePkg/Include/Protocol/SerialIo.h @@ -125,8 +125,9 @@ EFI_STATUS value of DefaultStopBits will use the device's = default number of stop bits. =20 - @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The serial device is not functioning correctly. + @retval EFI_SUCCESS The device was reset. + @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported = value. + @retval EFI_DEVICE_ERROR The serial device is not functioning corre= ctly. =20 **/ typedef --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 09:42:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511976521275766.6642754938388; Wed, 29 Nov 2017 09:28:41 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9D7DA20359EAB; Wed, 29 Nov 2017 09:24:11 -0800 (PST) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4CB3920359EA2 for ; Wed, 29 Nov 2017 09:24:08 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id f140so7483795wmd.2 for ; Wed, 29 Nov 2017 09:28:32 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id o80sm1782687wmg.6.2017.11.29.09.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:30 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zOOqy7fmyf8Ak/X59Z+au9wySb8Jh0uqj+hHY8lDEVE=; b=P19Ud4Ek7JowysYFF/FKatrdkqOEOyPTu4/mjXzvMba6+PlUPl6JuvAhQkmT8ziSI1 wPmARKb3/zV2D6b5kwspO1e8tpQBc+8xiAbew+wXegXxPmqQehYu6ArakjJQ8xoIAiLn ZDBP7JDlcDukFrYv8GdYM/5biDEWgNmT99kIE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zOOqy7fmyf8Ak/X59Z+au9wySb8Jh0uqj+hHY8lDEVE=; b=nUUPKidZKSxulHIHTcQ3vg8efYE3iuU9bB55z1cvDUo7NsO6bclK9mN8SVkbduEalZ iAkxCo9TT9x9Io/w8WTrBJ9VXnBOaUCoSmyYI985nDshx4U3XVNDyA1WabtuQCnbKG9u iPJsxtdnGNnaiCnmz/Jb3M+jGAW8gD66C8FM98Q8tOih1eHRJqnmReNZMQPhrof6QsMc Dw5Z6yt+tJD36TA8HLFUtIWz65t2bHeCpyXsDPU0jd6aXhK2OgezNFxZ7JXLdW8wOfPO eqAPirS0QQk08EEQO7C2HmzJ//eo5sl65Y5lVPoDp1Rtv5U8cIUbEKXFXbCK+D+MTFkV ksvQ== X-Gm-Message-State: AJaThX4Tu7r5T36dShzl2BiWOTtc/1Mhpm3F02ZWWuHsCTyJCnSGMnuJ Zk5/BIjPFvT2bKvgLtBxMs0+cw== X-Google-Smtp-Source: AGs4zMYC9vQfwZti3R8o4Fe+NiXOc2D0EEpBiKGPFZB7i5ooT+DsW1VX1XDVsM29WpvKJ18VCq25Qg== X-Received: by 10.28.97.194 with SMTP id v185mr2966881wmb.21.1511976511361; Wed, 29 Nov 2017 09:28:31 -0800 (PST) From: Julien Grall To: star.zeng@intel.com, eric.dong@intel.com, pankaj.bansal@nxp.com, lersek@redhat.com, leif.lindholm@linaro.org Date: Wed, 29 Nov 2017 17:28:23 +0000 Message-Id: <20171129172823.2906-4-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171129172823.2906-1-julien.grall@linaro.org> References: <20171129172823.2906-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v3 3/3] MdeModulePkg/SerialDxe: Do not fail reset when SetAttributes is not supported X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edk2-devel@lists.01.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Star Zeng Reviewed-by: Star Zeng and pushed the patches at http= s://github.com/tianocore/edk2/compare/f1f7190bf3bf...7ce5af40c98b with the = typo (pointed out by Laszlo) fixed in [Patch 2/3]. --- Changes in v3: - Add Star reviewed-by - Fix typoes in the commit message --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Uni= versal/SerialDxe/SerialIo.c index ee10ec7e05..e18cc7ed51 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -240,6 +240,15 @@ SerialReset ( (EFI_STOP_BITS_TYPE) This->Mode->StopBits ); =20 + // + // The serial device may not support some of the attributes. To prevent + // later failure, always return EFI_SUCCESS when SetAttributes is return= ing + // EFI_INVALID_PARAMETER. + // + if (Status =3D=3D EFI_INVALID_PARAMETER) { + return EFI_SUCCESS; + } + return Status; } =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel