Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5171977ybe; Tue, 17 Sep 2019 04:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX7ukecKA280y3uCifVvSLlvvP5SboILoXMVzVUVd9ij7h+1ckNKuxD0ZS8Okm9+dDx2GK X-Received: by 2002:a17:906:80d:: with SMTP id e13mr4122942ejd.72.1568718002944; Tue, 17 Sep 2019 04:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568718002; cv=none; d=google.com; s=arc-20160816; b=GWwq4NDUzEoxk13RLH84fkk18ZBtY2dOxJ9MQlD2IAYERlczOfxfJePE3b65j4+NWf o+DCQPbGp8cwsA1J4Zv4gWGXXEZZKRNjmWqud771o4QljQfOxYN3DAV5VaNNfHEEmwkZ DFjGi4GhbiTJ4DQNwmwhi27wh6DS3NP+rz9BwWAFT2Bd/53JdLDglPcRyzkN9fZQlBfh 8GNvq4UlCL1gRg+Ca1NAGZ49T7KSol0Gzf/puYGlK2NhtsBOdIwUKm1JR7JL6X14jlYy UkvycyiG3c9ALX095qSpuz7djl7EvcYsQPWfPfiHcL/ko5Ddb6hQqUVZWts8U8eyZvL4 GlIA== 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:dkim-signature; bh=d/mbCij81hsdqkMLMwE2XRa4mruKETckBiNT0oN1tm4=; b=ZpwWWnmavlH9r9lVfkfvCsNYozCWtHixnPfN4G4sQ6HAmu9VNCP0v/7Q5xHyMDGfY5 R6v1I5qrpZo+gulJQFatiOrBWQdOmaOZqPg76PSTgo0FikrIWshN67qLODBbl7pgbZXr EB81MLWSAP2fynpH1MlU22FR6GUXO61bDP0xG7KiTLoXNBEHhdZsUGJtUUXIHDiWE+c8 WTcOwKWs+d4cnP0WJk1oU5scl/bbtyef4b51ifvEge0cBGqCQOZgbdgrKsU2sUcyiOCn oVbBn0Hodjh9byyeEG5GxdUir9dy0MC2NctM6BAEYGUmmleXAnoyi9AKGrKadStOyFgf bmSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qvBdxxNX; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si912398ejn.18.2019.09.17.03.59.38; Tue, 17 Sep 2019 04:00:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qvBdxxNX; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725801AbfIQK6O (ORCPT + 99 others); Tue, 17 Sep 2019 06:58:14 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43627 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfIQK6O (ORCPT ); Tue, 17 Sep 2019 06:58:14 -0400 Received: by mail-ed1-f68.google.com with SMTP id r9so2874743edl.10 for ; Tue, 17 Sep 2019 03:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=d/mbCij81hsdqkMLMwE2XRa4mruKETckBiNT0oN1tm4=; b=qvBdxxNXITibFG9bgyt6vnIBtI+xEt8+MfXwDmpCj9TZb5uKg7JmkBK3VpHYfR2+XG y9vjZD+xJd7WSAESOLfxLD8JaHo89eXGvZjJ8Ii2hoUfPdjTV9Itr+VM6tGbSqO4BRZS fHSrRI6u82/rciZdIRbdYJHNokqp91TQdflsHougBErtMFxR5oEwHP7GbkWU2H44PpDt 0kmv52Z97v9U7f20Ik0LG0xamcHbO77zAk1XX8h6N/BBJ3JLiO1dUlRG7uuSKcvqHmW5 LnBoCxxiNGR++UVbk8eWqCoZYbLkot6ct8JwqWj2zh51KHA3X3PipjEC0jkPAqiQZtx8 ifPQ== 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:in-reply-to :references; bh=d/mbCij81hsdqkMLMwE2XRa4mruKETckBiNT0oN1tm4=; b=JfQGpSTownF4v1Jc9FMg9LVMCQ+wBqMM7HZk0vasgzF0FUlDaye2Nea2jX+gKtOhvi Fbrqc6LvAh1g4sp/j//jpCuNl/e0hhFKanQ86oQV028s6n6Q/9NvffF4u0Op24Kad5Hc U0Pt75IrnxlDKtuUJrzD5jOg2ugITIivf02tO+petlB4f80qiXbEJfmb9GAf0HRumUy5 0as52K31X/E+dkIqYDyawAWfT/X3xcfQoizXCBwvwa28yePlFhIxOuzh/qx+2+fb0xNr tm+uxaRSPsofqNghdebLWM3NVnTLQl9gY0CcPXU2Q3KSm0knPA9WdSNlzMZ7Cgt1O98J xF5g== X-Gm-Message-State: APjAAAWznbxjmjCNE7JBKtg3UzZXP8UMwuMAkc/hOnqJYGnSyayAXBgz cbpmmoLq7MKr259OGOWMcWij4wkB X-Received: by 2002:a17:907:40bc:: with SMTP id nu20mr4055300ejb.309.1568717890989; Tue, 17 Sep 2019 03:58:10 -0700 (PDT) Received: from localhost.localdomain.com ([188.204.2.113]) by smtp.gmail.com with ESMTPSA id i53sm367253eda.33.2019.09.17.03.58.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Sep 2019 03:58:10 -0700 (PDT) From: Pascal van Leeuwen X-Google-Original-From: Pascal van Leeuwen To: linux-crypto@vger.kernel.org Cc: antoine.tenart@bootlin.com, herbert@gondor.apana.org.au, davem@davemloft.net, Pascal van Leeuwen Subject: [PATCH 1/2] crypto: inside-secure: [URGENT] Fix stability issue with Macchiatobin Date: Tue, 17 Sep 2019 11:55:18 +0200 Message-Id: <1568714119-29945-2-git-send-email-pvanleeuwen@verimatrix.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1568714119-29945-1-git-send-email-pvanleeuwen@verimatrix.com> References: <1568714119-29945-1-git-send-email-pvanleeuwen@verimatrix.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch corrects an error in the Transform Record Cache initialization code that was causing intermittent stability problems on the Macchiatobin board. Unfortunately, due to HW platform specifics, the problem could not happen on the main development platform, being the VCU118 Xilinx development board. And since it was a problem with hash table access, it was very dependent on the actual physical context record DMA buffers being used, i.e. with some (bad) luck it could seemingly work quit stable for a while. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index dc04112..ac3e1ed 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -221,9 +221,9 @@ static void eip197_trc_cache_init(struct safexcel_crypto_priv *priv) /* Step #3: Determine log2 of hash table size */ cs_ht_sz = __fls(asize - cs_rc_max) - 2; /* Step #4: determine current size of hash table in dwords */ - cs_ht_wc = 16<> 4)); + cs_rc_max = min_t(uint, cs_rc_abs_max, asize - (cs_ht_wc >> 2)); /* Clear the cache RAMs */ eip197_trc_cache_clear(priv, cs_rc_max, cs_ht_wc); -- 1.8.3.1