Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2104909rdb; Mon, 20 Nov 2023 01:58:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFoJNm7OP4xcRsWgzXAiXAWZfMZiEPdcyY12A+JIERq0dCDTGBulpI+YRLIZ62c2KpuuE2L X-Received: by 2002:a05:6a20:1607:b0:15e:9923:3e35 with SMTP id l7-20020a056a20160700b0015e99233e35mr19004834pzj.19.1700474329624; Mon, 20 Nov 2023 01:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700474329; cv=none; d=google.com; s=arc-20160816; b=dodKJPxZNS+1A80uOzd3r55O704ScMNGrYqSX4RQgSBMKXnxDYw8V9yskOcm3/ReRm XczfDJ8OykgDrnYo+hENToYr8mrpOX7WvpqIjxRPX/zOBQfIum/RUCxh/2nUmeVXr9vF qLFGUOynHd2Z9/t7RG5GPHKBjL0x50zyCJhluTcQvrCuCcqWaBN1tZqMwx6xo1D2d40r vWSjvURZNPOo0ZI1vbr5nDgZ7rbxhIY+S3zC8tpblJTZHJfQ0eqYA/twYmkcUSEc7M88 7yGVLUC6/sLCNtacFk2umoJ75yjvDAEOJrjIDUBaF8+FQsS9tP1FPCr1cmQDUj255Eti oAOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RRH8ihRwgqqNWiOQXVgz2lSe5cF5QqM2TrvGcFPpVxQ=; fh=PHHjPEex97qIeC5+UIH0j/AeMThfxu6zwoNT5hubKyU=; b=twy8pfaLAYoXptwWQpUYwzfe3+KC8JSWxxCinAi0FXo2iaUt0ZEPI4VwX679uyqeDC RLcVn8O2y/pd08og6RX+RYVO275egtEEedvjMd+VXQ1JKrl2yqd6VXAG3q6p2sdiOqYm cU14e7mtvgOPY2qGuOP9cdqpgkcJz1Sn9mTtTp5h5aDXgl/hLc6IY7kZT8dtsIirU4Vl kebeX09tR73fW9oECagykr/C24R9/8Uj3SHIZiObv7AZrRLWY8A87P6Rys66scBQWXiz Em11SXRj6512tVZn7qVyK+8yLbbIyi2w/Dz6PcWHKF2sLndo2zjFPicpRVFbpNXGlJB0 l+Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eAF0KRxg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q16-20020a656850000000b005bd39be60b3si7819416pgt.390.2023.11.20.01.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 01:58:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eAF0KRxg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 991AC8087DEC; Mon, 20 Nov 2023 01:58:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232538AbjKTJ6S (ORCPT + 99 others); Mon, 20 Nov 2023 04:58:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbjKTJ6P (ORCPT ); Mon, 20 Nov 2023 04:58:15 -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 BFB6ECD; Mon, 20 Nov 2023 01:58:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date: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=RRH8ihRwgqqNWiOQXVgz2lSe5cF5QqM2TrvGcFPpVxQ=; b=eAF0KRxgbthRFbPQ6izZC3J3oy NoICC18OIT3Qs7cMSCHEyKdPJVEqlqYYz46JeVVogCAoBWUhXiyxhy9SzyCivvREMDfvxXZSrMpqk BHZ3abqeLK7FySm29lIYiV3szbHsZGZ0MEwL9YBdWcQ/tt0m9Epi+ARclf048DAo9sTRBExtXyU2Y OWqc0bZ0sBPg5y7tECdJwrgrcIV0utpcws+XvnYsepZe+SO7zSvE1M0Dc3TnoMMhyx+qLFfvV/gAy zBVN1YBhtJaSqBUjieLhtAr5Xh4FKBvt+x6MQT63nLwsYbtpT2WmNNA7nk4PLOb78D4oGUQs88/cg AGe8pcpA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:43368) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r512Z-0005Gn-2Y; Mon, 20 Nov 2023 09:58:05 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r512Z-00034w-8Z; Mon, 20 Nov 2023 09:58:03 +0000 Date: Mon, 20 Nov 2023 09:58:03 +0000 From: "Russell King (Oracle)" To: Jianyong Wu Cc: "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" , "linux-csky@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-ia64@vger.kernel.org" , "linux-parisc@vger.kernel.org" , Salil Mehta , Jean-Philippe Brucker , Justin He , James Morse , Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi Subject: Re: [PATCH 34/39] arm64: psci: Ignore DENIED CPUs Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 20 Nov 2023 01:58:46 -0800 (PST) On Mon, Nov 20, 2023 at 09:36:05AM +0000, Jianyong Wu wrote: > > > > -----Original Message----- > > From: Russell King > > Sent: 2023年11月20日 17:25 > > To: Jianyong Wu > > Cc: 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; > > linux-csky@vger.kernel.org; linux-doc@vger.kernel.org; > > linux-ia64@vger.kernel.org; linux-parisc@vger.kernel.org; Salil Mehta > > ; Jean-Philippe Brucker ; > > Justin He ; James Morse ; > > Catalin Marinas ; Will Deacon ; > > Mark Rutland ; Lorenzo Pieralisi > > > > Subject: Re: [PATCH 34/39] arm64: psci: Ignore DENIED CPUs > > > > On Thu, Nov 16, 2023 at 07:45:51AM +0000, Jianyong Wu wrote: > > > Hi Russell, > > > > > > One inline comment. > > ... > > > > Changes since RFC v2 > > > > * Add specification reference > > > > * Use EPERM rather than EPROBE_DEFER > > ... > > > > @@ -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 != -EPROBE_DEFER) > > > > > > Should this be EPERM? As the following psci cpu_on op will return it. > > > I think you miss to change this when apply Jean-Philippe's patch. > > > > It looks like James didn't properly update all places. Also, > > > > > > diff --git a/drivers/firmware/psci/psci.c > > > > b/drivers/firmware/psci/psci.c index d9629ff87861..ee82e7880d8c > > > > 100644 > > > > --- a/drivers/firmware/psci/psci.c > > > > +++ b/drivers/firmware/psci/psci.c > > > > @@ -218,6 +218,8 @@ static int __psci_cpu_on(u32 fn, unsigned long > > > > cpuid, unsigned long entry_point) > > > > int err; > > > > > > > > err = invoke_psci_fn(fn, cpuid, entry_point, 0); > > > > + if (err == PSCI_RET_DENIED) > > > > + return -EPERM; > > > > return psci_to_linux_errno(err); > > > > This change is unnecessary - probably comes from when -EPROBE_DEFER was > > being used. psci_to_linux_errno() already does: > > But may print lots of noise like: > > [ 0.008955] smp: Bringing up secondary CPUs ... > [ 0.009661] psci: failed to boot CPU1 (-1) > [ 0.010360] psci: failed to boot CPU2 (-1) > [ 0.011164] psci: failed to boot CPU3 (-1) > [ 0.011946] psci: failed to boot CPU4 (-1) > [ 0.012764] psci: failed to boot CPU5 (-1) > [ 0.013534] psci: failed to boot CPU6 (-1) > [ 0.014349] psci: failed to boot CPU7 (-1) > [ 0.014820] smp: Brought up 1 node, 1 CPU > > Is this expected? Please read my email again, and take note of the _context_ above the places that I've commented. Context matters. What I'm saying is that this change: err = invoke_psci_fn(fn, cpuid, entry_point, 0); + if (err == PSCI_RET_DENIED) + return -EPERM; return psci_to_linux_errno(err); Is unnecessary when psci_to_linux_errno() already does: static __always_inline int psci_to_linux_errno(int errno) { switch (errno) { ... case PSCI_RET_DENIED: return -EPERM; So, a return of PSCI_RET_DENIED from invoke_psci_fn() above will _already_ be translated to -EPERM (which is -1) by psci_to_linux_errno(). There is no need to add that extra if() statement in __psci_cpu_on(). I was _not_ saying that the entire patch was unnecessary. Context matters. That's why we include context in replies. Standard email etiquette (before Microsoft messed it up) is to quote the email that is being replied to, trimming hard irrelevant content, and to place the reply comments immediately below the original content to which the comments relate, to give the reply comments the context necessary for correct interpretation. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!