Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5290973rdb; Wed, 13 Dec 2023 04:53:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHb0atvMa9Mfop4K+uSQMHMyDGYJLHOsNY7mKtsw15lvoIYpxHfpO4jVDB2Y1NXyT8A2FXz X-Received: by 2002:a05:6a20:2583:b0:18c:d38:9169 with SMTP id k3-20020a056a20258300b0018c0d389169mr8913004pzd.21.1702472009378; Wed, 13 Dec 2023 04:53:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472009; cv=none; d=google.com; s=arc-20160816; b=xLzoyrNmnCmkLRGCfiXfJ1qsjVOLM7pWIo/npHT1WmBYdHw+T2lPF+k7X71oEiLuvt prZJEqer4eHuhmTyJA/5V80Hric2RjwP+GN74GcIbXCVh+gd0RPnmQ7yeYMpo7neJFQj xuGsZxSAGekXHOGwL8m1w/FG5EFvI1p/HkeyWpxvmaahRWbVgV1MSD13X7pvve8bqfII OHm4EHUCNSX+hoj4Y7pwJ4rycbdwuwZTqfqjgu10x5fd4zr6o4w+qTJIM8F80vtVVp+l 24/fwP0JdgIm/HF8JeTkD2fGB/FfmokscIkl1F5ASYK8rLJH1A41VKIlMLJN4t5XWNPN dTfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=CzUDlXDbVRENX5I3t4jDtWhqIqX9ckshZ8M9DQwNtkI=; fh=YWIBRcP8cdLYR894sEToaan3lN1VSUITe+B678IO0WY=; b=AU9SAFV3oHs1esPWkUPfD6UPOOKAJlG5GDpvN37h5m8KVb5WKa6xAXUJmLwFUhNSfc 3pwwR1CeMlcfPqrVIFLAV+GyD2emRES3WSIVZmXtOHzucbSwgtgYJC9jolcQd7FdIyEj TFaMWDCb59NSUxq5pKvjIIMq2UlKrSzfZvwuXtRr47Nu39JOkaixD/7vyZE0asvlJv0k RAJPJUOE8BjgbSQ8a3Xql4Y+/BMQ3WPRi2JIU67NxCs1bcirG+V4LgybLMTnbn8f8qxn RpvwlWhWQttcMtwWiH49ZZLYlNT9zW9AsDulyLXn4NAr/h1hihW12AsjwlV7WYGqA4h7 68BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ryyhQHuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id m10-20020a056a00080a00b006d0d83a11bcsi593029pfk.102.2023.12.13.04.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:53:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=ryyhQHuR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8C242818D514; Wed, 13 Dec 2023 04:53:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379018AbjLMMvb (ORCPT + 99 others); Wed, 13 Dec 2023 07:51:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379017AbjLMMvF (ORCPT ); Wed, 13 Dec 2023 07:51:05 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45293170A; Wed, 13 Dec 2023 04:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CzUDlXDbVRENX5I3t4jDtWhqIqX9ckshZ8M9DQwNtkI=; b=ryyhQHuRHb7agprV7SzAPCOWs7 +KSXGolWfQxBz68idh9LhxWZ4JzZ71clasxJMQDmclWim/lWLX+Gb1xqGHQ9n3UU4aTI4I9d13qgo hj4BIus5sr1uZgPAKqSg5BR+qboNz0g2L0iDXYBeGJ7lvBRoed+H+5R2YFjK8ueU93g8YItCdFaeb fxbImF1Xl0TwiBldiAdAMRv9Tgek/TNe6QoJrV9pJFFkVccAuQ3oipJY0EaPDNElQ4hd2UdXqoxdp PQJmrKVqAhtuUZLhBMQbgjSydQTFhRQyXfg22Jx79LASfFaMpnGo14mdNGw9zQWMI8ZnrjSj92Dyh 1BXBKHfg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50070 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDOh5-0008Gu-1L; Wed, 13 Dec 2023 12:50:31 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDOh7-00Dvl7-LR; Wed, 13 Dec 2023 12:50:33 +0000 In-Reply-To: References: From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Subject: [PATCH RFC v3 16/21] arm64: psci: Ignore DENIED CPUs MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Wed, 13 Dec 2023 12:50:33 +0000 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:53:24 -0800 (PST) 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 Signed-off-by: Russell King (Oracle) --- Changes since RFC v2 * Add specification reference * Use EPERM rather than EPROBE_DEFER Changes since RFC v3: * Use EPERM everywhere * Drop unnecessary changes to drivers/firmware/psci/psci.c --- 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 defbab84e9e5..6bc9094feb19 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.30.2