From nobody Wed Dec 25 13:45:50 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 150832201465782.89954990503145; Wed, 18 Oct 2017 03:20:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3FD022095E53D; Wed, 18 Oct 2017 03:16:36 -0700 (PDT) Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) (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 0A248202E60E9 for ; Wed, 18 Oct 2017 03:16:34 -0700 (PDT) Received: by mail-qk0-x22a.google.com with SMTP id x82so5540680qkb.12 for ; Wed, 18 Oct 2017 03:20:11 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id y29sm6360381qtk.64.2017.10.18.03.20.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 03:20:10 -0700 (PDT) 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=2607:f8b0:400d:c09::22a; helo=mail-qk0-x22a.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; bh=N3PvhVE5ZDvk/0PXZ2n6QJACAcrY77qGhW5KgrYF0jk=; b=OjfkqBrxG/u+n2LiojpYLbEQJ4J4ejxr9UDOSyTytUoU4uRVTM2vcH9zm+6ylSPW68 saRL8RZx1b58OKlPPpe07cbklJQQTIgQRD6uUscpDT9MjlJlLeMsJuzfgt1lJXi8jk2b pYSZfhVVjMO/gPVet4a8qndXek0ysyaj3oBHg= 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; bh=N3PvhVE5ZDvk/0PXZ2n6QJACAcrY77qGhW5KgrYF0jk=; b=U8Qi1Di975RNmJxC/Y4wEHBt8jqchRCgfeV1yhQUzz2ZNkwsNcxNVv7VLNyOHc3w1S rGLzU7hQgkvJT+Al+ySyzPgi226UBBB4YdjkLocHcddpKuzzVT1Ng6dFG7xc2y7sJA7G wzeANvyMqDGwD5FtRVx9+LpMnMeQGbwgPpb8bxbErfPoGR9SIDynOj/55JFCGT4NfdSd mYS4xaAFDzX4mBlU02zeW2U1S8bI3p0dSGYLhHfPgv26suXjuGaCK2HZm2WDJgA2YFXo d9A0DUl+EPyzu7sm6EIzSxWfkyGoRfkAQcL/rx+QsSR8niqQPlxvYeGIj+QMXLUuXpi/ 5w3A== X-Gm-Message-State: AMCzsaUoLxMY8ZC7dIUz2BxQmTRclp77qDkrLkdcocYmboz4MDGTg+yH HGgamXjH15yeakKmZad3cXltyw== X-Google-Smtp-Source: ABhQp+Rfm1YxQS4Nhf+I/yO91uo8n1ZfLjP3D1dvK5D01O4My/xjXNt/gjapxVYZn8d7cRpTG6umIw== X-Received: by 10.55.188.6 with SMTP id m6mr1681968qkf.312.1508322010844; Wed, 18 Oct 2017 03:20:10 -0700 (PDT) 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, 18 Oct 2017 11:19:51 +0100 Message-Id: <20171018101951.1890-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] 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 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 --- MdeModulePkg/Universal/SerialDxe/SerialIo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c b/MdeModulePkg/Uni= versal/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 =3D=3D RETURN_UNSUPPORTED ) + return RETURN_SUCCESS; =20 return Status; } --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel