From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) 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) 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) From: Julien Grall To: star.zeng@intel.com, eric.dong@intel.com, pankaj.bansal@nxp.com, lersek@redhat.com, leif.lindholm@linaro.org Cc: edk2-devel@lists.01.org, Julien Grall 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: [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: , X-List-Received-Date: Wed, 18 Oct 2017 10:16:35 -0000 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/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