Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5246169ybl; Tue, 14 Jan 2020 06:01:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwj+bfkfWrkS1Bk6iRQLuAwul8vvR09lF+ICyBxJIP0GZ0DIqifdtTmA9eX+Qoc8JZjuzes X-Received: by 2002:aca:4d58:: with SMTP id a85mr15879685oib.35.1579010473938; Tue, 14 Jan 2020 06:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579010473; cv=none; d=google.com; s=arc-20160816; b=NjFsaniEY/d04QSPi099GS2+NqrkRa11qqClwaGv9QrBPmabHGOkSry0+3JucmlZ+y PQs6t2vFQTxkl0paR9mHV3dHKbdERy/NmT0MRf3/vVg4qBuRHKawx69zb/9kT7yJ4RsC NMBqhD1S75SZmoLaK6hqok9JwnPK8aM/ZJx+RKr66lwWt8bH4340S6FTkxJhOrDJbrj+ 7H/+7k7Ep+z/27UNuieNC9HEtCwlHF+FV+kz3OaIiUzZfXL3tCGyV48cGIrxAT4jvwii Mcj4ODyhxKPa579B7kjTe/ZgqXVDeiReAeR1WNkYMwouJAbz+2NY1RaZoI9UIX216DRG QAmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xjPV4Ha5BYE0MCX17Wl6xnLI6QAy5DnWASz8VTCVvYQ=; b=H3pQWr0JJEsTz8P3aQexludkQ8sVu1y1f5irxJllWRdy+R9TfAc0IQk24jyWnjp30A /3Hs7+y2e8Z/LlQR+TM7NJPVn5VNS/4hZUDyxJDxCfrKs2RoyU45k/yc/15+mvy7jQ8M DrqFDtUuUpU+51U0GacRZgfD6nAk/6Q8BpQ7usaUXLIOMzFCXiXaKgt4nsFeIIbh9G91 xkXhMZywbSCwhiBduk1qqhc88ZuTo8iyJ+ehP6A/Fm7ZzQ5dMZs3CEqPRH1E1+yt/e6S BwQCLCy4Md6zsf5NUhEdc95yqg54khga9I4VSQVD5gwOkyOpwEFpHy4/LropjcO7+m01 F0Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EUO5m76U; 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 l131si7371957oig.120.2020.01.14.06.01.03; Tue, 14 Jan 2020 06:01:13 -0800 (PST) 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=EUO5m76U; 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 S1728863AbgANOAX (ORCPT + 99 others); Tue, 14 Jan 2020 09:00:23 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34765 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728939AbgANN76 (ORCPT ); Tue, 14 Jan 2020 08:59:58 -0500 Received: by mail-wm1-f66.google.com with SMTP id w5so2378446wmi.1; Tue, 14 Jan 2020 05:59:56 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=xjPV4Ha5BYE0MCX17Wl6xnLI6QAy5DnWASz8VTCVvYQ=; b=EUO5m76UvmdUwWtNzcIKhgu1b3wsytiLJXK+nCU8Jd+QLUFj3sjQ6tp4GDPLdz01Tk CqD2W85UbyrcCOMSjLf/dFpOusOr7BW9TGliVE1RP6bXsB8Sxe8ahdtC2GAFpvVWPHtu huctNx72GCsTAiGkF1SCKWPEXR1HgUR4pAxwdKl8372GYVvlcoKFEIjoubnexI0StKy6 x656qiDvIBYjjnHT10RUOQDzOjyDF4tIiOjDG3EtntrJNHGhnm/SU9hhc3qJmCNhKtuH mUG4dI9ncJ9bO9nTWh1qxkJkNIl9HucXdHS5WgPs9si0eKsDk+9KCo/JNtoxvjSE9hva LINg== 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:mime-version:content-transfer-encoding; bh=xjPV4Ha5BYE0MCX17Wl6xnLI6QAy5DnWASz8VTCVvYQ=; b=ZBE7vZM9HVNLRuZmt9dln8hZtzG/Us4DLZr+UkHN7nm4HMJvN4Gqrl2wRu119GoQfl Eb9uRuejZQePAs8jFmSExHCdaC1xF+0h/NnubT9CY4tz+Vg/+CRtwOojC6ofk1Rh3Qpb gp+MwiT9p5gNYN5OTWZlSG+39b9Z82sEeL/E+Ol8wu8L3pm9ybxY0G0E882c/ckB3f8c WkMR5hRpDvFQT0n3QyrTKZ/joAK+VRre6nfAeHfGqVspHI3PcU5cDpZZJUUwOkppVJXN nkSaz/NGPu8B0ZkewieLw5gRkchdcStg28nnGTeh/zqZDt4m075m6iRIlnwyBpy4mQO+ h2zQ== X-Gm-Message-State: APjAAAWxKCwXYbGOKXbGWrRqd1S8ymmvzKMRPXtfLPd4pzq/0psrM+MQ MFPePSigY86y5dUpyx5ZBsY= X-Received: by 2002:a1c:62c1:: with SMTP id w184mr28138545wmb.150.1579010396021; Tue, 14 Jan 2020 05:59:56 -0800 (PST) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id 4sm17854448wmg.22.2020.01.14.05.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 05:59:55 -0800 (PST) From: Corentin Labbe To: alexandre.torgue@st.com, davem@davemloft.net, herbert@gondor.apana.org.au, mcoquelin.stm32@gmail.com, mripard@kernel.org, wens@csie.org, iuliana.prodan@nxp.com, horia.geanta@nxp.com, aymen.sghaier@nxp.com Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH RFC 04/10] crypto: sun8i-ce: introduce the slot number Date: Tue, 14 Jan 2020 14:59:30 +0100 Message-Id: <20200114135936.32422-5-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114135936.32422-1-clabbe.montjoie@gmail.com> References: <20200114135936.32422-1-clabbe.montjoie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch adds the slot position, for choosing which task in the task list should be prepared/unprepared. The slot is for the moment is always 0 until the infrastructure will handle non 0 value. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 6 ++++-- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c index 401f39f144ea..9c1f6c9eaaf9 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c @@ -96,6 +96,7 @@ static int sun8i_ce_cipher_prepare(struct crypto_engine *engine, void *async_req int flow, i; int nr_sgs = 0; int nr_sgd = 0; + int slot = 0; int err = 0; algt = container_of(alg, struct sun8i_ce_alg_template, alg.skcipher); @@ -114,7 +115,7 @@ static int sun8i_ce_cipher_prepare(struct crypto_engine *engine, void *async_req chan = &ce->chanlist[flow]; - cet = chan->tl; + cet = &chan->tl[slot]; memset(cet, 0, sizeof(struct ce_task)); cet->t_id = cpu_to_le32(flow); @@ -301,11 +302,12 @@ static int sun8i_ce_cipher_unprepare(struct crypto_engine *engine, void *async_r unsigned int ivsize, offset; int nr_sgs = rctx->nr_sgs; int nr_sgd = rctx->nr_sgd; + int slot = 0; int flow; flow = rctx->flow; chan = &ce->chanlist[flow]; - cet = chan->tl; + cet = &chan->tl[slot]; ivsize = crypto_skcipher_ivsize(tfm); if (areq->src == areq->dst) { diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index e8bf7bf31061..bd355f4b95f3 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -120,7 +120,7 @@ int sun8i_ce_run_task(struct sun8i_ce_dev *ce, int flow, const char *name) /* Be sure all data is written before enabling the task */ wmb(); - v = 1 | (ce->chanlist[flow].tl->t_common_ctl & 0x7F) << 8; + v = 1 | (ce->chanlist[flow].tl[0].t_common_ctl & 0x7F) << 8; writel(v, ce->base + CE_TLR); mutex_unlock(&ce->mlock); -- 2.24.1