Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8805616rwb; Thu, 24 Nov 2022 04:39:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7m0ryF41EyXKbxi7lukF9L1BpkPZuxoNv0rvEA/IcfgAdncohA1IYojMj7xD/hGor+v4Mr X-Received: by 2002:a17:902:f651:b0:187:190f:6aa7 with SMTP id m17-20020a170902f65100b00187190f6aa7mr14472979plg.131.1669293596226; Thu, 24 Nov 2022 04:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669293596; cv=none; d=google.com; s=arc-20160816; b=rdPIxGkQ3tWE0uG5UJL4IfvXc4vZtBhYezJna8FBe5Ew3gq7EN3U79ahL0miFOqkQA mY96cX2vsoZ6T/QE0pEExpcz2JE1gSLAiOeiBWjxhBYZmK1IvByeIO8MnHQd5V9/tMvK ePfArswTaG5zwsBQNZjy8hhO9y4ML2APk3mNtxHS6kyxSpVTm0klOhKkFv6KMvdTbmUt mZlJgkgpt9kEmt4+hrPGBQYfZQ/EXwjDES6O1DCi/yAZt+rwvpdoKYeGStdY+D8d9dJS iWSUNviiBoVCdk2HmMU+9IhMnEkO3Tc4+1iErFDEdwqyWurk92h/aH3r+mj5D53d++lK vi+w== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=otPs1j8oJj0i3mqbOehFsNnzfRsN88SsLw/TOhGwxUo=; b=ZA24fALf3ALqCz1dR3MeTTivY0h+a+QMW8LRKdDi4iliuFNJLKxwvotR91YvzywN7I 7z4pq01ivLF2YhETEjIOOg5OBlBthzWXLhUw2G7KW/KH3N1V/Op3ISD1srDyowtdfwON YhEsmcHweDSr7K5khjRxzRU1zVmEyBdraTHNuvjbgQfXG4M4el1w2xRSOYFLc0Hq0GNE T8RNZ1T79Uyyfb2U0S54bK5xMKVn01hsM8YaWtsuv03aA6OSjxpgQ+4mEOmDTncX/+0E Lb/1ucCUzhlbzxyAAYlDELmsAmARUk4LfhG33Z52PUZ+74QlrBn+nDB08GrWSrrl9Vp1 QiSA== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o26-20020a635a1a000000b0047048d81089si1131647pgb.186.2022.11.24.04.39.45; Thu, 24 Nov 2022 04:39:56 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiKXM36 (ORCPT + 87 others); Thu, 24 Nov 2022 07:29:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbiKXM35 (ORCPT ); Thu, 24 Nov 2022 07:29:57 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB89511C31 for ; Thu, 24 Nov 2022 04:29:55 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BF0023A; Thu, 24 Nov 2022 04:30:02 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D7D13F73B; Thu, 24 Nov 2022 04:29:54 -0800 (PST) Message-ID: <84b33e86-be89-4242-1cff-5c60c037c603@arm.com> Date: Thu, 24 Nov 2022 12:29:52 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] coresight: trbe: remove cpuhp instance node before remove cpuhp state Content-Language: en-US To: Anshuman Khandual , Yang Shen , mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org References: <20221122090355.23533-1-shenyang39@huawei.com> From: Suzuki Kuruppassery Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On 24/11/2022 12:22, Anshuman Khandual wrote: > > > On 11/24/22 17:00, Suzuki Kuruppassery Poulose wrote: >> On 22/11/2022 09:03, Yang Shen wrote: >>> cpuhp_state_add_instance() and cpuhp_state_remove_instance() should >>> be used in pairs. Or there will lead to the warn on >>> cpuhp_remove_multi_state() since the cpuhp_step list is not empty. >>> >>> The following is the error log with 'rmmod coresight-trbe': >>> Error: Removing state 215 which has instances left. >>> Call trace: >>>    __cpuhp_remove_state_cpuslocked+0x144/0x160 >>>    __cpuhp_remove_state+0xac/0x100 >>>    arm_trbe_device_remove+0x2c/0x60 [coresight_trbe] >>>    platform_remove+0x34/0x70 >>>    device_remove+0x54/0x90 >>>    device_release_driver_internal+0x1e4/0x250 >>>    driver_detach+0x5c/0xb0 >>>    bus_remove_driver+0x64/0xc0 >>>    driver_unregister+0x3c/0x70 >>>    platform_driver_unregister+0x20/0x30 >>>    arm_trbe_exit+0x1c/0x658 [coresight_trbe] >>>    __arm64_sys_delete_module+0x1ac/0x24c >>>    invoke_syscall+0x50/0x120 >>>    el0_svc_common.constprop.0+0x58/0x1a0 >>>    do_el0_svc+0x38/0xd0 >>>    el0_svc+0x2c/0xc0 >>>    el0t_64_sync_handler+0x1ac/0x1b0 >>>    el0t_64_sync+0x19c/0x1a0 >>>   ---[ end trace 0000000000000000 ]--- >>> >>> Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver") >>> Signed-off-by: Yang Shen > > Reviewed-by: Anshuman Khandual > >>> --- >>>   drivers/hwtracing/coresight/coresight-trbe.c | 1 + >>>   1 file changed, 1 insertion(+) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c >>> index 2b386bb848f8..1fc4fd79a1c6 100644 >>> --- a/drivers/hwtracing/coresight/coresight-trbe.c >>> +++ b/drivers/hwtracing/coresight/coresight-trbe.c >>> @@ -1434,6 +1434,7 @@ static int arm_trbe_probe_cpuhp(struct trbe_drvdata *drvdata) >>> >>>   static void arm_trbe_remove_cpuhp(struct trbe_drvdata *drvdata) >>>   { >>> +    cpuhp_state_remove_instance(drvdata->trbe_online, &drvdata->hotplug_node); >>>       cpuhp_remove_multi_state(drvdata->trbe_online); >>>   } >>> >> >> Applied to coresight next. >> >> https://git.kernel.org/coresight/c/5fefef85b0d3 > > Hi Suzuki, > > Could you please add the above tag for the patch. Thank you. Sorry, its too late. It is already in the upstream tree. Suzuki