Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1961266rda; Tue, 24 Oct 2023 08:18:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXr1Eua1b/U0zUMKnxPYUCG3kdGP7gFMKrbXyEB9CopUirKeEjhwzGniJYcyjv1vI0v6J8 X-Received: by 2002:a17:90a:1917:b0:27d:b4a4:2d87 with SMTP id 23-20020a17090a191700b0027db4a42d87mr10275487pjg.1.1698160721648; Tue, 24 Oct 2023 08:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160721; cv=none; d=google.com; s=arc-20160816; b=xOj+qOJgZoIiDHV2GKHcWPVWpzEJj3wgYzAmx1lzr9Ry7ABvtwnXFGePTwwcMdvxKu qMKlKw5fZMTKFj8VpvUSjaGjOh4oMCNO1gcxTWD00Jy9NJSnqMXpbBEYMv0U2weq5oQS 79ULpvW4nUS7wpf7qTS4ZxeXmRxTj6EVkOLC45W7QwlFUF7au3FxswUqN45P+pczbGNG 9FYAp9qyTSpaIbG57pXd5rcjd0SU5bS3GdohJCLWGTlYpOPhnJtf76D6o6rGRAc2HRQH r0FHnR2qLBZf5KoDc01SNDmNXc0DWGuxvGdE3iRCX4J/fV4X8/+l+HXlSlOcxtIJGbvQ dOgA== 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=p0b2kl5ZQZyPpYGhGNqSy4gUePxhsbbkYmOZebf/OF0=; fh=l8EFpk7Ei3L85Td2A01hBrINexzBkrfns5u14IZj5lo=; b=uwAZNXQ2Eb6RnAakcLQRPuOa7pW/lQ6b8KZiMxQlvceRq8hpBtf049W1AkaZ0RmzxQ om4ch2hr+4x62Fv/AL6pz2092+7uFDhBKkA96YMk5JS/tVjrGz4h8r+lXnizANg6uy0v s0dblR+URYS1gVUfM2EtB14LQZ9l+Wke+LjEG/1z+c0thpOitzmd2Nz/HtXoED/GTtd/ Jrjtj+Sh+k02e5ZrN6inqRF54r+lcpjteetlyQw26fYvOnkQf5Wb8sU/+mUFUn7L6BMf ld+KA3LNfQwGQF+fnq7Fq1ltaIVxwViUkks2UdHCxhw8PrKn00el5umZ908xP/AJ3FRx 9Ewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=WJD1oE1N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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. [23.128.96.36]) by mx.google.com with ESMTPS id s10-20020a17090a948a00b002773cc10d3csi10735762pjo.78.2023.10.24.08.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:18:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=WJD1oE1N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 3D5738041314; Tue, 24 Oct 2023 08:18:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343635AbjJXPSZ (ORCPT + 99 others); Tue, 24 Oct 2023 11:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234800AbjJXPRn (ORCPT ); Tue, 24 Oct 2023 11:17:43 -0400 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 48E1010FE; Tue, 24 Oct 2023 08:17:13 -0700 (PDT) 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=p0b2kl5ZQZyPpYGhGNqSy4gUePxhsbbkYmOZebf/OF0=; b=WJD1oE1NFD/kZPPg77oZXcXLhK 9Pqyn4nFV27zeuKjdtDERgEsslVXNedy+BlubHJtYJFbHxxDfBScGLixdFr9WPUEpX/1+YetbsybU qrvP9b/uw3Rpt0zJTrtBOGlJGHS911VTGvRyycy+lGfdZ8YqUd83gae5alv3v3ZP1wrMNnRyoWl4W doRxS87uGXEkApJhiR29f8myrDPzjl66k3zINybCxnrzhfpQJhhQ6bQXGFDaxNp1cwkjwhiwplyKP 0xrmnxqTeHsjk0yavbkbSgbmlzn9aGV772xFLoi251GT/ELYUbp5Wh46t2GbFuL/YKOd54xQj4njA At2bkVig==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56516 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 1qvJ9P-0004Nu-12; Tue, 24 Oct 2023 16:16:59 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJ9Q-00AqPk-O9; Tue, 24 Oct 2023 16:17:00 +0100 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, 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 , Greg Kroah-Hartman , "Rafael J. Wysocki" , Paul Walmsley , Palmer Dabbelt , Albert Ou Subject: [PATCH 10/39] drivers: base: Print a warning instead of panic() when register_cpu() fails MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 24 Oct 2023 16:17:00 +0100 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 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]); Tue, 24 Oct 2023 08:18:38 -0700 (PDT) From: James Morse loongarch, mips, parisc, riscv and sh all print a warning if register_cpu() returns an error. Architectures that use GENERIC_CPU_DEVICES call panic() instead. Errors in this path indicate something is wrong with the firmware description of the platform, but the kernel is able to keep running. Downgrade this to a warning to make it easier to debug this issue. This will allow architectures that switching over to GENERIC_CPU_DEVICES to drop their warning, but keep the existing behaviour. Signed-off-by: James Morse Reviewed-by: Russell King (Oracle) Signed-off-by: Russell King (Oracle) --- drivers/base/cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 579064fda97b..d31c936f0955 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -535,14 +535,15 @@ int __weak arch_register_cpu(int cpu) static void __init cpu_dev_register_generic(void) { - int i; + int i, ret; if (!IS_ENABLED(CONFIG_GENERIC_CPU_DEVICES)) return; for_each_present_cpu(i) { - if (arch_register_cpu(i)) - panic("Failed to register CPU device"); + ret = arch_register_cpu(i); + if (ret) + pr_warn("register_cpu %d failed (%d)\n", i, ret); } } -- 2.30.2