Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp773498rwe; Thu, 1 Sep 2022 07:26:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR5OCi6ArJ0Y/m8UEy1bYTgszfKQBb9AXJzMq5zGg7h+sxciswzZYaYkjj9O9WDkoSVXGw7k X-Received: by 2002:aa7:ccc8:0:b0:448:b0ce:3b65 with SMTP id y8-20020aa7ccc8000000b00448b0ce3b65mr12813165edt.56.1662042415163; Thu, 01 Sep 2022 07:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662042415; cv=none; d=google.com; s=arc-20160816; b=cV+XxEgBIWHBrdcbYKIY8YIXQh2crmPtoaWY2mjKwZUvDch12R0eNP534OCNN5OecZ yPzYHeJBtYC9bLb+rdaNxqdHt6sg50tfnjZFVGoAAB0SGNHVtO3+8mk8gFeRsaZD/G3Y tui1D269FpqeRC6ZuYuNjqBQIMXQU1QpdW3UPQdsj+mH9DeifoNLOts3TRHiNYGFUTID ElEQtUZLSEUZJmdRErY4FJ/bw10J8rQCZrfGmf9kYt9uuKnLqxrHB6d4WkbsJi64KyLu Amp3iKBYTlSdDdv5XWa/UvPpCSCLKiafldCiIrk1IPNacbTQ99YS4Cc4TTdrTosMsiTW B5iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0pValQemCvGX1LEq88UuNr8omRZeEtwxwFj8CYGFUUk=; b=yO83pXxnXyl844mJXu3hLaRYQkcdM6E06wK+HD575/NBjD+X633gbFPI9BLoUEImKi oyciOdPAS76+5nMb4X28TeZxIDT+BnNmUm7YiKuQ8+caWxL+3BsvyYZUjlJ1R6evIDWp T1XzS4ugesrm0Ip+T3A9pHIO25jsrXgOmS5mkk6vvnaVhi+6rvtQaxJ+CRnRG+wktel1 1ny4Owx3f6tdIvJ5Vt/fna8DKc6dM5xyWFP80SX0ZaBQHbMSdnEddH+YKjNPxYF/h3Yw ObZs6saUF8sFM41jg0tmxrucUDlH99oNQIXadriVO4Rk5l13TG3oPm8rnrW6i8Uuhmnf dPmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=tbxhzmPq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a50c00f000000b004486942c31bsi1837256edb.274.2022.09.01.07.26.10; Thu, 01 Sep 2022 07:26:55 -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; dkim=pass header.i=@canonical.com header.s=20210705 header.b=tbxhzmPq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234638AbiIAOX5 (ORCPT + 99 others); Thu, 1 Sep 2022 10:23:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234761AbiIAOXl (ORCPT ); Thu, 1 Sep 2022 10:23:41 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0CDC72FDE for ; Thu, 1 Sep 2022 07:23:15 -0700 (PDT) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 435203F495 for ; Thu, 1 Sep 2022 14:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1662042192; bh=0pValQemCvGX1LEq88UuNr8omRZeEtwxwFj8CYGFUUk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tbxhzmPqBTixnRFsFnJM2I7Y6WYR3dBghMd+YxJPxOuuPjUkLweDKVzolAXPQvJEw X0/BGPLuDBjQuoSj1IEUVH0031lXFoQ9cNrVMSKHIFfuPALRkw2sozNj11PgSuEzZq wEXlCZBkn8BzhZHJjzv2FNMdWHPtnzbkyNvVg7mATDqvGQws8ZEYuyxWNaQ02Z+Yam aYW/HIHUjYleFbGPUmSKHGmW2PFTm70Mcl4V/1z8ZB0GIRoDXjh1cbmz/Zxkj6iLVX chlIZDxQrlZ3FJVnSY/qr0iBishbT2VFljxTyRGPbvDPkg6CECHu2Z6CydnAF5gGfV yd5r7nkLsMnPw== Received: by mail-ed1-f70.google.com with SMTP id p4-20020a056402500400b00447e8b6f62bso11934057eda.17 for ; Thu, 01 Sep 2022 07:23:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=0pValQemCvGX1LEq88UuNr8omRZeEtwxwFj8CYGFUUk=; b=nOCmiX9Y5ym9l/qs+yAuElZzjSTvdKL8CWTUpOFZCdZHg/z5EsWl3xdGGu5n/piKIS BBzeRSnslZxTVil6mu26QxZRdlsR+kJqhDE2A5/Zki6nS/E2y4U4H7ZhT6Yf+hgl8W1H itYCTVQqRAWdEvXrbkU5BWtE1+Q8/0+MUK2txqUx56x0zoaUVv2Np4R6C3PoEkmZQPtp BcANe23JSOoKkUm7stIYb8QyJKJ6PVtaJ+O7RQjqXoN4qxdrn+l2todZrKwUpC6jQAg2 8d+WSk/u0Me1gRb5b8sm2HuaxyN+vhcPyaywT073KgoPSRaMIa4YT8q69Z1s8WvBwr+p SzcQ== X-Gm-Message-State: ACgBeo0qalPHG24kgva3PSHRoRRdaalyssDbhDC0r4Fx2ku81U3Za7Va A5yNIRqsj0kDjiLH4FaUdXVMtV9KE3ZwBiNJvEnCfmZEkG0z+E3SCGoGMBc/bo+sWl0C8aP1cuC iw8oq5adwGoTV57vfKHo1JQQd1pV9+pbpsO7RAB3yKx/ZyJ0xH1djFDBIfA== X-Received: by 2002:a17:907:a40f:b0:730:c4ce:631c with SMTP id sg15-20020a170907a40f00b00730c4ce631cmr22980394ejc.362.1662042191768; Thu, 01 Sep 2022 07:23:11 -0700 (PDT) X-Received: by 2002:a17:907:a40f:b0:730:c4ce:631c with SMTP id sg15-20020a170907a40f00b00730c4ce631cmr22980376ejc.362.1662042191485; Thu, 01 Sep 2022 07:23:11 -0700 (PDT) MIME-Version: 1.0 References: <20220901021628.1130985-1-koba.ko@canonical.com> In-Reply-To: From: Koba Ko Date: Thu, 1 Sep 2022 22:23:00 +0800 Message-ID: Subject: Re: [PATCH V2] crypto: ccp - Release dma channels before dmaengine unrgister To: Tom Lendacky Cc: John Allen , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Thu, Sep 1, 2022 at 9:57 PM Koba Ko wrote: > > On Thu, Sep 1, 2022 at 9:42 PM Tom Lendacky wrote: > > > > On 8/31/22 21:16, Koba Ko wrote: > > > A warning is shown during shutdown, > > > > > > __dma_async_device_channel_unregister called while 2 clients hold a reference > > > WARNING: CPU: 15 PID: 1 at drivers/dma/dmaengine.c:1110 __dma_async_device_channel_unregister+0xb7/0xc0 > > > > > > Call dma_release_channel for occupied channles before dma_async_device_unregister. > > > > > > Fixes: 4cbe9bc34ed0 ("crypto: ccp - ccp_dmaengine_unregister release dma channels") > > > > I can't find this Fixes: tag. I did find: > > > > 54cce8ecb925 ("crypto: ccp - ccp_dmaengine_unregister release dma channels") > > > > Not sure if Herbert can take care of that or if you'll need a v3. > > Sorry, it should be 54cce8ecb925("crypto: ccp - > ccp_dmaengine_unregister release dma channels") > > > > > With the change to the Fixes: tag > > > > Acked-by: Tom Lendacky Should I add acked-by in V3 by myself? thanks > > > Reported-by: kernel test robot > > > Signed-off-by: Koba Ko > > > --- > > > V2: Fix the unused warning > > > --- > > > drivers/crypto/ccp/ccp-dmaengine.c | 6 +++++- > > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c > > > index 7d4b4ad1db1f3..9f753cb4f5f18 100644 > > > --- a/drivers/crypto/ccp/ccp-dmaengine.c > > > +++ b/drivers/crypto/ccp/ccp-dmaengine.c > > > @@ -641,6 +641,10 @@ static void ccp_dma_release(struct ccp_device *ccp) > > > for (i = 0; i < ccp->cmd_q_count; i++) { > > > chan = ccp->ccp_dma_chan + i; > > > dma_chan = &chan->dma_chan; > > > + > > > + if (dma_chan->client_count) > > > + dma_release_channel(dma_chan); > > > + > > > tasklet_kill(&chan->cleanup_tasklet); > > > list_del_rcu(&dma_chan->device_node); > > > } > > > @@ -766,8 +770,8 @@ void ccp_dmaengine_unregister(struct ccp_device *ccp) > > > if (!dmaengine) > > > return; > > > > > > - dma_async_device_unregister(dma_dev); > > > ccp_dma_release(ccp); > > > + dma_async_device_unregister(dma_dev); > > > > > > kmem_cache_destroy(ccp->dma_desc_cache); > > > kmem_cache_destroy(ccp->dma_cmd_cache);