Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2597137rwl; Thu, 13 Apr 2023 08:26:34 -0700 (PDT) X-Google-Smtp-Source: AKy350bxpUNo3XtS8NpSjJu+R31AaKaxqF923bAmmFYua1vzCqeVT/8Tdbj1pJju+oJyT2NAT+oW X-Received: by 2002:a17:90b:690:b0:247:1e13:89be with SMTP id m16-20020a17090b069000b002471e1389bemr2299725pjz.27.1681399594455; Thu, 13 Apr 2023 08:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681399594; cv=none; d=google.com; s=arc-20160816; b=O4YnK7gAYfeiTXc3TdH/xEezfugAX/KUSOBIpQnnO1S6SXmIuoR4dn0TFtlw87jt2x nFsyLPQd1br0HS1F5pBWhCa14pLfVPiE39lKH8gB2eXCvtoqJd4PSIsJ6IxNvbP4Q0vM osLewyZ2cPKbpDRB3JSG09lFpSzGKmkbib7ZVRHK4NCGFK+43LPs3lhIpWwOTnfwnd2j dH/XGpGPEn7Em8zifzjbWZvOB+mwtRviMIy9aGReUSZm6dAoAgrJhcqbcLeuV8MKVoUB 4mQLrSMKGpt+JvcDjqWh5nsGYSATYBtCUxKRESgwPDLqkksQKWXQb+LFlHlhu5/ZsrMu tDBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=L/mgNEU13UIq3qvcQDZNmO8P2YsFIqpEiuRsQBnJxLk=; b=fLGL0QlTbA0sEJl1iR7w0iN8lxJ77rf8xHiHVU58lAiciiGpqnmy5K6A97uFD/szaC oKejAjwAgN0jBf9PEjPQktVODiVAzuGE5un0GdAoN8Q0WhWx6+Plqa+s3wF2ikcLSopl q01vZ2uvpGSW8a2XZiW89qOzuot/rzioGK0vQa7SSoqD8/sY0dWoX0W2slEAko0BsUcy qzr/00FjgsKuAHTR1Y2tES3lev5gwOUz398L9je1fa2GmnC9h2e3vq+wB8ajwiPpwzOU xBriAGFfXhbUtLK1IeP4ffM40/I2HDPBTvFkltOmPHAfXVyQBHqgi8PMIWJZmRRlzW3S mmFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a170902a5c400b001a2a31a4f0bsi2165981plq.373.2023.04.13.08.26.20; Thu, 13 Apr 2023 08:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbjDMPZi (ORCPT + 99 others); Thu, 13 Apr 2023 11:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjDMPZh (ORCPT ); Thu, 13 Apr 2023 11:25:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D3EAD2735 for ; Thu, 13 Apr 2023 08:25:34 -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 182A6D75; Thu, 13 Apr 2023 08:26:19 -0700 (PDT) Received: from [10.34.100.129] (pierre123.nice.arm.com [10.34.100.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07A533F73F; Thu, 13 Apr 2023 08:25:32 -0700 (PDT) Message-ID: <78419d88-1114-e58e-aeec-6a991a8fdb37@arm.com> Date: Thu, 13 Apr 2023 17:25:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 3/4] arch_topology: Remove early cacheinfo error message Content-Language: en-US To: Conor Dooley Cc: linux-kernel@vger.kernel.org, Radu Rendec , Alexandre Ghiti , Will Deacon , Conor Dooley , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Palmer Dabbelt , Gavin Shan References: <20230413091436.230134-1-pierre.gondois@arm.com> <20230413091436.230134-4-pierre.gondois@arm.com> <20230413-prudishly-unruly-090f5297fd54@wendy> From: Pierre Gondois In-Reply-To: <20230413-prudishly-unruly-090f5297fd54@wendy> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/13/23 12:02, Conor Dooley wrote: > On Thu, Apr 13, 2023 at 11:14:33AM +0200, Pierre Gondois wrote: >> fetch_cache_info() tries to get the number of cache leaves/levels >> for each CPU in order to pre-allocate memory for cacheinfo struct. >> Allocating this memory later triggers a: >> 'BUG: sleeping function called from invalid context' >> in PREEMPT_RT kernels. >> >> If there is no cache related information available in DT or ACPI, >> fetch_cache_info() fails and an error message is printed: >> 'Early cacheinfo failed, ret = ...' >> >> Not having cache information should be a valid configuration. >> Remove the error message if fetch_cache_info() fails. >> >> Suggested-by: Conor Dooley > > Not that it really matters for suggested-by, and there's no way really > for you to know, but the corporate overlords prefer: > s/conor@kernel.org/conor.dooley@microchip.com/ > >> Link: https://lore.kernel.org/all/20230404-hatred-swimmer-6fecdf33b57a@spud/ >> Signed-off-by: Pierre Gondois >> --- >> drivers/base/arch_topology.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c >> index b1c1dd38ab01..1f071eaede5b 100644 >> --- a/drivers/base/arch_topology.c >> +++ b/drivers/base/arch_topology.c >> @@ -843,10 +843,8 @@ void __init init_cpu_topology(void) >> >> for_each_possible_cpu(cpu) { >> ret = fetch_cache_info(cpu); >> - if (ret) { >> - pr_err("Early cacheinfo failed, ret = %d\n", ret); > > Hmm do you really want to remove the print altogether? This can fail > with -EINVAL and -ENOMEM too, so should we just check for > | if (ret && ret != -ENOENT) > instead, since in the other cases it really did fail? I think [PATCH 2/4] requires the following update in this case: --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -288,8 +288,10 @@ int init_of_cache_level(unsigned int cpu) struct device_node *prev = NULL; unsigned int levels = 0, leaves, level; - if (!of_check_cache_nodes(np)) - goto err_out; + if (!of_check_cache_nodes(np)) { + of_node_put(np); + return -ENOENT; + } leaves = of_count_cache_leaves(np); if (leaves > 0) Is it ok to do this and keep your Reviewed-by ? Thanks for the review, Regards, Pierre