All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] memory: tegra: Remove interconnect state syncing hack
@ 2021-09-12 18:30 Dmitry Osipenko
  2021-09-20  8:34 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Osipenko @ 2021-09-12 18:30 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Krzysztof Kozlowski
  Cc: linux-kernel, linux-tegra

State syncing works properly now, previously the sync callback was never
invoked. Apparently it was fixed in drivers core, so let's remove the
hack. The state won't be synced until all consumer drivers of devices
that reference memory controller in a device-tree are probed, i.e. keeping
bandwidth at maximum until both display and devfreq drivers are probed.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/memory/tegra/mc.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 3c5aae7abf35..6b710c204799 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -706,15 +706,6 @@ static int tegra_mc_interconnect_setup(struct tegra_mc *mc)
 			goto remove_nodes;
 	}
 
-	/*
-	 * MC driver is registered too early, so early that generic driver
-	 * syncing doesn't work for the MC. But it doesn't really matter
-	 * since syncing works for the EMC drivers, hence we can sync the
-	 * MC driver by ourselves and then EMC will complete syncing of
-	 * the whole ICC state.
-	 */
-	icc_sync_state(mc->dev);
-
 	return 0;
 
 remove_nodes:
@@ -835,6 +826,15 @@ static int __maybe_unused tegra_mc_resume(struct device *dev)
 	return 0;
 }
 
+static void tegra_mc_sync_state(struct device *dev)
+{
+	struct tegra_mc *mc = dev_get_drvdata(dev);
+
+	/* check whether ICC provider is registered */
+	if (mc->provider.dev == dev)
+		icc_sync_state(dev);
+}
+
 static const struct dev_pm_ops tegra_mc_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(tegra_mc_suspend, tegra_mc_resume)
 };
@@ -845,6 +845,7 @@ static struct platform_driver tegra_mc_driver = {
 		.of_match_table = tegra_mc_of_match,
 		.pm = &tegra_mc_pm_ops,
 		.suppress_bind_attrs = true,
+		.sync_state = tegra_mc_sync_state,
 	},
 	.prevent_deferred_probe = true,
 	.probe = tegra_mc_probe,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] memory: tegra: Remove interconnect state syncing hack
  2021-09-12 18:30 [PATCH v1] memory: tegra: Remove interconnect state syncing hack Dmitry Osipenko
@ 2021-09-20  8:34 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2021-09-20  8:34 UTC (permalink / raw)
  To: Dmitry Osipenko, Jonathan Hunter, Thierry Reding
  Cc: Krzysztof Kozlowski, linux-tegra, linux-kernel

On Sun, 12 Sep 2021 21:30:09 +0300, Dmitry Osipenko wrote:
> State syncing works properly now, previously the sync callback was never
> invoked. Apparently it was fixed in drivers core, so let's remove the
> hack. The state won't be synced until all consumer drivers of devices
> that reference memory controller in a device-tree are probed, i.e. keeping
> bandwidth at maximum until both display and devfreq drivers are probed.
> 
> 
> [...]

Applied, thanks!

[1/1] memory: tegra: Remove interconnect state syncing hack
      commit: 77b14c9d05bd72d6a3f11b4982591d6cb0090ffe

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-20  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 18:30 [PATCH v1] memory: tegra: Remove interconnect state syncing hack Dmitry Osipenko
2021-09-20  8:34 ` Krzysztof Kozlowski

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.