From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E492CC433E0 for ; Thu, 28 May 2020 08:12:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4A472088E for ; Thu, 28 May 2020 08:12:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EBrP8BM/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BEzQtCvp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4A472088E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JjEeeq0URKllaRhRC1JgOUaj0ddVu2BwL/N2tYDX4h8=; b=EBrP8BM/NNb0o+ Pc7PDvDaVtLWswx539cS10Y1YnuleBZSs/GPstf2/q50T1I1AbsAxmj0TzGvoMAGwSDu7b9jVpRFS YV1PvphTpVQxgUv1bLVH8wWTRaIz/NsmPBkux0i0VqKKTMHephLtnNAr/lSYZpFMzts14QLkup89L U//skYdsIlquSB4UxjemdcZKsmhrNSrmFtPTYEcE+xgPAax7h/1TGCj8K/utcwThq6gSiAv2ee5J+ Y/7gXwyMje/03BZcAS7pfiL4gY3uFFisTq8NxLMQlrw2SjvC8wEy+cNBWmAgnQ27zpbH+jXEZBUrP BpZECX5DuR8GiGU3Tosw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeDe8-00062s-TT; Thu, 28 May 2020 08:12:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeDe5-00062C-Mj for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2020 08:12:11 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1F022088E; Thu, 28 May 2020 08:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590653529; bh=imndFlcgv7RLpEhOci747HlNeOoZ3mqc+1kh6hejVU0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BEzQtCvp7Q1N3+o5PEIdiL0s0MD9yhrDJNLozSFCWwfXke0u9jUGoCqCmMtJakLfJ 4VNOjmybR6zYLbHZeVhBMFUokJh7Qzw1Ooy8BjO9eDQkSqNp/LRqdvdLDobXTmuxj3 TfyFgCQB8DEwAc4KAzXNrtD0iMPKZeZDNwdVyBLE= Date: Thu, 28 May 2020 09:12:04 +0100 From: Will Deacon To: Nobuhiro Iwamatsu Subject: Re: [PATCH/RFC] arm64/kernel: Fix return value when cpu_online() fails in __cpu_up() Message-ID: <20200528081204.GC22156@willie-the-truck> References: <20200527233457.2531118-1-nobuhiro1.iwamatsu@toshiba.co.jp> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200527233457.2531118-1-nobuhiro1.iwamatsu@toshiba.co.jp> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200528_011209_756790_6247CD80 X-CRM114-Status: GOOD ( 18.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , catalin.marinas@arm.com, "Signed-off-by : Gavin Shan" , Yuji Ishikawa , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 28, 2020 at 08:34:57AM +0900, Nobuhiro Iwamatsu wrote: > If boot_secondary() was successful, and cpu_online() was an error in > __cpu_up(), -EIO was returned, but 0 is returned by commit d22b115cbfbb7 > ("arm64/kernel: Simplify __cpu_up() by bailing out early"). > Therefore, bringup_wait_for_ap() causes the primary core to wait for a > long time, which may cause boot failure. > This commit sets -EIO to return code under the same conditions. > > Fixes: d22b115cbfbb7 ("arm64/kernel: Simplify __cpu_up() by bailing out early") > CC: Signed-off-by: Gavin Shan > CC: Catalin Marinas > CC: Mark Rutland > Tested-by: Yuji Ishikawa > Signed-off-by: Nobuhiro Iwamatsu > --- > arch/arm64/kernel/smp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index 061f60fe452f7..ea677680e4277 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -137,6 +137,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) > if (cpu_online(cpu)) > return 0; > > + ret = -EIO; > pr_crit("CPU%u: failed to come online\n", cpu); > secondary_data.task = NULL; > secondary_data.stack = NULL; This appears to restore the old behaviour, so looks good to me. I'd probably just replace the final 'return ret' with 'return -EIO' since it's never going to be anything else. Also -- aren't you in a pretty serious mess if the CPU starts but doesn't come online? I think the patch is fine, but this really shouldn't happen, right? Could you share your dmesg? Either way: Acked-by: Will Deacon Catalin -- do you want to take this (the problematic change was introduced during the last merge window afaict)? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel