Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5921383rdb; Thu, 14 Dec 2023 03:43:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+Kf5jALxy7XwLo+3OkLBmTdP571NQvY3AznVswoCnk3jdyce+vn8SOmixmdiIK/eL18zI X-Received: by 2002:a05:6870:649e:b0:203:2a9c:d6a6 with SMTP id cz30-20020a056870649e00b002032a9cd6a6mr2482593oab.50.1702554213748; Thu, 14 Dec 2023 03:43:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702554213; cv=none; d=google.com; s=arc-20160816; b=S1GKrqETlK80HejvQ1VBEqpa+j+GX90Ollrl5IShFK97V93NG2Kq038POqXaz/UV0J 6kSKrNfwCA1V1MEW6B6jeHCaKY5A9zQl4Zckk8YxefSM7cRe97OKrJxsxYgRcd6ZkN+m WEgtdztkBUDlUNy3C/+iikne2wThK7ZpwusH+fBycj7BoYq05LVfsK/ecFwMs7CkTIio ykjIU/3d+c8M+uIKjVF4978gDa9UmrCwGm5f2mVJ8klCoBwq8RVWU4b4XyHo7z6+jhPS cWPzFwCeWI/BQk8aNULq+6ev1i9cfH7Q+Dwo94OueluuZEGsaHdNpXSWS4GMR2zPxcR/ wtWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hfMKRVnpBaCu6d6aUwhdQLjOhhBXaGuNFVwN6cK+sqg=; fh=TEn06IatapHMgkFhNRCYXHrnqycBlFaJECTG22CvvEc=; b=Lip26cegDsRoIf2wIXq7SOeoG+VsN47Fv2o3Iw5wHBVjaSAO3DewcGsJ5VSYlWpiL+ akKroWZcaWxHLc8bHmOloKKDNGt/PIP2kjk51Tc67P3a42KJBUUmxX1TCHN28qWg0YVF /QRdatYR6VVDhfK7t2vLw9YOMNYhRPcuyQc/p0px0+rKooEz9QAxQn+cZCIvQcEpHR6P axB0U9BRP8tzjN/9djmJG6rUS+b/EBOQ1TFbXqF7i45kUPaEQzpOUfOji96s/SXapD2m 0RbUNYlBGhMJjAFzBHMxhUbbvPfrY+RshD4w4fPmmR3jVrodF4TCYFeVbgbcGaBxaCPF 7xLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SbW8yd0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id by4-20020a056a02058400b005c6be9a9841si11606675pgb.469.2023.12.14.03.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:43:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SbW8yd0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 79D398329960; Thu, 14 Dec 2023 03:43:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444105AbjLNLnF (ORCPT + 99 others); Thu, 14 Dec 2023 06:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444033AbjLNLmv (ORCPT ); Thu, 14 Dec 2023 06:42:51 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0EDE11A; Thu, 14 Dec 2023 03:42:57 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BEAPLNN016003; Thu, 14 Dec 2023 11:42:48 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=hfMKRVn pBaCu6d6aUwhdQLjOhhBXaGuNFVwN6cK+sqg=; b=SbW8yd0tTpQ566T+gzGVrah XiqsllHRAdb4CXBnjt0JN21aAZLXYgXl4KyQGl64WBb72jj7R0buELSHClnIoq8h /dDywnmwZnYEIYA6FNC3l2t1z/lkXuQ5IiATHrS2d0YqtU0TKJjHld/R82IgfBL6 8R0J0zvfkIz41LfWOEqtS7WFMwtxglBbgbkNf48CYKF6kJ1GZWLhE5DQIsQqXxmf L7JR02t6ulxc6p9IlNpFD09n75zK8Mda0k0CblP0Go2/hPd+zCAu1ky8eeMLs52a 7rptjm2maVni001slkNVVGGeTwI7QMdz23Rgynm1JVzdRPwBqBslO9gvELP06HQ= = 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 3uyp0p9a3a-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 3BEBexrD001132; 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 3uvhaktch9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Dec 2023 11:42:45 +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 3BEBgijg003213; 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 3BEBgiLr003203 (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 A2FC041675; 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 10/11] crypto: qce - Add support for lock/unlock in sha Date: Thu, 14 Dec 2023 17:12:38 +0530 Message-Id: <20231214114239.2635325-11-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> 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: 1A59z-BMlZOsEGQqFZMD1oqtBwMfspnP X-Proofpoint-GUID: 1A59z-BMlZOsEGQqFZMD1oqtBwMfspnP 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_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 phishscore=0 impostorscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312140080 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:43:28 -0800 (PST) Add support for lock/unlock on bam pipe in sha. 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/sha.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index f850c6206a31..942aecbb0736 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -47,6 +47,8 @@ static void qce_ahash_done(void *data) int error; u32 status; + qce_bam_release_lock(qce); + error = qce_dma_terminate_all(&qce->dma); if (error) dev_dbg(qce->dev, "ahash dma termination error (%d)\n", error); @@ -102,6 +104,8 @@ static int qce_ahash_async_req_handle(struct crypto_async_request *async_req) rctx->authklen = AES_KEYSIZE_128; } + qce_bam_acquire_lock(qce); + rctx->src_nents = sg_nents_for_len(req->src, req->nbytes); if (rctx->src_nents < 0) { dev_err(qce->dev, "Invalid numbers of src SG.\n"); -- 2.34.1