Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3971767pxb; Tue, 25 Jan 2022 00:19:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBFvvjP/tTGvPQ9kDbyaysJAHH+MTTH4cV+Z96o94Bphrn0tnStsN1mme7BuPw6uEfdrkZ X-Received: by 2002:a50:ed1a:: with SMTP id j26mr10046445eds.414.1643098752605; Tue, 25 Jan 2022 00:19:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098752; cv=none; d=google.com; s=arc-20160816; b=DErrvm2LSp++9T9tJcDlgtYHistjGgBP73zml99WI/XQi80BUaigMrSwrzTh/Tdzwc 9bUQj6OMCZkZtjcrhhm8UjIm5H+WUhSfzQGsGqrfkYTRDzXAypFFU0Wn9F2ooKjep1EQ Rn3Gys3X/kb2V0j1bSGAyPyJSVS5vYJoSaWp4rjPWFpq8FqpH+WnV9ZOkCRC8AHLaqyH b9RPRCBaUvt1J/mVqliLjvh7lc+gIhkp9H/1/Tt5OzuD6Ar7m9u6i/3E++ILFXfeROfo Y0tOThjPmH5l89e6/OkzV/FPRz8da3vdIc+9vZ2YaW/iXmy0ymurylLP0YlCTigXTDeQ pMKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZogJFEb2+oyl+Ei4yIOztgH+oaoPVDfM2Yq+Ch/rvWY=; b=tIv3fKsak6RiPRTqVrtnxClMtFpgH4bvD/X9LQKpyiriZwjegwZh7Qmnm1hLmGKDPB ksaYZ67ecBx0Diq8QUxSoY5uZ3JJxFxsZtQGefKM5gyBqJsJODLlLNLtfvFoiYDtGSlR GRZftu19XXuq9DGo1PrAae1+G2JPwbutuJxj/l1+TGZXpoLkHPaapaYsamFGKS0KVGT6 pK7uKBbSdqqAtc6huKSGdWH6bK8oRJSnYdv6blF0G9BmR4s738ir6GLcI2W0JWrzPdes zfojbL/tKrb51SQrS2pu5C6eLOcaB8f7hqyH6kcmsZEl8QttY0KN9w776zMRSVbz9s6e G/nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sn76BkUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si10279034edx.609.2022.01.25.00.18.48; Tue, 25 Jan 2022 00:19:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sn76BkUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3413126AbiAYAi2 (ORCPT + 99 others); Mon, 24 Jan 2022 19:38:28 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:59174 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354330AbiAXVHG (ORCPT ); Mon, 24 Jan 2022 16:07:06 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C30B7B8105C; Mon, 24 Jan 2022 21:07:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D308EC340E5; Mon, 24 Jan 2022 21:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058423; bh=ZTyiFhQJN4fI0ohqFr2xGTdcTomL+FISSSU8k9rBfuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sn76BkUr7b3v3qs36ZCZdh8d/ix7VC4wsUKL4SmEhD+yciE8m3LzI60mb/Nqb8GzN dJOOZDr8EfItfLUsAbYi/QhHdLSf88mCiSNk+vaABv37mvYLC/9J6dNInu0Vup/nYD 9+jAk4Di3Z18rbporIDUhNC41utHDXI5L+vy3bZ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Murphy , Will Deacon , Sasha Levin Subject: [PATCH 5.16 0284/1039] perf/arm-cmn: Fix CPU hotplug unregistration Date: Mon, 24 Jan 2022 19:34:33 +0100 Message-Id: <20220124184134.829380525@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Murphy [ Upstream commit 56c7c6eaf3eb8ac1ec40d56096c0f2b27250da5f ] Attempting to migrate the PMU context after we've unregistered the PMU device, or especially if we never successfully registered it in the first place, is a woefully bad idea. It's also fundamentally pointless anyway. Make sure to unregister an instance from the hotplug handler *without* invoking the teardown callback. Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/2c221d745544774e4b07583b65b5d4d94f7e0fe4.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/perf/arm-cmn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index bc3cba5f8c5dc..400eb7f579dce 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -1561,7 +1561,8 @@ static int arm_cmn_probe(struct platform_device *pdev) err = perf_pmu_register(&cmn->pmu, name, -1); if (err) - cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node); + cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); + return err; } @@ -1572,7 +1573,7 @@ static int arm_cmn_remove(struct platform_device *pdev) writel_relaxed(0, cmn->dtc[0].base + CMN_DT_DTC_CTL); perf_pmu_unregister(&cmn->pmu); - cpuhp_state_remove_instance(arm_cmn_hp_state, &cmn->cpuhp_node); + cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); return 0; } -- 2.34.1