From patchwork Wed Nov 29 17:28:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120032 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3331930qgn; Wed, 29 Nov 2017 09:28:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMaSu4Uh9E9pp5fVKIpUERdmC7AyHz+ASHiVmT2hIh2lG/rv/JFYtGRuc2b+vXkpC+kFM+NK X-Received: by 10.84.132.9 with SMTP id 9mr3641597ple.77.1511976514141; Wed, 29 Nov 2017 09:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511976514; cv=none; d=google.com; s=arc-20160816; b=LRDNYHY2xkAw1Uj7iUhT6MOYrlDJvUU9fXSAUGQwgMJDh+MUZJFu9mK1DB/E/4Rjnl U2IIAXhmqFUWQtTuhN7E20lhoDqzqvWJ4EJwBNRSHDGZ0SmY+9PFML3KHmiokqwa62wL 2gnJjC+DJ9rQSWj0iGAvJRbJ4phA2txgP9Kp7X7pRo/8mDFG07oAfOK3gS3r1EKWV5IC 55nPZXVdyaSqeq+lXhY2VT1P2yEkzc81jWV5BNOidV/7vDY/Qyr9EYl1nkaFZCbho/2q aMzdxr20p5J5TQGCv56rMx07gYM7zAL7T3GqMAkrs3qe6WY/AMoqp1KUWStgElHcFfC6 1+aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ysvW7BmQOvkNuEGs2WHUUj12dvZA7ih5nrsW6M+mw5A=; b=pM41lKofiXA586xM3/tTFzLaaIF+Tsyx2EOllWEQ9xPT+yhobrA4XR+tTAIv2mQK/r rPcp6RsOomSdG7s6tE/W9OfJkIoMiegy6zFK+x1zG+t0+QXsbmy0axBclpfcd+F4weWI ZJgJvRe5aoVTA+is+ILz+vN3PkmDZbSihoq3ZSVHXWNpuPTFrGTh7R6FMO0FwAWLkA17 K1cJHEfWzdoNvVfESPXCWXYEiexh3XStA78r4ANkCqbZ1HS3imSD4gexXQDrCjtkPqFm wYyFteAZPe/JjNWIxv2EadATK1lsRzdzYLqcpWgl5uDavuRV+cq136qjWHCbhvU1b+Db tyCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CgsqNms5; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id w7si1546165pgp.397.2017.11.29.09.28.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CgsqNms5; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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) 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-Received: by 10.28.10.5 with SMTP id 5mr3060847wmk.74.1511976509280; Wed, 29 Nov 2017 09:28:29 -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) 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/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. @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. **/ EFI_STATUS @@ -265,7 +265,7 @@ SerialReset ( stop bits. @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. **/ EFI_STATUS diff --git a/MdePkg/Include/Protocol/SerialIo.h b/MdePkg/Include/Protocol/SerialIo.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. @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. **/ typedef From patchwork Wed Nov 29 17:28:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120033 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3331981qgn; Wed, 29 Nov 2017 09:28:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMZbeDv7HDR2R+Rmc/K5pSrG0jbH28ONY69lfblSOXmkzuNxW4hCpdDAZCaquaXI88pqNrWh X-Received: by 10.98.80.208 with SMTP id g77mr3715627pfj.201.1511976516977; Wed, 29 Nov 2017 09:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511976516; cv=none; d=google.com; s=arc-20160816; b=ikPLJHCibG94H9EzbReiqfiesn7VXgIHF1V01zK4Xo/rgvsWQjrVB9yOO+f0sBPO+T NVenXXfHlZNlFSq4HprplMriW1bv4VK9RqUUb/cqiTo9VBuMmyK6TlBBMXCAuSF2f2pn RdMh5NdVQxXgXqVHN7eleP/vpQlIRil2iFAAlnfvdZ+XW2omCORmX8Org4obuZi5z3Yi LkFqB/675QO4d3IazmYrj3t0qdFRaX6wYTSWWR/4cJWIUVUJr1L7PEWzlCQ6meL1siUC PoufRlbMe49hCDh/tJQiv1DVZ4GGbNxA3gRghxeGMHAGm+7XKXVlVniI+5LdkM9NwD3s elPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=SigCN4AVHei86kRQZwEntvrSjxCq9H0QhwsZWCUTzi0=; b=BB3oFEdeAjkSo6fZG9v2tsqC9PMcXjYtnFidfX+w6CQNK8cTkVMZrDuNYYr3qf8pqA 8CNzQLgInWxozDjoy74bpws2T90E8u9rcdhoG8CaCDGihyjqkucoaXERVgcc6sfO2Wm4 aXBXVFzFNwU2K9iZQEcDCczjKC/8FPyg0sSgTiAK5Yr3zasW6NP1f8sH+X9ppZatIN+f zd3Ovsj5FSdgicfBvw9fZVbBVaMU1eRyYawEGc+nC8rGDP4o8hiVbG29XvJuJTZablWX ioXwCpynbFNQctR9c4KJx57Q0ouTYshfIn+aEa3WLmPt9UefVGYqrL83FrqszvQ5Y/tW 2Zpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YN9pFwRf; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id k8si1563520pgt.29.2017.11.29.09.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YN9pFwRf; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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) 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-Received: by 10.223.171.85 with SMTP id r21mr2901084wrc.182.1511976510427; 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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); 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: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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- 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(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/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. - @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 correctly. **/ EFI_STATUS @@ -264,8 +265,9 @@ SerialReset ( value of DefaultStopBits will use the device's default number of stop bits. - @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 correctly. **/ EFI_STATUS @@ -323,8 +325,10 @@ SerialSetAttributes ( DataBits = OriginalDataBits; StopBits = OriginalStopBits; Status = EFI_SUCCESS; + } else if (Status == EFI_INVALID_PARAMETER || Status == EFI_UNSUPPORTED) { + return EFI_INVALID_PARAMETER; } else { - return Status; + return EFI_DEVICE_ERROR; } } diff --git a/MdePkg/Include/Protocol/SerialIo.h b/MdePkg/Include/Protocol/SerialIo.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. - @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 correctly. **/ typedef From patchwork Wed Nov 29 17:28:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120034 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3332030qgn; Wed, 29 Nov 2017 09:28:39 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ/Ozj4UDfLh/kRF27HMz9NzhjFmek82nCvgN01MxUya5M8mjozxrp+WLZ+jTTB2rE/faq5 X-Received: by 10.99.123.24 with SMTP id w24mr3440695pgc.438.1511976519731; Wed, 29 Nov 2017 09:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511976519; cv=none; d=google.com; s=arc-20160816; b=GfdlUdohnfEsAZGU0A0M15IWsQvfq1qMDjFaiMaK7kNGue7BLXgiwfkZvNLtrIozFZ +T+++tcLd+6hL9JgHXMd5nrkYNR8gdbwD0g5sgUIXRlVmNz7Tttc6hsJ5zp6nBeITDUY BwJTWnA3uBDf+sJHoYq5hRLhX+lubz9FhqbVRZ/RxajI0EmXMST1ZFDh/vRDyl9FFidR aY/HV3hxfuVCADSoX4e/KQdOc5237pF5ZrquqsB0k5HqaqbESAbFStaPRqL/E3O8wUQ8 2g7k+VL7jikfhF9gOX4OIa+GfsqDgRU0z7W0jWSbV/1G5RzU5rF/fLdEuD77PDOHNs6s cSkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=kqqqOyMe3vAvUP0lDGbpILI/uUHZgxNZpX5pTCzZbDU=; b=OVp38HwXWCUV5oFwDkpAfi0gRWy9riT/5nWv70CRiNkedeDefln4/IDQCLDGBl2flA +c+vFqMKVMQXFN1Hn5jFnl4UON9ljMZ9RBSrYxlICW68loUuq1XS1g4+NUSvx6g4o+/l OdB93FL7SkD7tqRMRCUlhMpPOL0RxkVvyW9hMAwDu4Sb7OWa2G4fg+RYPp0BbMbBacRH ej8dkmqDxdqnBbmoGug6UOi3QYUfKpJKfyoSCMEz6MxmLMvnor2UsY1AtCgbEqwSX65o vo83+eRZx96zpcV+DMwYtBdguBou2uf5GRLBZnHiKDrfNZ9BS5H/Uy4vZAmHrhFiWpll BeYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P19Ud4Ek; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id t84si1664787pfg.252.2017.11.29.09.28.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:28:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P19Ud4Ek; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.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 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) 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-Received: by 10.28.97.194 with SMTP id v185mr2966881wmb.21.1511976511361; Wed, 29 Nov 2017 09:28:31 -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) 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- Changes in v3: - Add Star reviewed-by - Fix typoes in the commit message --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/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 ); + // + // The serial device may not support some of the attributes. To prevent + // later failure, always return EFI_SUCCESS when SetAttributes is returning + // EFI_INVALID_PARAMETER. + // + if (Status == EFI_INVALID_PARAMETER) { + return EFI_SUCCESS; + } + return Status; }