All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] NVIDIA Tegra core power domain follow up
@ 2021-06-01 23:10 Dmitry Osipenko
  2021-06-01 23:10 ` [PATCH v1 1/2] soc/tegra: pmc: Don't sync core domain if it's missing in device-tree Dmitry Osipenko
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2021-06-01 23:10 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Ulf Hansson
  Cc: linux-kernel, linux-tegra, linux-pm

Remove the lockdep_set_class(), which Ulf Hansson asked for. And
prevent core domain syncing if domain node is missing in device-tree,
which I accidentally missed to add after squashing the standalone
domain driver into the PMC driver.

Dmitry Osipenko (2):
  soc/tegra: pmc: Don't sync core domain if it's missing in device-tree
  soc/tegra: pmc: Remove usage of lockdep_set_class()

 drivers/soc/tegra/pmc.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

-- 
2.30.2


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

* [PATCH v1 1/2] soc/tegra: pmc: Don't sync core domain if it's missing in device-tree
  2021-06-01 23:10 [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Dmitry Osipenko
@ 2021-06-01 23:10 ` Dmitry Osipenko
  2021-06-01 23:10 ` [PATCH v1 2/2] soc/tegra: pmc: Remove usage of lockdep_set_class() Dmitry Osipenko
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2021-06-01 23:10 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Ulf Hansson
  Cc: linux-kernel, linux-tegra, linux-pm

Older device-trees don't have core domain node. In this case we shouldn't
mark the domain as synced, allowing to begin core voltage scaling.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/soc/tegra/pmc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index d8eee285fd58..d317532130c3 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -431,6 +431,7 @@ struct tegra_pmc {
 	struct notifier_block clk_nb;
 
 	bool core_domain_state_synced;
+	bool core_domain_registered;
 };
 
 static struct tegra_pmc *pmc = &(struct tegra_pmc) {
@@ -1382,6 +1383,8 @@ static int tegra_pmc_core_pd_add(struct tegra_pmc *pmc, struct device_node *np)
 		goto remove_genpd;
 	}
 
+	pmc->core_domain_registered = true;
+
 	return 0;
 
 remove_genpd:
@@ -3798,6 +3801,14 @@ static void tegra_pmc_sync_state(struct device *dev)
 {
 	int err;
 
+	/*
+	 * Older device-trees don't have core PD, and thus, there are
+	 * no dependencies that will block the state syncing. We shouldn't
+	 * mark the domain as synced in this case.
+	 */
+	if (!pmc->core_domain_registered)
+		return;
+
 	pmc->core_domain_state_synced = true;
 
 	/* this is a no-op if core regulator isn't used */
-- 
2.30.2


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

* [PATCH v1 2/2] soc/tegra: pmc: Remove usage of lockdep_set_class()
  2021-06-01 23:10 [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Dmitry Osipenko
  2021-06-01 23:10 ` [PATCH v1 1/2] soc/tegra: pmc: Don't sync core domain if it's missing in device-tree Dmitry Osipenko
