Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3057542pxu; Mon, 14 Dec 2020 19:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSiCrFdpsY20EhqDhBEJdzWW712ZUsrS9fOx29lc0okbG6b3wOpFZHJyXL/p17NfRkXlJR X-Received: by 2002:a17:906:e082:: with SMTP id gh2mr24292673ejb.406.1608003097470; Mon, 14 Dec 2020 19:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608003097; cv=none; d=google.com; s=arc-20160816; b=XY9h4k7c9uR4O2uz4CSkf6VA1adiHpFfa07o54NvCxjNbMUNffpfNZNDtaqrv+Vfhr L17HDHIaNOh/ZuJI7l0TD6JlMfNp8ze1hqwnK7GExM1UxAq098oClZvFOP6UKX5nVn7f crflJ30f7kvSlWYMFha50ERxdR9xVXfBE88jerv3SRCxzYnQCAIfwbNk99e1Wu9vQAi5 I2YYZUhkJAxfeIOJdY9J4gXDYSwCWbvCPHPbo4AvdPYovSvAHEoVn0TzKUtHlMmoUJGX 1xjJz6D81bopjiOD7euUeaeI+pg1CIRGzEZQybv0odml+MK9shALayhpP5R7u9PqPXZ4 TkXA== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=gqnhc4hqXes/DCke0h0GzFjlN28eiV+79uWm4OVG9JA=; b=zNirfl79T/IGfjDvTcmmMRH0LURj4UyBy8dDPmimixHkvKvpxSiIBPbB32KfeZKONZ mRd4b5Sp1fCTflrfcRciZnXsMVOiA22E0Rr07bpO4fDSy7DjA3DW4um42c+sHwao9FKL dJU96AVZs90q2YjDSJPduMnNIZR5cK0RpYSOCmzjihl5QSPW0wviOjYa7JHhKSrehgDs JuzHqBYHoeQ/tFHNN4buid2qh1z5qo8FI+Nb+J3Po76rggMw+BB8VUsskjlHFJQ61oPo 2F9xdhLQOGGCTAkPaozNoI/4Xzhpv41kFo6ziE66cdL03O59+1bOJ2uhXMZcyWG3H4iK In4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si270788ejc.96.2020.12.14.19.31.14; Mon, 14 Dec 2020 19:31:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727320AbgLOD2O (ORCPT + 99 others); Mon, 14 Dec 2020 22:28:14 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9177 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgLOD1v (ORCPT ); Mon, 14 Dec 2020 22:27:51 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cw3ZW6Y26z15dbZ; Tue, 15 Dec 2020 11:26:27 +0800 (CST) Received: from [10.174.178.63] (10.174.178.63) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Tue, 15 Dec 2020 11:27:01 +0800 Subject: Re: [PATCH] MIPS: No need to check CPU 0 in {loongson3,bmips,octeon}_cpu_disable() To: Tiezhu Yang , Thomas Bogendoerfer , Huacai Chen , Jiaxun Yang , Florian Fainelli CC: , , , Xuefeng Li References: <1606299090-14013-1-git-send-email-yangtiezhu@loongson.cn> From: "liwei (GF)" Message-ID: <0aafd8a7-a9ec-524e-7279-d40dbf246375@huawei.com> Date: Tue, 15 Dec 2020 11:26:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.0 MIME-Version: 1.0 In-Reply-To: <1606299090-14013-1-git-send-email-yangtiezhu@loongson.cn> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.63] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2020/11/25 18:11, Tiezhu Yang wrote: > After commit 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable"), Why CPU#0 is not hotpluggable on MIPS? Does that unrealizable? > c->hotpluggable is 0 for CPU 0 and it will not generate a control > file in sysfs for this CPU: > > [root@linux loongson]# cat /sys/devices/system/cpu/cpu0/online > cat: /sys/devices/system/cpu/cpu0/online: No such file or directory > [root@linux loongson]# echo 0 > /sys/devices/system/cpu/cpu0/online > bash: /sys/devices/system/cpu/cpu0/online: Permission denied > > So no need to check CPU 0 in {loongson3,bmips,octeon}_cpu_disable(), missing cps_cpu_disable()? Thanks, Wei > just remove them. > > Signed-off-by: Tiezhu Yang > --- > arch/mips/cavium-octeon/smp.c | 3 --- > arch/mips/kernel/smp-bmips.c | 3 --- > arch/mips/loongson64/smp.c | 3 --- > 3 files changed, 9 deletions(-) > > diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c > index 076db9a..66ce552 100644 > --- a/arch/mips/cavium-octeon/smp.c > +++ b/arch/mips/cavium-octeon/smp.c > @@ -290,9 +290,6 @@ static int octeon_cpu_disable(void) > { > unsigned int cpu = smp_processor_id(); > > - if (cpu == 0) > - return -EBUSY; > - > if (!octeon_bootloader_entry_addr) > return -ENOTSUPP; > > diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c > index 1dbfb5a..359b176 100644 > --- a/arch/mips/kernel/smp-bmips.c > +++ b/arch/mips/kernel/smp-bmips.c > @@ -362,9 +362,6 @@ static int bmips_cpu_disable(void) > { > unsigned int cpu = smp_processor_id(); > > - if (cpu == 0) > - return -EBUSY; > - > pr_info("SMP: CPU%d is offline\n", cpu); > > set_cpu_online(cpu, false); > diff --git a/arch/mips/loongson64/smp.c b/arch/mips/loongson64/smp.c > index aa0cd72..b8c1fc3 100644 > --- a/arch/mips/loongson64/smp.c > +++ b/arch/mips/loongson64/smp.c > @@ -544,9 +544,6 @@ static int loongson3_cpu_disable(void) > unsigned long flags; > unsigned int cpu = smp_processor_id(); > > - if (cpu == 0) > - return -EBUSY; > - > set_cpu_online(cpu, false); > calculate_cpu_foreign_map(); > local_irq_save(flags); >