b/arch/arm/include/asm/bL_switcher.h
@@ -20,9 +20,22 @@ typedef void (*bL_switch_completion_handler)(void *cookie);
int bL_switch_request_cb(unsigned int cpu, unsigned int new_cluster_id,
bL_switch_completion_handler completer,
void *completer_cookie);
+
+static void bL_switch_complete_cb(void *cookie)
+{
+ struct completion *switch_complete = (struct completion *) cookie;
+ complete(switch_complete);
+}
+
static inline int bL_switch_request(unsigned int cpu, unsigned int
new_cluster_id)
{
- return bL_switch_request_cb(cpu, new_cluster_id, NULL, NULL);
+ struct completion complete;
+
+ init_completion(&complete);
+ bL_switch_request_cb(cpu, new_cluster_id, &bL_switch_complete_cb,
+ &complete);
+ wait_for_completion(&complete);
+ return 0;
}
/*
@@ -129,6 +129,13 @@ bL_cpufreq_set_rate(u32 cpu, u32 old_cluster, u32
new_cluster, u32 rate)
int ret;
bool bLs = is_bL_switching_enabled();
+ /* Switch cluster */
+ if (old_cluster != new_cluster) {
+ pr_debug("%s: cpu: %d, old cluster: %d, new cluster: %d\n",
+ __func__, cpu, old_cluster, new_cluster);
+ bL_switch_request(cpu, new_cluster);
+ }
+
mutex_lock(&cluster_lock[new_cluster]);