From patchwork Fri May 21 09:41:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haren Myneni X-Patchwork-Id: 445986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5982C433B4 for ; Fri, 21 May 2021 09:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B778661002 for ; Fri, 21 May 2021 09:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236869AbhEUJmy (ORCPT ); Fri, 21 May 2021 05:42:54 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42178 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236850AbhEUJmx (ORCPT ); Fri, 21 May 2021 05:42:53 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14L9YFI0068137; Fri, 21 May 2021 05:41:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=nwk3NcOmz2AlMTGeyCM5ZGCmKPJZs0A8MQi+9ta0E10=; b=Kzys9WR+u4hRB6wmYxSgJR/QEsU5RTfi4OkElBjJPqBg6gWXoqVe3P938u2Ka4SqkTdi XRAWJ6xqZsScmpr6bI7xpTCelsOtn9WgeKmxCi3XS3bdvT4ZnzihlxSVDBfimEaEQKaq ucGUrq7D4M0Jq/ApCMGskj9o2W1MaKxbfVWkiD2auESzUNxjw6tDMxARyCGG8LquejXd y7mNixCnSBR9FdRL+Hg78Prj5SIof3ImXO7qkxeQv+vz0wF4FIAX+l6jUM8Dci9vIDhI Tth7iZmFQHI0yckvL8n7SOEIsmjml2NwcvJvZTPXTqt6n5YVhsDhp1BwI63xBBPk6B02 Og== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38p7pkvsm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 May 2021 05:41:25 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14L9YigM069865; Fri, 21 May 2021 05:41:25 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 38p7pkvsk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 May 2021 05:41:25 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 14L9WwdR015046; Fri, 21 May 2021 09:41:24 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04wdc.us.ibm.com with ESMTP id 38j5x9xkpx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 May 2021 09:41:24 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14L9fNsE26149268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 May 2021 09:41:23 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FA1DAC05F; Fri, 21 May 2021 09:41:23 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9304FAC05E; Fri, 21 May 2021 09:41:22 +0000 (GMT) Received: from sig-9-65-94-165.ibm.com (unknown [9.65.94.165]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 21 May 2021 09:41:22 +0000 (GMT) Message-ID: Subject: [PATCH v4 14/16] crypto/nx: Register and unregister VAS interface From: Haren Myneni To: linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org, mpe@ellerman.id.au, herbert@gondor.apana.org.au, npiggin@gmail.com Cc: hbabu@us.ibm.com, haren@us.ibm.com Date: Fri, 21 May 2021 02:41:20 -0700 In-Reply-To: <8d219c0816133a8643d650709066cf04c9c77322.camel@linux.ibm.com> References: <8d219c0816133a8643d650709066cf04c9c77322.camel@linux.ibm.com> User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 3xmOcVzJ53diyHT4AWQGpgH1d0KejWNR X-Proofpoint-ORIG-GUID: N7R5C-yy2SfyxqR6AmrJIlssX1zoKypj X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-21_03:2021-05-20,2021-05-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 phishscore=0 impostorscore=0 bulkscore=0 clxscore=1015 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105210061 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Changes to create /dev/crypto/nx-gzip interface with VAS register and to remove this interface with VAS unregister. Signed-off-by: Haren Myneni Acked-by: Herbert Xu --- drivers/crypto/nx/Kconfig | 1 + drivers/crypto/nx/nx-common-pseries.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/crypto/nx/Kconfig b/drivers/crypto/nx/Kconfig index 23e3d0160e67..2a35e0e785bd 100644 --- a/drivers/crypto/nx/Kconfig +++ b/drivers/crypto/nx/Kconfig @@ -29,6 +29,7 @@ if CRYPTO_DEV_NX_COMPRESS config CRYPTO_DEV_NX_COMPRESS_PSERIES tristate "Compression acceleration support on pSeries platform" depends on PPC_PSERIES && IBMVIO + depends on PPC_VAS default y help Support for PowerPC Nest (NX) compression acceleration. This diff --git a/drivers/crypto/nx/nx-common-pseries.c b/drivers/crypto/nx/nx-common-pseries.c index cc8dd3072b8b..9a40fca8a9e6 100644 --- a/drivers/crypto/nx/nx-common-pseries.c +++ b/drivers/crypto/nx/nx-common-pseries.c @@ -9,6 +9,7 @@ */ #include +#include #include "nx-842.h" #include "nx_csbcpb.h" /* struct nx_csbcpb */ @@ -1101,6 +1102,12 @@ static int __init nx842_pseries_init(void) return ret; } + ret = vas_register_api_pseries(THIS_MODULE, VAS_COP_TYPE_GZIP, + "nx-gzip"); + + if (ret) + pr_err("NX-GZIP is not supported. Returned=%d\n", ret); + return 0; } @@ -1111,6 +1118,8 @@ static void __exit nx842_pseries_exit(void) struct nx842_devdata *old_devdata; unsigned long flags; + vas_unregister_api_pseries(); + crypto_unregister_alg(&nx842_pseries_alg); spin_lock_irqsave(&devdata_mutex, flags);