Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3639476rdb; Wed, 13 Sep 2023 19:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkd4/HGxjytJEd6GhrMN7bAZoFafy0eFNFt8VRkjXkK9uHHdGzVL5EQsfyNBuGenWSJwI9 X-Received: by 2002:a05:6a00:2c94:b0:68f:cc75:a2d with SMTP id ef20-20020a056a002c9400b0068fcc750a2dmr4748164pfb.0.1694660314753; Wed, 13 Sep 2023 19:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694660314; cv=none; d=google.com; s=arc-20160816; b=iFQucYrhjxoVSAeSz/4v9S0Nr5fZQFi3C0inRUuOJg+nSrUIe3lX+XNV0a3Fu/rWvb eUB27PTdc8Rj9ZBqFlId5y1+PemygslZksSmKMmaL+/VjhRZEi94BWtMM0TkR+GAQ7E8 ZjyegDaArC8v+/MNi7Pqb5sfwnfmhe3vfq/ANjQ8zP7o0tmR4ytn+JXqZZ6kc+JnaiAk t2ZlRNWmJxbTzemFHFuKF5SyAlYO2+n+PMojKR9jIDy3qngrBRGvnqSS31VAEOEDckJv sru2TIoVccZEpfQH9s6Lrq2MCzcnUe8qJNMmn+dDdb4hee0M/eIC2P8u2OB371IT+CLy p/Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BkPaW2dUUg2OUXqQf5AHAQZwRwuBQlCdS9dHLWUFGK0=; fh=2nhVWB0fZ+8YH0lLFpnF/Mo8eq+n1VMLe+b+IpvS0g0=; b=ISr58uvI6r8pUWuAS1RjQrv3ugGDIf9ylvilQH8vX54Zwp7Kv+K2qcufhjigz4qVwY AIcpyzeFxpd750eI++qtNfidZJc6Wc5ayaD2HpJkmoDcJGYy6+JRuzv9Ow029s4syBFU 8UEfJX+I2ArlLKOiY7y5fYkXlVYs7Z3j/Z4700x1gZ3ga769SiijqcMnKcYwmR99TKU5 6jzGH6bGNKCyL3gDeoU8kSv3cOQ40FD9TTt1fGKGYT45HrdMVcahPPc4cwYBIB1j/YsP o1RrdzzUmJDGDtF6EW2UPR1Xgw1qD563ebBwnI/S8KNQzx+rMq5v5AkZ8LKf4JvwN151 vp/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m11-20020a056a00080b00b006901a8f5dadsi647231pfk.289.2023.09.13.19.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 19:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A5F5F81C7AAD; Wed, 13 Sep 2023 09:39:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbjIMQjP (ORCPT + 99 others); Wed, 13 Sep 2023 12:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230368AbjIMQjH (ORCPT ); Wed, 13 Sep 2023 12:39:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4405E1BD0; Wed, 13 Sep 2023 09:39:03 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42F2DC15; Wed, 13 Sep 2023 09:39:40 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 480883F5A1; Wed, 13 Sep 2023 09:39:01 -0700 (PDT) From: James Morse 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 Cc: x86@kernel.org, Salil Mehta , Russell King , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com Subject: [RFC PATCH v2 05/35] drivers: base: Print a warning instead of panic() when register_cpu() fails Date: Wed, 13 Sep 2023 16:37:53 +0000 Message-Id: <20230913163823.7880-6-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913163823.7880-1-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 09:39:14 -0700 (PDT) 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 --- 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.39.2