ARM: tegra: clock: Return minimum iso bandwidth
Alex Frid [Sun, 5 May 2013 03:22:02 +0000 (20:22 -0700)]
Expanded tegra_emc_apply_efficiency() interface to return minimum iso
bandwidth limit. Set this limit equal to iso bw allocation after iso
share margin is applied to all iso clients requests.

Bug 1001227

Change-Id: I31f8427feebaf81d5ec9e532ad0ae34a932491e1
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/225487
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/tegra11_clocks.c
arch/arm/mach-tegra/tegra14_clocks.c
arch/arm/mach-tegra/tegra_emc.c
arch/arm/mach-tegra/tegra_emc.h

index 7622fad..6402903 100644 (file)
@@ -5149,7 +5149,7 @@ static unsigned long tegra11_clk_shared_bus_update(struct clk *bus,
 
        if (bus->flags & PERIPH_EMC_ENB)
                bw = tegra_emc_apply_efficiency(
-                       bw, iso_bw, bus->max_rate, usage_flags);
+                       bw, iso_bw, bus->max_rate, usage_flags, NULL);
 
        rate = override_rate ? : max(rate, bw);
        ceiling = min(ceiling, ceiling_but_iso);
index 66a5177..5b4a7ca 100644 (file)
@@ -4643,7 +4643,7 @@ static unsigned long tegra14_clk_shared_bus_update(struct clk *bus,
 
        if (bus->flags & PERIPH_EMC_ENB)
                bw = tegra_emc_apply_efficiency(
-                       bw, iso_bw, bus->max_rate, usage_flags);
+                       bw, iso_bw, bus->max_rate, usage_flags, NULL);
 
        rate = override_rate ? : max(rate, bw);
        ceiling = min(ceiling, ceiling_but_iso);
index 04891d6..6b751bd 100644 (file)
@@ -73,7 +73,8 @@ static u8 tegra_emc_get_iso_share(u32 usage_flags)
 }
 
 unsigned long tegra_emc_apply_efficiency(unsigned long total_bw,
-       unsigned long iso_bw, unsigned long max_rate, u32 usage_flags)
+       unsigned long iso_bw, unsigned long max_rate, u32 usage_flags,
+       unsigned long *iso_bw_min)
 {
        u8 efficiency = tegra_emc_get_iso_share(usage_flags);
        if (iso_bw && efficiency && (efficiency < 100)) {
@@ -82,6 +83,8 @@ unsigned long tegra_emc_apply_efficiency(unsigned long total_bw,
                                (iso_bw * 100) : max_rate;
        }
        emc_iso_allocation = iso_bw;
+       if (iso_bw_min)
+               *iso_bw_min = iso_bw;
 
        efficiency = tegra_emc_bw_efficiency;
        if (total_bw && efficiency && (efficiency < 100)) {
index 084acab..723550f 100644 (file)
@@ -52,7 +52,8 @@ struct dentry;
 void tegra_emc_iso_usage_table_init(struct emc_iso_usage *table, int size);
 int  tegra_emc_iso_usage_debugfs_init(struct dentry *emc_debugfs_root);
 unsigned long tegra_emc_apply_efficiency(unsigned long total_bw,
-       unsigned long iso_bw, unsigned long max_rate, u32 usage_flags);
+       unsigned long iso_bw, unsigned long max_rate, u32 usage_flags,
+       unsigned long *iso_bw_min);
 void tegra_emc_dram_type_init(struct clk *c);
 int tegra_emc_get_dram_type(void);
 int tegra_emc_get_dram_temperature(void);