Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1020005rdg; Fri, 11 Aug 2023 07:23:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG43F4mMkWq6HppEClN2dKd5b6Z5Cfb1e2YCveZX4q+xpuJ0AnzdgR/rBMo58ZCWBb7ldKs X-Received: by 2002:a17:907:2cea:b0:99b:8c6f:f3af with SMTP id hz10-20020a1709072cea00b0099b8c6ff3afmr1720871ejc.12.1691763830903; Fri, 11 Aug 2023 07:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691763830; cv=none; d=google.com; s=arc-20160816; b=Ulbf3ktVSxQpz/AV8BiqbCJJyy6dulzYnxs2ONB6VjCEhw281XuOEYl4kOcsW6RcNH Y0pwokLn14dj2FZB2q6UUJ6iTQBmg/Nzs1wCAzCLo7UC2E8Wf7QftO/cjgQRnYWfCONi bJJ7bfSvYerHGFEHfj8qDjCQcnEICU5NAWBb/tg6NmRWS8HCD/dJnKx0hqCrcLzG2hlh LQYt63wbe5YUZ6vn5mBHlrShSRpBiZCf7NmqVjtIAz3yM2/m+IbzI3C5extSDOTpTj6V C0HRiDIrrvPQcPDP9NaxmquUlLLNI4AavAPH0IqSqqqJpOZzAZ1vyCNUyaK3gupl9D5p 15zA== 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 :message-id:date:subject:cc:to:from; bh=lchJGixLnTpYH6NF007v2u0pTcTF26Ue4ka4NYWSvDw=; fh=fXxcka4ttcRjf8y/QNeUVBVR3n8KtaOL7ehuC2YQY+g=; b=pJfESYIV9awo+139bU3Di9Pa4tsrt8RtYllXneTYLAeaByHEUAfWtN1jG+iOTUschw l6eXIufFZhyDK1hYHh30Bl52G9/ZpwtVgPj4WC/Azyxo3vDc/H8EUXXBe3VVSLAq+b8M z1dMleZOoyQ5pfuFOtdbs4Mo9D5zPsjrb5lCMrNxAuWq3UA/qMFXhP6iD4yzlgd1RjBX 09xlgWrIM2ljD6v7Nmb1kvez9MyTxN7F+VUEJa8f6nubkZDPmlQrwpsUrX4wS1kHHz/W T7i0FgU61bAvvDPL7wdntLkZiwakKtwhT7GrJVaYtQu5V9D8Gqi4efNGrpRtxmE6u+xh EaRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a1709065fd600b00992d6fae2bfsi3552167ejv.953.2023.08.11.07.23.25; Fri, 11 Aug 2023 07:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbjHKOKq (ORCPT + 99 others); Fri, 11 Aug 2023 10:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjHKOKq (ORCPT ); Fri, 11 Aug 2023 10:10:46 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F39D7 for ; Fri, 11 Aug 2023 07:10:44 -0700 (PDT) Received: from kwepemm600009.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RMlxL1V2NzqSgQ for ; Fri, 11 Aug 2023 22:07:50 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 11 Aug 2023 22:10:42 +0800 From: Weili Qian To: CC: , , , Weili Qian Subject: [PATCH v2 0/7] crypto: hisilicon - fix some issues in hisilicon drivers Date: Fri, 11 Aug 2023 22:07:42 +0800 Message-ID: <20230811140749.5202-1-qianweili@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patchset fixes some issues of the HiSilicon accelerator drivers. The first patch uses 128bit atomic operations to access mailbox instead of the generic IO interface. The reason is that one QM hardware entity in one accelerator servers QM mailbox MMIO interfaces in related PF and VFs. A mutex cannot lock mailbox processes in different functions. The second patch allocs memory for mailbox openration when the driver is bound to the device. The software directly returns after waiting for the mailbox times out, but the hardware does not cancel the operation. If the temporary memory is used, the hardware may access the memory after it is released. The third patch enables the maximum number of queues supported by the device instead of returning error, when the maximum number of queues is less than the default value. The fourth patch checks the number of queues on the function before algorithm registering to crypto subsystem. If the number of queues does not meet the minimum number of queues for task execution, the function is not registered to crypto to avoid process initialization failure. The fifth patch adds a cond_resched() to prevent soft lockup. The sixth patch fixes aeq type value. The last patch increases function communication waiting time so that the PF can communicate with all VFs. v2: - Re-describe the issues resolved by these patches. - Fix some code styles. Longfang Liu (1): crypto: hisilicon/qm - fix PF queue parameter issue Weili Qian (6): crypto: hisilicon/qm - obtain the mailbox configuration at one time crypto: hisilicon/qm - alloc buffer to set and get xqc crypto: hisilicon/qm - check function qp num before alg register crypto: hisilicon/qm - prevent soft lockup in qm_poll_req_cb()'s loop crypto: hisilicon/qm - fix the type value of aeq crypto: hisilicon/qm - increase function communication waiting time drivers/crypto/hisilicon/debugfs.c | 75 ++- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 25 +- drivers/crypto/hisilicon/hpre/hpre_main.c | 19 +- drivers/crypto/hisilicon/qm.c | 567 ++++++++++---------- drivers/crypto/hisilicon/qm_common.h | 6 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 31 +- drivers/crypto/hisilicon/sec2/sec_main.c | 29 +- drivers/crypto/hisilicon/zip/zip_crypto.c | 29 +- drivers/crypto/hisilicon/zip/zip_main.c | 19 +- include/linux/hisi_acc_qm.h | 39 +- 10 files changed, 475 insertions(+), 364 deletions(-) mode change 100644 => 100755 drivers/crypto/hisilicon/qm.c -- 2.33.0