Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4195454pxb; Tue, 17 Nov 2020 14:04:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo5QJeYKA5xWz5fo6ophkK8m430s/vJSu0fvVWoyaAfG++pKL7sJ7IKn65i5142Ka9EDDK X-Received: by 2002:a17:906:6b82:: with SMTP id l2mr20746339ejr.241.1605650662717; Tue, 17 Nov 2020 14:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605650662; cv=none; d=google.com; s=arc-20160816; b=uf5I1dz7KgZx6XegM5sKoA7qZqbSBhiInhr3KhdAb7gT7u5aK5BQE78SKMIDP3PTYV QeTxnd1VGQiIGR2kVqg5Lvb4B7lq7S2qMrBfdcV5hTGut0ra+fJRRDBFF3dNjGmJdK+I oUHUYtkuC4Dtw2NfYgF0v3zzzxeQ8UcPEd4EhgH6F7M79X3QwpV+XWN7dt6NBXSoIIuh tYK2B3AbOFe/oUZ4+41diW1/iK3Pe6CBHBCguMizEncv4/vzewQ8SuEzeLOO8RhkAzkL 0dlT609idara5uMG0+nB3akAAewgEgdgO+t4PxWKAO+JFiMTn+eieJw0Tl4sW2pRJCK0 Ts0Q== 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=W5om3zQzsHiBGMpHdWoQikEGL2r18KBMb1Ag+GnaG08=; b=H1/ejJftMycjqR0fnQWi5kUp7bxro5JcmcRdBbgkoCnJct/6nq3ttnN2MeadlTxTlr jEDK5x4seestF8ElUyFFEy6Y4NaCKvv3TheyVWCEY9VlV2IlTtvNlpmS+dmBkE4vPw+F 7/7Y9D2HWLAPLCcJrXwW1zQasimvYn50jOf5TtXxM6r7ZJPqNEpIG6c2B0XVvc7/0nW3 yMP0SMpGNRdVaPH0rJlhbRZV8BCmxOklf+n5G85tJ/usasisHAXJtAxSKxP0c2AgSjhp c7p9Gth1wjyZTJtMEssKNGUC2Gsu9bZf7KIVQteZMUuy3F7ep4/GKjSVgOTomNjhFP5x zNQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aUPTRert; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc16si15112219edb.391.2020.11.17.14.04.00; Tue, 17 Nov 2020 14:04:22 -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=@gmail.com header.s=20161025 header.b=aUPTRert; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728544AbgKQWCh (ORCPT + 99 others); Tue, 17 Nov 2020 17:02:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726504AbgKQWCh (ORCPT ); Tue, 17 Nov 2020 17:02:37 -0500 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBA0C0613CF; Tue, 17 Nov 2020 14:02:36 -0800 (PST) Received: by mail-lj1-x244.google.com with SMTP id b17so16550ljf.12; Tue, 17 Nov 2020 14:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=W5om3zQzsHiBGMpHdWoQikEGL2r18KBMb1Ag+GnaG08=; b=aUPTRertfb05h4PXQBp+XblhFmhkq3dYxYo19vCMmRFRwFfo3o1IW4o98iLAok03IX SB7/dAIf/DxDZrSAmId3g1EI40aBDac3fFJ5YPVvSW4ZcmMmQ1/fZT7zXo9ji1tnSBH2 2ryoHGWBmcPCOGGdekoRik9gvEfoJIq1jigT730xbZyGcrmpeGU4NrOrXGvOplzotgE/ YujRyvzI7YgCBSKphSJsvHJdJaz64JVUE1DdR45WFz0QWc2ezvGHPVWoY5Lg6HFf46Nl 0V2nRoj5jQVYhYcul1ZHcmKsPqCQgZ5dqIGEIVHgEXRfIfsykIDOct6IpeM1FbHDQTJX oN4g== 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=W5om3zQzsHiBGMpHdWoQikEGL2r18KBMb1Ag+GnaG08=; b=Ue1BuOWJ5esZvC4xTAbhknFSXbd5ZEjvBF0Z0EzmHKQgLAE25nteGP60PitT7U5xtx Ni30aY5XdRyyLCCu/O+8xujmhLSTUsadauTIfMhnlMCIvMHo8frwgV8A8DEMTAZmFJBz tZQglRBPi8FxjI8pW2YUTvpnZAb9/QTcLmm6qqZnIkasyKMcOkxjxJWQSkPMa3zv/T4l 92w7keejWhlc7RZqID5OF412FqEmlrOWT+iHEmHgHnjG5Itkan8NjB+6VOC10FM9nPKe HYqGCYlRUvrSi1PT53jYoQLbtw+5mAqRncx5i/auDPd2zVOMN6cSXlOmvN4h76fHcvCV 3iqg== X-Gm-Message-State: AOAM530Q/iTPEWsZaEltAKuHfYU0u5d7Uyr3uI8BYoD46z3NTII/bZgu LZw8EnL0BcEwmj4QYxQ5kKE= X-Received: by 2002:a05:651c:30d:: with SMTP id a13mr2849268ljp.386.1605650555139; Tue, 17 Nov 2020 14:02:35 -0800 (PST) Received: from [192.168.2.145] (109-252-193-159.dynamic.spd-mgts.ru. [109.252.193.159]) by smtp.googlemail.com with ESMTPSA id v16sm3215544ljj.0.2020.11.17.14.02.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Nov 2020 14:02:34 -0800 (PST) Subject: Re: [PATCH v9 01/17] memory: tegra30: Support interconnect framework To: Georgi Djakov , Thierry Reding , Jonathan Hunter , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen , Viresh Kumar , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20201115212922.4390-1-digetx@gmail.com> <20201115212922.4390-2-digetx@gmail.com> <61e777d9-b730-02c6-cedf-cf0aa1a50fb8@linaro.org> From: Dmitry Osipenko Message-ID: <7e484678-43cc-e612-1017-73ed580f9840@gmail.com> Date: Wed, 18 Nov 2020 01:02:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: <61e777d9-b730-02c6-cedf-cf0aa1a50fb8@linaro.org> 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 17.11.2020 23:24, Georgi Djakov пишет: > Hi Dmitry, > > Thank you working on this! > > On 15.11.20 23:29, Dmitry Osipenko wrote: >> Now Internal and External memory controllers are memory interconnection >> providers. This allows us to use interconnect API for tuning of memory >> configuration. EMC driver now supports OPPs and DVFS. MC driver now >> supports tuning of memory arbitration latency, which needs to be done >> for ISO memory clients, like a Display client for example. >> >> Tested-by: Peter Geis >> Signed-off-by: Dmitry Osipenko >> --- >>   drivers/memory/tegra/Kconfig       |   1 + >>   drivers/memory/tegra/tegra30-emc.c | 349 +++++++++++++++++++++++++++-- >>   drivers/memory/tegra/tegra30.c     | 173 +++++++++++++- >>   3 files changed, 501 insertions(+), 22 deletions(-) >> > [..]> diff --git a/drivers/memory/tegra/tegra30.c > b/drivers/memory/tegra/tegra30.c >> index d0314f29608d..ea849003014b 100644 >> --- a/drivers/memory/tegra/tegra30.c >> +++ b/drivers/memory/tegra/tegra30.c > [..] >> + >> +static int tegra30_mc_icc_set(struct icc_node *src, struct icc_node >> *dst) >> +{ >> +    struct tegra_mc *mc = icc_provider_to_tegra_mc(src->provider); >> +    const struct tegra_mc_client *client = &mc->soc->clients[src->id]; >> +    u64 peak_bandwidth = icc_units_to_bps(src->peak_bw); >> + >> +    /* >> +     * Skip pre-initialization that is done by icc_node_add(), which >> sets >> +     * bandwidth to maximum for all clients before drivers are loaded. >> +     * >> +     * This doesn't make sense for us because we don't have drivers >> for all >> +     * clients and it's okay to keep configuration left from bootloader >> +     * during boot, at least for today. >> +     */ >> +    if (src == dst) >> +        return 0; > > Nit: The "proper" way to express this should be to implement the > .get_bw() callback to return zero as initial average/peak bandwidth. > I'm wondering if this will work here? > > The rest looks good to me! Hello Georgi, Returning zeros doesn't allow us to skip the initialization that is done by provider->set(node, node) in icc_node_add(). It will reconfigure memory latency in accordance to a zero memory bandwidth, which is wrong to do. It actually should be more preferred to preset bandwidth to a maximum before all drivers are synced, but this should be done only once we will wire up all drivers to use ICC framework. For now it's safer to keep the default hardware configuration untouched.