Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1413122pxb; Thu, 4 Mar 2021 10:37:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNzkMW+8WMbmnLlF5W3M4YF70PTswCUorwUI3VmfqzWr2He7YT2/q2/38JB/qGLiR1h9IA X-Received: by 2002:a17:906:85b:: with SMTP id f27mr5954423ejd.414.1614883039611; Thu, 04 Mar 2021 10:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614883039; cv=none; d=google.com; s=arc-20160816; b=hIK7SRNPf7qsvcBqQJ3Q1W9GzsP3GHGu/EdLDu0K+MX11nQ4YJMiI5CHNd/cXDP5B0 dgwCs5DrHfiNlIs6wxT1YEn33BjnoIAeWe/c75MRT0GOJdTDQOxeFCyTSWo0CMeizBQ0 j2eT87623pfT6272tM3iKZAGfPxeDOzd/f4PSgJaTpgjwRUcwZ8gz/Tr1U614UI3hGts 7nvzxPVgtdnQnnploktl3mYSr3KE9WojtfZrMuypT5ZWmBjFlVnpFTrfMg72PotbpBuH /6joqMldLZt3+e9HGYyV662eH+62pljhzHxaq7iXK9YD/hH0aVVN8vLkfTx3sp2Az1cP YCuA== 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:dkim-signature; bh=YnxlDtU5po5D1M53NldIE72sMInCUbrZRLnykBeu2V8=; b=w8XnLdC0inrfHqkTTRB50NlRaO2MMyWUp/8DsEowXR8b+l1LHO7ZJuUOxgZbBHzY3T OFl38jsluPAWGBIMj/xTh9IoKGPBHVQ6fBZ0CHpcS+Ua4/BPrhIBFjRu7u1SmmHZ/z+n Bh35dL1Vpqo2w2E6EQJ0Z93TnqzzRVB15u4ysXg0VSjJtEoaDzAXOqFJBkCXGX7eKggV vXqP4jDpVOyvRuRKgFWfgU9Dtmhl1Fpi1Mg5To/X2BURTx4WN8Ua5gC4gVVeYRqbKdT/ R7deaULP3j/2NWru0jnVAVuzNZbdGe3a3iMSFVZJBvBulbSTQxUM3S+yyJhB6VySJJ64 LQJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ewxi+ORe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg13si18428605ejc.669.2021.03.04.10.36.48; Thu, 04 Mar 2021 10:37:19 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Ewxi+ORe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238653AbhCDQyO (ORCPT + 99 others); Thu, 4 Mar 2021 11:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238654AbhCDQyK (ORCPT ); Thu, 4 Mar 2021 11:54:10 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C44D5C061761 for ; Thu, 4 Mar 2021 08:53:29 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id u16so10402634wrt.1 for ; Thu, 04 Mar 2021 08:53:29 -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=YnxlDtU5po5D1M53NldIE72sMInCUbrZRLnykBeu2V8=; b=Ewxi+OReE6dJAiv1zXYkq05geSl/fq+jZkRgzrMwoyzv7/mX7eQzNkoXLfZA/H4WjA dLxCRUQXjLaUaurQNnE2V1uuSVtL1ssUBtAdfk47+VjVE3TodqBAoyI+HNZr9jaugwih QozPefxrDjjzljWSRoqtM5xVlGU9Pye4vHHgjW0WwQ5jmtTxzIbIessoty315fsV3Pto 3rUuogs9lyEX7c3FT883rgCuhQlAV95l3Ki/0K1GkqZhT2pUmINFxC/lBZLVmiOR6r0I /mSml0hG8PHwm/dAmJQhv/t8QNpecklP1K6I1reeFu194Rh1icR2BB1MMK/v7koexmb3 k6ng== 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=YnxlDtU5po5D1M53NldIE72sMInCUbrZRLnykBeu2V8=; b=J4j5Vj74nRYuuaHfEkppMyg17ZqS8nHrZNne8vluyanurWUv+jVqIeG2QVW+5bTtf4 EWc1+tmwhmDFaZw+t1K2bOC1k4H8rM8P/VYIep29B47V51wTNuxgjASU+Yeh8zGKuuyi 1dwSPIN6elQEGVNlRUvEOq8n9L9CyDBOwpxWRF8gyjD7Qxxz2WjTpS+CRHb9nG5pPCyn i9ug4ek8ROQTTzYxTjxlzgmHZrrxSpN82oB63BSfJKHUE4UldSdO0YKuj3kzehMRFkRi 77YwWpKw6C7NrEuG2YBizTxaPgOtveMJpRJ6gDrLljbAX6rK5b/+13kD9HlIZX2yfcnV wGqQ== X-Gm-Message-State: AOAM530ePWSQ9T33Nl4or+i32fT6AC6W8Cn357LC5/mkjz/yb3c/OprT P6ds+aa7qb2GJeP2jPVE7gG6Ng== X-Received: by 2002:adf:d1c2:: with SMTP id b2mr4922891wrd.424.1614876808222; Thu, 04 Mar 2021 08:53:28 -0800 (PST) Received: from [192.168.0.41] (lns-bzn-59-82-252-144-192.adsl.proxad.net. [82.252.144.192]) by smtp.googlemail.com with ESMTPSA id b15sm36807595wrr.47.2021.03.04.08.53.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Mar 2021 08:53:27 -0800 (PST) Subject: Re: [PATCH] devfreq: Register devfreq as a cooling device To: Lukasz Luba Cc: cwchoi00@gmail.com, kyungmin.park@samsung.com, myungjoo.ham@samsung.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , Qiang Yu , David Airlie , Daniel Vetter , Rob Clark , Sean Paul , Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , "open list:DRM DRIVERS FOR LIMA" , "moderated list:DRM DRIVERS FOR LIMA" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" References: <20210304125034.28404-1-daniel.lezcano@linaro.org> <5f06e0c5-b2d9-5e11-01b6-fdd0dac635a7@arm.com> From: Daniel Lezcano Message-ID: <8d153937-c5fc-1de2-d510-d3f91f7a9724@linaro.org> Date: Thu, 4 Mar 2021 17:53:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <5f06e0c5-b2d9-5e11-01b6-fdd0dac635a7@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lukasz, thanks for commenting this patch, On 04/03/2021 14:47, Lukasz Luba wrote: > Hi Daniel, > > On 3/4/21 12:50 PM, Daniel Lezcano wrote: >> Currently the default behavior is to manually having the devfreq >> backend to register themselves as a devfreq cooling device. >> >> There are no so many and actually it makes more sense to register the >> devfreq device when adding it. >> >> Consequently, every devfreq becomes a cooling device like cpufreq is. >> >> Having a devfreq being registered as a cooling device can not mitigate >> a thermal zone if it is not bound to this one. Thus, the current >> configurations are not impacted by this change. > > There are also different type of devices, which register into devfreq > framework like NoC buses, UFS/eMMC, jpeg and video accelerators, ISP, > etc. > In some platforms there are plenty of those devices and they all would > occupy memory due to private freq_table in devfreq_cooling, function: > devfreq_cooling_gen_tables(). > > IIRC in OdroidXU4 there are ~20 devfreq devs for NoC buses. I'm curious, do you have a pointer to such kernels having all those devfreq ? > It's true that they will not affect thermal zones, but unnecessarily, > they all will show up in the /sys/class/thermal/ as > thermal-devfreq-X > > > IMO the devfreq shouldn't be tight with devfreq cooling thermal. The energy model is tied with a cooling device initialization. So if we want to do power limitation, the energy model must be initialized with the device, thus the cooling device also. That is the reason why I'm ending up with this change. Chanwoo suggestion makes sense and that will allow to move the initialization to devfreq which is more sane but it does not solve the initial problem with the energy model. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog