From patchwork Wed Oct 18 10:19:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 116259 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp5889157qgn; Wed, 18 Oct 2017 03:20:14 -0700 (PDT) X-Received: by 10.101.65.11 with SMTP id w11mr13663282pgp.207.1508322014230; Wed, 18 Oct 2017 03:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508322014; cv=none; d=google.com; s=arc-20160816; b=BZEthUw1zrXSsIyPQsLPRaR5WSTobIF8wQqyzXWID2kOy3/1RDXQdf8ewrajpxMuJW MvpAj9Qbk6p69epN7zE0H+y/mJH2gtXHg4H69aHXrB/aQFNc8E9uLf6pLklFGhgXeCVO 13ZCSDMb31agt8ddqOAxArzQsldudnJQDIfzbmu/rayk8tAfv53wTzryD6DyiU62ys0M 23flIvTypOmjKYq0CKe7QkPJ46DL2MMJHvxLvx010Ap6seo1cxQymLChOoa9CaZLYjKI qF9YiRZ60jJ/J69LaiQZDQEASmOaunlea7Bsg+tuTc78eCGArwWjHtAJtfnnXmOWGvZK Ts7g== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=fQh/vdMXVpJE6wIq9F2veevroXMrnn3S2hEABKJ2U2Q=; b=NJRDIjlfAoOgvFVQ0gcSNVXl8DZ/EFgJ4Swuzl7AEp6+zExjVap/xCirbOdFOxaerz AeFCor5+OsgBED4l7MiwZAy8dpyEA7EGza3Hvqek1DcAMg9DROUovVsQ1gHToNPq+zlr CKiNMuFecp64Y+6NyCS5hNSt0kkdecPNhSWmeeFBOavXPVFOkPNmlc2lHC9fw7ZtT9pi Pra2oIQB4oJYA5BPQcvsvgmQXlO2tM4MFmkN91y5wf6HRRJa9chNxhkpDJG6AzQygXPd ToB6Y2m3mL5W2HvxtXP8uwvzBjmKpumktVktc7a7ASzIav2GDVMBk8vAa+AZD2Gy+EUN Pq6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OjfkqBrx; 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 r28si7240128pfk.101.2017.10.18.03.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 03:20:14 -0700 (PDT) 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=OjfkqBrx; 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 3FD022095E53D; Wed, 18 Oct 2017 03:16:36 -0700 (PDT) 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=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 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 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 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(+) -- 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 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; }