From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF643C0650F for ; Mon, 5 Aug 2019 16:05:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B40822064A for ; Mon, 5 Aug 2019 16:05:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Bg6wAIMK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Wpyzd4Y2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B40822064A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4KmTqafSv/e4JJD16rXK/x0yaQI9wFFvpoLUh2/2r88=; b=Bg6wAIMKqxMIVn SpetT83vMtk6Q/Jj6d3IW0K4vOfLMK0TBMYeNTTthF6S3hyBSWrsc1yV+zselVN0zftYJOjLv7vir NfjLDRmmn5NXwY5rbf92sc3TFLVK8t3YKMVRsDGFnDWyn1jwM8VGLMUrbvhmha/ya9DezKUcUFVnk QPJGOmvafK7jK4CjMEESXMAIKTnzsKtIkQbcwFeovnQsYSR4WlOBL23d3Kpg2wijLVllOdBWmnk0m tLOuD67sGCliyJB/eFgS2iKkldk6jvLKCCYUIh6xKUOl3VE9yLe6+Un62mYGLvxC0obJ/9Puo5Ete GfSQ8MMlsOJGf0fe1ISA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hufUE-0008Ls-9m; Mon, 05 Aug 2019 16:05:26 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hufUB-0008LU-ON for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2019 16:05:25 +0000 Received: by mail-lf1-x141.google.com with SMTP id h28so58391534lfj.5 for ; Mon, 05 Aug 2019 09:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=61p5AzjQF9OjwcCgDHmk+Gn1Hy4tPflyDpQWg2DQeqY=; b=Wpyzd4Y2/nkmPiRjFFM8P8mROdyXEGby1MykkxLW9L1Exfr+0LwcJOAJCMZms0c2Im /0Ir/txcMgrbgOV1l8OtAba+XUIKIq55sZqgoSCknx6AWCJpLu+LwC9fDZiEEiRBaHgL fqdm4ygFQZzcnCi4raOJMsAdKGJ9l+fKlol/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=61p5AzjQF9OjwcCgDHmk+Gn1Hy4tPflyDpQWg2DQeqY=; b=bn9KKR0ZWZnWiwoyebtj5rlsdp5BEJntBRLAPZzgoi2sOLfb1mHbzfQb/qx/yGsDwm +M6iq0WL3OOe16WJHiaVayeyVYQl3coDLR0je9ke8VgNHKqV1xq6G3xP4v5vv+C96UMJ 3qmtoMzcc7xvdVCf7Mnk48MdNIVdkRAfhoKB47J3qsarJbFrrX9jj2XOH1PAzKCC46w8 hegkYtFlbnK86pevvaYhDong6fQeh1irv87QWgW4rz5jdXoYYJiAn0qtmoR8hROBe0At QWkgo1DlPaXNl/EzYDx0RN4wZjoQM+9k91uRSmXjP4DMHcGiNr8lbR4hzdg8rF/9tR1L HtGw== X-Gm-Message-State: APjAAAW/0/BjGeb925lkpm5AddSJRbM9QfxRTKfJZ36zSO/CGwUPLBcA bR/d8YnCHGHvLoIOMY3RrJS4tPTlK5E= X-Google-Smtp-Source: APXvYqwnqU8b04U0tgb9EoCidKwZaE7fX3OqgR972kYVTwsLZajzyz4S95pLAjGceaAq6uIUmD7HHA== X-Received: by 2002:ac2:48bc:: with SMTP id u28mr63087093lfg.126.1565021121348; Mon, 05 Aug 2019 09:05:21 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id q21sm1869550lfo.18.2019.08.05.09.05.20 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 09:05:20 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id c9so58377472lfh.4 for ; Mon, 05 Aug 2019 09:05:20 -0700 (PDT) X-Received: by 2002:a19:cbd3:: with SMTP id b202mr8777985lfg.185.1565021119654; Mon, 05 Aug 2019 09:05:19 -0700 (PDT) MIME-Version: 1.0 References: <752aca6f-4f69-301d-81ef-ff29bc25b614@linaro.org> <20190805153332.10047-1-georgi.djakov@linaro.org> In-Reply-To: <20190805153332.10047-1-georgi.djakov@linaro.org> From: Evan Green Date: Mon, 5 Aug 2019 09:04:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] interconnect: Add pre_aggregate() callback To: Georgi Djakov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190805_090523_821768_FE147DF2 X-CRM114-Status: GOOD ( 17.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pm@vger.kernel.org, Sean Sweeney , LKML , David Dai , Doug Anderson , amit.kucheria@linaro.org, Bjorn Andersson , linux-arm-msm , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 5, 2019 at 8:33 AM Georgi Djakov wrote: > > Introduce an optional callback in interconnect provider drivers. It can be > used for implementing actions, that need to be executed before the actual > aggregation of the bandwidth requests has started. > > The benefit of this for now is that it will significantly simplify the code > in provider drivers. > > Suggested-by: Evan Green > Signed-off-by: Georgi Djakov Thanks Georgi, I like it! We should confirm that it actually does allow David to remove the sum_avg_cached and max_peak_cached shadow arrays. > --- > drivers/interconnect/core.c | 3 +++ > include/linux/interconnect-provider.h | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index 251354bb7fdc..7b971228df38 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -205,6 +205,9 @@ static int aggregate_requests(struct icc_node *node) > node->avg_bw = 0; > node->peak_bw = 0; > > + if (p->pre_aggregate) > + p->pre_aggregate(node); > + > hlist_for_each_entry(r, &node->req_list, req_node) > p->aggregate(node, r->tag, r->avg_bw, r->peak_bw, > &node->avg_bw, &node->peak_bw); > diff --git a/include/linux/interconnect-provider.h b/include/linux/interconnect-provider.h > index 4ee19fd41568..fd42bd19302d 100644 > --- a/include/linux/interconnect-provider.h > +++ b/include/linux/interconnect-provider.h > @@ -36,6 +36,8 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec, > * @nodes: internal list of the interconnect provider nodes > * @set: pointer to device specific set operation function > * @aggregate: pointer to device specific aggregate operation function > + * @pre_aggregate: pointer to device specific function that is called > + * before the aggregation begins (optional) > * @xlate: provider-specific callback for mapping nodes from phandle arguments > * @dev: the device this interconnect provider belongs to > * @users: count of active users > @@ -47,6 +49,7 @@ struct icc_provider { > int (*set)(struct icc_node *src, struct icc_node *dst); > int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw, > u32 peak_bw, u32 *agg_avg, u32 *agg_peak); > + int (*pre_aggregate)(struct icc_node *node); > struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data); > struct device *dev; > int users; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel