Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2678183lqz; Wed, 3 Apr 2024 05:44:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXV+7Y1M4iiC+jsYhDeNZBx0xia74psAcbN7DZXomk+ZlyPK7ioVPEXen+0+43ab8xxULCgSSsaGX+B4OXwxbVQ1HO9jwraN39GREWtFA== X-Google-Smtp-Source: AGHT+IHPui6inNms5OGvD/bHeEpkYRRM+yrg/6CTE5GhEK7wtLdYoIPlTGXxcspxkpuql3O10sWO X-Received: by 2002:a17:90a:2f66:b0:2a2:a3ae:1e43 with SMTP id s93-20020a17090a2f6600b002a2a3ae1e43mr946369pjd.13.1712148285960; Wed, 03 Apr 2024 05:44:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712148285; cv=pass; d=google.com; s=arc-20160816; b=T7wss30CsZlogpzN3tQO7l2zcHToGQtxtdQWa1jVVj8Lvh511PPEzn5+ur9E5wdju+ avf7fZvNU5D6cbttAhQhqHGLtxXlTrntU/UjuqVUp4TiLJgSNn4Hlc0/HsPCHkvKtEK8 fgNTWwKSv6zzuzJ9VekHNjoof98qGdYiRb72PdEARsbqCnyth17H6Rz2cjC3Po3+OwXn hNqBY/Q8Ei9rm1EqcOwAbCVmb15pr9f4Cf/F80MyYv1D6C//fMYAHcnZMUXNykbuHv0T rWUKxzqbvFiLlaEhroMFMFyqbqKXrMMwbkSF6vyvTBccGuTOBS+ztNVIHRZ19qy0jWk1 dolQ== 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=EPlJkkLnAe8ntLJRsBUyTo74PKlc/TErSyYGWSfOSh8=; fh=V86y3Wl2owZr9eRWLeIdRD9U8HEdTjoVFJWD04dhIEA=; b=Mq3XTpZT09E67YSItAimSKzib27gOLDw7FUrg+zC5FbStYwl3KgkqTBSNKmfZNhvTO bAdYFrUhWUMp8gxYqZveSBE5SRYhm673i9NTEaNjZtvUYRe+1I5f69Ue+2hd+0EVDKtJ fIGhAKZFtiz3eFfQq4fRC2vqMDe+3PpXQhbE0tGpasqE/CeIE+yheRKuueLCMfxvx18C pOcmobj4rJSMwSVuKqi/FhjB4+utbzim39Ihm7AT4yKx2LYc/bOOCMbf1WniioHHsqqs /M78nePzFrJKXVY7pHHwqUUj4xJ7Ee3aecTgflYNlnbIF/8OpyIvPCGXrJgezArb1N0G ZbVQ==; 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-129729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a7-20020a17090ad80700b0029bce872076si15342388pjv.58.2024.04.03.05.44.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 05:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-129729-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129729-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DEBBF28A944 for ; Wed, 3 Apr 2024 12:44:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55CDD146A78; Wed, 3 Apr 2024 12:44:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D85D158112; Wed, 3 Apr 2024 12:43:59 +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=1712148241; cv=none; b=NW2ECjasLt0dWk18qKKPPKBcQ2EdKACd66aBRMljpUcJhvZyhoWXGgQDdkXoPr6QnzQ0gHkwWp43NHOao8cY3I+WXhOEohDEnHJVrleXSt6HcvFa/60rCEkZcum/lJjtP7EF27eeUk/J09smtXX6oCxocGVtfVuaq31tbGZaz90= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712148241; c=relaxed/simple; bh=iTl4hiDfmuAKuYy1bynC/DvOEHtq0a5faUhxWHTuGPY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TBB9L1lSc61ly4E4LRyHsmcuEq5gvvbFxQf+JUUtLybTibH97i3l18ov7x0PaJasXJd94EQSQpARznA8v3IPQQ6tjatZYK4WdTkCfiFYps0S0IaceMhy88bm3cfTJ8zKeiY8ME+QoS40rrM5GX6O9fY2vxsoUCg6r8yXv7KM/R0= 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 0F8DD1007; Wed, 3 Apr 2024 05:44:30 -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 BC9E23F64C; Wed, 3 Apr 2024 05:43:57 -0700 (PDT) Message-ID: Date: Wed, 3 Apr 2024 13:43:59 +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 1/3] thermal: gov_power_allocator: Allow binding without cooling devices Content-Language: en-US To: Nikita Travkin Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Daniel Lezcano , linux-kernel@vger.kernel.org, Zhang Rui References: <20240403-gpa-no-cooling-devs-v2-0-79bdd8439449@trvn.ru> <20240403-gpa-no-cooling-devs-v2-1-79bdd8439449@trvn.ru> From: Lukasz Luba In-Reply-To: <20240403-gpa-no-cooling-devs-v2-1-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 was recently refactored to split out memory allocation into a > separate funciton. That funciton was made to return -EINVAL if there is > zero power_actors and thus no memory to allocate. This causes IPA to > fail probing when the thermal zone has no attached cooling devices. > > Since cooling devices can attach after the thermal zone is created and > the governer is attached to it, failing probe due to the lack of cooling > devices is incorrect. > > Change the allocate_actors_buffer() to return success when there is no > cooling devices present. > > Fixes: 912e97c67cc3 ("thermal: gov_power_allocator: Move memory allocation out of throttle()") > Signed-off-by: Nikita Travkin > --- > drivers/thermal/gov_power_allocator.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c > index 1b17dc4c219c..ec637071ef1f 100644 > --- a/drivers/thermal/gov_power_allocator.c > +++ b/drivers/thermal/gov_power_allocator.c > @@ -606,7 +606,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params, > > /* There might be no cooling devices yet. */ > if (!num_actors) { > - ret = -EINVAL; > + ret = 0; > goto clean_state; > } > > LGTM Reviewed-by: Lukasz Luba