]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
platform: tegra: dvfs: cpu regulator attach check
authorBibek Basu <bbasu@nvidia.com>
Mon, 15 Jun 2015 05:26:38 +0000 (10:56 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 17 Jun 2015 11:56:29 +0000 (04:56 -0700)
Many QoS clients tries to request for cpu freq boost
even before regulator attach to vdd_cpu rail. This patch
is to provide api to synchronize QoS calls. Calls should
be made only after regulator attach is done.

Bug 200105276

Change-Id: I1a98ae3a1a2d1f832080d51a429c5d417dd675f9
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/756879
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/platform/tegra/dvfs.c
drivers/usb/host/xhci-tegra.c
include/linux/clk/tegra.h

index aa6c124b2dce912ea6f3b920bfe9b8bdf95badab..75af69d3ca9565059e9585be9958b723edebe906 100644 (file)
@@ -106,6 +106,15 @@ int tegra_dvfs_get_core_boot_level(void)
 }
 EXPORT_SYMBOL(tegra_dvfs_get_core_boot_level);
 
+bool tegra_dvfs_is_cpu_rail_connected_to_regulators(void)
+{
+       if (tegra_cpu_rail && tegra_cpu_rail->reg)
+               return true;
+       else
+               return false;
+}
+EXPORT_SYMBOL(tegra_dvfs_is_cpu_rail_connected_to_regulators);
+
 unsigned long tegra_dvfs_get_fmax_at_vmin_safe_t(struct clk *c)
 {
        if (!c->dvfs)
index 82f36bdc0ae38efda035e2dd6488a86966e3cff4..6a1e0f2842edc00403a1d10b8e47cce422beadc5 100644 (file)
@@ -322,7 +322,10 @@ static void tegra_xusb_boost_cpu_deinit(struct tegra_xhci_hcd *tegra)
 
 static bool tegra_xusb_boost_cpu_freq(struct tegra_xhci_hcd *tegra)
 {
-       return schedule_work(&tegra->boost_cpufreq_work);
+       if (tegra_dvfs_is_cpu_rail_connected_to_regulators())
+               return schedule_work(&tegra->boost_cpufreq_work);
+       else
+               return -EPERM;
 }
 #else
 static void tegra_xusb_boost_cpu_init(struct tegra_xhci_hcd *unused) {}
index 3b154512514748b4e10bfd583bd7d8017b85c31a..916ebe157676de3c9c2ab47237d8d688e0592abc 100644 (file)
@@ -175,6 +175,7 @@ int tegra_dvfs_set_fmax_at_vmin(struct clk *c, unsigned long f_max, int v_min);
 int tegra_dvfs_get_core_override_floor(void);
 int tegra_dvfs_get_core_nominal_millivolts(void);
 int tegra_dvfs_get_core_boot_level(void);
+bool tegra_dvfs_is_cpu_rail_connected_to_regulators(void);
 /* Get max rate safe at min voltage in all t-ranges; return zero if unknown */
 unsigned long tegra_dvfs_get_fmax_at_vmin_safe_t(struct clk *c);