Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp156413lqf; Fri, 26 Apr 2024 02:43:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvl/tlaeN9P5iQE+p4dHWdPUHkA2WbB1I3VYr7z14rxnge8LTnfGR/OUD2FGZ5bPRLzsQSis0RvnIYJNW8mHe7SptIqxqUAX+rB3UtrA== X-Google-Smtp-Source: AGHT+IEJanCqEF4Ir+k1tFirTtXG1cl9qCPeVeI56oSYGNp9P980Wf2uq1YenSAeEFDTqjEuEx6X X-Received: by 2002:a05:6a00:1791:b0:6ea:914e:a108 with SMTP id s17-20020a056a00179100b006ea914ea108mr2868103pfg.12.1714124589583; Fri, 26 Apr 2024 02:43:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714124589; cv=pass; d=google.com; s=arc-20160816; b=l6XPvB0wrkZ6tLlioLrtujEI/81SoIjgf9pe67ilumrlx2boyov3ca5XWiyU4nFhSQ JzOybcNuzv90/aK0wK5brQVq+PgtikvLPTi3HbtVCoWATT/E++Jx3ccvVWCE+iZS64fj Jf7k88Xjyovur3tE51ejg4Ie6nfjUGYimLsRI37H8FpjzERTRRnckCUfM78zVmG4Vqms 0Z2eUOHAMq0GECwpkzEoDhKcyIPfzS3gDQGvVYPJbR3mCtZ/10yF3GyHDklDMovAnww6 eGF9yX184hEnE3G5VXLavCmW1bMXcx9RfBUie6tVdUbN9Uf+amsUgjJrBVfVvSCaGZAb 2ElQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qExq3Nq0hUqrQo4qRdmB4OoXaEaQNPNwgb/ED5v1FgA=; fh=RlEqSGvmOh1toGp/w4PQ1m6sgeH7cNRiFFjKOKufUcU=; b=h6PrrUM2PPtj40Wr0MnCvoK95bk3uc71Xq+0jnozQByQDnpoSjYec9IrxoSpsWIDQr oYT3GU7PNjK/nRg2p6bv5ZpMdDyjIbw+SF8N+6mbLRDeV/7F+0Yr7FsQwY86ibYpCnkY uz0phht1nGSvGcVvKT4sqU43BjMaFlgMHD4H8JbAkJXYO/uB+ShxHoQQ6vlL7v+uz3UP oW8mag1i6d2H4BnjUqFybM8qntPb2qJIpdW9ep5T+/5X6QKsqnPN7BTzVDorIjvzrFM2 Sj+8Hsqh3ChoCAYx1lNO/RbRXZd8yxz9q+wUEg/w9Dk12rib/x5hE+YsslZv1o09Rplt 3wIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NAJFlKQU; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-159799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u27-20020a63b55b000000b005f80567c9b5si12439996pgo.730.2024.04.26.02.43.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NAJFlKQU; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-159799-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 997F7287E51 for ; Fri, 26 Apr 2024 09:36:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2882213F440; Fri, 26 Apr 2024 09:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NAJFlKQU" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 B181013F426 for ; Fri, 26 Apr 2024 09:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124187; cv=none; b=frR7SSajZSLbu2SbJmn04y43PSE7Hxk3f6windzuer8BCMcoJpRluLOT1s8sDkLWK4zHwYqrnb1AdUOUD4CCPIoDFbAZK98kDqZcjvTz4VAOGemn3xrE4s89qcpQst+VfwTFxFlS1O+5o69JFMUgZJBTpqWIRpKv4Wsda1t4egI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124187; c=relaxed/simple; bh=Y3jENvyu7fKPEdBvKAbLTUiG9vM1ldEliX0y6fpkZxM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tNj1wZQ2IzxrpesDDJBX1p8JkHel7DJWkPkEFkOtouzdKZf0DkSZytgaF1gicGFiQ3oeT4oBxbceHcdbgjxbnZ1gS+BAXHNsCrnMa/6iMbINwyMY3h8fPmSFWdyQwD4wNQm3mQNhafWyB8ksvpBQVj+JUtsluj3wFmolQh0dN4I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=NAJFlKQU; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714124184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qExq3Nq0hUqrQo4qRdmB4OoXaEaQNPNwgb/ED5v1FgA=; b=NAJFlKQUOtD8Xyw1KldI5jzjzoZPg4rSl8CObnjHlCwVsIoCXxa0/ew5Gbg5KYmImMU/OX 5A4afiBufnudk7BM787q+EKyayAs7SIr+9PxwW8gk7b8KXBZbK6BMkLGKUE2bwqwP1K6fx /w93e8BoyRtaGATLoprfd+dpzsnjrwE= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-97-TtNwzY3eOj-jol1sHRJUKA-1; Fri, 26 Apr 2024 05:36:22 -0400 X-MC-Unique: TtNwzY3eOj-jol1sHRJUKA-1 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-1e2bbb6049eso18152495ad.0 for ; Fri, 26 Apr 2024 02:36:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714124181; x=1714728981; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qExq3Nq0hUqrQo4qRdmB4OoXaEaQNPNwgb/ED5v1FgA=; b=SS+QixXYbwxe710ChagR59kYVZ+5S+wCNZpOvKJqEhxBviMDUJSR59GgqG6+uNvGJw k5k0HQys6xMn4qQczLtXDpCDSsKCVBtE+0WeVHzp6XwhW1omGvrB+Xem/eq1bqTRIzk9 FKGlh3wbefcCgq/H8fkXMvLHVPyICGwbxv2mfo4w8NSbz0NZSLjo7jdrEJUA/F6Ik970 amMBJ10Df6JtVaLK4l+/wOOK09JWxFLEKeJOBqIi1rvy/DX//c3p8zLppBUown/Kb0F0 ha89CCkUidAdiAmiKUqPKHQS/M2E/uAA2ZeR5hO50DxfelxnErXsCSdTtQ/kVmwdYxRC 9cZg== X-Forwarded-Encrypted: i=1; AJvYcCW0B1i4bTWlp1MeDdGkPtj/3uhQTeoIByYFuWY4VPHr4viWoKocxhdjUFX2ZOwbzCqkFll9SepI2QWTm1J8XNGnU7S/+iFfpZH1XjO7 X-Gm-Message-State: AOJu0YxxhnNhg7TBXFIe26GoZql9T/cL+UBy5yOMrQBJ8S4m3nZG59bJ 4xw+Lg9ztIPrXm3Dd0pmTx3FifC4H/GN32qLI2MAgXeFFKsGDQqMVTbIwq4m7QNJQj8HE/B4S8/ hZUJpjoUfECr11JObiKEG14CMNDDIHcjgnsfoOcBppdVLQtfOXNECPdbkYgbhJw== X-Received: by 2002:a17:902:e743:b0:1e9:13eb:9082 with SMTP id p3-20020a170902e74300b001e913eb9082mr2650418plf.0.1714124181202; Fri, 26 Apr 2024 02:36:21 -0700 (PDT) X-Received: by 2002:a17:902:e743:b0:1e9:13eb:9082 with SMTP id p3-20020a170902e74300b001e913eb9082mr2650377plf.0.1714124180801; Fri, 26 Apr 2024 02:36:20 -0700 (PDT) Received: from [192.168.68.50] ([43.252.112.88]) by smtp.gmail.com with ESMTPSA id u2-20020a170902e5c200b001e556734814sm15079254plf.134.2024.04.26.02.36.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 02:36:20 -0700 (PDT) Message-ID: Date: Fri, 26 Apr 2024 19:36:10 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 12/16] arm64: psci: Ignore DENIED CPUs Content-Language: en-US To: Jonathan Cameron , Thomas Gleixner , Peter Zijlstra , 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, kvmarm@lists.linux.dev, x86@kernel.org, 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 , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-13-Jonathan.Cameron@huawei.com> From: Gavin Shan In-Reply-To: <20240418135412.14730-13-Jonathan.Cameron@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/18/24 23:54, Jonathan Cameron wrote: > 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 > --- > v7: 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; > } > The changes in smp.c are based the assumption that PSCI is the only backend, which isn't true. So we probably need move this error message to specific backend, which could be PSCI, ACPI parking protocol, or smp_spin_table. Thanks, Gavin