Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp193827lql; Fri, 12 Apr 2024 07:44:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsGLcpT6knYTVaJ0QP+kTCT3JN2o3thRThndCQd/ZNsBSdnI1P+dY/IV4SNPAhawypEswqGl45sjD6DijpmwRk4R3IjrEi5HsIduafDw== X-Google-Smtp-Source: AGHT+IEfN9yfxcdMsZpxZmKKMeJnEDwgKk2Oxag2yYUhVNbxvyVPPhUOl+bjZf2M82CScs3mihlU X-Received: by 2002:a17:906:b191:b0:a46:df55:e238 with SMTP id w17-20020a170906b19100b00a46df55e238mr1695802ejy.44.1712933079010; Fri, 12 Apr 2024 07:44:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712933079; cv=pass; d=google.com; s=arc-20160816; b=zOM1cMfNLHVOsbmHPP0W88l/hNDzQgPa6KyERTtprclIG/jsltn84kF/3c/xQeEGLR nYB8nh/sSVC3GOhrtKBRyKVF/XsoT/Tx0kXyYVWk4774ooKBCeolcfZxUL/mrzF9d85k DGQVVrwww9E4JA9ua0DuSRQTQDpU7TBQemw1jqn+civ6O4VgnU4j+hIZzIv54GdO0nGj rL7JJRXl1yejAUeyIJXydeI4ovVJ50LaH3jsVc2cC9IN9w1dbXxf1pkOZH5l4kc5suPX AvGqTS0KWLmMVC3drwk6YcgzlaYygs8x1hoBhJmaaVjJi39aBpYAF28f57+D/EmYwG6+ +sUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=UYN3Qn9o/DpkvqnM7oZ65FLXPg2TXW231U1Z3wFpw/8=; fh=8XQHdFtte3XOHSEIytMgmfctfSZlTmw2q6RqB5HTTCI=; b=arcv2DcJPhSl2IuyotmGVpDnwDLul/cTOPLjNULZvChIu52JCoHmfyGbuT+/5mF7U+ t5XiVu4ODNxeP2nrwCGDz7kYSO00fZ3dc4MLV6zXfxfBLe5DjgxIc5r8Xbyk0dd/LTCc Jwn7UBtcNIrW6Ww5Lrq9hk95TtC+5WYgRaAfld7ovT8w7VKXsfpxbLqLkoG9wR/yxUOx xJYBt4rdS/AmdcuCpogpEYDcDnJF/28EvkbJZtMzo+2CRlYYR7U3A7z79PpedhCMqYbr qf8Wfp6peNYzoIY46UvwO/rEkuwiVYe/zUZbPV/PaNCDYhp78FIBxBBMBcy2iCdu4Hkw 5yfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-142867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id he42-20020a1709073daa00b00a522c10d448si1252561ejc.517.2024.04.12.07.44.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:44:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-142867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7CEA61F21A52 for ; Fri, 12 Apr 2024 14:44:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D4D0143892; Fri, 12 Apr 2024 14:44:30 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 675FA142621; Fri, 12 Apr 2024 14:44:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712933069; cv=none; b=Lj5a13VUvUdN+1Ff8JuPyDAFtGrXXRA37c5YPz2GVxUK9r6CNxP0svekuhv7/yzPUuzGUUFT19us3G/5mD+Y7Z/LERoKwzHnBHeuW0nHv+z6TAO70ACOArPCfiAjqmOcvxyfTSh93c0TYhfMtI1lh/0K5p1IjrnZfIgkD5ujcDI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712933069; c=relaxed/simple; bh=Sc4/QQMpboLSwi8LX/TNfgEscS/XcoKFrynL6Fxk/lc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ICGQFVsl7hOv5z7nObnw1T9hvUHXhBeAj+qw4ZPVAMPk6fBfB9JuHn2hYLtye/n6OUTlCdlvbtV7jS1JVhh74qiFN6NaY94S/OG98aM9a/ucW53v9OU1oNvdFG3CFM18jfLekRc8YENPiJjT4JT/1yjbH51VwlWQx2Bu6axdRQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VGK6V13R3z6J6Kh; Fri, 12 Apr 2024 22:42:42 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 712161408FE; Fri, 12 Apr 2024 22:44:26 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 15:44:25 +0100 From: Jonathan Cameron To: , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon CC: , , Subject: [PATCH v5 14/18] arm64: psci: Ignore DENIED CPUs Date: Fri, 12 Apr 2024 15:37:15 +0100 Message-ID: <20240412143719.11398-15-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240412143719.11398-1-Jonathan.Cameron@huawei.com> References: <20240412143719.11398-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) From: Jean-Philippe Brucker When a CPU is marked as disabled, but online capable in the MADT, PSCI applies some firmware policy to control when it can be brought online. PSCI returns DENIED to a CPU_ON request if this is not currently permitted. The OS can learn the current policy from the _STA enabled bit. Handle the PSCI DENIED return code gracefully instead of printing an error. See https://developer.arm.com/documentation/den0022/f/?lang=en page 58. Signed-off-by: Jean-Philippe Brucker [ morse: Rewrote commit message ] Signed-off-by: James Morse Tested-by: Miguel Luis Tested-by: Vishnu Pajjuri Tested-by: Jianyong Wu Reviewed-by: Jonathan Cameron Signed-off-by: Russell King (Oracle) Signed-off-by: Jonathan Cameron --- v5: No change --- arch/arm64/kernel/psci.c | 2 +- arch/arm64/kernel/smp.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 29a8e444db83..fabd732d0a2d 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -40,7 +40,7 @@ static int cpu_psci_cpu_boot(unsigned int cpu) { phys_addr_t pa_secondary_entry = __pa_symbol(secondary_entry); int err = psci_ops.cpu_on(cpu_logical_map(cpu), pa_secondary_entry); - if (err) + if (err && err != -EPERM) pr_err("failed to boot CPU%d (%d)\n", cpu, err); return err; diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 4ced34f62dab..dc0e0b3ec2d4 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -132,7 +132,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) /* Now bring the CPU into our world */ ret = boot_secondary(cpu, idle); if (ret) { - pr_err("CPU%u: failed to boot: %d\n", cpu, ret); + if (ret != -EPERM) + pr_err("CPU%u: failed to boot: %d\n", cpu, ret); return ret; } -- 2.39.2