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>
}
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)
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) {}
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);