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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7E48CCD13CF for ; Mon, 18 Sep 2023 03:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hm/iEKfpN/9jR/HkP1zNKzEtc1Bj13qG3fyqofxWp2w=; b=t1DTEkarN3Rngb GTGJ2/0G4iirJpLDIILP4vXUj4ib3P4NJ28EDMFjD8rLZHjRwwOU+KTV9WT449iWGp9AlflYx1gJ3 JzrueuNshLsrIUeJG6jcmO9bZQPRHZYdgO4r4rG/Mx06QLJxXUjgyF3Qm9a5dw6mVlKUFTwMqdN47 cSo3fzJH0cNFR6ANYR2TAu89ExCGyhncdhiZoggiJpGyYyzAWRH7BjGEqa8N7lBGex/w3BUFi3xzC 6hL3+eQDmJgQAgAglmu61riUbYy/2DF1WoelylDSd6RTYn0Q5j4UEp4aiTBZ58dxF3rjoHq7I98CY YV0Xna9ebbzl4s9prY8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qi51O-00EIe1-2a; Mon, 18 Sep 2023 03:34:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qi51M-00EIcO-0e for linux-arm-kernel@lists.infradead.org; Mon, 18 Sep 2023 03:34:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695008032; 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=gHzH+a1yYhJkfNUv/Dy9j8VaViRqaOEkd87Y+pYRKHg=; b=de7SCyqEm0AjEBTEDKJDehgm0YwkxrQDfblTnYgFz82/p5ryAjMxTZ+1KPEHqQmlo/fl4r mri8PlOY10mmj6/ZSckyVg9M34dSIUc/Z61n5zu4cTO5MdF6ylYwz6xtHNsG7W1xq3c9Yx ljALUwG7mXM7I9Jk0cNREv1TirHUJJI= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-93-floODQNxOpOK1yR-INkgvQ-1; Sun, 17 Sep 2023 23:33:48 -0400 X-MC-Unique: floODQNxOpOK1yR-INkgvQ-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-274ac6d570aso1973484a91.2 for ; Sun, 17 Sep 2023 20:33:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695008027; x=1695612827; 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=gHzH+a1yYhJkfNUv/Dy9j8VaViRqaOEkd87Y+pYRKHg=; b=Zp4W7kCT7rlfEocSzCabBdqX4TKGvl/0KmRrDBC4Ajs7N0Qval1+71QTSAX2eDSDzH ZU/oeHa7yvYx42KCSr0JgmxH/HR+aHjp9gF/nO7Ucy1WSZUigAVVdSPnjU3LAcfhh12W tDD1AxJeme1GKWE/+wh+6AMIvbSFayrhUkvdp45QTpCgZvOhzLu8CefweHHb+Yc2OAEW QjI+o6wcEp64eAWirpU68yxIfgvZslDIu5Vaq6AyJGX1vT8Hmio7/7/JqDIPzljwDt4P hImNZllzz4/VirE0rIt08iLm9XezzhCEHhJmIbgoUfRl6QdRH4C7QobU4CqzjTRV3ZMP 4l6g== X-Gm-Message-State: AOJu0YwnCjBTrwJDzZ8jTwVcm+h1k9zYMyG2MKB7N8QbdNbec4fC6dzh F0+lZDvzeip39GazHMlQ9N9D6BsqgnC8g2wZsz3cdj4CcOGqy1Du+Ac/jntdXwDFL8x4IDz5lbz zrAwM+gQnHAIvx9Ln45jmJCnALdkvwg2amOg= X-Received: by 2002:a17:90b:890:b0:274:7de7:d6fa with SMTP id bj16-20020a17090b089000b002747de7d6famr7131227pjb.9.1695008027065; Sun, 17 Sep 2023 20:33:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdFVHnxmGek3zqSMDKaRzCcHQAQEv2cIpV7L2yNs7LNSqm4GiEBUNxLVrj5jEdjCAv9J4IOA== X-Received: by 2002:a17:90b:890:b0:274:7de7:d6fa with SMTP id bj16-20020a17090b089000b002747de7d6famr7131213pjb.9.1695008026727; Sun, 17 Sep 2023 20:33:46 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id 8-20020a17090a004800b0026b420ae167sm8825822pjb.17.2023.09.17.20.33.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Sep 2023 20:33:45 -0700 (PDT) Message-ID: <2c23ab17-7516-e310-8b79-b8c5fc02984a@redhat.com> Date: Mon, 18 Sep 2023 13:33:37 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [RFC PATCH v2 05/35] drivers: base: Print a warning instead of panic() when register_cpu() fails To: James Morse , 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 References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-6-james.morse@arm.com> From: Gavin Shan In-Reply-To: <20230913163823.7880-6-james.morse@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230917_203400_328280_A759A89C X-CRM114-Status: GOOD ( 22.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/14/23 02:37, James Morse wrote: > 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); > } > } > The same warning message has been printed by arch/loongarch/kernel/topology.c::arch_register_cpu(). In order to avoid the duplication, I think the warning message in arch/loongarch needs to be dropped? Thanks, Gavin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel