Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp616566lqb; Wed, 17 Apr 2024 06:27:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXf2eWf/bMYT7ZBVLZSDITOfPJOjrg54t1pN9MdV+9iD/CSb9Z5UdffvH1EEDmAPUZWSBK7hWN7lfMGj7ebfTpczM/3HI8OCiSKnmtNXQ== X-Google-Smtp-Source: AGHT+IE6pYwZllrOFnhNCIZjQwCfrXGhXRyrrJl0otbNk3O5m/rFNyuxdvDxI5hkLx9v2r4WWIfH X-Received: by 2002:a17:907:7208:b0:a51:a329:cd76 with SMTP id dr8-20020a170907720800b00a51a329cd76mr13218751ejc.13.1713360419918; Wed, 17 Apr 2024 06:26:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713360419; cv=pass; d=google.com; s=arc-20160816; b=KzS7JZknPu1a4rnyk/m8hKKcSnHPcMEoy5PXn6/XROpyKZMmgjwtiE0oyBQ2iBsMJK W+Uv1tEigXeLenDGvbWdnO6x6WEIYqujOoi3JoK9WLKMh1Bsh11qaAtrB7MEvXF8qJ6+ 0F5mDm5wpCoSU0uFDTCs6drcyh7ce+J4mho0hsJzvfFM8B7X85Rmr0HbRPo7PysX1kul m3qwSlYiAAUFHhkkKXDecrl419cn3JdcXgbzN8u2uw5aAi4YZV2S/MYYQ/1b/gZQqkbb 9rz42W/7aew9mSBT1iQscX3B7wLD2IlRNjoKuMl1OREZbVODaIeriW0ekkrEgcfVxjmp +P9A== 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=wmH6eZgtoFCyes/zVTYi+VaxxdPmNW9hqdNd8ZTZ4XU=; b=DFv54KCCRGrE6QtMTgm+fJ7WiPUWh8hiJREyYFuZNK/hONCkDS6tCFKOS2D+hkKSnm mSWw8TT2naFL5kUrg1u5iEQiTK67z8tPu41lTMlbqrEkplCESCc706DH9b+Z/InM1c9S y7zufS7uTp3DclSErVCIs9K8drxPkqA9sCGkNaW8hoxhGihL08XLOmpAACGzwNqq8wze nyqz/ik1n93CHDmOQToucRLYYofU90V86pkzK+v4J5B/wUzqs6w3P2V51bfLPbdoGJqV UZUqae4MgdlEueit9CU7m7vDPKGxtBFzw8gjfMVOvLYAQwxtT2NHLYDgwniiUFZyUUQx XkWA==; 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-148564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148564-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s15-20020a1709067b8f00b00a526cb00df6si3127468ejo.715.2024.04.17.06.26.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:26:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-148564-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148564-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 A57FF1F21502 for ; Wed, 17 Apr 2024 13:26:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C5B81420BB; Wed, 17 Apr 2024 13:25:24 +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 47EF013F00A; Wed, 17 Apr 2024 13:25:21 +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=1713360324; cv=none; b=YMIgcT07+Viz/r+uWuQtVo31yb+uKcfU1Jp1NpdOPwagy6DRpapKU+opPyZQaAanf+f7nfNazU/GDjkNpqpkaVZ1UamBXxSJM5Jj4DjlgRybQu5VWfoLlSB8Dts+hA73qXXJDab2iHtuTt+fVsp0PB33xxPFwyZcHom1ts6K7RQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360324; 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=OuH9VdvWPEiCXGEXLVJjO4LMDUKTICYH1WvlnD5XE5j7MZDYMjL94QfaE+koZLddRa+R2152KXfuFaPp5VclpJB/NKWpQDxdI/av1ze5p2/IFCu3HMuUmn5ZWTjc5KT1igtC6U1s5HwAf192I/HpiMo7j+zymlgDiDDbc0lXh1I= 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.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VKM392G0tz6K8jS; Wed, 17 Apr 2024 21:20:21 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id E9D4D140B38; Wed, 17 Apr 2024 21:25:18 +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; Wed, 17 Apr 2024 14:25:18 +0100 From: Jonathan Cameron To: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v6 12/16] arm64: psci: Ignore DENIED CPUs Date: Wed, 17 Apr 2024 14:19:05 +0100 Message-ID: <20240417131909.7925-13-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240417131909.7925-1-Jonathan.Cameron@huawei.com> References: <20240417131909.7925-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: lhrpeml500001.china.huawei.com (7.191.163.213) 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