Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3175885rwb; Sat, 8 Oct 2022 23:46:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7loNisbzcDBPKawAkoIo1kwBtKjrAxv7KP3ndx3+geca64RB6hv4XSeM2yPmE8hpYnMt8q X-Received: by 2002:a17:907:7b94:b0:731:1b11:c241 with SMTP id ne20-20020a1709077b9400b007311b11c241mr10520095ejc.676.1665297986430; Sat, 08 Oct 2022 23:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665297986; cv=none; d=google.com; s=arc-20160816; b=knaOoHuRdY3KtXdmXrR6OZaJmqMw17SwV0Mfn2sd/u2vLxBtXE0/ikblvJLd91IMKa qG0X8zEbJuY9bTDPFcdGtf+9YyQ7OtMFFP7zIBHCrT//06mrvQ4gAyxGLo7vW276mxiU btS4Fsf2+GGGHpPcHxC2nSRd5BS0teIxOV86TPY5OeuAOw8PSv2l50YvN5zMDhmzNreg dkxgpLgNYUimKT/4yC7QbkFPp3Jh7MqeZPnCD0mGL368FUaoWUaI2FDqd6iFYiG8WkTD ToGKExbhe8JQUaV9V5l1HToqnk3b/QEuHAx8vS7g695woWhntsW7xhRDN2OP373C/o7v psRw== 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=hJSvlitY7PrGoz4iqmG6Crav12XfosTYL/HKEZXNrPY=; b=iYLgAK3AduR4wqD56rssCkCpg6MfohFyY8xasnQP7T1zK3K/YKTXvOLWSFsIET4DKL YxCHrsUW70ZP7gM2DoXSHj9eQUheCWLPfJiu3l/+DOxhxVId03XXa7XKqsMhrOTg7WP/ YuZzXFck+qZhtVEEzynMA25dfItDRX0xg7Q3TdoXLTnDWl4mrmaimCeUkkvSzVKEeFZs H57SJZ7o2XWVuelSxZRKxUWreYZzoorZGaLryqDh5WAH/JAu2hEuK2oYtBjzPImAFxY0 tKUGpa9HhjT4YtFho39HAK2bus7/wKoFk2uF9fX3vWEcCKXhiKvzRiS5vJTejvyk767p t3ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ugmSW59E; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a170906684d00b00787d0df52f3si6515422ejs.910.2022.10.08.23.46.01; Sat, 08 Oct 2022 23:46:26 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ugmSW59E; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiJIGPo (ORCPT + 99 others); Sun, 9 Oct 2022 02:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiJIGPm (ORCPT ); Sun, 9 Oct 2022 02:15:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D9D2B619 for ; Sat, 8 Oct 2022 23:15:39 -0700 (PDT) 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 E99BBB80C74 for ; Sun, 9 Oct 2022 06:15:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF75AC43142 for ; Sun, 9 Oct 2022 06:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665296136; bh=FXMIi4X/yLKllQTQawao9abCe7Z+/qcgFVtJRXh+Q6w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ugmSW59EkGNtQPaGv+m8tLRYNpRz/M/F+bTWjcUh2OpRnH6WJiI7IovegMkB0PQky tGMc1q3+ns1AT7rjo+c7t5AQUiCB7NnrnJGa7bSHb3OEwiqCgE5duQ2HX5p/NSJSYh DyCcN18sY9jkJPVvDAjCZ8T0vTlRDvogVw17QHRtpAf0zi7aVj995MsX1pPUwZq0zZ XyyveacWb6HSJefARt321crIV/SAm7R9Tyvmfxg65679By3tCjr0GWYDOEHtOBGSFk UF68frUz7GyzbMuRm3Ml3BzSGzfgwFzKtoRYhY3nwBlU2jaLQiS994HNEIALqysxpM DuI/iJ4MfcgGg== Received: by mail-ed1-f52.google.com with SMTP id s30so12050651eds.1 for ; Sat, 08 Oct 2022 23:15:36 -0700 (PDT) X-Gm-Message-State: ACrzQf2u8kScXvcAd14JTDBa0T7czVQgiqyl2ffCZxjqBx+HgXmeGfh+ JwBgN/tlhnFkTFuXN9bohZdY8E9rfsp26BYgLFc= X-Received: by 2002:a05:6402:c81:b0:458:c428:173a with SMTP id cm1-20020a0564020c8100b00458c428173amr12031575edb.298.1665296134980; Sat, 08 Oct 2022 23:15:34 -0700 (PDT) MIME-Version: 1.0 References: <1665278582-16038-1-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: <1665278582-16038-1-git-send-email-yangtiezhu@loongson.cn> From: Huacai Chen Date: Sun, 9 Oct 2022 14:15:28 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] LoongArch: Do not create sysfs control file for io master CPUs To: Tiezhu Yang Cc: WANG Xuerui , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Queued for loongarch-next, thanks. Huacai On Sun, Oct 9, 2022 at 9:23 AM Tiezhu Yang wrote: > > Now io master CPUs are not hotpluggable on LoongArch, in the current code, > only /sys/devices/system/cpu/cpu0/online is not created, let us set the > hotpluggable field of all the io master CPUs as 0, then prevent to create > sysfs control file for the other io master CPUs which confuses some user > space tools. This is similar with commit 9cce844abf07 ("MIPS: CPU#0 is not > hotpluggable"). > > Signed-off-by: Tiezhu Yang > --- > arch/loongarch/include/asm/bootinfo.h | 5 +++++ > arch/loongarch/kernel/smp.c | 5 ----- > arch/loongarch/kernel/topology.c | 3 ++- > 3 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/arch/loongarch/include/asm/bootinfo.h b/arch/loongarch/include/asm/bootinfo.h > index 8e5881b..ed0910e 100644 > --- a/arch/loongarch/include/asm/bootinfo.h > +++ b/arch/loongarch/include/asm/bootinfo.h > @@ -40,4 +40,9 @@ extern unsigned long fw_arg0, fw_arg1, fw_arg2; > extern struct loongson_board_info b_info; > extern struct loongson_system_configuration loongson_sysconf; > > +static inline bool io_master(int cpu) > +{ > + return test_bit(cpu, &loongson_sysconf.cores_io_master); > +} > + > #endif /* _ASM_BOOTINFO_H */ > diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c > index b5fab30..781a4d4 100644 > --- a/arch/loongarch/kernel/smp.c > +++ b/arch/loongarch/kernel/smp.c > @@ -240,11 +240,6 @@ void loongson3_smp_finish(void) > > #ifdef CONFIG_HOTPLUG_CPU > > -static bool io_master(int cpu) > -{ > - return test_bit(cpu, &loongson_sysconf.cores_io_master); > -} > - > int loongson3_cpu_disable(void) > { > unsigned long flags; > diff --git a/arch/loongarch/kernel/topology.c b/arch/loongarch/kernel/topology.c > index ab1a75c..caa7cd8 100644 > --- a/arch/loongarch/kernel/topology.c > +++ b/arch/loongarch/kernel/topology.c > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > > static DEFINE_PER_CPU(struct cpu, cpu_devices); > > @@ -40,7 +41,7 @@ static int __init topology_init(void) > for_each_present_cpu(i) { > struct cpu *c = &per_cpu(cpu_devices, i); > > - c->hotpluggable = !!i; > + c->hotpluggable = !io_master(i); > ret = register_cpu(c, i); > if (ret < 0) > pr_warn("topology_init: register_cpu %d failed (%d)\n", i, ret); > -- > 2.1.0 >