Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14356798pxu; Mon, 4 Jan 2021 22:15:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwICgwTp0Le3Ddgh+Ztiz6zjst/ys07OfDOZiFRlSsucOUgqhzWjUfMjl5l68qw9VJrE6sP X-Received: by 2002:a50:9354:: with SMTP id n20mr75809934eda.231.1609827311574; Mon, 04 Jan 2021 22:15:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609827311; cv=none; d=google.com; s=arc-20160816; b=ch2GeaMmoN3XbFzA+HyrXbOao2b+n4RLeVHk+klug2MZTY5weZc12hFHwRMcyMCc1N ro/FfiNuOaQfAEcSCoUg9oLaU6IBOpUHf0fGqwgoFfOAFWKpsKr81IFk4SCIXewALmxO LtwT4KoR5tQLPT7DrT5aMgwMEcprMoUpQ+HW3LlLJmAqE+SuxSLuHFJVXWwnBeaie8ut IAHz5nHnuglbIq3Zk/LR11XPBujKKbY0ToJx8j02yaXbQltTTwZl7k9+Vx4YpAhVZiNk /l9jtzNkL2a1bxkHr3vcQm3i3n8JNPX4EHtzCLJi8o7AnxcHqvw8bTNZqjhCpCHSvWNW TocA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=mO2FcxKxNipRJomXTntOeEzit/HAQ0NuQ6ueL5i3+pg=; b=CN04YRcw75E5GXEU/Xd5DBWyeCfaOpnOgwKpksxhekzHL9h4IQhtRYI5pFUQdfjGUj IofYygwL6dWorLYnuhknDZd03uNnbgG3ZrSKKl2NawSh2Jn88S6Im9Zv7ZhsPiLYw3li fTME8Cr4m+3vlhix2161boEwB7PlmAixQLqNXHLp/7H2iEhSE6kCACw4FfFWYhg+NZ+j 2nKJh3PDyrAgLPRqSiH1BqgnqzxD5d498MB6k9N6ZO3zfIumUFjZUWfgBxHdIviVZtKN lt0ywPCHgY/o61tXtbdxa9dZWr/1VQhBPc6wvY82rqW3R6FSLjy4+RPJ5DH2Jlpb+UTG UfRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si31960038edq.247.2021.01.04.22.14.51; Mon, 04 Jan 2021 22:15:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725535AbhAEGOs (ORCPT + 99 others); Tue, 5 Jan 2021 01:14:48 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10021 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbhAEGOs (ORCPT ); Tue, 5 Jan 2021 01:14:48 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D92HC6mTTzj3NQ; Tue, 5 Jan 2021 14:13:11 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Tue, 5 Jan 2021 14:14:01 +0800 From: Kai Ye To: CC: , Subject: [PATCH] crypto: hisilicon/qm - SVA bugfixed on Kunpeng920 Date: Tue, 5 Jan 2021 14:12:03 +0800 Message-ID: <1609827123-842-1-git-send-email-yekai13@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Kunpeng920 SEC/HPRE/ZIP cannot support running user space SVA and kernel Crypto at the same time. Therefore, the algorithms should not be registered to Crypto as user space SVA is enabled. Signed-off-by: Kai Ye Reviewed-by: Zaibo Xu Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/qm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index f21ccae..10a04ab 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -4004,6 +4004,9 @@ int hisi_qm_alg_register(struct hisi_qm *qm, struct hisi_qm_list *qm_list) { int flag = 0; int ret = 0; + /* HW V2 not support both use uacce sva mode and hardware crypto algs */ + if (qm->ver <= QM_HW_V2 && qm->use_sva) + return 0; mutex_lock(&qm_list->lock); if (list_empty(&qm_list->list)) @@ -4035,6 +4038,9 @@ EXPORT_SYMBOL_GPL(hisi_qm_alg_register); */ void hisi_qm_alg_unregister(struct hisi_qm *qm, struct hisi_qm_list *qm_list) { + if (qm->ver <= QM_HW_V2 && qm->use_sva) + return; + mutex_lock(&qm_list->lock); list_del(&qm->list); mutex_unlock(&qm_list->lock); -- 2.8.1