Message ID | 20201104164923.21238-1-digetx@gmail.com |
---|---|
Headers | show |
Series | Introduce memory interconnect for NVIDIA Tegra SoCs | expand |
Hi Dmitry, You need to update the MAINTAINERS file about tegra20-devfreq.c 11343 MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA 11344 M: Dmitry Osipenko <digetx@gmail.com> 11345 L: linux-pm@vger.kernel.org 11346 L: linux-tegra@vger.kernel.org 11347 T: git git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git 11348 S: Maintained 11349 F: drivers/devfreq/tegra20-devfreq.c 11350 F: drivers/devfreq/tegra30-devfreq.c Except of missing the updating of MAINTAINERS, Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Thanks, Chanwoo Choi On 11/5/20 1:49 AM, Dmitry Osipenko wrote: > Remove tegra20-devfreq in order to replace it with a EMC_STAT based > devfreq driver. Previously we were going to use MC_STAT based > tegra20-devfreq driver because EMC_STAT wasn't working properly, but > now that problem is resolved. This resolves complications imposed by > the removed driver since it was depending on both EMC and MC drivers > simultaneously. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/devfreq/Kconfig | 10 -- > drivers/devfreq/Makefile | 1 - > drivers/devfreq/tegra20-devfreq.c | 210 ------------------------------ > 3 files changed, 221 deletions(-) > delete mode 100644 drivers/devfreq/tegra20-devfreq.c > > diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig > index 0ee36ae2fa79..00704efe6398 100644 > --- a/drivers/devfreq/Kconfig > +++ b/drivers/devfreq/Kconfig > @@ -121,16 +121,6 @@ config ARM_TEGRA_DEVFREQ > It reads ACTMON counters of memory controllers and adjusts the > operating frequencies and voltages with OPP support. > > -config ARM_TEGRA20_DEVFREQ > - tristate "NVIDIA Tegra20 DEVFREQ Driver" > - depends on ARCH_TEGRA_2x_SOC || COMPILE_TEST > - depends on COMMON_CLK > - select DEVFREQ_GOV_SIMPLE_ONDEMAND > - help > - This adds the DEVFREQ driver for the Tegra20 family of SoCs. > - It reads Memory Controller counters and adjusts the operating > - frequencies and voltages with OPP support. > - > config ARM_RK3399_DMC_DEVFREQ > tristate "ARM RK3399 DMC DEVFREQ Driver" > depends on (ARCH_ROCKCHIP && HAVE_ARM_SMCCC) || \ > diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile > index 3ca1ad0ecb97..a16333ea7034 100644 > --- a/drivers/devfreq/Makefile > +++ b/drivers/devfreq/Makefile > @@ -13,7 +13,6 @@ obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o > obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o > obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o > obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o > -obj-$(CONFIG_ARM_TEGRA20_DEVFREQ) += tegra20-devfreq.o > > # DEVFREQ Event Drivers > obj-$(CONFIG_PM_DEVFREQ_EVENT) += event/ > diff --git a/drivers/devfreq/tegra20-devfreq.c b/drivers/devfreq/tegra20-devfreq.c > deleted file mode 100644 > index fd801534771d..000000000000 > --- a/drivers/devfreq/tegra20-devfreq.c > +++ /dev/null > @@ -1,210 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -/* > - * NVIDIA Tegra20 devfreq driver > - * > - * Copyright (C) 2019 GRATE-DRIVER project > - */ > - > -#include <linux/clk.h> > -#include <linux/devfreq.h> > -#include <linux/io.h> > -#include <linux/kernel.h> > -#include <linux/module.h> > -#include <linux/of_device.h> > -#include <linux/platform_device.h> > -#include <linux/pm_opp.h> > -#include <linux/slab.h> > - > -#include <soc/tegra/mc.h> > - > -#include "governor.h" > - > -#define MC_STAT_CONTROL 0x90 > -#define MC_STAT_EMC_CLOCK_LIMIT 0xa0 > -#define MC_STAT_EMC_CLOCKS 0xa4 > -#define MC_STAT_EMC_CONTROL 0xa8 > -#define MC_STAT_EMC_COUNT 0xb8 > - > -#define EMC_GATHER_CLEAR (1 << 8) > -#define EMC_GATHER_ENABLE (3 << 8) > - > -struct tegra_devfreq { > - struct devfreq *devfreq; > - struct clk *emc_clock; > - void __iomem *regs; > -}; > - > -static int tegra_devfreq_target(struct device *dev, unsigned long *freq, > - u32 flags) > -{ > - struct tegra_devfreq *tegra = dev_get_drvdata(dev); > - struct devfreq *devfreq = tegra->devfreq; > - struct dev_pm_opp *opp; > - unsigned long rate; > - int err; > - > - opp = devfreq_recommended_opp(dev, freq, flags); > - if (IS_ERR(opp)) > - return PTR_ERR(opp); > - > - rate = dev_pm_opp_get_freq(opp); > - dev_pm_opp_put(opp); > - > - err = clk_set_min_rate(tegra->emc_clock, rate); > - if (err) > - return err; > - > - err = clk_set_rate(tegra->emc_clock, 0); > - if (err) > - goto restore_min_rate; > - > - return 0; > - > -restore_min_rate: > - clk_set_min_rate(tegra->emc_clock, devfreq->previous_freq); > - > - return err; > -} > - > -static int tegra_devfreq_get_dev_status(struct device *dev, > - struct devfreq_dev_status *stat) > -{ > - struct tegra_devfreq *tegra = dev_get_drvdata(dev); > - > - /* > - * EMC_COUNT returns number of memory events, that number is lower > - * than the number of clocks. Conversion ratio of 1/8 results in a > - * bit higher bandwidth than actually needed, it is good enough for > - * the time being because drivers don't support requesting minimum > - * needed memory bandwidth yet. > - * > - * TODO: adjust the ratio value once relevant drivers will support > - * memory bandwidth management. > - */ > - stat->busy_time = readl_relaxed(tegra->regs + MC_STAT_EMC_COUNT); > - stat->total_time = readl_relaxed(tegra->regs + MC_STAT_EMC_CLOCKS) / 8; > - stat->current_frequency = clk_get_rate(tegra->emc_clock); > - > - writel_relaxed(EMC_GATHER_CLEAR, tegra->regs + MC_STAT_CONTROL); > - writel_relaxed(EMC_GATHER_ENABLE, tegra->regs + MC_STAT_CONTROL); > - > - return 0; > -} > - > -static struct devfreq_dev_profile tegra_devfreq_profile = { > - .polling_ms = 500, > - .target = tegra_devfreq_target, > - .get_dev_status = tegra_devfreq_get_dev_status, > -}; > - > -static struct tegra_mc *tegra_get_memory_controller(void) > -{ > - struct platform_device *pdev; > - struct device_node *np; > - struct tegra_mc *mc; > - > - np = of_find_compatible_node(NULL, NULL, "nvidia,tegra20-mc-gart"); > - if (!np) > - return ERR_PTR(-ENOENT); > - > - pdev = of_find_device_by_node(np); > - of_node_put(np); > - if (!pdev) > - return ERR_PTR(-ENODEV); > - > - mc = platform_get_drvdata(pdev); > - if (!mc) > - return ERR_PTR(-EPROBE_DEFER); > - > - return mc; > -} > - > -static int tegra_devfreq_probe(struct platform_device *pdev) > -{ > - struct tegra_devfreq *tegra; > - struct tegra_mc *mc; > - unsigned long max_rate; > - unsigned long rate; > - int err; > - > - mc = tegra_get_memory_controller(); > - if (IS_ERR(mc)) { > - err = PTR_ERR(mc); > - dev_err(&pdev->dev, "failed to get memory controller: %d\n", > - err); > - return err; > - } > - > - tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); > - if (!tegra) > - return -ENOMEM; > - > - /* EMC is a system-critical clock that is always enabled */ > - tegra->emc_clock = devm_clk_get(&pdev->dev, "emc"); > - if (IS_ERR(tegra->emc_clock)) > - return dev_err_probe(&pdev->dev, PTR_ERR(tegra->emc_clock), > - "failed to get emc clock\n"); > - > - tegra->regs = mc->regs; > - > - max_rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); > - > - for (rate = 0; rate <= max_rate; rate++) { > - rate = clk_round_rate(tegra->emc_clock, rate); > - > - err = dev_pm_opp_add(&pdev->dev, rate, 0); > - if (err) { > - dev_err(&pdev->dev, "failed to add opp: %d\n", err); > - goto remove_opps; > - } > - } > - > - /* > - * Reset statistic gathers state, select global bandwidth for the > - * statistics collection mode and set clocks counter saturation > - * limit to maximum. > - */ > - writel_relaxed(0x00000000, tegra->regs + MC_STAT_CONTROL); > - writel_relaxed(0x00000000, tegra->regs + MC_STAT_EMC_CONTROL); > - writel_relaxed(0xffffffff, tegra->regs + MC_STAT_EMC_CLOCK_LIMIT); > - > - platform_set_drvdata(pdev, tegra); > - > - tegra->devfreq = devfreq_add_device(&pdev->dev, &tegra_devfreq_profile, > - DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL); > - if (IS_ERR(tegra->devfreq)) { > - err = PTR_ERR(tegra->devfreq); > - goto remove_opps; > - } > - > - return 0; > - > -remove_opps: > - dev_pm_opp_remove_all_dynamic(&pdev->dev); > - > - return err; > -} > - > -static int tegra_devfreq_remove(struct platform_device *pdev) > -{ > - struct tegra_devfreq *tegra = platform_get_drvdata(pdev); > - > - devfreq_remove_device(tegra->devfreq); > - dev_pm_opp_remove_all_dynamic(&pdev->dev); > - > - return 0; > -} > - > -static struct platform_driver tegra_devfreq_driver = { > - .probe = tegra_devfreq_probe, > - .remove = tegra_devfreq_remove, > - .driver = { > - .name = "tegra20-devfreq", > - }, > -}; > -module_platform_driver(tegra_devfreq_driver); > - > -MODULE_ALIAS("platform:tegra20-devfreq"); > -MODULE_AUTHOR("Dmitry Osipenko <digetx@gmail.com>"); > -MODULE_DESCRIPTION("NVIDIA Tegra20 devfreq driver"); > -MODULE_LICENSE("GPL v2"); >
On 11/5/20 1:49 AM, Dmitry Osipenko wrote: > Add devfreq support to the Tegra20 EMC driver. Memory utilization > statistics will be periodically polled from the memory controller and > appropriate minimum clock rate will be selected by the devfreq governor. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/Kconfig | 2 + > drivers/memory/tegra/tegra20-emc.c | 92 ++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > > diff --git a/drivers/memory/tegra/Kconfig b/drivers/memory/tegra/Kconfig > index ac3dfe155505..76e9a3b10839 100644 > --- a/drivers/memory/tegra/Kconfig > +++ b/drivers/memory/tegra/Kconfig > @@ -12,6 +12,8 @@ config TEGRA20_EMC > tristate "NVIDIA Tegra20 External Memory Controller driver" > default y > depends on TEGRA_MC && ARCH_TEGRA_2x_SOC > + select DEVFREQ_GOV_SIMPLE_ONDEMAND > + select PM_DEVFREQ > select PM_OPP nitpick. If you select PM_DEVFREQ, don't need to select 'PM_OPP' bacause PM_DEVFREQ use OPP as mandatory with 'select PM_OPP' in Kconfig. > help > This driver is for the External Memory Controller (EMC) found on > diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c > index 5e10aa97809f..9946b957bb01 100644 > --- a/drivers/memory/tegra/tegra20-emc.c > +++ b/drivers/memory/tegra/tegra20-emc.c > @@ -8,6 +8,7 @@ > #include <linux/clk.h> > #include <linux/clk/tegra.h> > #include <linux/debugfs.h> > +#include <linux/devfreq.h> > #include <linux/err.h> > #include <linux/interconnect-provider.h> > #include <linux/interrupt.h> > @@ -102,6 +103,10 @@ > > #define EMC_FBIO_CFG5_DRAM_WIDTH_X16 BIT(4) > > +#define EMC_PWR_GATHER_CLEAR (1 << 8) > +#define EMC_PWR_GATHER_DISABLE (2 << 8) > +#define EMC_PWR_GATHER_ENABLE (3 << 8) > + > static const u16 emc_timing_registers[] = { > EMC_RC, > EMC_RFC, > @@ -157,6 +162,7 @@ struct emc_timing { > }; > > enum emc_rate_request_type { > + EMC_RATE_DEVFREQ, > EMC_RATE_DEBUG, > EMC_RATE_ICC, > EMC_RATE_TYPE_MAX, > @@ -193,6 +199,9 @@ struct tegra_emc { > > /* protect shared rate-change code path */ > struct mutex rate_lock; > + > + struct devfreq_simple_ondemand_data ondemand_data; > + struct devfreq *devfreq; > }; > > static irqreturn_t tegra_emc_isr(int irq, void *data) > @@ -952,6 +961,88 @@ static int tegra_emc_opp_table_init(struct tegra_emc *emc) > return err; > } > > +static int tegra_emc_devfreq_target(struct device *dev, unsigned long *freq, > + u32 flags) > +{ > + struct tegra_emc *emc = dev_get_drvdata(dev); > + struct dev_pm_opp *opp; > + unsigned long rate; > + > + opp = devfreq_recommended_opp(dev, freq, flags); > + if (IS_ERR(opp)) { > + dev_err(dev, "failed to find opp for %lu Hz\n", *freq); > + return PTR_ERR(opp); > + } > + > + rate = dev_pm_opp_get_freq(opp); > + dev_pm_opp_put(opp); > + > + return emc_set_min_rate(emc, rate, EMC_RATE_DEVFREQ); > +} > + > +static int tegra_emc_devfreq_get_dev_status(struct device *dev, > + struct devfreq_dev_status *stat) > +{ > + struct tegra_emc *emc = dev_get_drvdata(dev); > + > + /* freeze counters */ > + writel_relaxed(EMC_PWR_GATHER_DISABLE, emc->regs + EMC_STAT_CONTROL); > + > + /* > + * busy_time: number of clocks EMC request was accepted > + * total_time: number of clocks PWR_GATHER control was set to ENABLE > + */ > + stat->busy_time = readl_relaxed(emc->regs + EMC_STAT_PWR_COUNT); > + stat->total_time = readl_relaxed(emc->regs + EMC_STAT_PWR_CLOCKS); > + stat->current_frequency = clk_get_rate(emc->clk); > + > + /* clear counters and restart */ > + writel_relaxed(EMC_PWR_GATHER_CLEAR, emc->regs + EMC_STAT_CONTROL); > + writel_relaxed(EMC_PWR_GATHER_ENABLE, emc->regs + EMC_STAT_CONTROL); > + > + return 0; > +} > + > +static struct devfreq_dev_profile tegra_emc_devfreq_profile = { > + .polling_ms = 30, > + .target = tegra_emc_devfreq_target, > + .get_dev_status = tegra_emc_devfreq_get_dev_status, > +}; > + > +static int tegra_emc_devfreq_init(struct tegra_emc *emc) > +{ > + int err; > + > + /* > + * PWR_COUNT is 1/2 of PWR_CLOCKS at max, and thus, the up-threshold > + * should be less than 50. Secondly, multiple active memory clients > + * may cause over 20% of lost clock cycles due to stalls caused by > + * competing memory accesses. This means that threshold should be > + * set to a less than 30 in order to have a properly working governor. > + */ > + emc->ondemand_data.upthreshold = 20; > + > + /* > + * Reset statistic gathers state, select global bandwidth for the > + * statistics collection mode and set clocks counter saturation > + * limit to maximum. > + */ > + writel_relaxed(0x00000000, emc->regs + EMC_STAT_CONTROL); > + writel_relaxed(0x00000000, emc->regs + EMC_STAT_LLMC_CONTROL); > + writel_relaxed(0xffffffff, emc->regs + EMC_STAT_PWR_CLOCK_LIMIT); > + > + emc->devfreq = devfreq_add_device(emc->dev, &tegra_emc_devfreq_profile, > + DEVFREQ_GOV_SIMPLE_ONDEMAND, > + &emc->ondemand_data); Do you want to use 'devfreq_add_device' instead of 'devm_devfreq_add_device()'? If you have to use 'devfreq_add_device' due to some reason, you need to call 'devfreq_remove_device' on exit. > + if (IS_ERR(emc->devfreq)) { > + err = PTR_ERR(emc->devfreq); > + dev_err(emc->dev, "failed to initialize devfreq: %d", err); > + return err; > + } > + > + return 0; > +} > + > static int tegra_emc_probe(struct platform_device *pdev) > { > struct device_node *np; > @@ -1019,6 +1110,7 @@ static int tegra_emc_probe(struct platform_device *pdev) > tegra_emc_rate_requests_init(emc); > tegra_emc_debugfs_init(emc); > tegra_emc_interconnect_init(emc); > + tegra_emc_devfreq_init(emc); > > /* > * Don't allow the kernel module to be unloaded. Unloading adds some >
05.11.2020 05:25, Chanwoo Choi пишет: > Hi Dmitry, > > You need to update the MAINTAINERS file about tegra20-devfreq.c > > 11343 MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA > 11344 M: Dmitry Osipenko <digetx@gmail.com> > 11345 L: linux-pm@vger.kernel.org > 11346 L: linux-tegra@vger.kernel.org > 11347 T: git git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git > 11348 S: Maintained > 11349 F: drivers/devfreq/tegra20-devfreq.c > 11350 F: drivers/devfreq/tegra30-devfreq.c > > Except of missing the updating of MAINTAINERS, > Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Hello Chanwoo, Good catch! Thank you!
05.11.2020 05:30, Chanwoo Choi пишет: > On 11/5/20 1:49 AM, Dmitry Osipenko wrote: >> Add devfreq support to the Tegra20 EMC driver. Memory utilization >> statistics will be periodically polled from the memory controller and >> appropriate minimum clock rate will be selected by the devfreq governor. >> >> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> >> --- >> drivers/memory/tegra/Kconfig | 2 + >> drivers/memory/tegra/tegra20-emc.c | 92 ++++++++++++++++++++++++++++++ >> 2 files changed, 94 insertions(+) >> >> diff --git a/drivers/memory/tegra/Kconfig b/drivers/memory/tegra/Kconfig >> index ac3dfe155505..76e9a3b10839 100644 >> --- a/drivers/memory/tegra/Kconfig >> +++ b/drivers/memory/tegra/Kconfig >> @@ -12,6 +12,8 @@ config TEGRA20_EMC >> tristate "NVIDIA Tegra20 External Memory Controller driver" >> default y >> depends on TEGRA_MC && ARCH_TEGRA_2x_SOC >> + select DEVFREQ_GOV_SIMPLE_ONDEMAND >> + select PM_DEVFREQ >> select PM_OPP > > nitpick. If you select PM_DEVFREQ, don't need to select 'PM_OPP' > bacause PM_DEVFREQ use OPP as mandatory with 'select PM_OPP' in Kconfig. Ok ... >> +static int tegra_emc_devfreq_init(struct tegra_emc *emc) >> +{ >> + int err; >> + >> + /* >> + * PWR_COUNT is 1/2 of PWR_CLOCKS at max, and thus, the up-threshold >> + * should be less than 50. Secondly, multiple active memory clients >> + * may cause over 20% of lost clock cycles due to stalls caused by >> + * competing memory accesses. This means that threshold should be >> + * set to a less than 30 in order to have a properly working governor. >> + */ >> + emc->ondemand_data.upthreshold = 20; >> + >> + /* >> + * Reset statistic gathers state, select global bandwidth for the >> + * statistics collection mode and set clocks counter saturation >> + * limit to maximum. >> + */ >> + writel_relaxed(0x00000000, emc->regs + EMC_STAT_CONTROL); >> + writel_relaxed(0x00000000, emc->regs + EMC_STAT_LLMC_CONTROL); >> + writel_relaxed(0xffffffff, emc->regs + EMC_STAT_PWR_CLOCK_LIMIT); >> + >> + emc->devfreq = devfreq_add_device(emc->dev, &tegra_emc_devfreq_profile, >> + DEVFREQ_GOV_SIMPLE_ONDEMAND, >> + &emc->ondemand_data); > > Do you want to use 'devfreq_add_device' instead of > 'devm_devfreq_add_device()'? If you have to use 'devfreq_add_device' > due to some reason, you need to call 'devfreq_remove_device' on exit. The reason I didn't use the devm here is because the EMC-clk callback should be unregistered *after* devfreq is removed. Thinking a bit more about it, I guess the best variant will be to add devm support to the clk callback registration and then it should be possible to use devm for the devfreq. I'll try to implement it in v8, thanks.
On Wed, 04 Nov 2020 19:48:44 +0300, Dmitry Osipenko wrote: > The SoC core voltage can't be changed without taking into account the > clock rate of External Memory Controller. Document OPP table that will > be used for dynamic voltage frequency scaling, taking into account EMC > voltage requirement. Document optional core voltage regulator, which is > optional because some boards may have a fixed core regulator and still > frequency scaling may be desired to have. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../memory-controllers/nvidia,tegra20-emc.txt | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > Acked-by: Rob Herring <robh@kernel.org>
On Wed, Nov 04, 2020 at 07:48:40PM +0300, Dmitry Osipenko wrote: > There is superfluous zero in the registers base address and registers > size should be twice bigger. > > Acked-by: Rob Herring <robh@kernel.org> > Acked-by: Thierry Reding <treding@nvidia.com> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../bindings/memory-controllers/nvidia,tegra20-emc.txt | 2 +- Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:48:42PM +0300, Dmitry Osipenko wrote: > Memory controller is interconnected with memory clients and with the > External Memory Controller. Document new interconnect property which > turns memory controller into interconnect provider. > > Acked-by: Rob Herring <robh@kernel.org> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../bindings/memory-controllers/nvidia,tegra20-mc.txt | 3 +++ Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:48:44PM +0300, Dmitry Osipenko wrote: > The SoC core voltage can't be changed without taking into account the > clock rate of External Memory Controller. Document OPP table that will > be used for dynamic voltage frequency scaling, taking into account EMC > voltage requirement. Document optional core voltage regulator, which is > optional because some boards may have a fixed core regulator and still > frequency scaling may be desired to have. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../memory-controllers/nvidia,tegra20-emc.txt | 16 ++++++++++++++++ Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:48:46PM +0300, Dmitry Osipenko wrote: > External memory controller is interconnected with memory controller and > with external memory. Document new interconnect property which turns > External Memory Controller into interconnect provider. > > Acked-by: Rob Herring <robh@kernel.org> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../bindings/memory-controllers/nvidia,tegra30-emc.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:48:50PM +0300, Dmitry Osipenko wrote: > Document new OPP table and voltage regulator properties which are needed > for supporting dynamic voltage-frequency scaling of the memory controller. > Some boards may have a fixed core voltage regulator, hence it's optional > because frequency scaling still may be desired. > > Reviewed-by: Rob Herring <robh@kernel.org> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > .../memory-controllers/nvidia,tegra124-emc.yaml | 12 ++++++++++++ > 1 file changed, 12 insertions(+) Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:48:54PM +0300, Dmitry Osipenko wrote: > Each memory client has unique hardware ID, add these IDs. > > Acked-by: Rob Herring <robh@kernel.org> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > include/dt-bindings/memory/tegra30-mc.h | 67 +++++++++++++++++++++++++ > 1 file changed, 67 insertions(+) Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:49:04PM +0300, Dmitry Osipenko wrote: > Multiple Tegra drivers need to retrieve Memory Controller and there is > duplication of the retrieval code among the drivers. > > Add new devm_tegra_memory_controller_get() helper to remove the code's > duplication and to fix put_device() which was missed in the duplicated > code. Make EMC drivers to use the new helper. > > Acked-by: Thierry Reding <treding@nvidia.com> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/mc.c | 48 ++++++++++++++++++++++++ > drivers/memory/tegra/tegra124-emc.c | 18 ++------- > drivers/memory/tegra/tegra210-emc-core.c | 39 +++++-------------- > drivers/memory/tegra/tegra30-emc.c | 18 ++------- > include/soc/tegra/mc.h | 10 +++++ > 5 files changed, 74 insertions(+), 59 deletions(-) > Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:49:06PM +0300, Dmitry Osipenko wrote: > The platform_get_irq() prints error message telling that interrupt is > missing, hence there is no need to duplicated that message in the drivers. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/mc.c | 4 +--- > drivers/memory/tegra/tegra20-emc.c | 1 - > drivers/memory/tegra/tegra30-emc.c | 5 ++--- Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:49:08PM +0300, Dmitry Osipenko wrote: > Add common SoC-agnostic ICC framework which turns Tegra Memory Controller > into a memory interconnection provider. This allows us to use interconnect > API for tuning of memory configurations. > > Tested-by: Peter Geis <pgwipeout@gmail.com> > Tested-by: Nicolas Chauvet <kwizart@gmail.com> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/Kconfig | 1 + > drivers/memory/tegra/mc.c | 100 +++++++++++++++++++++++++++++++++++ > drivers/memory/tegra/mc.h | 22 ++++++++ > include/soc/tegra/mc.h | 17 ++++++ > 4 files changed, 140 insertions(+) Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:49:10PM +0300, Dmitry Osipenko wrote: > EMC driver will become mandatory after turning it into interconnect > provider because interconnect users, like display controller driver, will > fail to probe using newer device-trees that have interconnect properties. > Thus make EMC driver to probe even if timings are missing in device-tree. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/tegra20-emc.c | 34 ++++++++++++++---------------- > 1 file changed, 16 insertions(+), 18 deletions(-) Thanks, applied. Best regards, Krzysztof
On Wed, Nov 04, 2020 at 07:49:12PM +0300, Dmitry Osipenko wrote: > Add devfreq support to the Tegra20 EMC driver. Memory utilization > statistics will be periodically polled from the memory controller and > appropriate minimum clock rate will be selected by the devfreq governor. > > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/memory/tegra/Kconfig | 2 + > drivers/memory/tegra/tegra20-emc.c | 92 ++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > I see this one still received comments. I skipped the DTS patches and applied everything till patch #35. I understand you will send v8, so in such case please skip the applied ones (you can rebase on my for-next or on Monday's linux-next). Best regards, Krzysztof
06.11.2020 22:13, Krzysztof Kozlowski пишет: > On Wed, Nov 04, 2020 at 07:49:12PM +0300, Dmitry Osipenko wrote: >> Add devfreq support to the Tegra20 EMC driver. Memory utilization >> statistics will be periodically polled from the memory controller and >> appropriate minimum clock rate will be selected by the devfreq governor. >> >> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> >> --- >> drivers/memory/tegra/Kconfig | 2 + >> drivers/memory/tegra/tegra20-emc.c | 92 ++++++++++++++++++++++++++++++ >> 2 files changed, 94 insertions(+) >> > > I see this one still received comments. I skipped the DTS patches and > applied everything till patch #35. I understand you will send v8, so in > such case please skip the applied ones (you can rebase on my for-next or > on Monday's linux-next). Thank you! I'll also need to wait for a reply from Viresh Kumar in other thread regarding dev_pm_opp_get_opp_table() usage and then will probably need to correct patch #35+ as well now, since turned out it may be wrong for drivers to use dev_pm_opp_get_opp_table().