Skip to contentSkip to conversation

memory: tegra: Add support for DBB clock on Tegra264

PATCH Applied Thierry Reding 3 participants 4 messages Jan 16 – Feb 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 memory: tegra: Add support for DBB clock on Tegra264

From: Thierry Reding <[email protected]>

The DBB clock is needed by many IP blocks in order to access system memory via the data backbone. The memory controller and external memory controllers are the central place where these accesses are managed, so make sure that the clock can be controlled from the corresponding driver.

Note that not all drivers fully register bandwidth requests, and hence the EMC driver doesn't have enough information to know when it's safe to switch the clock off, so for now it will be kept on permanently.

---
Changes in v2:
- convert to dev_err_probe() (Krzysztof)

 drivers/memory/tegra/tegra186-emc.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/memory/tegra/tegra186-emc.c +8 -0
index dfddceecdd1a..03ebab6fbe68 100644
@@ -22,6 +22,7 @@ struct tegra186_emc {
 	struct tegra_bpmp *bpmp;
 	struct device *dev;
 	struct clk *clk;
+	struct clk *clk_dbb;
 
 	struct tegra186_emc_dvfs *dvfs;
 	unsigned int num_dvfs;
@@ -328,6 +329,13 @@ static int tegra186_emc_probe(struct platform_device *pdev)
 		goto put_bpmp;
 	}
 
+	emc->clk_dbb = devm_clk_get_optional_enabled(&pdev->dev, "dbb");
+	if (IS_ERR(emc->clk_dbb)) {
+		err = dev_err_probe(&pdev->dev, PTR_ERR(emc->clk_dbb),
+				    "failed to get DBB clock\n");
+		goto put_bpmp;
+	}
+
 	platform_set_drvdata(pdev, emc);
 	emc->dev = &pdev->dev;
 
Signature · 1 line
2.52.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 36 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The DBB clock is needed by many IP blocks in order to access system memory via the data backbone. The memory controller and external memory controllers are the central place where these accesses are managed, so make sure that the clock can be controlled from the corresponding driver.

Note that not all drivers fully register bandwidth requests, and hence the EMC driver doesn't have enough information to know when it's safe to switch the clock off, so for now it will be kept on permanently.

---
Changes in v2:
- convert to dev_err_probe() (Krzysztof)

  drivers/memory/tegra/tegra186-emc.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/memory/tegra/tegra186-emc.c +1 -0
index dfddceecdd1a..03ebab6fbe68 100644
@@ -22,6 +22,7 @@ struct tegra186_emc {
  	struct tegra_bpmp *bpmp;
  	struct device *dev;
  	struct clk *clk;
+	struct clk *clk_dbb;
 
  	struct tegra186_emc_dvfs *dvfs;
  	unsigned int num_dvfs;
@@ -328,6 +329,13 @@ static int tegra186_emc_probe(struct platform_device *pdev)
  		goto put_bpmp;
  	}
 

drivers/memory/tegra/tegra186-emc.c static int tegra186_emc_probe(struct platform_device *pdev) · line 341

Quoted 10 lines
drivers/memory/tegra/tegra186-emc.c +7 -0
+	emc->clk_dbb = devm_clk_get_optional_enabled(&pdev->dev, "dbb");
+	if (IS_ERR(emc->clk_dbb)) {
+		err = dev_err_probe(&pdev->dev, PTR_ERR(emc->clk_dbb),
+				    "failed to get DBB clock\n");
+		goto put_bpmp;
+	}
+
  	platform_set_drvdata(pdev, emc);
  	emc->dev = &pdev->dev;
 

Looks good to me!

Cheers
Jon

Signature · 1 line
nvpublic
#2 lore raw
Quoted 32 lines · Jon Hunter
Quoted 30 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The DBB clock is needed by many IP blocks in order to access system memory via the data backbone. The memory controller and external memory controllers are the central place where these accesses are managed, so make sure that the clock can be controlled from the corresponding driver.

Note that not all drivers fully register bandwidth requests, and hence the EMC driver doesn't have enough information to know when it's safe to switch the clock off, so for now it will be kept on permanently.

---
Changes in v2:
- convert to dev_err_probe() (Krzysztof)

  drivers/memory/tegra/tegra186-emc.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/memory/tegra/tegra186-emc.c +1 -0
index dfddceecdd1a..03ebab6fbe68 100644
@@ -22,6 +22,7 @@ struct tegra186_emc {
  	struct tegra_bpmp *bpmp;
  	struct device *dev;
  	struct clk *clk;
+	struct clk *clk_dbb;
 
Quoted 7 lines

drivers/memory/tegra/tegra186-emc.c static int tegra186_emc_probe(struct platform_device *pdev) · line 332

Quoted 7 lines
drivers/memory/tegra/tegra186-emc.c +1 -0
  	struct tegra186_emc_dvfs *dvfs;
  	unsigned int num_dvfs;
@@ -328,6 +329,13 @@ static int tegra186_emc_probe(struct platform_device *pdev)
  		goto put_bpmp;
  	}
 
+	emc->clk_dbb = devm_clk_get_optional_enabled(&pdev->dev, "dbb");

This looks like new clock and I don't see it in the bindings. Are you sure this is not an undocumented ABI? In case this was asked last time, commit msg or changelog should briefly mention it, to avoid exactly that question.

Best regards,
Krzysztof

maintainer Applied
#3 lore raw
In reply to Thierry Reding
Quoted 11 lines · Thierry Reding

The DBB clock is needed by many IP blocks in order to access system memory via the data backbone. The memory controller and external memory controllers are the central place where these accesses are managed, so make sure that the clock can be controlled from the corresponding driver.

Note that not all drivers fully register bandwidth requests, and hence the EMC driver doesn't have enough information to know when it's safe to switch the clock off, so for now it will be kept on permanently.

[...]

Applied, thanks!

[1/1] memory: tegra: Add support for DBB clock on Tegra264

      https://git.kernel.org/krzk/linux-mem-ctrl/c/f3ca1719b114bb3a64592de266f8ff9ce64f311b

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>