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:c09::241; helo=mail-wm0-x241.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::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 9BA1920352609 for ; Thu, 26 Oct 2017 06:50:33 -0700 (PDT) Received: by mail-wm0-x241.google.com with SMTP id 196so19459227wma.1 for ; Thu, 26 Oct 2017 06:54:19 -0700 (PDT) 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=1FCLlcaubQ4o11/O1BrD/o1pk7Xw25pvx38BvZ36g4U=; b=OoKLiZ8U9b9M9yl7KrWzsWU4bi+TEnnJDZTiKtM6Y2ZAH4pW+7FG17f3zgPwDwDUsX wsICKYB2yvj7reFU5znaeyFF64khfKLCZQgfsb6CrIGS7klRBwEiC/XaY/5Qkalln/H6 +GfknM+NfqdhKXzw1sKqd3xqvadVGEE7xHZ38= 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=1FCLlcaubQ4o11/O1BrD/o1pk7Xw25pvx38BvZ36g4U=; b=FYcWgKJo+a7/itLKa1v297OFwjB1OvCxiSfG70Ni31pyUG74oCsNB04sDKq3bhp2JO UqeRivtBO4LE572tfMfC66NaeMW8ygs3hh70WHyjveRG0EzC03/+nr944CzVoQICAiqp vw2ICCRCR7OfwZBs8mHZ4ChVAHaG0H5DHEqUmJTX6Uy/hu04f221h9aAMkPmrBonmMkE xsJAkmpA3EF5Lv6cLJk7bGgJ3xd2jC4GkqmIbx5jrNYLDw7huO0uEruDqNBkaYvClcXZ lJHuyfTjvYu5EaQCGM9Q3aX4o/3QLvPXYoqzVK8cEhKETfss1b0oYj9qWAxXt9opRHsJ kFgA== X-Gm-Message-State: AMCzsaUCsSUT1Bw07KdRPBpR4ezHWI7q6CY1QoYJFLL9UWbd4TJShXZZ u+HspBcFl7SjAgbD2/B2bvt7Bw== X-Google-Smtp-Source: ABhQp+QOXrleGB8NWvGr4TaFsCwhEU4AHY67lavd2BCTAGP16Uo1ZIGP4xVSxk2E4XW34HVIeOeNdw== X-Received: by 10.28.143.130 with SMTP id r124mr1757152wmd.122.1509026058185; Thu, 26 Oct 2017 06:54:18 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 65sm3841242wrn.27.2017.10.26.06.54.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 06:54:17 -0700 (PDT) Date: Thu, 26 Oct 2017 14:54:15 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel-01 , Ard Biesheuvel , nadavh@marvell.com, Neta Zur Hershkovits , Kostya Porotchkin , Hua Jing , semihalf-dabros-jan , David Greeson Message-ID: <20171026135415.yui6fvz44je334b2@bivouac.eciton.net> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> <1508980777-29006-2-git-send-email-mw@semihalf.com> <20171026125143.bki4fywgtf3ybvmm@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH 01/10] Marvell/Drivers: MvI2cDxe: Abort transaction immediately upon fail 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: Thu, 26 Oct 2017 13:50:34 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 26, 2017 at 03:19:36PM +0200, Marcin Wojtas wrote: > Hi Leif, > > 2017-10-26 14:51 GMT+02:00 Leif Lindholm : > > On Thu, Oct 26, 2017 at 03:19:28AM +0200, Marcin Wojtas wrote: > >> From: David Greeson > >> > >> Although the I2C transaction routines were prepared to > >> return their status, they were never used. This could > >> cause bus lock-up e.g. in case of failing to send a > >> slave address, the data transfer was attempted to be > >> continued anyway. > >> > >> This patch fixes faulty behavior by checking transaction > >> status and stopping it immediately, once the fail > >> is detected. > >> > >> Contributed-under: TianoCore Contribution Agreement 1.1 > >> Signed-off-by: David Greeson > >> [Style adjustment and cleanup] > >> Signed-off-by: Marcin Wojtas > >> --- > >> Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 34 +++++++++++++++++--- > >> 1 file changed, 29 insertions(+), 5 deletions(-) > >> > >> diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c > >> index d85ee0b..7faf1f7 100755 > >> --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c > >> +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c > >> @@ -565,6 +565,7 @@ MvI2cStartRequest ( > >> UINTN Transmitted; > >> I2C_MASTER_CONTEXT *I2cMasterContext = I2C_SC_FROM_MASTER(This); > >> EFI_I2C_OPERATION *Operation; > >> + EFI_STATUS Status = EFI_SUCCESS; > >> > >> ASSERT (RequestPacket != NULL); > >> ASSERT (I2cMasterContext != NULL); > >> @@ -574,35 +575,58 @@ MvI2cStartRequest ( > >> ReadMode = Operation->Flags & I2C_FLAG_READ; > >> > >> if (Count == 0) { > >> - MvI2cStart ( I2cMasterContext, > >> + Status = MvI2cStart (I2cMasterContext, > >> (SlaveAddress << 1) | ReadMode, > >> I2C_TRANSFER_TIMEOUT > > > > Much as I appreciate seeing this form of the code, since it simplifies > > seeing the functional changes, this does cause those lines left > > unchanges to no longer conform to coding style. > > Can you please adjust throughout for a v2? > > > > No problem. I of course saw style violations, but I gave up on them > for "no mix of functional improvements and style cleanups" contraint > :) I will correct the modified function calls. Clarification: this is and has always been _unrelated_ style cleanups. Any statement that is actually being modified should be conformant afterwards. Thanks. / Leif