From patchwork Wed Feb 21 10:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129014 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp454141ljc; Wed, 21 Feb 2018 02:19:29 -0800 (PST) X-Google-Smtp-Source: AH8x224PuhOy1xUg/qgD2cy2c0wgP+NOfDyI0sNCCCBlPH6hTSrtk4u5QR6yGQWqnenHRmyIuLOs X-Received: by 10.99.127.90 with SMTP id p26mr2342134pgn.268.1519208369010; Wed, 21 Feb 2018 02:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519208369; cv=none; d=google.com; s=arc-20160816; b=pigEN38uw8dppVMYnLdJIT2+WUwgVAakIfIW3wdtJkUmswy53Wc6zIMgaTOyjIs61C EiZfJAFHMlZB+pcAUlMtmUWfnT6LdiDnDuGsswUC9BEULvyqzHTTiGIeyHoEYe2y6dar CiM4YBZMLcEWGmmuguEsIh7iavsc6P2McaboEzeX0g/fqshPr2FD5CASuV/ckBgJV4GF vijmDfffMENzdgSvUBxQKWaTS6QIkU1g1nKPROQBSp0CTakY0vTu/BKA0GcymfVRwqE6 hgTMvOT1ld1Z2JG7n4DvNONAElmmAV/2Y5Ekp5VxbvkQLpVlcdDlRJ5W22ItgzH5EYIC 3CZQ== 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=hkSgUSTBp5c0b6RQkP50G62icqOCnGkcc7yrisveRzI=; b=dnuNUQVHdRjm/cnG89cuqYfytVDS9PE+znjC9tSE+knPMuoWMgVhDeB/fYXJazFUwM JKUXiliGXPRlveUKNxi2gqtuL9R4ghGVxHOoKzfxcg7d5R1JPqC+0Ol9WAPzXNEg6VQx kqxVerwmVfzZMV2vAoJH4O7sJjVy3Dw4ti1CNjdE5Tc8gacM1jch60S/o5y52/8pM4n3 VzjTp4RBD+nFxryLSG32rKUW3NKhRB2Kyp0d7xSOoPVK188Ee+Y3W0bPkGL5b8995JU9 pHjUMjJyD0vA8U4aszi9CzEvuOTrJL6e2/NUO27bTGhqBJFTlI5XQjfJJVdyuw/yNvT7 6gHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ovq7TPxW; 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 e4-v6si1343159pln.655.2018.02.21.02.19.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 02:19:28 -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=Ovq7TPxW; 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 8C12B20954CAB; Wed, 21 Feb 2018 02:13:28 -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=ard.biesheuvel@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 251E7223C1783 for ; Wed, 21 Feb 2018 02:13:26 -0800 (PST) Received: by mail-wr0-x241.google.com with SMTP id o76so2877163wrb.7 for ; Wed, 21 Feb 2018 02:19:26 -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; bh=sW3/F5zNw9LkfhnXXPWGmeNJyisl0bN0jMO1lVQhTK8=; b=Ovq7TPxWiRoKYUjUVVoytSv8bSzGqBzw7w7X6Z8SJI9ZkgpnSN1KBmtB0INOJ0YXAm KuFj0wIgzOqPoNRxCAveGfgcz8R0M3xmsBddjTE0nAhj+XVZNZvnUW2Izv4pIEcLOWxv MvdKSh6gs6ZtJUbdS94JuzEZxWBTJ8fWfN9Tg= 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=sW3/F5zNw9LkfhnXXPWGmeNJyisl0bN0jMO1lVQhTK8=; b=d0LKctl7Sew/7PXQBODo2yG4ueRkJYIQHXPdl7DO0PNLhKO/z9roLDsFp0/nncHq+/ QcnCxZ1u6hpdOAHLXjIBuzOD3pw1jV9FX67x1WB2OEPbQe2hyAA6qwgfrpDFxFGFE8TS B2oT8S6GR+/PGEPyPRbtFp9w+Fva/FdLHvyzVwbR3qYIPwe7KZsNr1pxdcl7LkO5D8kM +5TS6ZWu6Gd4fXiOB2MLVB7SQaxWA4rsOoB7Kqb/ATgeTBFzpbIgZkZLOVHA+lXuDyaQ kQ5Myt3EP7aGTOPMmIyDdSx0kQ252fZTJE1AzE1BlhjgWugaoNymUhzyk13RHyqIV0NZ +SYw== X-Gm-Message-State: APf1xPACypQ3gFgED7DDdZ+QcQD+amC7hPkpau9bSWT+X0D4MEjhSsLX wDA15RN02NxvPxW5KfydwF3KaTHYA4Q= X-Received: by 10.28.11.70 with SMTP id 67mr1527861wml.158.1519208364115; Wed, 21 Feb 2018 02:19:24 -0800 (PST) Received: from localhost.localdomain ([105.149.187.179]) by smtp.gmail.com with ESMTPSA id k13sm24243042wrd.61.2018.02.21.02.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 02:19:23 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 21 Feb 2018 10:19:18 +0000 Message-Id: <20180221101918.16088-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH edk2-platforms] Silicon/Socionext/SynQuacerI2cDxe: fix TPL handling bug X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Currently, SynQuacerI2cStartRequest() increases the TPL to TPL_HIGH_LEVEL while accessing the I2C controller hardware, but fails to restore the TPL to the original level if the call to SynQuacerI2cMasterStart() fails, and returns right away. Given the TPL_HIGH_LEVEL implies that interrupts are disabled, this results in a complete system hang. So instead, break out of the loop, so that the TPL restore will occur before leaving the function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.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 diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c index 46c512a20151..b2318a6f5a8c 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c @@ -324,7 +324,7 @@ SynQuacerI2cStartRequest ( Status = SynQuacerI2cMasterStart (I2c, SlaveAddress, Op); if (EFI_ERROR (Status)) { - return Status; + break; } Status = WaitForInterrupt (I2c);