Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3098983pxu; Mon, 14 Dec 2020 21:11:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGEE1NNWhCBvmWJ7qooewqwLmoYJxjx1hR5htA7G4g4Lb0/aN76zwDU3KqkvMnmtiVcMtU X-Received: by 2002:a05:6402:b42:: with SMTP id bx2mr23494915edb.117.1608009077618; Mon, 14 Dec 2020 21:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608009077; cv=none; d=google.com; s=arc-20160816; b=MTXfa2H6Uf3av4sUMz+85sD/xk+b+/cyYj1ZEUSRYLZJJd1lrPpKbQq64r+xj9bDWJ y7R9NrkyhYjYxPg9VJgdDemkEtZoYnSYlkc+Z/lXxjEBZv7fWgjF6uJpiyyEzPXvxJTj zPmYf8zp7XznW3qF74R6YLzoecaIKZy+SoiPYVvMfuYaYJFlSdgFU+HlPJIXPemOiZbm pRYyT2ORVuOODdGiu24Ao+I0z+ZMpzHVteO4E7S/oEV1CKnGtqisVAlTDOB6wyibgaSn WnQBRPJFfrEefgRZvrgeL87fOGZg7kidkNJh3wC9qbWtZUTXjghVWxfr/z5v/akKGKhi aQGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=q+adSiIr7QCasq6x+rppMcZFWaacCMZ4sJEWn/yTYLk=; b=Mp6Kv2XBR8dtcVbES4GOUJ1QhGNkejgGRp+dlk/9ozXUAM5GDjZzDGUdE+6/gzxR5T o4kri0B7REpJmdnCzCCQap4d4IQNsWT6ADZDLZRzfNzcC55w7zrUXvRmfwsY8vyuiXRr Vi9f2xR+4kCrxoyvNy8iHC6IyYEhYAMo0zUfBCC5BDp0/QbNtKGiMcLQdynyOkUAJxwm XlyKq0aAzzw4u+j8w54+h36oeu6ogpmtRqG7NaRbQsM/73V3LsFAJ0dBJljUKoMvjbHQ zBDMh1kOmtTbbL7aMlxmv2aC5gv2RcQqEoOWatsXtD4K/wRUkaYQf2feMxPtU6pfD6vN 9COA== 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 bt28si291912edb.269.2020.12.14.21.10.54; Mon, 14 Dec 2020 21:11:17 -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 S1725973AbgLOFIN (ORCPT + 99 others); Tue, 15 Dec 2020 00:08:13 -0500 Received: from mail.loongson.cn ([114.242.206.163]:55824 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725960AbgLOFIM (ORCPT ); Tue, 15 Dec 2020 00:08:12 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Ax2cmPRNhf9IUAAA--.1409S2; Tue, 15 Dec 2020 13:07:27 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Wei Li , Xuefeng Li Subject: [PATCH] MIPS: No need to check CPU 0 in cps_cpu_disable() Date: Tue, 15 Dec 2020 13:07:26 +0800 Message-Id: <1608008846-27206-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Ax2cmPRNhf9IUAAA--.1409S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Wr1UXFW3ArW3CF4kGw1xKrg_yoWktFgEkr WfAr1kGr1rAw1avr93Wr4SgFy5J34SgFWY9w1Iq34jy3y7Jr1kZayDJFW5Xrn5WFZavFWS qan8ur4vgF129jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_GrWl 42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUeHUDDUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable"), 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 cps_cpu_disable(), just remove it. Reported-by: liwei (GF) Signed-off-by: Tiezhu Yang --- cps_cpu_disable() is not done in the early similar patch, sorry for that. arch/mips/kernel/smp-cps.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 8b027c7..bcd6a94 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -451,9 +451,6 @@ static int cps_cpu_disable(void) unsigned cpu = smp_processor_id(); struct core_boot_config *core_cfg; - if (!cpu) - return -EBUSY; - if (!cps_pm_support_state(CPS_PM_POWER_GATED)) return -EINVAL; -- 2.1.0