From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AH8x224tfgW5jOfww43Cyr4sLhiMLGNloxAKpeYi6aPTVHg2LVaHfE2QxwJWdfCmlIzYH7FlNRYUbg== 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 Cc: leif.lindholm@linaro.org, Ard Biesheuvel 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: [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: , X-List-Received-Date: Wed, 21 Feb 2018 10:13:27 -0000 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(-) 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); -- 2.11.0