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::242; helo=mail-wr0-x242.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (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 937E8223C1761 for ; Wed, 21 Feb 2018 02:18:53 -0800 (PST) Received: by mail-wr0-x242.google.com with SMTP id s5so2955636wra.0 for ; Wed, 21 Feb 2018 02:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yau5goiWIrjAybvDwJ07a3a+4KyJFAoEaua0Ud3IgIA=; b=E0+UvBf2MBLVo1sMKpmC8/R3E4pEE7wIyBk6jbsKsbquVZsnrsFaq36pzNUKdNoOpq bpu66XMKcDZ7ROQA+kyURzcaviD6tQjnrVDbNFef8Fi8TEkl77KgRNy+YVO68dbnVFkt tbTLU8U0yqDcjz8EKHlzWVSnVUrpF6yYW3nsI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yau5goiWIrjAybvDwJ07a3a+4KyJFAoEaua0Ud3IgIA=; b=CUd5Krakugk+dCxuFFfrI4Qq5h76dR7XNsGev6Mckb0t2iFRqg+sF+gmKybRiGm6Se cUEPa5kZ3Ny2vKkfTlqJT0drfF6K49xdOGQgW/GJJ4Pb/CuOJFu4oqfuJ6dMIpysyDdh pNTXielcDnyEYXCLSxOmuJG6Frsol4UJGuor5PwVY7TcoTi25i9JZEIZG1CyFYJCdAGi Jgi1X6gU6lL9XikSUBFP45dGf0QyYDa2Kh4WyCXd5qRVaWFlxb2SJ7KaX8P0qfWxd3Ts rOeVLAvqyXglQHyM7flZYQyrYsvg2bGGdZ68grcZxum/5P/I8JkrUOPphsz66rEfVNdD B9pg== X-Gm-Message-State: APf1xPA4oT3qxp5erKTP3rCONukWgdEnL+bKTh6lBaJfpI0hBKayj3U8 SxYo5zB1zrPEX335NPZuhf02lvR+dzg= X-Google-Smtp-Source: AH8x226GHseuf5Sad7fcVsP/xHWP7NIGNyi+P+eT88uqZk2c70qlO+o36dSX3VMf4Xc5Mu8Qz7GBrw== X-Received: by 10.28.170.195 with SMTP id t186mr1705774wme.93.1519208691342; Wed, 21 Feb 2018 02:24:51 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 41sm39043611wrc.12.2018.02.21.02.24.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 02:24:50 -0800 (PST) Date: Wed, 21 Feb 2018 10:24:48 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20180221102448.d5liacahtcofcbm7@bivouac.eciton.net> References: <20180221101918.16088-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180221101918.16088-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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:18:54 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 21, 2018 at 10:19:18AM +0000, Ard Biesheuvel wrote: > 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); This change also causes // Stop the transfer MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, 0); to be executed in the faulting case. Which at the very least looks quirky. / Leif