All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Sumit Gupta <sumitg@nvidia.com>
Cc: treding@nvidia.com, krzysztof.kozlowski@linaro.org,
	dmitry.osipenko@collabora.com, viresh.kumar@linaro.org,
	rafael@kernel.org, jonathanh@nvidia.com, robh+dt@kernel.org,
	lpieralisi@kernel.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
	mmaddireddy@nvidia.com, kw@linux.com, bhelgaas@google.com,
	vidyas@nvidia.com, sanjayc@nvidia.com, ksitaraman@nvidia.com,
	ishah@nvidia.com, bbasu@nvidia.com
Subject: Re: [Patch v3 02/11] memory: tegra: add interconnect support for DRAM scaling in Tegra234
Date: Thu, 23 Mar 2023 11:14:57 +0100	[thread overview]
Message-ID: <ZBwmoZJAEgzc+VEK@orome> (raw)
In-Reply-To: <20230320182441.11904-3-sumitg@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]

On Mon, Mar 20, 2023 at 11:54:32PM +0530, Sumit Gupta wrote:
[...]
> diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c
[...]
> +static int tegra234_mc_icc_set(struct icc_node *src, struct icc_node *dst)
> +{
> +	struct tegra_mc *mc = icc_provider_to_tegra_mc(dst->provider);
> +	struct mrq_bwmgr_int_request bwmgr_req = { 0 };
> +	struct mrq_bwmgr_int_response bwmgr_resp = { 0 };
> +	const struct tegra_mc_client *pclient = src->data;
> +	struct tegra_bpmp_message msg;
> +	struct tegra_bpmp *bpmp;
> +	int ret;
> +
> +	/*
> +	 * Same Src and Dst node will happen during boot from icc_node_add().
> +	 * This can be used to pre-initialize and set bandwidth for all clients
> +	 * before their drivers are loaded. We are skipping this case as for us,
> +	 * the pre-initialization already happened in Bootloader(MB2) and BPMP-FW.
> +	 */
> +	if (src->id == dst->id)
> +		return 0;
> +
> +	bpmp = of_tegra_bpmp_get();
> +	if (IS_ERR(bpmp)) {
> +		ret = PTR_ERR(bpmp);
> +		return ret;
> +	}

Irrespective of Whether we end up doing the BPMP lookup via
tegra_bpmp_get() or of_tegra_bpmp_get(), I think we should resolve at
probe time and cache the result, since this function can get called
multiple times and the lookup is a rather heavy operation.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-03-23 10:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 18:24 [Patch v3 00/11] Tegra234 Memory interconnect support Sumit Gupta
2023-03-20 18:24 ` [Patch v3 01/11] firmware: tegra: add function to get BPMP data Sumit Gupta
2023-03-23 10:08   ` Thierry Reding
2023-03-23 12:59     ` Sumit Gupta
2023-03-20 18:24 ` [Patch v3 02/11] memory: tegra: add interconnect support for DRAM scaling in Tegra234 Sumit Gupta
2023-03-23 10:14   ` Thierry Reding [this message]
2023-03-20 18:24 ` [Patch v3 03/11] memory: tegra: add mc clients for Tegra234 Sumit Gupta
2023-03-20 18:24 ` [Patch v3 04/11] memory: tegra: add software mc clients in Tegra234 Sumit Gupta
2023-03-20 18:24 ` [Patch v3 05/11] dt-bindings: tegra: add icc ids for dummy MC clients Sumit Gupta
2023-03-20 18:24 ` [Patch v3 06/11] arm64: tegra: Add cpu OPP tables and interconnects property Sumit Gupta
2023-03-20 18:24 ` [Patch v3 07/11] cpufreq: tegra194: add OPP support and set bandwidth Sumit Gupta
2023-03-21  7:36   ` kernel test robot
2023-03-21 11:49     ` Sumit Gupta
2023-03-22 17:51       ` Krzysztof Kozlowski
2023-03-23 12:50         ` Sumit Gupta
2023-03-20 18:24 ` [Patch v3 08/11] memory: tegra: make cpu cluster bw request a multiple of mc channels Sumit Gupta
2023-03-20 18:24 ` [Patch v3 09/11] PCI: tegra194: add interconnect support in Tegra234 Sumit Gupta
2023-03-20 18:24 ` [Patch v3 10/11] memory: tegra: handle no BWMGR MRQ support in BPMP Sumit Gupta
2023-03-22 17:50   ` Krzysztof Kozlowski
2023-03-23  9:55     ` Thierry Reding
2023-03-23  9:58       ` Krzysztof Kozlowski
2023-03-23 10:02         ` Thierry Reding
2023-03-23 12:46           ` Sumit Gupta
2023-03-20 18:24 ` [Patch v3 11/11] memory: tegra186-emc: fix interconnect registration race Sumit Gupta
2023-03-22 17:50   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBwmoZJAEgzc+VEK@orome \
    --to=thierry.reding@gmail.com \
    --cc=bbasu@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=ishah@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=ksitaraman@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sanjayc@nvidia.com \
    --cc=sumitg@nvidia.com \
    --cc=treding@nvidia.com \
    --cc=vidyas@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.