Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2665356ybl; Mon, 20 Jan 2020 07:10:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzK8IjJdbE/d2cQ7ROG146A/PM7q9wEjneL5BZo2zC5OftMuYvQ7j0uNZ8MMXtWiyP/ziWf X-Received: by 2002:a05:6830:1689:: with SMTP id k9mr16729293otr.311.1579533042420; Mon, 20 Jan 2020 07:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579533042; cv=none; d=google.com; s=arc-20160816; b=tDCXHy+ZDxY1wKU9fqs1G+OQwizLrvmFXlsl1Z/MVEddwv50sg3rDx+ZYqP4wIucat kwp+erEmA+MSHSyJehV8F3KQ1kK02JusvP4YRh45lyUOSBipxpVAr9T8s1Weu/D6NVbT XOFA+GopmQvwmVpxubGU/pZZSrhKuske1dRdQdmtcT0V5D4aB4JIxN/uS8eqzsu/IpDD wMTAzfwkI3qLdtPr0EnAn2hBq3pF4DN19FH+hQxMpK+vod1pQQH5irfPf9g6MEAbW604 /chN1KbnHN+T9S2CvXcGDEXLqK8riCSKd9Mmfe4q9qxODgnL5t5bUGMR+RQfv4SiRZ3A vzpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ByBSacKRJKuzSIYiOQyT8J9CJv5HzmRfCVnRBxTEqEo=; b=yFd6K8p64U3VEfb1HiMO4Ph9PmSrWZpBF+Yc5FUxZuk+95dEqqx/ODqQB42EANadh3 41010vrv2Bmx0/r+C62Bpky6SRTo4fwQ7ERxX0im0vqDLQKeqrSzolIS6xkMlnJj6A4A MNFJmFtxzcz1tuhLoX25/RNMJXKnaLngJkQ4vI/I0znwkz/QkPw47mRKRyqVcGqJOFSE 7r2h3T8nsSbec3PlKSfRvTQ5HPpYN5usB+b9DguiM8anK22d46jNmM8UsueEgr58wq9v CFAU97Rh8WGsoOvmdRgJgzHzJZAaTtTh/NzVrN76tCJLTW1F/fXMipj/JoKoFnh4DMoW cmFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qg1ZLvvi; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si17998184oic.62.2020.01.20.07.10.22; Mon, 20 Jan 2020 07:10:42 -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=@google.com header.s=20161025 header.b=qg1ZLvvi; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbgATPJZ (ORCPT + 99 others); Mon, 20 Jan 2020 10:09:25 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38874 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbgATPJZ (ORCPT ); Mon, 20 Jan 2020 10:09:25 -0500 Received: by mail-wm1-f65.google.com with SMTP id u2so15056364wmc.3 for ; Mon, 20 Jan 2020 07:09:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ByBSacKRJKuzSIYiOQyT8J9CJv5HzmRfCVnRBxTEqEo=; b=qg1ZLvviVZfjbWUxveYlY31YKSPtpCoqGvUCxFFFmuSNhzrZG+8/JTUBew4MqF1QwT ZkjTqLHsvs275UZGLdOmP854e8vkiW0i8IheAE92enwVx5dgNXUWibw7xuJsq5IzFhhk pKzY/RUwbanMSqGLmJ0vUxWmHzbBOZqzoxp9yT0uRtho17C6I5oH1xMf+pTIjzSN3MZY H8HxiblWXheI6D/R+4rBvbQG0cc5g6adqj0TwfF4L2cC1eWieAELuSXvre7Nin13453w MgPO0mLx6I2rhlnxlc70+w5Qw7/m8lq2IEay5qYyHSQ30y8iTLRUAkWggiNl+AA9LLR9 CgVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ByBSacKRJKuzSIYiOQyT8J9CJv5HzmRfCVnRBxTEqEo=; b=caWjR6AYuu6ERmXjqno8WYp+SZvMaXCCIm0WfRGirx4rnTN6p/60zxxPqJng7CZJ4T inPj3F12vc4flMSYN5q9ML9zi271idyIVo/8Nm0gnPov6iN9pt4Pza4eI1weJKNDuhHo +x59+RXtHJX5qYkJ/SCaIAf3RjVXbPSvfVuekHXhHIiBmY84O4nMsIG/S2GXkCsXrvYE V173Wmf1dbwcFQGWMLFG1PvxNjfNp16ttSBPxGqjlEmqzk4YPksQLdCQM+/rM0iFRAMo 0epgvXWXv9cTKbONJQBJlJMQKKG/zaUzrRQbvVjLlxtfWMC5eP+wBs1lUVaBjfFA8a/u xnww== X-Gm-Message-State: APjAAAVJOcDqQmtviEWNG96d4FGZpME0hoIZVpmoUPY2CW0BfestDfZx 4jpEK+wWTnEcix8W00Spt9NzJg== X-Received: by 2002:a05:600c:21da:: with SMTP id x26mr19321181wmj.4.1579532962450; Mon, 20 Jan 2020 07:09:22 -0800 (PST) Received: from google.com ([2a00:79e0:d:110:d6cc:2030:37c1:9964]) by smtp.gmail.com with ESMTPSA id a5sm23285242wmb.37.2020.01.20.07.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 07:09:21 -0800 (PST) Date: Mon, 20 Jan 2020 15:09:18 +0000 From: Quentin Perret To: Lukasz Luba Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-imx@nxp.com, Morten.Rasmussen@arm.com, Dietmar.Eggemann@arm.com, Chris.Redpath@arm.com, ionela.voinescu@arm.com, javi.merino@arm.com, cw00.choi@samsung.com, b.zolnierkie@samsung.com, rjw@rjwysocki.net, sudeep.holla@arm.com, viresh.kumar@linaro.org, nm@ti.com, sboyd@kernel.org, rui.zhang@intel.com, amit.kucheria@verdurent.com, daniel.lezcano@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, kernel@pengutronix.de, khilman@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, robh@kernel.org, matthias.bgg@gmail.com, steven.price@arm.com, tomeu.vizoso@collabora.com, alyssa.rosenzweig@collabora.com, airlied@linux.ie, daniel@ffwll.ch, kernel-team@android.com Subject: Re: [PATCH 1/4] PM / EM: and devices to Energy Model Message-ID: <20200120150918.GA164543@google.com> References: <20200116152032.11301-1-lukasz.luba@arm.com> <20200116152032.11301-2-lukasz.luba@arm.com> <20200117105437.GA211774@google.com> <40587d98-0e8d-cbac-dbf5-d26501d47a8c@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40587d98-0e8d-cbac-dbf5-d26501d47a8c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Lukasz, On Monday 20 Jan 2020 at 14:52:07 (+0000), Lukasz Luba wrote: > On 1/17/20 10:54 AM, Quentin Perret wrote: > > Suggested alternative: have two registration functions like so: > > > > int em_register_dev_pd(struct device *dev, unsigned int nr_states, > > struct em_data_callback *cb); > > int em_register_cpu_pd(cpumask_t *span, unsigned int nr_states, > > struct em_data_callback *cb); > > Interesting, in the internal review Dietmar asked me to remove these two > functions. I had the same idea, which would simplify a bit the > registration and it does not need to check the dev->bus if it is CPU. > > Unfortunately, we would need also two function in drivers/opp/of.c: > dev_pm_opp_of_register_cpu_em(policy->cpus); > and > dev_pm_opp_of_register_dev_em(dev); > > Thus, I have created only one registration function, which you can see > in this patch set. Right, I can see how having a unified API would be appealing, but the OPP dependency is a nono, so we'll need to work around one way or another. FWIW, I don't think having separate APIs for CPUs and other devices is that bad given that we already have entirely different frameworks to drive their respective frequencies. And the _cpu variants are basically just wrappers around the _dev ones, so not too bad either IMO :). Thanks, Quentin