From patchwork Fri Nov 24 16:20:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119597 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2436546qgn; Fri, 24 Nov 2017 08:20:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMbHeZxbEnD9Oqmb7SXZovQ34N7qNHeeOO45yShkAbGnzvSo3GhVb57qR3Kt+Ys+JsJSOAIZ X-Received: by 10.98.102.74 with SMTP id a71mr27664636pfc.23.1511540440559; Fri, 24 Nov 2017 08:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540440; cv=none; d=google.com; s=arc-20160816; b=zKpVMjXxle+u1hdqBRZD8FFgruxFAs70afVe1KscEKg27RUTh0tlS0NYoperutjphC /g6pwJvNUuOfkqC2cayX6jHuhEeVlrfJDi+mXfZV5heoYEDsxUbbyIGWT3XmpPvbyqiu 8nFOZUf1phK2sjIlUo7/VooLfiHpWr9iaptisRnxRuJGFlzBDA6TeXQP1z5B3y5p5N3E Ut59wBPlPnkEye5CQOC3DgJ8JaIdD4N/aD3sfWw/qghqmR8YdimCZRD5UI6irGWOk4t9 iX7eKQO+r6ykFRzmP9JPphD+qKxlhlZ7Wq5gz2gFswwqky5cvsENXCS1iPDjQuTs+gUB jIzg== 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=3cYhNDTnHCo5RnrFvp1LXPpoSdkfRsZd6N3fcb3iqt0=; b=oSryvJy8ok7CoArEn4/GvewkA5003WNro/UptMg2EEn9BAs0rer8+nLsPml/0bCNGm 4JRKoNPh67cdmxeVGyxUYbk0ytwdiwAxfVfWkXjFHRSGB+Rzkp31YOZiRsziRwUmZrZb VmagZIRrAOGKZQvAIsGeKNO27ahK9E7UKEobQj8uiFP8KKv9HjVcUXLLC4hZro0NbVxb Izp4+U7xu8BdJKMeqhwh2MtQjL2wkCg1jCW+OaI2/6/JBYvF7xtFilZCCYEYQqN078K6 Dfl06MiocNHr970iqTRm0J8nd5IaEkFRZfbf/mu6bMXKqX03OC4ZM+QwkKPqj1XJENtV 48tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dFpGt32o; 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 97si18799163plc.450.2017.11.24.08.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:40 -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=dFpGt32o; 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 3F2CB220F3C46; Fri, 24 Nov 2017 08:16:21 -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::241; helo=mail-wm0-x241.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (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 B6BB6220F3C40 for ; Fri, 24 Nov 2017 08:16:18 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id v186so23575540wma.2 for ; Fri, 24 Nov 2017 08:20:37 -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=C7XI33g3MwrgAHJ0EsONmW08cWz4i9g9hQH+kFHrLnk=; b=dFpGt32on4kqsCoWszBCzkE/+wye097UcoKrrPq/tVPL/zyVc2MoInfqMRsXLPWp/b ObCnZKgnbTNElP2YI2iN9l6eCuSTaXF5uT4RYp3+ZiGummZc0BJvr8LFGbZWUg4uKR0s mHxIszIpNCu4jU9jFP4LyURKrwlnPLisZBlf8= 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=C7XI33g3MwrgAHJ0EsONmW08cWz4i9g9hQH+kFHrLnk=; b=FWl7NynUsIOLXjyqRM+3tqUwX/36heQFUNwH6Vp1YdgV6jZJp58NbwHJqzHi36mpjg 1ooKCGPkTBOgBMl1HkTdVLtqv20BuVZZy+nIgZDIap/1zrZrXytjOevz8X6d7znDtAQS QKstlYqruLSJXTme47iylabZw6yntO0GDfqC9oex6FPsasOmAr8dvSsYFWNf5qhVfS1y fMbjnDKN9Ld1HVqkD7uBZmSzp65f86NAvTwg+5GxGoIEp5jPlt88hvPX29kUzdfVxw1b q9ZGIfXLJHaraUwb6D9+ptFQaXsQWks8EWepLPxn1yh7Tb4JmDFex9E2Kjx2+dDdGEHk K++A== X-Gm-Message-State: AJaThX6zAuOQbi9TYHZDyWHcuB889FfYsKxQXwRd9vWKrChvHU7ajWM7 2hvUq0QKrtXDduTLTITlysZL2w== X-Received: by 10.28.157.7 with SMTP id g7mr9540080wme.99.1511540436029; Fri, 24 Nov 2017 08:20:36 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id k30sm38803840wrf.63.2017.11.24.08.20.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:35 -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: Fri, 24 Nov 2017 16:20:28 +0000 Message-Id: <20171124162030.31156-2-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171124162030.31156-1-julien.grall@linaro.org> References: <20171124162030.31156-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v2 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 --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Signed-off-by: Julien Grall diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c index 964d0329f4..5946a6e2f3 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -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 From patchwork Fri Nov 24 16:20:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119598 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2436575qgn; Fri, 24 Nov 2017 08:20:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMZWW8sJERqF3Tduixh3uWRqvMc3Y1Y3O2GHaIdh2cUGEm0Q5drHZ3jVo4/nR74nFvagSLON X-Received: by 10.99.2.23 with SMTP id 23mr27554507pgc.99.1511540443174; Fri, 24 Nov 2017 08:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540443; cv=none; d=google.com; s=arc-20160816; b=h198GMSUleePGm+iuipqKPaNReBF9zTpLJmG/zXBqcmQXae9D8LZB7mctd8ZjyX0gb 7CEaPCAt1/9s/zv99FKHLbwxr2fK0wh6OJ0QKyBaYlurE8RG0EYeQM+TDiJb2AuHGqie ro+lFjLUY058uacElzrc5rJCda+t2x+kU7AOyaHm162tBeOPyv18C1Rd2agloxVx+Wq6 wMKK0vAzzL1DTAvkdIRx+qAcJ7igcKt2Ahwn+47X1zgqMLrfx4JfG77tpxFxIzj3lVtn p2nvAhgsq/qbrnNpPFECgrsYZbH8ykmwNHorABZ0jsRT0Y/Nrapwe+/GtDjhXhTAVuRh /oaw== 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=x9yK971/p8URHXN1UJmRTsGE6dIUFPJJBpvs2+yhV8g=; b=qYOYXHnrArnzi3MwCVlGaWhr7mRFZLQ1uY/LT4cMWqUVdZt5eFegkotPoMh2kcH0Gr ZZrREBuLqfv4QUlvFqcvMgUM5eMAuuODXA6sRRq8ssuj2Xv1wcc/CU0EUMpu8Aj7+ILx Tk1n43UO7Vkei6qW+EKT6YefumqgAa8OwbOw45VFS0tXCOrcCc6mnPStM4p5+gEPAYfZ KFknZt8H2pu3L/PeCsvQhmkEXsAnbnSg+9wuPnQ4S/SYhrw8/9kxWpzstS4VPQ1yQvUs MV821MaNv0vG8P1YmMz+lkpmX+1+ZIJAv5r6a0ttvJ4mfgWD3nxbo8XndSdmta6aKDj8 pzjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=F1nzBkvK; 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 q75si20192280pfg.61.2017.11.24.08.20.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:43 -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=F1nzBkvK; 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 78473220F3C4A; Fri, 24 Nov 2017 08:16:21 -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::241; helo=mail-wr0-x241.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (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 E7032220F3C43 for ; Fri, 24 Nov 2017 08:16:19 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id u40so20787262wrf.10 for ; Fri, 24 Nov 2017 08:20:38 -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=mMuGFrfwfga4dxcOTjsK8Qf5KAouUEBFIbpC8e+wrKA=; b=F1nzBkvKkCrWmx6JUJV8mAUylIMZG8dRyQSZkh2g810ZPofZpQVInBvsI//9eS842R Ah7dcBC3JKfNkHQ9bOrgP405etKzsfVwjrH+wM00OYx0uf90Tjy8LUQpf0Ur+v8nKrgL srgj5mS+0Cny3xTa8fkW58/tE+8Z2xf/fBwhI= 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=mMuGFrfwfga4dxcOTjsK8Qf5KAouUEBFIbpC8e+wrKA=; b=hzjsKk4Q0Mi0cFbJ8I3WLmrLl+04FDyJugL4uWap2oEr0m/xdmeBjxWWCPGdZNesnP 5tKZu/bUx758cwpMbFmohadNY1QGhxgobCRVCCbX5yR4c4UzO7YZZ6GGNnxI0/olTt6f pbRHxJx1gVL3hphzAVrBStz3PKjplZ2dr6Uv+IW+CtZeJIclp/iICaYcgWONl80XIbxr bMpjB9C9zEKvE1yjSMgX5FtppaVt9taTpxkitBea7x8bs+vzBN0epjUI+WjW/uxj4EgW 9gv1y16Un+awmD+sANpO89R+x3YO5SHeblcdKZrVTKLrFabdPsvrKhmWVmxnt8D9mEZ0 WOBw== X-Gm-Message-State: AJaThX6nyudVFP+jDhLzPCloRofFgdYBV7eXr+ZW9tjRn/vr+oAKLnkb bi/6nZlm2lLlcVNIq2aCuA/IKA== X-Received: by 10.223.181.132 with SMTP id c4mr1142490wre.42.1511540436925; Fri, 24 Nov 2017 08:20:36 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id k30sm38803840wrf.63.2017.11.24.08.20.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:36 -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: Fri, 24 Nov 2017 16:20:29 +0000 Message-Id: <20171124162030.31156-3-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171124162030.31156-1-julien.grall@linaro.org> References: <20171124162030.31156-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v2 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 --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Signed-off-by: Julien Grall diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c index 5946a6e2f3..08b95a4a33 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -264,8 +264,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 +324,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; } } From patchwork Fri Nov 24 16:20:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119599 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2436628qgn; Fri, 24 Nov 2017 08:20:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMbt6VcDc5GhX6v9VB0uul/6Zcc3lzhtFZ8QI6KvPdYaU/S88dJ9AeY7qDQ39R+qQC/lROyp X-Received: by 10.101.99.130 with SMTP id h2mr10698577pgv.361.1511540446007; Fri, 24 Nov 2017 08:20:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540445; cv=none; d=google.com; s=arc-20160816; b=MWSGHMDw/R7mPnpHw9U+jhOrGrL8ktZP2vsf8EEikqWn7HG8w9+VufrTzESQ98vQdz VXcucrNmqoylk70+q3KHGNen4vZ9ibuPUp3wN9YYtfpk6kCbp59cLJ2tLKn895kXEI6A zLafmhGmI3ySFA71aWN5m5dhDasgYXfhTetBZzbTaVsn6Hf77IrXaMRh1Fgc7pnrAtzl 7jcsm8JXwzPhv7ktm3PaXDVjIUggW4JX5h6FLr0tI0J+HKa4UI+517uT/Z5mdIPSCXxs ndPFkXnyQMbTnelvmlQbJUxPUjEQ6KUZVDfwkObnCkwzqZr8OfmNkg7JQqTQClpawXZu KXkA== 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=nrn0mq9DDM08S5uqK8o4B5P0JfTF+eOnGOpXTb3/Fuc=; b=rduMyNQWh4pYQ106zY94Wg7+4sF7eMsGyV4HaLUmXq8TMmiwsCsi8fmAF3iaaXsqGh fhZ0tQkDejmSYQgtxq1F29SZNyNLSAqmwnLavAOXeYu2Q38uk88y49v+OfzBupsEsl2H s5dpA8fS9HYmIZf9+eR6DW4IJmFe8QzYPpSA8blxSRz2P8EDQ3fuGYanbNwxDe30f6Kw isQT2NBAWnfyuJpPviQKmRGQ60ak2dcqJTpyo4zEYxqr2goSPnpB8BjmC54rOGIUFihA yC6GEFQ/v5Zk6OEVaquzN6g853vMmNjKleEblgwUoyD74DXN11bx7ZLKbM1dsxOkABLN WZGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LhKn8unM; 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 l8si18620723pga.538.2017.11.24.08.20.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:45 -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=LhKn8unM; 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 B73E1220F3C4D; Fri, 24 Nov 2017 08:16:21 -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::242; helo=mail-wr0-x242.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::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 6D693220F3C43 for ; Fri, 24 Nov 2017 08:16:20 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id s41so15381438wrc.7 for ; Fri, 24 Nov 2017 08:20:39 -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=12vqC89W4GPyhGrp1c7xCGSKpv+UI711veQLbgWGXgg=; b=LhKn8unMDt/PnPmi/1vl1trbtpijS+gMpAHPiWTHmEuOB7sXHpr8OYT9asnlpvayoR IFsNTaEIggNx3rYfVQwYXj7qCLuFLer1Owb/001+qBEqB0eQR9jxBB3X050dVlCQ75Oi +R2L1B7WbVvcPXNslqb/Ln+ybeGMYFwxrHh24= 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=12vqC89W4GPyhGrp1c7xCGSKpv+UI711veQLbgWGXgg=; b=Q6r/AGp5HIIK8AKfvh48wjQI1p/vmTLgI9iPg0DtQ3DUaxHXFOVG7pDwwFE1do19wY Opuyff5hcNk08ZtM84lSa5lwIE4JSVOQ+8Ru3j61+ZsW/aanwSWMv5BlFMJjML1oJ/A4 Y8iYfQnytN5GdGn38Vs899wj+2TSrXAsuxzAXb59/XQefc06X3Atwsz0JhpxMN/vDeOi MHjOI1ebVAB5piYWeMsQzWAfoGXkCddkdfwRhD3s4tzTddnNZFNjq1BdM6XvMYNcHo8s 48Gzne39BDxnhwYbNg77fYBsLFBgGllzOVcN+lVnkvChc1hWwRGE75kxx2ZBrvHil+Gx wEqQ== X-Gm-Message-State: AJaThX7QboituaH30R43g5N6XL6hNpqu0PIqHXB4T2/2zdcCar2aSwcb ZJgUv1VpwfMQAs3qU3dmOeyzgA== X-Received: by 10.223.195.203 with SMTP id d11mr27663173wrg.39.1511540437907; Fri, 24 Nov 2017 08:20:37 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id k30sm38803840wrf.63.2017.11.24.08.20.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 08:20:37 -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: Fri, 24 Nov 2017 16:20:30 +0000 Message-Id: <20171124162030.31156-4-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171124162030.31156-1-julien.grall@linaro.org> References: <20171124162030.31156-1-julien.grall@linaro.org> Subject: [edk2] [PATCH v2 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 propated 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 instropecting 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 --- 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 Signed-off-by: Julien Grall diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Universal/SerialDxe/SerialIo.c index 08b95a4a33..53d2785fed 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c @@ -239,6 +239,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; }