Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2791415rda; Wed, 25 Oct 2023 12:22:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPueDMnVnjrvGct0IOb7msM37qcQ9WsNHPQxQPR6CgR7e/Fr9TQgumLahNv+C1Ti4YeR8r X-Received: by 2002:a0d:f381:0:b0:592:5def:5c0d with SMTP id c123-20020a0df381000000b005925def5c0dmr16883819ywf.45.1698261721695; Wed, 25 Oct 2023 12:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698261721; cv=none; d=google.com; s=arc-20160816; b=Me2Gk5Wy3zkDXCuo3Bv55h8YaGTGVHuc6SLFCA40RMRxsgmHLHz+8dcQjctsVS+Ut2 TJml+D/D3B5T623bibnKdv0SQN0F4RH11II7SseHZbp/Btx/3+OgzeDfsCi1CC8WU3Bi HUSThcYqkMc6Nd671HSAlDhL2pTBr4B9FIaVbeN/p7bHRT5Zj4zf8U9bJ0+VvYi9Z4Zr A996cXFyzAtLhLoxor/iUvunxnFoLxDJ1rV3CX5EP0nDqYJaM7MhrdHnmw9HTSgVpJzB XtOgzm3jWDu5gk9G1ML0etC+OBwfix7w40HVGM7/vSp4JohEcTtJ0LGNNE0dZtUf1S7U ZN2g== 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=IZ7Kd6EIhQhjs0wg9sgFvQxP61l+Eno7nni2BlE1810=; fh=8IgpUQ2T6XGOjA/qDosxdUSIIBz0a6nQ23NA8pgv1Tg=; b=klBPBXjaSaY8rDueOctdcWMzlxcj/zQUcvbHR4XTLQIIQSRUpc6aR6R7hcooPn5hw3 FAexUhIw/wenInhCCTNiGVihTTexiMcmYI+Bum3OZNNvDAT1Fhx/MgpoD1qgwCGz/9xt kBH1ubzwllWcYXH/TSXVertSr+jy4LqtvKzPG4J5yigb/5hnWYfi6hftyA7v7KcPtTUz BGe0OYCKcjIG5zeJ+nJznVOLhQ2s8oPAD1XeleEU4v5WhpqaIBTFQbG8jyEsAWRO3+6R gUa9zI2M4QtawWFAmNOJ2s9Nza5RoZtJur4WmG1HDFFV117BPBLIKQrPW+C5lFK/4Dde KViw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id f4-20020a0ddc04000000b005a7f27f8f46si11808849ywe.393.2023.10.25.12.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 12:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 F269D811F93B; Wed, 25 Oct 2023 12:21:59 -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 S232363AbjJYTVv (ORCPT + 99 others); Wed, 25 Oct 2023 15:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjJYTVr (ORCPT ); Wed, 25 Oct 2023 15:21:47 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A46E13A; Wed, 25 Oct 2023 12:21:45 -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 DB2DB2F4; Wed, 25 Oct 2023 12:22:26 -0700 (PDT) Received: from e129166.arm.com (unknown [10.57.81.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1143A3F738; Wed, 25 Oct 2023 12:21:43 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, lukasz.luba@arm.com Subject: [PATCH 3/7] thermal: gov_power_allocator: Check the cooling devices only for trip_max Date: Wed, 25 Oct 2023 20:22:21 +0100 Message-Id: <20231025192225.468228-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231025192225.468228-1-lukasz.luba@arm.com> References: <20231025192225.468228-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 12:22:00 -0700 (PDT) The throttling logic takes care only for the last passive trip point and attached cooling devices to it. Therefore, there is no need to bail out if other trip points have a cooling device which is not a supported by IPA. Check the cooling devices only for the 'trip_max' during the binding. Signed-off-by: Lukasz Luba --- drivers/thermal/gov_power_allocator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 0dfc5b5ab5235..4b9ef04577a9a 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -578,6 +578,7 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update) * check_power_actors() - Check all cooling devices and warn when they are * not power actors * @tz: thermal zone to operate on + * @params: power allocator private data * * Check all cooling devices in the @tz and warn every time they are missing * power actor API. The warning should help to investigate the issue, which @@ -586,12 +587,16 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update) * Return: 0 on success, -EINVAL if any cooling device does not implement * the power actor API. */ -static int check_power_actors(struct thermal_zone_device *tz) +static int check_power_actors(struct thermal_zone_device *tz, + struct power_allocator_params *params) { struct thermal_instance *instance; int ret = 0; list_for_each_entry(instance, &tz->thermal_instances, tz_node) { + if (instance->trip != params->trip_max) + continue; + if (!cdev_is_power_actor(instance->cdev)) { dev_warn(&tz->device, "power_allocator: %s is not a power actor\n", instance->cdev->type); @@ -628,7 +633,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) return -EINVAL; } - ret = check_power_actors(tz); + ret = check_power_actors(tz, params); if (ret) { dev_warn(&tz->device, "power_allocator: binding failed\n"); kfree(params); -- 2.25.1