Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7952515imm; Thu, 28 Jun 2018 11:59:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIAOOZCOMNpOUp8LbqZeBmaL+aotM8eVvWaA10hBXf2eLJU9bTQixh3ksTGQLi1F5RGUVbm X-Received: by 2002:a17:902:1682:: with SMTP id h2-v6mr11683218plh.327.1530212375533; Thu, 28 Jun 2018 11:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530212375; cv=none; d=google.com; s=arc-20160816; b=yR398T7jSdCJKjqM/PyIc8ag6KEY2dXtwpUOd0arGuB7WrxfY7dU6iLXxXo7kzIXYp WHP4xvvZKsyEZHET4hzMYZK/SEf0bvHDIdAe1ik2KA7bsgHny1Tj//EQ/yXE1ley3UOZ rYd2ml3AXYm+JA8JOtKLsZ6Ov521P9VJkn4JQxul/sVJjl7OwsDd8ufY3Wt4HvsfUvmZ e9KTYbPyh96XvYyfUFVu7aI3tUkhYrA0RSroFvuiq4GFLmTB4LNd1gi+wiKQHv31Csr7 n682ndA6dsSzxhp8qITSJilTPUYPoNWQIAntdViBwU8KCOT+r6Dw6Hvpuh7TJiqFEPFZ CaMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iJ21NpdsBFZSCiIIuKO8m9bU04Wu1xopF5rwwLYRt2M=; b=hbqNQcFIY0NRsURI6l7kG5SUy8WMdMgRNyNuww6lCOxI2L/JxBusZQdZlM7DEXxl3Q 990k47j2YhL2HzMKPp7P/x+80AQS5ff3gRjDWqupkQViTNkavUsoc1FeXAlpZKH6UsFZ TwIjAKfrHk9cZfBkjzodUpRlMOO1WXoGKyP9ZIxZTeO5BeqhDZOMGz6y2U6IU4yqMsnD q3+tS3Ayja2thyVSz4s/ULkwagrHy/FZyikNj5aW4HC2fMGH3Y+/Zxct/AdcZTWY6VwU 8Lt+LPqsoOwxnOtHparaITR1Vfl8gSdXlo4NZ3CbpgrF+53akpSgY+cfAN1UMpcxwCEX wJvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81-v6si8334270pfa.368.2018.06.28.11.59.20; Thu, 28 Jun 2018 11:59:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967105AbeF1PUh (ORCPT + 99 others); Thu, 28 Jun 2018 11:20:37 -0400 Received: from mail.bootlin.com ([62.4.15.54]:53331 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967067AbeF1PUI (ORCPT ); Thu, 28 Jun 2018 11:20:08 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 608B420DDC; Thu, 28 Jun 2018 17:20:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (nat.foo.tf [163.172.35.26]) by mail.bootlin.com (Postfix) with ESMTPSA id 3118720703; Thu, 28 Jun 2018 17:20:06 +0200 (CEST) From: Antoine Tenart To: herbert@gondor.apana.org.au, davem@davemloft.net, gregory.clement@bootlin.com, andrew@lunn.ch, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com Cc: Ofer Heifetz , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, igall@marvell.com, Antoine Tenart Subject: [PATCH 12/14] crypto: inside-secure - set tx_max_cmd_queue to 32 Date: Thu, 28 Jun 2018 17:15:42 +0200 Message-Id: <20180628151544.22134-13-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628151544.22134-1-antoine.tenart@bootlin.com> References: <20180628151544.22134-1-antoine.tenart@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ofer Heifetz The ORO bridge (connected to the EIP197 write channel) does not generate back pressure towards the EIP197 when its internal FIFO is full. It assumes that the EIP will not drive more write transactions than the maximal supported outstanding (32). Hence tx_max_cmd_queue must be configured to 5 (or less). Signed-off-by: Ofer Heifetz Signed-off-by: Antoine Tenart --- drivers/crypto/inside-secure/safexcel.c | 4 ++++ drivers/crypto/inside-secure/safexcel.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index 5feb83c6238b..9e5d2bf232eb 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -306,6 +306,10 @@ static int safexcel_hw_init(struct safexcel_crypto_priv *priv) else if (((version >> 16) & 0xffff) == EIP197_HIA_VERSION_LE) val |= (EIP197_MST_CTRL_NO_BYTE_SWAP >> 24); + /* For EIP197 set maximum number of TX commands to 2^5 = 32 */ + if (priv->version == EIP197B || priv->version == EIP197D) + val |= EIP197_MST_CTRL_TX_MAX_CMD(5); + writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL); /* Configure wr/rd cache values */ diff --git a/drivers/crypto/inside-secure/safexcel.h b/drivers/crypto/inside-secure/safexcel.h index 94a89664f3d0..95095cb95ba4 100644 --- a/drivers/crypto/inside-secure/safexcel.h +++ b/drivers/crypto/inside-secure/safexcel.h @@ -222,6 +222,7 @@ #define WR_CACHE_4BITS (WR_CACHE_3BITS << 1 | BIT(0)) #define EIP197_MST_CTRL_RD_CACHE(n) (((n) & 0xf) << 0) #define EIP197_MST_CTRL_WD_CACHE(n) (((n) & 0xf) << 4) +#define EIP197_MST_CTRL_TX_MAX_CMD(n) (((n) & 0xf) << 20) #define EIP197_MST_CTRL_BYTE_SWAP BIT(24) #define EIP197_MST_CTRL_NO_BYTE_SWAP BIT(25) -- 2.17.1