Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1663564pxv; Fri, 25 Jun 2021 19:51:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo2hAKzTFJoqHxCjDc76NG1ppz5y8+jFC7AoPe8BwuLsj8ghkUhzrC5XwtBn07LhIHKkz6 X-Received: by 2002:a92:ca49:: with SMTP id q9mr9764288ilo.136.1624675889215; Fri, 25 Jun 2021 19:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624675889; cv=none; d=google.com; s=arc-20160816; b=sKQZ4L4a+jjAOS+YddnMhhwLD0Ahp5qLv1A+4ZJeLZeVgn6spU/Yt2kbs67S/wbRL0 Nx+SJPQiYQndmA3LtbNvGHkvqaktnrmRpwQn0dG6Re8pvVIAI9P9v+s3biz8Ruo4Dz4K O9qpA0jI7FvRYRc0lCJa5ekLuiOi45fcUO2Lc8qivR82aAaXnXn7XEDRhKuY7Amx769y FySZYa1KRuZxbWaAFcPT06nUuDYNjbqpGYzRvFtPOP/YJSRHD6mnjJ7hXuwr//6Jc79q DlD6aBoT0DmvCEFATGgFDMSIP1tGHjsj6cCDDvueXIDAVcvIa4FJLyTjGuPT49mLywDi vTGA== 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=xzN5AhiB49wIrejbYnWtgEYwR1VagZFV+aaY/lBUB4A=; b=GRuJ/JCL0/5so5vtT5QzrQJ6IK/QfMZLRWdnpe6cq9b5L5TCmlqB+DFEyIsRHpLdVS 9B3gTRh9UDyfSo6vTiHy/ifaKS5+FZ2kF6wqnG3KnUjEQuvlEqEoN+MIXYhJhIZlSbHD 8oYdAPnFbewi0gIPx48UsyVfWKQLDpBFz8ADQ7i8kov4T4UVTJcVT3je2so3LyCuzrUT N7Y8xQOqAOQsixdNvn5k2b/HT962L7gpt6MCKCgPnHsF6ROzpdZoGf/SFVFPaGBCgrOY 5Qaxu4s5kppEm5MkJQ1f988lxbKeyWPY8btGTXpS6OD26CEkGCDo3zNoodup/je6ZPff nnAA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si1996942jas.41.2021.06.25.19.51.04; Fri, 25 Jun 2021 19:51:29 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbhFZCxY (ORCPT + 99 others); Fri, 25 Jun 2021 22:53:24 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5082 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbhFZCxY (ORCPT ); Fri, 25 Jun 2021 22:53:24 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GBdXV6bHlzXhxP; Sat, 26 Jun 2021 10:45:46 +0800 (CST) Received: from dggpeml500012.china.huawei.com (7.185.36.15) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 10:51:00 +0800 Received: from huawei.com (10.69.192.56) by dggpeml500012.china.huawei.com (7.185.36.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 26 Jun 2021 10:51:00 +0800 From: Kai Ye To: CC: , , , Subject: [PATCH] crypto: hisilicon/sec - fix the process of disabling sva prefetching Date: Sat, 26 Jun 2021 10:50:33 +0800 Message-ID: <1624675833-20107-1-git-send-email-yekai13@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500012.china.huawei.com (7.185.36.15) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The open interface of the sva prefetching function is distinguish the chip version. But the close interface of the sva prefetching function doesn't distinguish the chip version. As a result, the sva prefetching close operation is also performed on Kunpeng920, those registers are important on Kunpeng920, which eventually leads to abnormal hardware problems. So need to fix it immediately. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/sec2/sec_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index 8ab4e67..710ea8d 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -363,6 +363,9 @@ static void sec_close_sva_prefetch(struct hisi_qm *qm) u32 val; int ret; + if (qm->ver < QM_HW_V3) + return; + val = readl_relaxed(qm->io_base + SEC_PREFETCH_CFG); val |= SEC_PREFETCH_DISABLE; writel(val, qm->io_base + SEC_PREFETCH_CFG); -- 2.7.4