Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5921438rdb; Thu, 14 Dec 2023 03:43:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGycOymzsGcO5B/Ev/iDAavR37znGBBcknDXGMpN+vwOUrYgoj2VOnG6ytXha+rMMoGPgo X-Received: by 2002:a05:6870:80d3:b0:1fb:3cc4:9481 with SMTP id r19-20020a05687080d300b001fb3cc49481mr11624525oab.32.1702554220206; Thu, 14 Dec 2023 03:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554220; cv=none; d=google.com; s=arc-20160816; b=cHa4tY1x3X+xfux+Fp8rscmGE87/of82BnvqHIw9sRUTRb2M44FIidkUNwHF1Sg9jz m0WiRLrIY2YydK+L5Y+qW0hfB5OY19i9G4j3ZVHYPj81sNxTFUX98Le6/zx/VFuj/a57 iY1cHGa/P6R/Z5EU+3gtfuXVOhBtklmzWNuub+f//Rts/T6gGCrMwJonmQBhYwBfjecd VbNlzRDjapNCKXORw10ydq1Ei7bZFBNceEsAi/yL9atZQvtOJyUu0ncuFw7qMSYAaq5e KDJiZGNh+m0IXvbO5KVZKJP44+Q/nYan4aFug4zMsLJvW8ak2xUgaJUxy2kw/cH2giH7 cBUQ== 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=jeaEe5HnF2x0m61p1cqViCnzJTUQfXgbn7gCqVrYXWY=; fh=TEn06IatapHMgkFhNRCYXHrnqycBlFaJECTG22CvvEc=; b=tK/s/mSqvSTANr/llu89We57xprZtyfb4EIoJIEv6Y0naoG5jl1wwTxwt8glt3CDKt BBu52oWxLJak9BV3iloPrgsdjOC6aTu5ae39O1RRoTi68KfBIeghhiyve+clvCez9BL1 wWQoGYXc6OlOsGSPXUeKfHf1QTgdRoZV9gMprm8O7i4d3VwfXIoFemAKl9KUBeYhAKVX XrjknXAIo67W3bg8NsArXqMcqTA0K7g+R61BKL+U6tzTFe2x04Zcy2eKS5Zi4ukaNRU1 u/kAJSQ8jLg/cniJQWTvH3Vu4RL5REmKWF6MP1m8Z7+qUa1eRxkto4jgE2qwMjEoTu3R OXWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Glx6lDfr; spf=pass (google.com: domain of linux-crypto+bounces-841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t7-20020a63dd07000000b005c70983efd5si8738826pgg.629.2023.12.14.03.43.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:43:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Glx6lDfr; spf=pass (google.com: domain of linux-crypto+bounces-841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-841-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EB94AB20E21 for ; Thu, 14 Dec 2023 11:43:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A70F74AF7F; Thu, 14 Dec 2023 11:43:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Glx6lDfr" 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 228C311D; Thu, 14 Dec 2023 03:42:59 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BE8kKvM006105; 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=jeaEe5H nF2x0m61p1cqViCnzJTUQfXgbn7gCqVrYXWY=; b=Glx6lDfrbeil+0LMVc7HomY qegf2zDZF/pJZq6jboTQ8wAEmLrtvwtgWEir/E9fkEeBqVHeJ8yS6r/rP7DXdckt haKcP6bThAlIMb658tiMIIzBABzh1J2k61GGJTptnLVmOhKyhmmll1fb9eIwVZWj bGu4Id+HtJ9NVS0ciTtsu2wO8Z03mUCulONCzdaVQa192vu06qEk8l99Fn0olO9X O35PZiGbAUxy6ml2yXHrrn8EM+MOIbAdljyww0mCqKKENcvBRl62k5socGazF2zY kRAozF2yVlIDeUes8pB34b5aMAHbjIdXXf7aXNg12m7dol3jrteTG2C5YWOPxNQ= = 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 3uysrprxb3-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 3BEBexrC001132; Thu, 14 Dec 2023 11:42:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3uvhaktcha-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 3BEBex01001124; 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 3BEBgiLw003204 (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 9F3A841674; 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 09/11] crypto: qce - Add support for lock/unlock in skcipher Date: Thu, 14 Dec 2023 17:12:37 +0530 Message-Id: <20231214114239.2635325-10-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-ORIG-GUID: IQo-KjvO-Z2zSMrrTFCRlCj_MGfHwWd5 X-Proofpoint-GUID: IQo-KjvO-Z2zSMrrTFCRlCj_MGfHwWd5 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 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 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 skcipher. 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/skcipher.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c index fa7ee5db9aa0..c74df30e8e31 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -42,6 +42,8 @@ static void qce_skcipher_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, "skcipher dma termination error (%d)\n", @@ -94,6 +96,8 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) dir_src = diff_dst ? DMA_TO_DEVICE : DMA_BIDIRECTIONAL; dir_dst = diff_dst ? DMA_FROM_DEVICE : DMA_BIDIRECTIONAL; + qce_bam_acquire_lock(qce); + rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); if (diff_dst) rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen); -- 2.34.1