summaryrefslogtreecommitdiffstats
path: root/drivers/memory/tegra/mc.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-03-19 14:09:33 +0100
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-04-01 19:58:22 +0200
commitfbd31f5aa60259bfa836dccb35159a7e17a60314 (patch)
treea914b310974c61a59edf8f208513dc11c3bb238d /drivers/memory/tegra/mc.c
parentmemory: tegra: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE (diff)
downloadlinux-fbd31f5aa60259bfa836dccb35159a7e17a60314.tar.xz
linux-fbd31f5aa60259bfa836dccb35159a7e17a60314.zip
memory: tegra20: Add debug statistics
Add debug statistics collection support. The statistics is available via debugfs in '/sys/kernel/debug/mc/stats', it shows percent of memory controller utilization for each memory client. This information is intended to help with debugging of memory performance issues, it already was proven to be useful by helping to improve memory bandwidth management of the display driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210319130933.23261-1-digetx@gmail.com
Diffstat (limited to 'drivers/memory/tegra/mc.c')
-rw-r--r--drivers/memory/tegra/mc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index a21163ccadc4..e58c3e5baea0 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -827,6 +827,15 @@ static int tegra_mc_probe(struct platform_device *pdev)
return err;
}
+ mc->debugfs.root = debugfs_create_dir("mc", NULL);
+
+ if (mc->soc->init) {
+ err = mc->soc->init(mc);
+ if (err < 0)
+ dev_err(&pdev->dev, "failed to initialize SoC driver: %d\n",
+ err);
+ }
+
err = tegra_mc_reset_setup(mc);
if (err < 0)
dev_err(&pdev->dev, "failed to register reset controller: %d\n",