# Re: \[PATCH v5 3/8\] clk: tegra: Implement Tegra210 EMC clock

- From: Thierry Reding \<hidden\>
- Date: 2020-03-23 11:05:38 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2020/03/8178109
- Thread: https://ratatoskr.run/linux-devicetree/2020/03/8177638/t.md

```text
On Tue, Mar 10, 2020 at 07:55:39PM +0300, Dmitry Osipenko wrote:
> 10.03.2020 18:19, Thierry Reding пишет:
> > From: Joseph Lo <redacted>
> > 
> > The EMC clock needs to carefully coordinate with the EMC controller
> > programming to make sure external memory can be properly clocked. Do so
> > by hooking up the EMC clock with an EMC provider that will specify which
> > rates are supported by the EMC and provide a callback to use for setting
> > the clock rate at the EMC.
> > 
> > Based on work by Peter De Schrijver [ref].
> > 
> > Signed-off-by: Joseph Lo <redacted>
> > Signed-off-by: Thierry Reding <redacted>
> > ---
> > Changes in v5:
> > - major rework and cleanup
> 
> ...
> 
> > +static int tegra210_emc_resume(struct device *dev)
> > +{
> > +	struct tegra_emc *emc = dev_get_drvdata(dev);
> > +
> > +	emc->emc_suspend = false;
> 
> Looks like the 'emc->emc_suspend' isn't really needed, nothing in kernel
> shall touch EMC rate at this point.

I've removed this.

> Perhaps should be better to make EMC clk exlusive in order to catch
> abusers, please see tegra30-emc suspend/resume for an example.

Good idea. Done.

> > +	clk_set_rate(emc->emc_clk, emc->emc_resume_rate);
> > +
> > +	pr_debug("%s at rate %lu\n", __func__, clk_get_rate(emc->emc_clk));
> > +
> > +	return 0;
> > +}
> > +#endif
> > +
> > +static const struct dev_pm_ops tegra210_emc_pm_ops = {
> > +	SET_SYSTEM_SLEEP_PM_OPS(tegra210_emc_suspend, tegra210_emc_resume)
> > +};
> What about to use the default suspend/resume level?

I don't understand. This is already the default suspend/resume level,
isn't it?

Thierry
```