@ 2021-06-01 23:10 ` Dmitry Osipenko
  2021-06-02  7:38 ` [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Ulf Hansson
  2021-06-02  9:10 ` Thierry Reding
  3 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2021-06-01 23:10 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Ulf Hansson
  Cc: linux-kernel, linux-tegra, linux-pm

The lockdep_set_class() will become necessary only if we will have a
nested toggling of core / PMC power domains that will happen if we will
add RPM and OPP support to Tegra CCF driver. Ulf Hansson has concerns
about whether this is the best approach. He suggested to remove the
lockdep class annotation until we will agree on how the OPP support of
clocks should be implemented, hence remove it for now.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/soc/tegra/pmc.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index d317532130c3..ea62f84d1c8b 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1344,7 +1344,6 @@ tegra_pmc_core_pd_opp_to_performance_state(struct generic_pm_domain *genpd,
 
 static int tegra_pmc_core_pd_add(struct tegra_pmc *pmc, struct device_node *np)
 {
-	static struct lock_class_key tegra_core_domain_lock_class;
 	struct generic_pm_domain *genpd;
 	const char *rname = "core";
 	int err;
@@ -1368,15 +1367,6 @@ static int tegra_pmc_core_pd_add(struct tegra_pmc *pmc, struct device_node *np)
 		return err;
 	}
 
-	/*
-	 * We have a "PMC pwrgate -> Core" hierarchy of the power domains
-	 * where PMC needs to resume and change performance (voltage) of the
-	 * Core domain from the PMC GENPD on/off callbacks, hence we need
-	 * to annotate the lock in order to remove confusion from the
-	 * lockdep checker when a nested access happens.
-	 */
-	lockdep_set_class(&genpd->mlock, &tegra_core_domain_lock_class);
-
 	err = of_genpd_add_provider_simple(np, genpd);
 	if (err) {
 		dev_err(pmc->dev, "failed to add core genpd: %d\n", err);
-- 
2.30.2


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

* Re: [PATCH v1 0/2] NVIDIA Tegra core power domain follow up
  2021-06-01 23:10 [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Dmitry Osipenko
  2021-06-01 23:10 ` [PATCH v1 1/2] soc/tegra: pmc: Don't sync core domain if it's missing in device-tree Dmitry Osipenko
  2021-06-01 23:10 ` [PATCH v1 2/2] soc/tegra: pmc: Remove usage of lockdep_set_class() Dmitry Osipenko
@ 2021-06-02  7:38 ` Ulf Hansson
  2021-06-02  9:10 ` Thierry Reding
  3 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2021-06-02  7:38 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Thierry Reding, Jonathan Hunter, Linux Kernel Mailing List,
	linux-tegra, Linux PM

On Wed, 2 Jun 2021 at 01:10, Dmitry Osipenko <digetx@gmail.com> wrote:
>
> Remove the lockdep_set_class(), which Ulf Hansson asked for. And
> prevent core domain syncing if domain node is missing in device-tree,
> which I accidentally missed to add after squashing the standalone
> domain driver into the PMC driver.
>
> Dmitry Osipenko (2):
>   soc/tegra: pmc: Don't sync core domain if it's missing in device-tree
>   soc/tegra: pmc: Remove usage of lockdep_set_class()
>
>  drivers/soc/tegra/pmc.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* Re: [PATCH v1 0/2] NVIDIA Tegra core power domain follow up
  2021-06-01 23:10 [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Dmitry Osipenko
                   ` (2 preceding siblings ...)
  2021-06-02  7:38 ` [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Ulf Hansson
@ 2021-06-02  9:10 ` Thierry Reding
  2021-06-02 10:00   ` Ulf Hansson
  3 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2021-06-02  9:10 UTC (permalink / raw)
  To: Dmitry Osipenko, Ulf Hansson
  Cc: Jonathan Hunter, linux-tegra, linux-pm, linux-kernel

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

On Wed, Jun 02, 2021 at 02:10:01AM +0300, Dmitry Osipenko wrote:
> Remove the lockdep_set_class(), which Ulf Hansson asked for. And
> prevent core domain syncing if domain node is missing in device-tree,
> which I accidentally missed to add after squashing the standalone
> domain driver into the PMC driver.
> 
> Dmitry Osipenko (2):
>   soc/tegra: pmc: Don't sync core domain if it's missing in device-tree
>   soc/tegra: pmc: Remove usage of lockdep_set_class()
> 
>  drivers/soc/tegra/pmc.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)

I've squashed these into the corresponding patches of you v6 series and
added Ulf's reviewed-by to them.

Ulf, let me know if I misinterpreted the discussion and your reviewed-by
didn't extend to the original patches.

Thierry

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

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

* Re: [PATCH v1 0/2] NVIDIA Tegra core power domain follow up
  2021-06-02  9:10 ` Thierry Reding
@ 2021-06-02 10:00   ` Ulf Hansson
  0 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2021-06-02 10:00 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Dmitry Osipenko, Jonathan Hunter, linux-tegra, Linux PM,
	Linux Kernel Mailing List

On Wed, 2 Jun 2021 at 11:08, Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Wed, Jun 02, 2021 at 02:10:01AM +0300, Dmitry Osipenko wrote:
> > Remove the lockdep_set_class(), which Ulf Hansson asked for. And
> > prevent core domain syncing if domain node is missing in device-tree,
> > which I accidentally missed to add after squashing the standalone
> > domain driver into the PMC driver.
> >
> > Dmitry Osipenko (2):
> >   soc/tegra: pmc: Don't sync core domain if it's missing in device-tree
> >   soc/tegra: pmc: Remove usage of lockdep_set_class()
> >
> >  drivers/soc/tegra/pmc.c | 21 +++++++++++----------
> >  1 file changed, 11 insertions(+), 10 deletions(-)
>
> I've squashed these into the corresponding patches of you v6 series and
> added Ulf's reviewed-by to them.
>
> Ulf, let me know if I misinterpreted the discussion and your reviewed-by
> didn't extend to the original patches.

Nope, looks good to me! Thanks!

Kind regards
Uffe

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

end of thread, other threads:[~2021-06-02 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 23:10 [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Dmitry Osipenko
2021-06-01 23:10 ` [PATCH v1 1/2] soc/tegra: pmc: Don't sync core domain if it's missing in device-tree Dmitry Osipenko
2021-06-01 23:10 ` [PATCH v1 2/2] soc/tegra: pmc: Remove usage of lockdep_set_class() Dmitry Osipenko
2021-06-02  7:38 ` [PATCH v1 0/2] NVIDIA Tegra core power domain follow up Ulf Hansson
2021-06-02  9:10 ` Thierry Reding
2021-06-02 10:00   ` Ulf Hansson

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.