Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1166129imm; Wed, 6 Jun 2018 11:28:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIdvo4ev7BiL1R0o9ItysiCEK7LBDtftHcgnbxtHokHGxvo4szahRY3NyEsLuyKVhIndqrj X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr4414270plb.119.1528309726893; Wed, 06 Jun 2018 11:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528309726; cv=none; d=google.com; s=arc-20160816; b=ZDHfrj5nfIOFX8evLOd1akdExLi57Vm84ukboNv2dCFQtLtY0lS8iYBfymvz3f4vvx wx3n0ZzidYs0KI+bl9P0VD4OXVEV5VzNR/CN/urYRxVsjuNHivzYDHY8v9iVRQITW1nn ABMxVKnxe6NuGxNRbtLOuWkWkVXICXOftNgGoDlqb9g1BCBhK5GxLXboCqWiz7K/3oeu 2dy2qfGMQb/VJkXrr4n8qLRX/iS9YIJ1dVzBDSgmWVhfJiRt9+IQql8NYTpdVpjQkjBQ UfQdnesUfz3fml64zlynPjvvXeNJElzdWYgqB0qxhdMWbRCG62qfa/pL76h/x58bbBYP Bt1A== 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:arc-authentication-results; bh=QaQ/2sSCYDTpRyO4xJ+lWmaYVP+avupTShQtIQEE15Y=; b=L/gGWpJiFrLdxHy2FJpouqmrn9+3T1TMIH9iQGn8k/zd1I0e3xUwmeEOeRTg9NISkf DHCRvZNdkZ0CTn+uV9Dw11g6rRTDOIv4P0cw5WJue8yFP2xnFVYugyzTTqyn8ZRukp+J 61mUrkbp+l8nl0vqyt30lWoqySJj7G22nn+0fqo90ulHs5KJgeX3nw9PB+EcxOxZ8fC/ RVVktrN5j9cNwxbB1R6xFPhM5ONrRNxl6THiULl2UEgtZnwkNqe2suhvfF6oC2dYS/I/ xsbXiKb3DdOKQ1LvwkA9uKmXwB/6MC2zDNtRhqNlf8L2urtAYybm7loELRorruW7PlUq 44EA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si53343106plh.34.2018.06.06.11.28.32; Wed, 06 Jun 2018 11:28:46 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600AbeFFQrl (ORCPT + 99 others); Wed, 6 Jun 2018 12:47:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35174 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbeFFQrk (ORCPT ); Wed, 6 Jun 2018 12:47:40 -0400 Received: by mail-wm0-f65.google.com with SMTP id j15-v6so13404080wme.0 for ; Wed, 06 Jun 2018 09:47:39 -0700 (PDT) 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=QaQ/2sSCYDTpRyO4xJ+lWmaYVP+avupTShQtIQEE15Y=; b=KOqa/jAVE5WQUzSKh3LhipE63roYm22yKmJ05WpqYQMH96Awck/8cvNCnjo9/WYp4G ucg3+HZ++apEqHkSEy7q7gJhdtHDuGHaTOhWoBK5k4RKWfipxFfaElXAePwkiW9ky+at re9BmtQWZCX2u3bczUpGy0GPLNLdB6bYCib6JadhH85b9ZM+CzqrBgvRjsAwF7aQx7xF 7KDJUuWZAJOFrVMAUN7rQ0xcA+ShWz3jVSyS39rLJGzNYalsuvxqvsMYBy10tkISu7pA MC6YbnB4yU80NF3CxPuE1EOs7Hwnl9ZpkIU+Az5DieQx23gYcHYqSjMegCDG8fTw/ayP sAUA== X-Gm-Message-State: APt69E2eQzbCuJr7ICxojCPXhVEl92AkX6JwiL/BhpJji2rVFAZh8yLl WqOulec4IKbx5rieGEYifyY6Tg== X-Received: by 2002:a1c:8410:: with SMTP id g16-v6mr2332316wmd.26.1528303658741; Wed, 06 Jun 2018 09:47:38 -0700 (PDT) Received: from localhost.localdomain ([151.15.207.242]) by smtp.gmail.com with ESMTPSA id w15-v6sm24702487wro.52.2018.06.06.09.47.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Jun 2018 09:47:37 -0700 (PDT) Date: Wed, 6 Jun 2018 18:47:34 +0200 From: Juri Lelli To: Quentin Perret Cc: peterz@infradead.org, rjw@rjwysocki.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joelaf@google.com, smuckle@google.com, adharmap@quicinc.com, skannan@quicinc.com, pkondeti@codeaurora.org, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org Subject: Re: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework Message-ID: <20180606164734.GC15894@localhost.localdomain> References: <20180521142505.6522-1-quentin.perret@arm.com> <20180521142505.6522-4-quentin.perret@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180521142505.6522-4-quentin.perret@arm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Quentin, On 21/05/18 15:24, Quentin Perret wrote: [...] > +#ifdef CONFIG_ENERGY_MODEL [...] > +struct em_data_callback { > + /** > + * active_power() - Provide power at the next capacity state of a CPU > + * @power : Active power at the capacity state (modified) > + * @freq : Frequency at the capacity state (modified) > + * @cpu : CPU for which we do this operation > + * > + * active_power() must find the lowest capacity state of 'cpu' above > + * 'freq' and update 'power' and 'freq' to the matching active power > + * and frequency. > + * > + * Return 0 on success. > + */ > + int (*active_power) (unsigned long *power, unsigned long *freq, int cpu); > +}; [...] > +#else > +struct em_freq_domain; > +struct em_data_callback; This doesn't compile for CONFIG_ENERGY_MODEL=n: drivers/cpufreq/cpufreq-dt.c:164:9: error: variable 'em_cb' has initializer but incomplete type struct em_data_callback em_cb = { &dev_pm_opp_of_estimate_power }; ^~~~~~~~~~~~~~~~ Guess you need some sort of macro to init the struct (w/o introducing ifdeffery into drivers code)? Best, - Juri