Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5921213rdb; Thu, 14 Dec 2023 03:43:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGoqpUNfCbtW0+5viko9pB7F+98KEsa7jnVXowLkz3VLiir4nCzWx0/v+hsULqRbwb8mKfU X-Received: by 2002:ac8:5846:0:b0:425:9651:4211 with SMTP id h6-20020ac85846000000b0042596514211mr13195595qth.16.1702554193426; Thu, 14 Dec 2023 03:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554193; cv=none; d=google.com; s=arc-20160816; b=KUXoLaccaGajKAF7/SehY0qp64jFxV1ufQDBB1kzQFOZdyGiisjNifu6n5se7nQHJA pX1JfXkne+tSJHv4bFv4/yPWNvo5X48vCp/46vaiUknX/jlg/34FNrAGQluwbGjj6TB6 ZfyjWlojH3qywxiHYr1/7SHnETWM87mfJJkWrbZe5+COCTglF4yKo9MiLA4SQT+HE7kP kf9X52K3aSWB29JXTyPFEfch7bDoqRZahNr+9OVUdDdDy/rxWMBI5rGxLrj0kAj/4xgV USDN85BCXEzqevfcRS4SYHqznUxq2g5scGDY4BAad92zhXJueGi33W/8Rj/8ICaMmWb1 RRsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3BBK0cA16vlGVM1ePtMVzo9Y00CXkV7qW3NiffbeC10=; fh=TEn06IatapHMgkFhNRCYXHrnqycBlFaJECTG22CvvEc=; b=sofkmCRScSuGZrr+mZIRJ58S7KThYRTn/9zQoca1iA6Cd08trtb4/oTCR19ulYP6Sd EoEJCInukpIPcPgmWxBIi01ys7VytvokTDF0WPgnG5Cs3/6HcaNG2U/c8/PPUOT3lK61 iJ5YOqnd1MC7LmCciHtCMOHHuHQvY6HsBsUJe01kYFrG3+qb4ILkgEI3CiQTBY90CBwF ops7zwpjwAFV/aQE/bGaJ34E9C/D/oreCWi3E2eZSvebcC9HOymIQajfzBmSa+AyHUq2 rCbwFwlZOYyepmn5QlWLPMhKGfDcriqrvDru9xBwS5TnB1j/Ddq3aFPwpU1VlztI+zCT EFzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=a3LN9IpL; spf=pass (google.com: domain of linux-crypto+bounces-834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j9-20020ac84409000000b0041cbb5e5a86si14430073qtn.428.2023.12.14.03.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:43:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=a3LN9IpL; spf=pass (google.com: domain of linux-crypto+bounces-834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3365B1C21583 for ; Thu, 14 Dec 2023 11:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 157514120F; Thu, 14 Dec 2023 11:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="a3LN9IpL" X-Original-To: linux-crypto@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE4A0F5; Thu, 14 Dec 2023 03:42:56 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BE9MMDE032328; Thu, 14 Dec 2023 11:42:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=qcppdkim1; bh=3BBK0cA 16vlGVM1ePtMVzo9Y00CXkV7qW3NiffbeC10=; b=a3LN9IpLfqHuOnAceCYKilX wNPhgY4ss7cX0v1vg7Htvo0/tBdiYK54CMcpTBMnwN7qc83HRXD6Dw6GQJVBGoIl /cPqV3l4f6UihQVeO64106ZyAqwsTVtuvakCRqDL4R2nKGXV1NKP9HVG5C5IZdxK RIlobXDVUH4FpjajEDbazXxy/BdBY2wDPcmQ4Lp6PlXV+P4OX8jLnIY8NJRXf6Mx W+nrYoPpPscWJAwsLi0fnNVGZ3xQdpPz3x+/+Qnwz0nVeGsXOG/p9ynWYeChBEfd /pXWHhAKJxIG3eofqy2xHAq8XOs1Jk58YLVkXZor9Rz4oGaJHjSZZOnpIiy1lVw= = Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uyq66h690-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:48 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3BEBgiA4003251; Thu, 14 Dec 2023 11:42:44 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3uvhaktchj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:44 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BEBgiaL003237; Thu, 14 Dec 2023 11:42:44 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-mdalam-blr.qualcomm.com [10.131.36.157]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3BEBgiHc003207 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:44 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 466583) id A639F41682; Thu, 14 Dec 2023 17:12:42 +0530 (+0530) From: Md Sadre Alam To: thara.gopinath@gmail.com, herbert@gondor.apana.org.au, davem@davemloft.net, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, vkoul@kernel.org, linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, quic_srichara@quicinc.com, quic_varada@quicinc.com Cc: quic_mdalam@quicinc.com Subject: [PATCH 11/11] crypto: qce - Add support for lock/unlock in aead Date: Thu, 14 Dec 2023 17:12:39 +0530 Message-Id: <20231214114239.2635325-12-quic_mdalam@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214114239.2635325-1-quic_mdalam@quicinc.com> References: <20231214114239.2635325-1-quic_mdalam@quicinc.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Wq7F7IUxFM9cgXcVeUgi--HxMwPjmT56 X-Proofpoint-ORIG-GUID: Wq7F7IUxFM9cgXcVeUgi--HxMwPjmT56 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 bulkscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312140080 Add support for lock/unlock on bam pipe in aead. If multiple EE's(Execution Environment) try to access the same crypto engine then before accessing the crypto engine EE's has to lock the bam pipe and then submit the request to crypto engine. Once request done then EE's has to unlock the bam pipe so that others EE's can access the crypto engine. Signed-off-by: Md Sadre Alam --- drivers/crypto/qce/aead.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c index c03600f396be..0948c30ea515 100644 --- a/drivers/crypto/qce/aead.c +++ b/drivers/crypto/qce/aead.c @@ -42,6 +42,8 @@ static void qce_aead_done(void *data) dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; + qce_bam_release_lock(qce); + error = qce_dma_terminate_all(&qce->dma); if (error) dev_dbg(qce->dev, "aead dma termination error (%d)\n", @@ -445,6 +447,8 @@ qce_aead_async_req_handle(struct crypto_async_request *async_req) else rctx->assoclen = req->assoclen; + qce_bam_acquire_lock(qce); + diff_dst = (req->src != req->dst) ? true : false; dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; -- 2.34.1