Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1649705pxy; Fri, 23 Apr 2021 13:19:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPDOFpHoKnKzfJtnWddoHqPhEjmcz4Vz8P+U/uRddDz/Ht7bR8zd2fG+rkI7PNZJD8cZ5j X-Received: by 2002:a62:6481:0:b029:249:ecee:a05d with SMTP id y123-20020a6264810000b0290249eceea05dmr5519040pfb.9.1619209177018; Fri, 23 Apr 2021 13:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619209177; cv=none; d=google.com; s=arc-20160816; b=P364XjBn0KTUyfVm5w0xc4yh/Vr0GYQSZU7HKrdirHlPsBk4vVGzuvfGgJF/xfVs/0 tauG+i4WwHCskRwV+hfm3fm5XhAP3HjNI4f0QfK8reQN3Te5ygX+dv7+vuzUjPSwl5p8 x0vuVYTH5EXNIvqk2zeUtFFxIt2zSMO3xTlycszypEq3V7SY2jMz2DQnVSyIK/xXNGGL DK8cXbsYarE8BBdc4yyNjMm8Uj/EHPrVOyWHZjoMVOjDOxuWSycUz/hysxDjdt4HBHww SPTwyZpAgLRrmzXYIS1z/fFCsNBPXPahd3sreAThJ0h+UTCsFZJ3Wl0gHhkp+AWNt0F2 YP9g== 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=RnUtRlrI0oqk70vWw+WBzVY/alQ23CRHibX5gn25xQQ=; b=oG/ujnv3WYiWwfecj/ee/B48slUKA+0g9ks2D4+PIQ8vFrNUbDJ2VGUmuLxwZbfR1b A0+7li6KTVN/GhDcICqCUDWwrgJdCnFY8Mmagvkah+lX3kBIiPYdkENKiPb9t+uQ1L7s 35HZohsV/RxlIAFAyog5nuvQsrzoQ1pDDsKrrM7+Fh62kHY7CYlHIevXyQmyD8mSPxOT zp4pDdZIfeDfn05c9IS3k28WPOFp5OELyHMm6Dgkv/QXnxGYJxSDlek9Yuu24rIlV3lJ RPZiFzCoSSAiJ/38W0YI+SMqARVpFL2+oBsggZtqgMMO9BLFWwjcNEpcPijzw8aNahqJ a8dg== 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 f18si7563640pjh.81.2021.04.23.13.19.23; Fri, 23 Apr 2021 13:19:37 -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 S243882AbhDWURm (ORCPT + 99 others); Fri, 23 Apr 2021 16:17:42 -0400 Received: from foss.arm.com ([217.140.110.172]:38832 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232200AbhDWURl (ORCPT ); Fri, 23 Apr 2021 16:17:41 -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 6A89711D4; Fri, 23 Apr 2021 13:17:03 -0700 (PDT) Received: from [10.57.2.99] (unknown [10.57.2.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1DB0B3F73B; Fri, 23 Apr 2021 13:16:59 -0700 (PDT) Subject: Re: [RFC PATCH 0/4] Support for passing runtime state idle time to TF-A To: Sowjanya Komatineni Cc: sudeep.holla@arm.com, souvik.chakravarty@arm.com, thierry.reding@gmail.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, jonathanh@nvidia.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org References: <1619123448-10138-1-git-send-email-skomatineni@nvidia.com> From: Lukasz Luba Message-ID: <064341f7-dce3-5ad4-e69b-9568115035c1@arm.com> Date: Fri, 23 Apr 2021 21:16:57 +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: <1619123448-10138-1-git-send-email-skomatineni@nvidia.com> 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 Sowjanya, On 4/22/21 9:30 PM, Sowjanya Komatineni wrote: > Tegra194 and Tegra186 platforms use separate MCE firmware for CPUs which is > in charge of deciding on state transition based on target state, state idle > time, and some other Tegra CPU core cluster states information. > > Current PSCI specification don't have function defined for passing runtime > state idle time predicted by governor (based on next events and state target > residency) to ARM trusted firmware. Do you have some numbers from experiments showing that these idle governor prediction values, which are passed from kernel to MCE firmware, are making a good 'guess'? How much precision (1us? 1ms?) in the values do you need there? IIRC (probably Rafael's presentations) predicting in the kernel something like CPU idle time residency is not a trivial thing. Another idea (depending on DT structure and PSCI bits): Could this be solved differently, but just having a knowledge that if the governor requested some C-state, this means governor 'predicted' an idle residency to be greater that min_residency attached to this C-state? Then, when that request shows up in your FW, you know that it must be at least min_residency because of this C-state id. It would depend on number of available states, max_residency, scale that you would choose while assigning values from [0, max_residency] to each state. IIRC there can be many state IDs for idle, so it would depend on number of bits encoding this state, and your needs. Example of linear scale: 4-bits encoding idle state and max predicted residency 10msec, that means 10000us / 16 states = 625us/state. The max_residency might be split differently, using different than linear function, to have some rage more precised. Open question is if these idle states must be all represented in DT, or there is a way of describing a 'set of idle states' automatically. Regards, Lukasz