]> 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)
committerVenkat Moganty <vmoganty@nvidia.com>
Fri, 17 Jul 2015 04:26:34 +0000 (21:26 -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: Ibe5eea18adb05a7742f2a2a92b6bc5033e5ca8a5
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/756879
(cherry picked from commit c99bd18c6e677fed363a23aabce424f076f2e57f)
Reviewed-on: http://git-master/r/769813
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/platform/tegra/dvfs.c
drivers/usb/host/xhci-tegra.c
include/linux/clk/tegra.h

index 6ec8ddf2143e1e0f52a81be0639b64c80576b727..e807d1a320ba9062d1f57724c6482152ec5316c9 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 a41e9aa483826a110c390c8f9a67c03e089b6a40..b78bcb42cb17f257b7e477bdf7dd39af87496428 100644 (file)
@@ -347,7 +347,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 e67b7f41d5716e3388c4ef005da4abf0eb99f530..11ce736355a8101b62b4ce28de90ba81271f9302 100644 (file)
@@ -186,6 +186,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);