#include <linux/sched/rt.h>
#include <linux/notifier.h>
#include "linux/amlogic/cpu_hotplug.h"
+#include <linux/delay.h>
#define MAX_CLUSTRS 2
struct cpu_hotplug_s {
return;
}
- mutex_lock(&hpg.mutex);
+ if (!mutex_trylock(&hpg.mutex))
+ return;
if (num > hpg.cpunum[clustr])
num = hpg.cpunum[clustr];
if (hpg.max_num[clustr] == num) {
while (1) {
if (kthread_should_stop())
break;
- mutex_lock(&hpg.mutex);
+ if (!mutex_trylock(&hpg.mutex)) {
+ usleep_range(1000, 2000);
+ continue;
+ }
for (clustr = 0; clustr < hpg.clusters; clustr++) {
if (!hpg.flgs[clustr])
continue;