Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1932609rwb; Fri, 2 Dec 2022 03:15:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LXjIhcWK+EBRNUU5cPuQkLJpp1Iu2kNTRO6H9wMFXDjJ1nRywRk1wBT9P9iGML7RSKpz7 X-Received: by 2002:a50:ff04:0:b0:46b:19aa:cfc4 with SMTP id a4-20020a50ff04000000b0046b19aacfc4mr22171111edu.384.1669979729777; Fri, 02 Dec 2022 03:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669979729; cv=none; d=google.com; s=arc-20160816; b=ydje183yTI89VOq8bicWYKct0NukJZnPhsw8pXT+pkpJncWdfW2lznPl4K/wx+EGD2 2BYRXdIWGcLSlBa4hILQuGquiCranlcLNy668cPXiz+ltH7HHeQ4TLBIZau7mgHNl9zF XejCl7LZZ0ItGFvT8SClVzodclG0ThBWrdFYhWDlzXtsVvNZyUmNjw4p81a4cf1G96Zu IIbsG4OXYEsHCjwLMcpxAZPXb9FKtQh100kOGSFBIWXPaACFoC05G41y1OPM7kk5gaXY N8neAMrhRYMVPW9TyQ2dWB4PEkHSUPqD/4exIsKlHUsccEPxnHKBPBQqn4JLjzcTUXvJ Hw5A== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=isrGOSsfUJko0nc9lBb9GuDaWvDdluRU2A1lOqKPwS8=; b=M5b/4yMp06MvGC4/GPNGp4b4LfU1kufCEnXG97BUuxODNDaAYt6/m7SwiwmEq4bQgI 782eJA9k5uIEj3ix1ta/dTwl4S/hwGDMTV0SANDtwTjNJ52QnyptjC9WtVDCFDpS1S1E HLy9Fc1b62m64ixcDKSC/FgAOcEOzSBL6OMyT0qmXhod1Q6qh3RCy/FfEkop25Qu/bjm MVY9zoyoKkMmCfMah5nhFXaFk6A9SfGoahnXvH7/qPpr8uLjzwTNsSNZ2ZSjibVNyyUh hE2BLvptCa3kbyrS9wW30bu8a73DPk2QPWwSwkt0rGQeYbr8JQcHIcNo3wGKEarreAkO yJAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 30-20020a17090600de00b0078e11e92257si5259646eji.333.2022.12.02.03.15.08; Fri, 02 Dec 2022 03:15:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S232723AbiLBKfM (ORCPT + 83 others); Fri, 2 Dec 2022 05:35:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbiLBKfD (ORCPT ); Fri, 2 Dec 2022 05:35:03 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA62C1BFB; Fri, 2 Dec 2022 02:35:02 -0800 (PST) Received: from kwepemi500014.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NNq7F5ljmz15N2v; Fri, 2 Dec 2022 18:34:17 +0800 (CST) Received: from [10.174.176.189] (10.174.176.189) by kwepemi500014.china.huawei.com (7.221.188.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 2 Dec 2022 18:34:59 +0800 Message-ID: <52a15a3f-a288-7a7f-e9b3-1096d108e4a3@huawei.com> Date: Fri, 2 Dec 2022 18:34:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH] net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue To: Pavan Chebbi CC: , , , , , , , , , , References: <20221201134717.25750-1-linqiheng@huawei.com> From: Qiheng Lin In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.189] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500014.china.huawei.com (7.221.188.232) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 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-kernel@vger.kernel.org 在 2022/12/2 18:02, Pavan Chebbi 写道: > On Fri, Dec 2, 2022 at 1:36 PM Pavan Chebbi wrote: >> >> On Thu, Dec 1, 2022 at 6:57 PM Qiheng Lin wrote: >>> >>> The mchp_sparx5_probe() won't destroy workqueue created by >>> create_singlethread_workqueue() in sparx5_start() when later >>> inits failed. Add destroy_workqueue in the cleanup_ports case, >>> also add it in mchp_sparx5_remove() >>> >>> Signed-off-by: Qiheng Lin >>> --- >>> drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c >>> index eeac04b84638..b6bbb3c9bd7a 100644 >>> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c >>> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c >>> @@ -887,6 +887,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev) >>> >>> cleanup_ports: >>> sparx5_cleanup_ports(sparx5); >>> + if (sparx5->mact_queue) >>> + destroy_workqueue(sparx5->mact_queue); >> >> Would be better if you destroy inside sparx5_start() before returning failure. >> > > Alternatively you could add the destroy inside sparx5_cleanup_ports() > that will cover all error exits? That works functionally, I have considered this modification as well. Since I'm not quite sure on the naming, destroying the mact_queue belongs to sparx5_cleanup_ports, which they don't contain now. > >>> cleanup_config: >>> kfree(configs); >>> cleanup_pnode: >>> @@ -911,6 +913,7 @@ static int mchp_sparx5_remove(struct platform_device *pdev) >>> sparx5_cleanup_ports(sparx5); >>> /* Unregister netdevs */ >>> sparx5_unregister_notifier_blocks(sparx5); >>> + destroy_workqueue(sparx5->mact_queue); >>> >>> return 0; >>> } >>> -- >>> 2.32.0 >>>