public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org,
	nadavh@marvell.com, neta@marvell.com, kostap@marvell.com,
	jinghua@marvell.com, jsd@semihalf.com,
	David Greeson <dgreeson@cisco.com>
Subject: Re: [platforms: PATCH 03/10] Marvell/Drivers: MvI2cDxe: Reduce bus occupation time
Date: Thu, 26 Oct 2017 14:13:24 +0100	[thread overview]
Message-ID: <20171026131324.6md5ji7olqzx6n3f@bivouac.eciton.net> (raw)
In-Reply-To: <1508980777-29006-4-git-send-email-mw@semihalf.com>

On Thu, Oct 26, 2017 at 03:19:30AM +0200, Marcin Wojtas wrote:
> From: David Greeson <dgreeson@cisco.com>
> 
> During each transaction start, clearing the I2C_CONTROL_FLAG
> was surrounded by 3 uncoditional stalls. This was not necessary,
> so replace them with one busy-wait loop, whose polling
> count could be also safely reduced.
> 
> Above improvements result in faster transfer initialization
> and allow to reduce the I2C bus occupation.

See now why I keep nagging about explanations for delays? :)

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: David Greeson <dgreeson@cisco.com>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c | 6 +-----
>  Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h | 2 +-
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c
> index 8ed96f0..3c26d18 100755
> --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c
> +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.c
> @@ -243,9 +243,8 @@ MvI2cClearIflg (
>   IN I2C_MASTER_CONTEXT *I2cMasterContext
>   )
>  {
> -  gBS->Stall(I2C_OPERATION_TIMEOUT);
> +  MvI2cPollCtrl (I2cMasterContext, I2C_OPERATION_TIMEOUT, I2C_CONTROL_IFLG);
>    MvI2cControlClear(I2cMasterContext, I2C_CONTROL_IFLG);
> -  gBS->Stall(I2C_OPERATION_TIMEOUT);
>  }
>  
>  /* Timeout is given in us */
> @@ -295,9 +294,6 @@ MvI2cLockedStart (
>      MvI2cClearIflg(I2cMasterContext);
>    }
>  
> -  /* Without this delay we Timeout checking IFLG if the Timeout is 0 */
> -  gBS->Stall(I2C_OPERATION_TIMEOUT);
> -
>    if (MvI2cPollCtrl(I2cMasterContext, Timeout, I2C_CONTROL_IFLG)) {
>      DEBUG((DEBUG_ERROR, "MvI2cDxe: Timeout sending %sSTART condition\n",
>          Mask == I2C_STATUS_START ? "" : "repeated "));
> diff --git a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h
> index 028fd54..3c9beaf 100644
> --- a/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h
> +++ b/Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.h
> @@ -68,7 +68,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>  
>  #define I2C_SOFT_RESET    0x1c
>  #define I2C_TRANSFER_TIMEOUT 10000
> -#define I2C_OPERATION_TIMEOUT 1000
> +#define I2C_OPERATION_TIMEOUT 100
>  
>  #define I2C_UNKNOWN        0x0
>  #define I2C_SLOW           0x1
> -- 
> 2.7.4
> 


  reply	other threads:[~2017-10-26 13:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  1:19 [platforms: PATCH 00/10] Armada 7k/8k - misc improvements pt.2 Marcin Wojtas
2017-10-26  1:19 ` [platforms: PATCH 01/10] Marvell/Drivers: MvI2cDxe: Abort transaction immediately upon fail Marcin Wojtas
2017-10-26 12:51   ` Leif Lindholm
2017-10-26 13:19     ` Marcin Wojtas
2017-10-26 13:54       ` Leif Lindholm
2017-10-26 13:55         ` Marcin Wojtas
2017-10-26  1:19 ` [platforms: PATCH 02/10] Marvell/Drivers: MvI2cDxe: Fix returning status in MvI2cStartRequest Marcin Wojtas
2017-10-26 13:11   ` Leif Lindholm
2017-10-26 13:22     ` Marcin Wojtas
2017-10-26 13:55       ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 03/10] Marvell/Drivers: MvI2cDxe: Reduce bus occupation time Marcin Wojtas
2017-10-26 13:13   ` Leif Lindholm [this message]
2017-10-26  1:19 ` [platforms: PATCH 04/10] Marvell/Library: MppLib: Prevent overwriting PCD values Marcin Wojtas
2017-10-26 13:15   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 05/10] Marvell/Library: MppLib: Disable the stack protector Marcin Wojtas
2017-10-26 13:26   ` Leif Lindholm
2017-10-26 13:29     ` Ard Biesheuvel
2017-10-26 13:57       ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 06/10] Marvell/Library: MppLib: Take 0xFF placeholders into account Marcin Wojtas
2017-10-26 13:30   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 07/10] Marvell/Drivers: Pp2Dxe: Change settings for the always-up link Marcin Wojtas
2017-10-26 13:38   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 08/10] Marvell/Drivers: XenonDxe: Fix UHS signalling mode setting Marcin Wojtas
2017-10-26 13:41   ` Leif Lindholm
2017-10-26  1:19 ` [platforms: PATCH 09/10] Marvell/Drivers: XenonDxe: Fix base clock frequency Marcin Wojtas
2017-10-26 13:46   ` Leif Lindholm
2017-10-26 13:54     ` Marcin Wojtas
2017-10-26 13:55       ` Ard Biesheuvel
2017-10-26 13:59         ` Marcin Wojtas
2017-10-26 14:02       ` Leif Lindholm
2017-10-26 14:29         ` Marcin Wojtas
2017-10-26 14:52           ` Leif Lindholm
2017-10-26 15:07             ` Marcin Wojtas
2017-10-26  1:19 ` [platforms: PATCH 10/10] Marvell/Drivers: XenonDxe: Do not modify FIFO default values Marcin Wojtas
2017-10-26 13:47   ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171026131324.6md5ji7olqzx6n3f@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox