Received: by 10.223.176.5 with SMTP id f5csp552350wra; Tue, 6 Feb 2018 03:36:37 -0800 (PST) X-Google-Smtp-Source: AH8x2243b94/tvubjbl06JgVj3/Z/ujtScC5KSZ1rRhu6ekCJxOAyVtxCfppVmz44jxAolyI6s5D X-Received: by 10.98.31.131 with SMTP id l3mr2175456pfj.116.1517916997815; Tue, 06 Feb 2018 03:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517916997; cv=none; d=google.com; s=arc-20160816; b=hW9Hd0sbhZbpKubxuCT8YoRqIIM5nUgL6JuDvmVunEI1lS4cSkedohHVcy8CGrT/vv fHarVIeWu6uW/8SU8v+PAb7u96XD2TWkYjGmT7yg7jldK5lkqKrhTNqfQznBl7APZCJZ +6j8tNJO7lPfjISk8tal4EeoMM4doN1yHE3zrdt7Z3p/94jD4Vf1bV4txJ/pRLpphq23 c8n40S7uEmPN6q9WpVkoaLyThtWFZ4v0dBtuSmNDXrRWoglm2KPisBCQcrgfewbN02DM dUiKW8D6ZMzq8emiANeQC92HNb2xmr4ffMcsxy3r2tXGAbyhhA545OvKN8QQLrsFeVk7 6ftg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=cxD0BceBIE3At+ZY3L/y49PvR29eHQndHnhZdROagWk=; b=vfEgkB6LU7+wr8pv/XIsbe8DteuBb4fyDE4fGvbxDHZ7bGU67WCzwQhZ/dwivw6dyX Kt4sp1yJo5qi6rqAyfv4PQlM61slchGpxuEa6qZVyrJMfSrdGqdPaCD5Gioo8TkkE/gH J+hmTjPhNEPiOEaP9pz/8I0v/tLoaZ7cjYTANG7r2y5fcwUsmwFdQSqMVe3Df13UtA1U 73L1Sf/z5uOnGin5xoFOvE4jOeGens3yj+U0p3abNZXZwJrChilZUdqkqcBR9Y3+pgjo pjD9XUwuIAIpOQ/WE+ssWRiQvE8CuIuAamyBdl+ogdmRoBUDARn+B6iDeOL/14DcURDz IlmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SD71aMQ9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si1171822pgt.196.2018.02.06.03.36.22; Tue, 06 Feb 2018 03:36:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SD71aMQ9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbeBFLe6 (ORCPT + 99 others); Tue, 6 Feb 2018 06:34:58 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:54613 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbeBFLew (ORCPT ); Tue, 6 Feb 2018 06:34:52 -0500 Received: by mail-wm0-f47.google.com with SMTP id i186so3095677wmi.4 for ; Tue, 06 Feb 2018 03:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cxD0BceBIE3At+ZY3L/y49PvR29eHQndHnhZdROagWk=; b=SD71aMQ9DrWUu7L+F2j3Q9l9WEB2nlvjCwPmxRYHNBszCoX+aTpH5KL63S9wh7ByLU G9X04iuS5CenF93Sm5WK6z5ehH59eIuVQuPBOcXK9ONSE/PfrPW0oNLWVDukUs7zutyw e07SCO96L0UQdRQbPzyKEXQZ7ooCZW1nU2G5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cxD0BceBIE3At+ZY3L/y49PvR29eHQndHnhZdROagWk=; b=ERZTKmwcfqS3CRedUZIbh7S26HzRInpTsAcESYVgY56ZWe8Ao18fis1eX+2yugdBKA yDxhirsjQX2WVFzTJFj6TBRv8U8Hx/rchTfWQ/XDCe6w1Zj6E9NWZ+uc4b6q9bgoIem4 RHWYoAj24c3rd4sw0By3/ZlhwVBwI3DnLxy6Du+j/ySLbKFiSdU2U88J+yNbhaiQy8SY LgsNCzymgXQc0/YOTMTgjRKb5cljlng7T48eaIP49QLnKTxCsLrkqSV0zPMlMrtrDLcQ akbOJqZgroXLgndk1mn2JX3yul2WTdktGKvEEggaV2pxPuEP5uwzdPISJAQfNmo5nncU TU/Q== X-Gm-Message-State: APf1xPAtKUpg9aDKHUXu+/Gcd5b66BamRGRdQiHBKsD/u8svRad9hRWA yntflosAHZO+sBEfgh1gEikNog== X-Received: by 10.80.176.163 with SMTP id j32mr3402538edd.270.1517916890680; Tue, 06 Feb 2018 03:34:50 -0800 (PST) Received: from [192.168.1.75] (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.googlemail.com with ESMTPSA id q11sm8394041edj.64.2018.02.06.03.34.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 03:34:49 -0800 (PST) Subject: Re: [PATCH 5/8] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver To: Daniel Thompson , edubezval@gmail.com Cc: kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, Zhang Rui , Javi Merino , "open list:THERMAL" References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-6-git-send-email-daniel.lezcano@linaro.org> From: Daniel Lezcano Message-ID: <0b58fe4c-e505-f5b9-74a6-17ada2052cc0@linaro.org> Date: Tue, 6 Feb 2018 12:34:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/2018 14:54, Daniel Thompson wrote: > On 23/01/18 15:34, Daniel Lezcano wrote: >> +/** >> + * cpuidle_cooling_get_max_state - Get the maximum state >> + * @cdev  : the thermal cooling device >> + * @state : a pointer to the state variable to be filled >> + * >> + * The function gives always 100 as the injection ratio is percentile >> + * based for consistency accros different platforms. >> + * >> + * The function can not fail, it returns always zero. >> + */ >> +static int cpuidle_cooling_get_max_state(struct >> thermal_cooling_device *cdev, >> +                     unsigned long *state) >> +{ >> +    /* >> +     * Depending on the configuration or the hardware, the running >> +     * cycle and the idle cycle could be different. We want unify >> +     * that to an 0..100 interval, so the set state interface will >> +     * be the same whatever the platform is. >> +     * >> +     * The state 100% will make the cluster 100% ... idle. A 0% >> +     * injection ratio means no idle injection at all and 50% >> +     * means for 10ms of idle injection, we have 10ms of running >> +     * time. >> +     */ >> +    *state = 100; > > Doesn't this requires DTs to be changed? > > Basically the existing bindings for cpu cooling dictate that > cooling-max-levels == num OPPs - 1 . > > Likewise I think cooling-max-levels *defines* the scale used by the > cooling maps in the DT. Introducing an alternative scale means that the > OPP limits in the cooling-map will be misinterpreted when we bind the > cooling device. The DT binding for the cpuidle cooling device just need to bind to the thermal-zone, it does not care about the cooling-max-levels which is a binding for the cpufreq cooling device. That makes both cooling devices to be able to co-exists with the same DT. However, as you mentioned it in the previous emails, new DT bindings will need to be defined in order to extend the features. That is something I would like to put apart in the discussion in order to be focused in the thermal mitigation aspect of the cooling device. The DT bindings discussions can be long and end up as a non-removable definition, so that is something IMO which should be discussed in a specific series. > Note that we get away with this on Hikey because its mainline cooling > map is, AFAICT, deeply sub-optimal and doesn't set any cooling limits. > If its cooling map has been tuned (as the Exynos ones are) then I > suspect there could be overheating problems when the cpuidle (or combo) > CPU coolers are enabled. Yes, that's a good point but from my POV, if we select here the cpuidle cooling device then we should also change the cooling mapping which is optimized for the cpufreq cooling device, a cooling device we deliberately disabled by choosing the cpuidle cooling device. The DT aspect is complex to solve, that's why I propose this first simple approach to introduce the feature with current DT bindings. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog