From patchwork Mon Aug 22 02:15:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 1668567 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xCS/yGPe; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HRSBxEVC; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M9wyF43JPz1ygP for ; Mon, 22 Aug 2022 12:18:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kZlNbV7EDLTy6763GvSSB0INfZbHOguucqjqxgWVmZc=; b=xCS/yGPeq/yW0g q0h7HkUgbRA2AZoagc2jrZGzkCZq40Q+HPERVjMEunfC89t2vGZTzMePArPqS/F50CEinsDPZFYdH +nyTQtBWhWzGYbUdPNsn1Nls0AjiGzyNBSmS0Vw/QKrS9lQ6kcrLOMbJ63uQcH06SVEv81X47tixh 5qdmBBpoRh5piJR3xVibvLWyFGNxwJEhaw0LiGtv9ok6a1XyKK15nOCctWvAPkQk8/4v6JyPcKZmK 4GZzdhQe21Dt865l2Y7cJrg/09H1I28ab9K7JXxcf7vckeKya6BmnKCE2XlT37emIuwDHPv906ESV HMzYSpVUNrPun+hCbhmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPx0p-003mY3-Sk; Mon, 22 Aug 2022 02:18:01 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPwzU-003lYa-4T for linux-arm-kernel@lists.infradead.org; Mon, 22 Aug 2022 02:16:40 +0000 Received: by mail-pj1-x102a.google.com with SMTP id m15so1522643pjj.3 for ; Sun, 21 Aug 2022 19:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=xB76u9yqtIZ+mSa30ADibl4N4bymJ9Dh7UlLFPT7o98=; b=HRSBxEVCt3rvrI/7lmMMzAo0rRbfGOgqEC67o825HvHiARvDrjB8+tDVoRpWMePXYp 9oQI+id67tHzlJ/A1v+NZiooV2Ufdbed57m4RPzeWT4HTWQ3q2I+/Pe+oeuuLSkGr3sH OFGxMUhrOnPgyl+8PJjFb2VlRGBH65CMs+CTIcK33IedsTj91WJy8qIYPkCyA3YhPpbN xDCCgOZKQ5Y1aN3JjfMjYvKZvr6vDO7+ZcRdt9uyjXkR87MKlV9+WnblT5SVy92eqfSx w3yN/jWsdSyvHft8Zf3G5N2NxPQml5tWr62cry/lKZIDETPbgI06U3OybrR+Eaet25zB MNXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=xB76u9yqtIZ+mSa30ADibl4N4bymJ9Dh7UlLFPT7o98=; b=ttvFlBCnMjSEA77sONU0SsjOC/IpPUQ4GuBFHe9f8Dcixw2mWAKZa1JuHOHDRtOwUq wXqxysN1xBGJYSQWJCWOqxrCQKUlUxhIgsEjSQe/Imk5kiF3AWq2//xmxQspk4hHzm6t SYxNW947wupIvgu737F3hTodB91NeBYOTWtEVVWmUfIqSCpc12ute8n9lNTjsST4JUIW ub//m04g43x2YTZyF7D629f7UiHEAmS8F8JyVsqpHJIr4G8s5uhU/AVLPgDhLFyJoSlu 8RZtD/Xo7iSmMpnO4IKlP+qTTcV37q7DLRmqLIVv3+2JPxQammeB9/m2GE4VYnE9Wroq vDzg== X-Gm-Message-State: ACgBeo2Rmgpbor0+rvqWtPPU+JBmBMeL6yHOcOmRZLc8N7/vw+NnL9Ig nyL/iV7KYi96Ex0nlOeu7WIMv6B9sA== X-Google-Smtp-Source: AA6agR522vRbRjKGj/9trWnx6g9g6lhC9pFTs134FCjBnfDght6iTV00F7UnaCUQri0jee4v1rjxPQ== X-Received: by 2002:a17:90b:33ce:b0:1fb:1aec:ffac with SMTP id lk14-20020a17090b33ce00b001fb1aecffacmr5850314pjb.137.1661134594615; Sun, 21 Aug 2022 19:16:34 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id k3-20020aa79723000000b005321340753fsm7312139pfg.103.2022.08.21.19.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 19:16:34 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-fpga@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Pingfan Liu , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Fenghua Yu , Dave Jiang , Vinod Koul , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Will Deacon , Mark Rutland , Frank Li , Shaokun Zhang , Qi Liu , Andy Gross , Bjorn Andersson , Konrad Dybcio , Khuong Dinh , Li Yang , Yury Norov Subject: [RFC 08/10] cpuhp: Replace cpumask_any_but(cpu_online_mask, cpu) Date: Mon, 22 Aug 2022 10:15:18 +0800 Message-Id: <20220822021520.6996-9-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220822021520.6996-1-kernelfans@gmail.com> References: <20220822021520.6996-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220821_191638_139038_13AF3FB8 X-CRM114-Status: GOOD ( 17.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: In a kexec quick reboot path, the dying cpus are still on cpu_online_mask. During the teardown of cpu, a subsystem needs to migrate its broker to a real online cpu. This patch replaces cpumask_any_but(cpu_online_mask, cpu) in a teardown procedure with cpumask_not_dying_but(cpu_online_mask, cpu). Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [kernelfans[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org In a kexec quick reboot path, the dying cpus are still on cpu_online_mask. During the teardown of cpu, a subsystem needs to migrate its broker to a real online cpu. This patch replaces cpumask_any_but(cpu_online_mask, cpu) in a teardown procedure with cpumask_not_dying_but(cpu_online_mask, cpu). Signed-off-by: Pingfan Liu Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Fenghua Yu Cc: Dave Jiang Cc: Vinod Koul Cc: Wu Hao Cc: Tom Rix Cc: Moritz Fischer Cc: Xu Yilun Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: Will Deacon Cc: Mark Rutland Cc: Frank Li Cc: Shaokun Zhang Cc: Qi Liu Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Khuong Dinh Cc: Li Yang Cc: Yury Norov To: linux-arm-kernel@lists.infradead.org To: dmaengine@vger.kernel.org To: linux-fpga@vger.kernel.org To: intel-gfx@lists.freedesktop.org To: dri-devel@lists.freedesktop.org To: linux-arm-msm@vger.kernel.org To: linuxppc-dev@lists.ozlabs.org To: linux-kernel@vger.kernel.org --- arch/arm/mach-imx/mmdc.c | 2 +- arch/arm/mm/cache-l2x0-pmu.c | 2 +- drivers/dma/idxd/perfmon.c | 2 +- drivers/fpga/dfl-fme-perf.c | 2 +- drivers/gpu/drm/i915/i915_pmu.c | 2 +- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-ccn.c | 2 +- drivers/perf/arm-cmn.c | 4 ++-- drivers/perf/arm_dmc620_pmu.c | 2 +- drivers/perf/arm_dsu_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 2 +- drivers/perf/fsl_imx8_ddr_perf.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 2 +- drivers/perf/marvell_cn10k_tad_pmu.c | 2 +- drivers/perf/qcom_l2_pmu.c | 2 +- drivers/perf/qcom_l3_pmu.c | 2 +- drivers/perf/xgene_pmu.c | 2 +- drivers/soc/fsl/qbman/bman_portal.c | 2 +- drivers/soc/fsl/qbman/qman_portal.c | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index af12668d0bf5..a109a7ea8613 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -220,7 +220,7 @@ static int mmdc_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) if (!cpumask_test_and_clear_cpu(cpu, &pmu_mmdc->cpu)) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 993fefdc167a..1b0037ef7fa5 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -428,7 +428,7 @@ static int l2x0_pmu_offline_cpu(unsigned int cpu) if (!cpumask_test_and_clear_cpu(cpu, &pmu_cpu)) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/dma/idxd/perfmon.c b/drivers/dma/idxd/perfmon.c index d73004f47cf4..f3f1ccb55f73 100644 --- a/drivers/dma/idxd/perfmon.c +++ b/drivers/dma/idxd/perfmon.c @@ -528,7 +528,7 @@ static int perf_event_cpu_offline(unsigned int cpu, struct hlist_node *node) if (!cpumask_test_and_clear_cpu(cpu, &perfmon_dsa_cpu_mask)) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); /* migrate events if there is a valid target */ if (target < nr_cpu_ids) diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c index 587c82be12f7..57804f28357e 100644 --- a/drivers/fpga/dfl-fme-perf.c +++ b/drivers/fpga/dfl-fme-perf.c @@ -948,7 +948,7 @@ static int fme_perf_offline_cpu(unsigned int cpu, struct hlist_node *node) if (cpu != priv->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c index 958b37123bf1..f866f9223492 100644 --- a/drivers/gpu/drm/i915/i915_pmu.c +++ b/drivers/gpu/drm/i915/i915_pmu.c @@ -1068,7 +1068,7 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) return 0; if (cpumask_test_and_clear_cpu(cpu, &i915_pmu_cpumask)) { - target = cpumask_any_but(topology_sibling_cpumask(cpu), cpu); + target = cpumask_not_dying_but(topology_sibling_cpumask(cpu), cpu); /* Migrate events if there is a valid target */ if (target < nr_cpu_ids) { diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 03b1309875ae..481da937fb9d 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c @@ -1447,7 +1447,7 @@ static int cci_pmu_offline_cpu(unsigned int cpu) if (!g_cci_pmu || cpu != g_cci_pmu->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 728d13d8e98a..573d6906ec9b 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -1205,7 +1205,7 @@ static int arm_ccn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) if (cpu != dt->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; perf_pmu_migrate_context(&dt->pmu, cpu, target); diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index 80d8309652a4..1847182a1ed3 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -1787,9 +1787,9 @@ static int arm_cmn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *cpuhp_no node = dev_to_node(cmn->dev); if (cpumask_and(&mask, cpumask_of_node(node), cpu_online_mask) && cpumask_andnot(&mask, &mask, cpumask_of(cpu))) - target = cpumask_any(&mask); + target = cpumask_not_dying_but(&mask, cpu); else - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target < nr_cpu_ids) arm_cmn_migrate(cmn, target); return 0; diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 280a6ae3e27c..3a0a2bb92e12 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -611,7 +611,7 @@ static int dmc620_pmu_cpu_teardown(unsigned int cpu, if (cpu != irq->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index aa9f4393ff0c..e19ce0406b02 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -236,7 +236,7 @@ static int dsu_pmu_get_online_cpu_any_but(struct dsu_pmu *dsu_pmu, int cpu) cpumask_and(&online_supported, &dsu_pmu->associated_cpus, cpu_online_mask); - return cpumask_any_but(&online_supported, cpu); + return cpumask_not_dying_but(&online_supported, cpu); } static inline bool dsu_pmu_counter_valid(struct dsu_pmu *dsu_pmu, u32 idx) diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 00d4c45a8017..827315d31056 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -640,7 +640,7 @@ static int smmu_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) if (cpu != smmu_pmu->on_cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index 8e058e08fe81..4e0276fc1548 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -664,7 +664,7 @@ static int ddr_perf_offline_cpu(unsigned int cpu, struct hlist_node *node) if (cpu != pmu->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index fbc8a93d5eac..8c39da8f4b3c 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -518,7 +518,7 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) /* Choose a new CPU to migrate ownership of the PMU to */ cpumask_and(&pmu_online_cpus, &hisi_pmu->associated_cpus, cpu_online_mask); - target = cpumask_any_but(&pmu_online_cpus, cpu); + target = cpumask_not_dying_but(&pmu_online_cpus, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c index 69c3050a4348..268e3288893d 100644 --- a/drivers/perf/marvell_cn10k_tad_pmu.c +++ b/drivers/perf/marvell_cn10k_tad_pmu.c @@ -387,7 +387,7 @@ static int tad_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) if (cpu != pmu->cpu) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index 30234c261b05..8823d0bb6476 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -822,7 +822,7 @@ static int l2cache_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) /* Any other CPU for this cluster which is still online */ cpumask_and(&cluster_online_cpus, &cluster->cluster_cpus, cpu_online_mask); - target = cpumask_any_but(&cluster_online_cpus, cpu); + target = cpumask_not_dying_but(&cluster_online_cpus, cpu); if (target >= nr_cpu_ids) { disable_irq(cluster->irq); return 0; diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c index 1ff2ff6582bf..ba26b2fa0736 100644 --- a/drivers/perf/qcom_l3_pmu.c +++ b/drivers/perf/qcom_l3_pmu.c @@ -718,7 +718,7 @@ static int qcom_l3_cache_pmu_offline_cpu(unsigned int cpu, struct hlist_node *no if (!cpumask_test_and_clear_cpu(cpu, &l3pmu->cpumask)) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; perf_pmu_migrate_context(&l3pmu->pmu, cpu, target); diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index 0c32dffc7ede..069eb0a0d3ba 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c @@ -1804,7 +1804,7 @@ static int xgene_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) if (!cpumask_test_and_clear_cpu(cpu, &xgene_pmu->cpu)) return 0; - target = cpumask_any_but(cpu_online_mask, cpu); + target = cpumask_not_dying_but(cpu_online_mask, cpu); if (target >= nr_cpu_ids) return 0; diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c index 4d7b9caee1c4..8ebcf87e7d06 100644 --- a/drivers/soc/fsl/qbman/bman_portal.c +++ b/drivers/soc/fsl/qbman/bman_portal.c @@ -67,7 +67,7 @@ static int bman_offline_cpu(unsigned int cpu) return 0; /* use any other online CPU */ - cpu = cpumask_any_but(cpu_online_mask, cpu); + cpu = cpumask_not_dying_but(cpu_online_mask, cpu); irq_set_affinity(pcfg->irq, cpumask_of(cpu)); return 0; } diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index e23b60618c1a..3807a8285ced 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -148,7 +148,7 @@ static int qman_offline_cpu(unsigned int cpu) pcfg = qman_get_qm_portal_config(p); if (pcfg) { /* select any other online CPU */ - cpu = cpumask_any_but(cpu_online_mask, cpu); + cpu = cpumask_not_dying_but(cpu_online_mask, cpu); irq_set_affinity(pcfg->irq, cpumask_of(cpu)); qman_portal_update_sdest(pcfg, cpu); }