Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3240365rwi; Fri, 28 Oct 2022 18:25:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uD3F2WCJ1Gsqat0OzT1I168DjDqjcc4OZWrlGf/EiW+lN9W0L8fW8yi9mWtTczO4ICdYC X-Received: by 2002:a17:902:7e0e:b0:17f:8edd:5f00 with SMTP id b14-20020a1709027e0e00b0017f8edd5f00mr1982767plm.96.1667006750337; Fri, 28 Oct 2022 18:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667006750; cv=none; d=google.com; s=arc-20160816; b=j3ci/6Doqij46K5mucd5Gml3VYc1NNABlAZl0PDZ3T2V4cTp60gsxS+sWIElLfwzgl MpTk3e2DOf+DrQnMCQhkDHgFET70VgyJdDwSH4WatuGF6QlSIPzuhLpMpyHXZU663X0C CBlMG6cbCirOr1xJ+ZvlH+iXS7fbpPo1KPWiIMMD8EXoaRnX2sspOa6hRrvmb9W4mwww vJRBfabL086M8vBu4Vmks42hVTfAw7oC1bXsD2HN8mJ4NPK274Vy6MWxBndwVrotDXIN GU9Vj1tV835VR/5NBaQ3EdDj8l3vz3U/h7Z+j8JD382rbyUudzvHMN/ZVuy0YqZsiXrI sM7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=jv9dcH7ReQApOWL80NhX+taLfE308KR4X7x2SZxrHxg=; b=bghFA256meCxZCAB4zy4CYcgl3+07uW0k9CxYsrM+kJHnHRdT5uBCEO9TO+Ll2efF/ Q/S/7w/W7d2NWOm1IztsFdON/cdrpZRueLBp7nG/ntRmPQTe19k/bREbeRd0cev6Z3aX IBoTLSd9EHWcbRz3RbHC6ilrPIFjMhpRfXKn9XpK7d2VWr5+1XIZBbHnW2h/KcB44jVN W1NGFOUahZMi/SaU1ySAOtR2z35IVJWoz2tkXKdlVywh9fyVMULRefT9aD5Nu6O86PDA TbWuZEWWSu4HiPlx+KpMkIOG+giDRhfhwif53/O0Dc3ogHIrMGh/iIYnGaixw3FDk+Ym hT3w== 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 e10-20020a170902cf4a00b00179f1584540si207613plg.564.2022.10.28.18.25.27; Fri, 28 Oct 2022 18:25: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 S229647AbiJ2BZY (ORCPT + 99 others); Fri, 28 Oct 2022 21:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiJ2BZY (ORCPT ); Fri, 28 Oct 2022 21:25:24 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79E969ECB; Fri, 28 Oct 2022 18:25:21 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MzhRq2Fp3z15MD6; Sat, 29 Oct 2022 09:20:23 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 29 Oct 2022 09:25:19 +0800 Received: from [10.67.103.158] (10.67.103.158) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 29 Oct 2022 09:25:19 +0800 Subject: Re: [PATCH] crypto/hisilicon: Add null judgment to the callback interface To: Herbert Xu CC: , , References: <20220930024320.29922-1-liulongfang@huawei.com> <717adf23-3080-5041-14ed-6ab5dcaddbf9@huawei.com> From: liulongfang Message-ID: Date: Sat, 29 Oct 2022 09:25:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.158] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 On 2022/10/28 11:57, Herbert Xu wrote: > On Fri, Sep 30, 2022 at 11:48:02AM +0800, liulongfang wrote: >> >> Even if the task is sent in synchronous mode, when using the hardware >> driver, the hardware still informs the driver software through an >> interrupt after completing the task, and the workqueue in the driver >> software will call this callback function. >> >> And I found that the device drivers of other manufacturers under the >> crypto subsystem are also in this asynchronous mode, and this problem >> is also encountered when using the synchronous mode. > > This still makes no sense to me. > > Who is making an async request with no callback? > The context of the problem may not have been clearly stated in the previous description. This is a problem found in one of our real user scenarios: In this scenario of using an accelerator to perform encryption services, it was originally intended to use the CPU to perform encryption services in synchronous mode (without loading the hardware device driver, and without registering the asynchronous callback function), but due to a deployment error, the Hisi hardware device driver was loaded into the system, this wrong operation causes the encryption service to call the device driver of the hisi hardware, but the hardware device driver executes the asynchronous mode, so the callback interface is called after the service is completed. This leads to this system calltrace problem. The purpose of this patch is to ensure that the device does not appear calltrace in this abnormal situation. > Cheers, > Thanks, Longfang.