Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp408513pxb; Wed, 18 Nov 2020 07:34:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwy5KdaDPWeaU2koeajXz0MqLranw+xqhmmKNIK2erUG/QllD0bSLcKirqJHjUWzeeMto6P X-Received: by 2002:aa7:c2d7:: with SMTP id m23mr26169017edp.230.1605713684108; Wed, 18 Nov 2020 07:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605713684; cv=none; d=google.com; s=arc-20160816; b=ZsZxl+5ni6UdWXUUtjMfnRvN3FEw1OGFcYAlGxhhIU4AMnMpHPBDKxj58Vpv5Yw9qj 5KqWVBMuOkdgEMDnvco2maAB0/yaedFS9621Uj3Qy6jlCdpKXcOCRz5cbHTGvyrYqd7L IiAxTuDMidljswa1785tU3eCPc2IzJ9DoeEJJiBYSQWYke5KClIZA5bZRlCaQqI7u3y5 qPOwzKb3kgEmEjVcI4eFvbrmV4T0chresgtpAReGtr9pOsqaI8n48jfMJerWUBb5Nq+C 4fciYUfM1/CQg/oBXAgd+x9dxdCX4A4EtIrln6j23cDxIsrrcTy1DlYAKo+LECbv4UfL h8bg== 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:date:message-id:from:references:cc:to :subject:dkim-signature; bh=/SDkP0vkKcya+FIJEA+cPnvkReKH8EFRybVcIu9lk9M=; b=dOqNfiSTPf+dtwHdaeFRQE8q+gQ1NxBfaxOLTt1bph6tUo3UBWI8OVRJcFxWjZTtYd a3xxQ2HMv5J/7KFt21br5CSqwrjDzMmxnNb4WhGF1VCAYTXf0Gd9OoP/OJeO8YAKhLMg P2qYUn1OI0wDMoOFtO4gFr6wB5fSKir8oRwqDcTXsrFFo/GS+IIaQY6j1ANHbMXDb+yk lBV6X8rWc2ziv7fyTsuX6hMZV9vyVrx38ECXPcYPs5rFaHRYzXosqz9/dqsRE9yuG41X KG/vbPw7YqugOt8VYDGeI04jtUyX+EaVEtYMvap9q/6ZaUrpojvo6HApLc6L96gFrhyR 6D0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D1BytoB6; 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 ox26si3864240ejb.107.2020.11.18.07.34.20; Wed, 18 Nov 2020 07:34:44 -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=D1BytoB6; 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 S1727412AbgKRPaa (ORCPT + 99 others); Wed, 18 Nov 2020 10:30:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbgKRPa1 (ORCPT ); Wed, 18 Nov 2020 10:30:27 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E4FC061A48 for ; Wed, 18 Nov 2020 07:30:26 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id h21so3102278wmb.2 for ; Wed, 18 Nov 2020 07:30:26 -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:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=/SDkP0vkKcya+FIJEA+cPnvkReKH8EFRybVcIu9lk9M=; b=D1BytoB6O03jBcACE4ZhAx92rosgf9wYS2rPHzrBHSfzKSQ0rUMTzY3xFt8TEHE9k0 YIIiPTr94Bc7PUn7zwCH9EE+zMbRYo4nnn12/5TpwUogKdAUXolEut/KGLgjD8p1u9z+ dAYzFovYhNWO+3rZhx7IoAOF+fVoq+FdKg0mn20a1XWJUdbwnQ20TZzHguw90k+BaASf 7P+5q6YagtEKTiL9MoxhoA0aKwhwyc39dlKHA6piMdU8eOhplAdHXaNEcJpNvodiG8QL JTVWIUvFDbkbxf7qqsJ2NSlEFEvArxEdy8Xn4hO7Lb5vG6HcO7PIrZcevw0aveSWR9kJ kERw== 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 :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/SDkP0vkKcya+FIJEA+cPnvkReKH8EFRybVcIu9lk9M=; b=BiW0GrtpFJClpz9m7wwV4EX+ybENc/r9w3SdIDTZNuPySTpSupxlLKCPlG4vWXySFo RN2y7B6/JSrrxDkhSyfJR+5cD8DvT3Rf3L1NyvcLpSwtLQK//agNh/Hv5vsVQu9mkF1n pXTlsVZhKO5sVD3NORLdvI/ttDH7v2YVnSo3MJoSWwvh2an7Y1NTcD6ZGExzTnIv2+9C abOaZhTAbozD820p2l96wvKe2cUd8F7qJ/vpQhNOFVMSAA0KUXI3BkTw0Mwm30ebgTjM xqbpxK3YWToW76VyWV+7kCqOQiQ0RGUanEVtFT0RuecOy2i4iqeQdbz9HyXAvhDvYggG SrOw== X-Gm-Message-State: AOAM530/gUY4orn2GD1pFPOR1TyhAIuz2PCojdOprQWoHndTH7Vaac+c SxEgXmUaFoCY2D3Dxrpo/3PbYg== X-Received: by 2002:a1c:790c:: with SMTP id l12mr560063wme.47.1605713425424; Wed, 18 Nov 2020 07:30:25 -0800 (PST) Received: from MacBook-Pro.local ([212.45.64.13]) by smtp.googlemail.com with ESMTPSA id w11sm4405479wmg.36.2020.11.18.07.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Nov 2020 07:30:24 -0800 (PST) Subject: Re: [PATCH v9 01/17] memory: tegra30: Support interconnect framework To: Dmitry Osipenko , 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> <7e484678-43cc-e612-1017-73ed580f9840@gmail.com> From: Georgi Djakov Message-ID: <83a3f33b-3695-2a40-1c2b-5c38d117c1ad@linaro.org> Date: Wed, 18 Nov 2020 17:30:22 +0200 MIME-Version: 1.0 In-Reply-To: <7e484678-43cc-e612-1017-73ed580f9840@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.11.20 0:02, Dmitry Osipenko wrote: > 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. Ok, thanks for clarifying! Is there a way to read this hardware configuration and convert it to initial bandwidth? That's the idea of the get_bw() callback actually. I am just curious and trying to get a better understanding how this works and if it would be useful for Tegra. Thanks, Georgi