Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2680396lqz; Wed, 3 Apr 2024 05:48:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYRfSfDdI361QJgUgc2IhQiWuoZL7IVW5qXCVpbFvD8S9NoiBA0gJlEVTsAr0CUElML6zzcqVscUoCujTQbBpdoYYbIgWqOXUsGRPvJA== X-Google-Smtp-Source: AGHT+IHO5Y+o96jQOCE9Eq/1rc9YfWsysmAnGswg81sSFiZsgod02cTX1ltYXWUrINoqxiDC7kEW X-Received: by 2002:a17:907:1115:b0:a46:ed72:6bb4 with SMTP id qu21-20020a170907111500b00a46ed726bb4mr9162039ejb.72.1712148533255; Wed, 03 Apr 2024 05:48:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712148533; cv=pass; d=google.com; s=arc-20160816; b=HUvik/F0H/S9aFbnPBeuXZh/D4hE9k+Pujr+r5ukmfqAr+L92lOLYjHgMrRkipZaUx 9iCtKVlFn2NycXFn7hzc8/7PdfxXJ7/ootCy+YekxaNhdmm86pA7NuAJnsIcrSN+Dznj O+48hU/1DHVUiefevRUMlbCl9DR3WiuIEDEMIuLGnfxbiAn5Rg5KSHhS5Oa7kO+vAO2b //N/S8qnK59Y8oly8duqxKYC2A3w/FKqrVL8lCOVmSQftQgAuSgzJog1tfqcq/xuPF/N eDdrUMQnfi7qnNH/KOtr7gPyAobETTjTMBHXv30qF68MTDL2flWT6AXjmuuNH3GqDzUT QHMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=c9yYFlIc9vaYLVN+or3gAz+ms1MSAedG/l+N9KMlA/Y=; fh=ZXVEI8ztcF390nf2mdlLhkTj5fKLziEzGdQQp+1/XEQ=; b=Vl98Qz/S8t6laF+75EPdqGaibb8iElBoSqEnSzRlYK1ARk10HS3Rrd3SOH6oqDK1ze cMYE5f++pvd5T6TJg1gqECPcKVJFJ/nsQnKUL4FEZJFnLqnhXEy49jS6ElQm6GFfNoLl JnHL1dTGceTVnCLipo9W53iAxotIQOToQUL07ROarPegfzbWO8bkHGxni1BMnSGov5Rj Yr1P16SVeGmoiIL26PWdYUpN1JOjQI9d4yAEQy5xtVQ934ZjRd+bajvXFxNQVWYBkyW+ 5Hx6Pph2FmxhfxViOFZ9eIyvICjymt5MFuvOFT6NI9P185pMHcVYT5P6itQRXzRBXgEz xJ3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-129734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t11-20020a170906064b00b00a4e5a7c996esi3956153ejb.535.2024.04.03.05.48.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 05:48:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-129734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F1E081F22309 for ; Wed, 3 Apr 2024 12:48:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43679146D54; Wed, 3 Apr 2024 12:48:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E0951EEF9; Wed, 3 Apr 2024 12:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712148521; cv=none; b=p2c6uDB0z1hlIDm+Zihzx54KPt1jOAdlCgUvrbdihEJ+cLCwT8w8YYWqKHiY/rAWz/+Ud0BVXEwazPNSVK9CtVTihTGI7dnDzvF9Oj6x1qLINZUvtpFx5EkVYrAMfV+qcreMptyQ2tpYjNSBnJOLH5Y/1TH0oisY99Hlhf7qG9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712148521; c=relaxed/simple; bh=PYlvBMrQ4HW2xqH/K7Y6/nSBj4Fe4xVbdSMQHX2JE0s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RZbO6bTXVc9nYwp1LogjH4zIMcEhNeBBIe7KH0XPPu+qSvCqxS3ormfst8zUL11mLphmss8sa9iQxHc8sfkSJZTOQMUtaBe5YJZ3ml9A6vmtrHi6CSTyLxN5djEEh45ld4BcFIupjfVQAPSnX829001WS2UYb6aymqcogF+QmTY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 405AA1007; Wed, 3 Apr 2024 05:49:10 -0700 (PDT) Received: from [10.57.72.191] (unknown [10.57.72.191]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2B003F64C; Wed, 3 Apr 2024 05:48:37 -0700 (PDT) Message-ID: <1737b288-8550-407e-b501-469011b2a8cd@arm.com> Date: Wed, 3 Apr 2024 13:48:40 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] thermal: gov_power_allocator: Allow binding without trip points Content-Language: en-US To: Nikita Travkin Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Daniel Lezcano , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui References: <20240403-gpa-no-cooling-devs-v2-0-79bdd8439449@trvn.ru> <20240403-gpa-no-cooling-devs-v2-2-79bdd8439449@trvn.ru> From: Lukasz Luba In-Reply-To: <20240403-gpa-no-cooling-devs-v2-2-79bdd8439449@trvn.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/3/24 12:31, Nikita Travkin via B4 Relay wrote: > From: Nikita Travkin > > IPA probe function was recently refactored to perform extra error checks > and make sure the thermal zone has trip points necessary for the IPA > operation. With this change, if a thermal zone is probed such that it > has no trip points that IPA can use, IPA will fail and the TZ won't be > created. This is the case if a platform defines a TZ without cooling > devices and only with "hot"/"critical" trip points, often found on some > Qualcomm devices [1]. > > Documentation across IPA code (notably get_governor_trips() kerneldoc) > suggests that IPA is supposed to handle such TZ even if it won't > actually do anything. > > This commit partially reverts the previous change to allow IPA to bind > to such "empty" thermal zones. > > [1] arch/arm64/boot/dts/qcom/sc7180.dtsi#n4776 > > Fixes: e83747c2f8e3 ("thermal: gov_power_allocator: Set up trip points earlier") > Signed-off-by: Nikita Travkin > --- > drivers/thermal/gov_power_allocator.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c > index ec637071ef1f..e25e48d76aa7 100644 > --- a/drivers/thermal/gov_power_allocator.c > +++ b/drivers/thermal/gov_power_allocator.c > @@ -679,11 +679,6 @@ static int power_allocator_bind(struct thermal_zone_device *tz) > return -ENOMEM; > > get_governor_trips(tz, params); > - if (!params->trip_max) { > - dev_warn(&tz->device, "power_allocator: missing trip_max\n"); > - kfree(params); > - return -EINVAL; > - } > > ret = check_power_actors(tz, params); > if (ret < 0) { > @@ -714,9 +709,10 @@ static int power_allocator_bind(struct thermal_zone_device *tz) > else > params->sustainable_power = tz->tzp->sustainable_power; > > - estimate_pid_constants(tz, tz->tzp->sustainable_power, > - params->trip_switch_on, > - params->trip_max->temperature); > + if (params->trip_max) > + estimate_pid_constants(tz, tz->tzp->sustainable_power, > + params->trip_switch_on, > + params->trip_max->temperature); > > reset_pid_controller(params); > > LGTM Reviewed-by: Lukasz Luba