Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp973718pxp; Wed, 16 Mar 2022 23:08:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU1ZVlw2VOzpVXA5ZBbNo33zR59ClFREAFTw4JV3ttjfA9gA97KWvZxIiOT3hBb5QZzR5M X-Received: by 2002:a65:5bc3:0:b0:378:4f82:d73d with SMTP id o3-20020a655bc3000000b003784f82d73dmr2470355pgr.191.1647497286592; Wed, 16 Mar 2022 23:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497286; cv=none; d=google.com; s=arc-20160816; b=0O1XIXJWHHhEt6w0q5SGpk4vRRuptef+PSmxME11LJPchiVttornJVLtILHApkxS7m QoSrHUYZN8Hrw18XOiebY7D4Zat9yv3jZr0HmrFj7PRm6T+a6/CFsay2r6tlzWMgRHWO FDWNdBB0cmfuvDqkayI1YXRxBxZQQjDXttlxXW9JNDQTscOf/gFFw9kbm3WD1IOv9j3M uwSCNR/Rcasiuizfb6kMu9UBJ86i6ZKl6IbhbnUMZyY2GcbrrOI8rhSStNmHoFSGMex8 y7nVnHA4ONzIc8NakxyjVq+eqYCyZE76NpzUump+l6uk0YHIn7ZK9O+gsTPxXThAt8+r pS3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=3lPQNM68GKoSiX2xvRoQf56vlzVrikjlwDNJgUi1zak=; b=rZVN+qXRbna44LsnRWpLM+7h4k6UTT/5NrbhyU7MMy3gc/vCZ4wJ0HNwBpHE9A9ZMp 3ai2omGFZalm+b3Ci/1CP95GiCnhOceI7m+yY02tXxIYyN0hxLh75kRa8KfGe1EwrhM9 hL5/xjBl8k7YoBGiLlLOW0gTbipLIdG9qxzDWseg/rWNYwsoOckkc3I3vnPur1qoiir+ eqr9wh7YHpewcoilLhpKK8OcLjUw5/dYPjudCsx73ssotKribbLLlS7DuTx9GMcGXonA deWfxWYJcKykpOkev2w99kHnAXb4wAIkFSvd+JNfzGgjLYpznKESUoR64IKdSymIC7/A m/kg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a9-20020a056a000c8900b004f77fae8711si4918426pfv.117.2022.03.16.23.08.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:08:06 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC5632A03D7; Wed, 16 Mar 2022 22:17:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353569AbiCPXyZ (ORCPT + 99 others); Wed, 16 Mar 2022 19:54:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354208AbiCPXyG (ORCPT ); Wed, 16 Mar 2022 19:54:06 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2253C339; Wed, 16 Mar 2022 16:52:49 -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 D92711515; Wed, 16 Mar 2022 16:52:48 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.19.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EF7763F766; Wed, 16 Mar 2022 16:52:45 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, Pierre.Gondois@arm.com, ionela.voinescu@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, mka@chromium.org, nm@ti.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cristian.marussi@arm.com, sudeep.holla@arm.com, matthias.bgg@gmail.com Subject: [[PATCH 8/8] powercap: DTPM: Check for Energy Model type Date: Wed, 16 Mar 2022 23:52:11 +0000 Message-Id: <20220316235211.29370-9-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220316235211.29370-1-lukasz.luba@arm.com> References: <20220316235211.29370-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The Energy Model power values might be artificial. In such case it's safe to bail out during the registration, since the PowerCap framework supports only micro-Watts. Signed-off-by: Lukasz Luba --- drivers/powercap/dtpm_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index bca2f912d349..f5eced0842b3 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -211,7 +211,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) return 0; pd = em_cpu_get(cpu); - if (!pd) + if (!pd || em_is_artificial(pd)) return -EINVAL; dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); -- 2.17.1