Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2265794pxy; Tue, 3 Aug 2021 01:50:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7iAKfxiLM+yb8qmv97pM5+3tXXMCqFTXW5loOVGi7UG2wuNrPa1OzAoV+TYGNr5yxIcnC X-Received: by 2002:a92:c24d:: with SMTP id k13mr363170ilo.227.1627980638970; Tue, 03 Aug 2021 01:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627980638; cv=none; d=google.com; s=arc-20160816; b=JMtcP6yITGOGNTbqq3en0Z1Wx36I0585pG+GX0Zy2b8BUvaNtY8P57WZUYMxlM3vit 28Q11K0HnrSph5gEuIqMZDB5zXPvoSIwcCbZ5bWFfNLxNQRTp3HlExJfZviyqdR+bYjJ 420RJMJtRrb84wyg/I/lBdsgng9oaHJw6Yu3iGhvk+438r9Md5/Ou85RBKhbjN89YEEu W333/dR9lfhe8aIfIFcBXLEicyFT5oA9xUh/29CwLctBNXNoPpcmAtILcPXwKcGELdE0 JPl+djWYd4DmzwVF6FauzYle9Lp8ijt67O0+VVRU26s9J2GYq4QC71cr0RUvLqYfDXRr +L8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=h8My0gJmNjopyCMm4OePmUPSjDz/V0QNeA+KreHwvCI=; b=L2gofu6/K0W04dP2ujjk3khKEBRiPpErlnFNiziYzLQnm1jqC4qTEzR70cQT+NiNN+ DZcAPD0h93zFSkmO2gSspbKHLb0Q4JgJgGcb2ZF7pcD6xeBO4lruhWQXd8nY08IDfGs2 ISEj+BN/o6eU6A1a9OwhigCYMxGdgt4ZOEhCdgilrK1w/zCtbj8BE30MqnpKUgqhbJyE GbeZnolWb58mkVfbnP4FOTS02QDtfJjSHYGm7aclwUrnCO+cXPmEvDL96RsKxgfm/I2E VSNaJFrbnf1tD0H43o1UVC85c6ZYgaj/J7NDBMp9TF4DVUhkjw2pm46g4frJl2rFy44/ sOeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si1689892ilm.90.2021.08.03.01.50.27; Tue, 03 Aug 2021 01:50:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234813AbhHCItk (ORCPT + 99 others); Tue, 3 Aug 2021 04:49:40 -0400 Received: from foss.arm.com ([217.140.110.172]:44852 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234622AbhHCIti (ORCPT ); Tue, 3 Aug 2021 04:49:38 -0400 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 5AF0611D4; Tue, 3 Aug 2021 01:49:27 -0700 (PDT) Received: from [10.57.9.94] (unknown [10.57.9.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14E523F40C; Tue, 3 Aug 2021 01:49:23 -0700 (PDT) Subject: Re: [PATCH] cpufreq: arm_scmi: Fix error path when allocation failed To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, sudeep.holla@arm.com, cristian.marussi@arm.com, rjw@rjwysocki.net, nicola.mazzucato@arm.com, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org References: <20210802204550.12647-1-lukasz.luba@arm.com> <20210803043445.7sm4mnl4f5f7co7h@vireshk-i7> From: Lukasz Luba Message-ID: <455e76f8-43c5-2976-e10b-a0fffeaee25f@arm.com> Date: Tue, 3 Aug 2021 09:49:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20210803043445.7sm4mnl4f5f7co7h@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, On 8/3/21 5:34 AM, Viresh Kumar wrote: > On 02-08-21, 21:45, Lukasz Luba wrote: >> Print warning and return an error which would stop the initialization >> when cpumask allocation failed. >> >> Fixes: 80a064dbd556 ("scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM") >> Signed-off-by: Lukasz Luba >> --- >> drivers/cpufreq/scmi-cpufreq.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >> index ec9a87ca2dbb..b159123e68fd 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -133,8 +133,10 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) >> return -ENODEV; >> } >> >> - if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) >> - ret = -ENOMEM; >> + if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) { >> + dev_warn(cpu_dev, "failed to allocate cpumask\n"); > > We shouldn't be printing here anything I believe as the allocation > core does it for us. That's why you won't see a print message anywhere > for failed allocations. Thanks for the comment. Let me send the v2.