Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1313382ybt; Thu, 9 Jul 2020 04:06:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOexV8hq5Ty6ry9HYIcALrSKRUHSKxdx9odKsOiadMC8ma9FGXyKPpE6GXtYkbtVbX1tCC X-Received: by 2002:a17:906:8381:: with SMTP id p1mr55083521ejx.280.1594292799962; Thu, 09 Jul 2020 04:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594292799; cv=none; d=google.com; s=arc-20160816; b=NjD9KXPm/kPbUlK3YjwQtHsoOSnJGuQXypg5D1e0+VzwOB3sVTAKV6ermqNYYWFLaS R6qIksIUF54pqs8AqbedzaQMCF6mKme0Mea+37HwVUs5GXTaYUF2K3dR1B488SwhHrSA 57/22bT4WfNfhivKj+avXmQTm9UawDXEz4Lbd1nqCmfBBMPb+Q8mR+Z6+qZrgcxwn5pD qoOxGmtpINr17K6lzp8/Q80SegaO0+l4PHb4ogjsq0dEr1VQFf2swJeeqe3FgX/5r1VU NlczDECZIrpIV+9xP/8gcVF+PQ9uYT15DDA/IDO+h39fkb1OomAck6wu+KIvBCpiiECh J8lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=03j5dx8waA5C+V197+YQev7avoW/sMbbpIpdr7nEYIs=; b=Qebce8Zmc9doKH2HoV37frmX2/DyXe6EEH0zHSnXhB2duq6ekCBPd057b87Ob4VRpJ eQXsH5SmhIPaeiG+R1Yq5rMsoQOYMnkotZs6zVkof+enp98b7Hx4/qXv9RLyfgm8Jlwl uansjjBLnQmDSOAD29KYUITr/CcQ40Z7XvPN6ogHal1+lnAyuLRv0Ssme8z7Fud8761B z7t8YCgQSoaHrwkZ6WA3oIBkcrrzJRBAunA8zfmpdJhljn+Xb+sTYLgzcFBY4NCHZUQg x+TQUEud7ys2gJmzox6HDWU6cNKLQyVQzFsEJyM9x6kKCgbIDsQk2lkJWZ7ELKJBZw2W V0og== 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 i23si1791741eds.82.2020.07.09.04.06.10; Thu, 09 Jul 2020 04:06:39 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgGILFY (ORCPT + 99 others); Thu, 9 Jul 2020 07:05:24 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53724 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726936AbgGILFX (ORCPT ); Thu, 9 Jul 2020 07:05:23 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A6B6E94268DA562CD4B4; Thu, 9 Jul 2020 19:05:21 +0800 (CST) Received: from [127.0.0.1] (10.74.173.29) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Thu, 9 Jul 2020 19:05:11 +0800 Subject: Re: [Patch v2 8/9] crypto: hisilicon/qm - fix the process of register algorithms to crypto To: Herbert Xu References: <1593587995-7391-1-git-send-email-shenyang39@huawei.com> <1593587995-7391-9-git-send-email-shenyang39@huawei.com> <20200709053619.GA5637@gondor.apana.org.au> CC: , , , From: "shenyang (M)" Message-ID: <4e79b1ce-2b2a-7db3-dc55-380c2229657a@huawei.com> Date: Thu, 9 Jul 2020 19:05:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20200709053619.GA5637@gondor.apana.org.au> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.173.29] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2020/7/9 13:36, Herbert Xu wrote: > On Wed, Jul 01, 2020 at 03:19:54PM +0800, Yang Shen wrote: >> When the devices are removed or not existing, the corresponding algorithms >> which are registered by 'hisi-zip' driver can't be used. >> >> Move 'hisi_zip_register_to_crypto' from 'hisi_zip_init' to >> 'hisi_zip_probe'. The algorithms will be registered to crypto only when >> there is device bind on the driver. And when the devices are removed, >> the algorithms will be unregistered. > > You can't just unregister a live algorithm because if someone > holds a reference count on it then the Crypto API will crash. > Yes, this patch just fixes the bug for 'hisi_zip'. As for 'hisi_hpre' and 'hisi_sec2', this patch doesn't change the logic. We have noticed the problem you say, and the patch is prepared. We fix this in 'hisi_qm', and you will see it soon. > Cheers, > Thanks Yang