本文整理汇总了C++中queue_delayed_work_on函数的典型用法代码示例。如果您正苦于以下问题:C++ queue_delayed_work_on函数的具体用法?C++ queue_delayed_work_on怎么用?C++ queue_delayed_work_on使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了queue_delayed_work_on函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tmu_irq
static irqreturn_t tmu_irq(int irq, void *id)
{
struct tmu_info *info = id;
unsigned int status;
disable_irq_nosync(irq);
status = __raw_readl(info->tmu_base + INTSTAT);
if (status & INTSTAT_RISE0) {
pr_info("Throttling interrupt occured!!!!\n");
__raw_writel(INTCLEAR_RISE0, info->tmu_base + INTCLEAR);
info->tmu_state = TMU_STATUS_THROTTLED;
queue_delayed_work_on(0, tmu_monitor_wq,
&info->polling, usecs_to_jiffies(500 * 1000));
} else if (status & INTSTAT_RISE1) {
pr_info("Warning interrupt occured!!!!\n");
__raw_writel(INTCLEAR_RISE1, info->tmu_base + INTCLEAR);
info->tmu_state = TMU_STATUS_WARNING;
queue_delayed_work_on(0, tmu_monitor_wq,
&info->polling, usecs_to_jiffies(500 * 1000));
} else if (status & INTSTAT_RISE2) {
pr_info("Tripping interrupt occured!!!!\n");
info->tmu_state = TMU_STATUS_TRIPPED;
__raw_writel(INTCLEAR_RISE2, info->tmu_base + INTCLEAR);
tmu_tripped_cb();
} else {
pr_err("%s: TMU interrupt error\n", __func__);
return -ENODEV;
}
return IRQ_HANDLED;
}
示例2: lcd_notifier_callback
static int lcd_notifier_callback(struct notifier_block *nb,
unsigned long event, void *data)
{
switch (event) {
case LCD_EVENT_ON_START:
isSuspended = false;
if(tplug_hp_enabled)
queue_delayed_work_on(0, tplug_wq, &tplug_work,
msecs_to_jiffies(sampling_time));
else
queue_delayed_work_on(0, tplug_resume_wq, &tplug_resume_work,
msecs_to_jiffies(10));
pr_info("thunderplug : resume called\n");
break;
case LCD_EVENT_ON_END:
break;
case LCD_EVENT_OFF_START:
break;
case LCD_EVENT_OFF_END:
isSuspended = true;
pr_info("thunderplug : suspend called\n");
break;
default:
break;
}
return 0;
}
示例3: tplug_es_resume_work
static void tplug_es_resume_work(struct early_suspend *p) {
isSuspended = false;
#ifdef CONFIG_SCHED_HMP
if(tplug_hp_style==1)
#else
if(tplug_hp_enabled)
#endif
queue_delayed_work_on(0, tplug_wq, &tplug_work,
msecs_to_jiffies(sampling_time));
else
queue_delayed_work_on(0, tplug_resume_wq, &tplug_resume_work,
msecs_to_jiffies(10));
pr_info("thunderplug : resume called\n");
}
示例4: tplug_input_event
static void tplug_input_event(struct input_handle *handle, unsigned int type,
unsigned int code, int value)
{
if (type == EV_KEY && code == BTN_TOUCH) {
if(DEBUG)
pr_info("%s : type = %d, code = %d, value = %d\n", THUNDERPLUG, type, code, value);
if(value == 0) {
stop_boost = 1;
if(DEBUG)
pr_info("%s: stopping boost\n", THUNDERPLUG);
}
else {
stop_boost = 0;
if(DEBUG)
pr_info("%s: starting boost\n", THUNDERPLUG);
}
}
#ifdef CONFIG_SCHED_HMP
if ((type == EV_KEY) && (code == BTN_TOUCH) && (value == 1)
&& touch_boost_enabled == 1)
#else
if ((type == EV_KEY) && (code == BTN_TOUCH) && (value == 1)
&& touch_boost_enabled == 1)
#endif
{
if(DEBUG)
pr_info("%s : touch boost\n", THUNDERPLUG);
queue_delayed_work_on(0, tplug_boost_wq, &tplug_boost,
msecs_to_jiffies(0));
}
}
示例5: watchdog_start
static void watchdog_start(void)
{
unsigned int val;
unsigned long flags;
spin_lock_irqsave(&wdt_lock, flags);
/* set to PCLK / 256 / 128 */
val = S3C2410_WTCON_DIV128;
val |= S3C2410_WTCON_PRESCALE(255);
writel(val, S3C2410_WTCON);
/* program initial count */
writel(watchdog_reset * TPS, S3C2410_WTCNT);
writel(watchdog_reset * TPS, S3C2410_WTDAT);
/* start timer */
val |= S3C2410_WTCON_RSTEN | S3C2410_WTCON_ENABLE;
writel(val, S3C2410_WTCON);
spin_unlock_irqrestore(&wdt_lock, flags);
/* make sure we're ready to pet the dog */
#if defined(PET_BY_WORKQUEUE)
queue_delayed_work_on(0, watchdog_wq, &watchdog_work,
watchdog_pet * HZ);
#elif defined(PET_BY_DIRECT_TIMER)
pet_watchdog_timer.expires = jiffies + watchdog_pet * HZ;
add_timer_on(&pet_watchdog_timer, 0);
#else
hrtimer_start(&watchdog_timer,
ktime_set(watchdog_pet, 0), HRTIMER_MODE_REL);
#endif
}
示例6: watchdog_workfunc
static void watchdog_workfunc(struct work_struct *work)
{
/* pr_err("%s kicking...\n", __func__); */
writel(watchdog_reset * TPS, S3C2410_WTCNT);
queue_delayed_work_on(0, watchdog_wq, &watchdog_work,
watchdog_pet * HZ);
}
示例7: intelli_plug_init
int __init intelli_plug_init(void)
{
int rc;
//pr_info("intelli_plug: scheduler delay is: %d\n", delay);
pr_info("intelli_plug: version %d.%d by faux123\n",
INTELLI_PLUG_MAJOR_VERSION,
INTELLI_PLUG_MINOR_VERSION);
rc = input_register_handler(&intelli_plug_input_handler);
#ifdef CONFIG_POWERSUSPEND
register_power_suspend(&intelli_plug_power_suspend_driver);
#endif
intelliplug_wq = alloc_workqueue("intelliplug",
WQ_HIGHPRI | WQ_UNBOUND, 1);
intelliplug_boost_wq = alloc_workqueue("iplug_boost",
WQ_HIGHPRI | WQ_UNBOUND, 1);
INIT_DELAYED_WORK(&intelli_plug_work, intelli_plug_work_fn);
INIT_DELAYED_WORK(&intelli_plug_boost, intelli_plug_boost_fn);
queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
msecs_to_jiffies(10));
return 0;
}
示例8: do_input_boost
static void do_input_boost(struct work_struct *work)
{
unsigned int i, ret, freq;
struct cpu_sync *i_sync_info;
struct cpufreq_policy policy;
for_each_online_cpu(i) {
i_sync_info = &per_cpu(sync_info, i);
ret = cpufreq_get_policy(&policy, i);
if (ret)
continue;
// ensure, touch boost freq does never exceed max scaling freq
if (input_boost_freq > policy.max)
freq = policy.max;
else
freq = input_boost_freq;
if (policy.cur >= freq)
continue;
cancel_delayed_work_sync(&i_sync_info->input_boost_rem);
i_sync_info->input_boost_min = freq;
cpufreq_update_policy(i);
queue_delayed_work_on(i_sync_info->cpu, cpu_boost_wq,
&i_sync_info->input_boost_rem,
msecs_to_jiffies(input_boost_ms));
}
}
示例9: intelli_plug_resume
static void __cpuinit intelli_plug_resume(struct early_suspend *handler)
#endif
{
int num_of_active_cores;
int i;
mutex_lock(&intelli_plug_mutex);
/* keep cores awake long enough for faster wake up */
persist_count = BUSY_PERSISTENCE;
suspended = false;
mutex_unlock(&intelli_plug_mutex);
/* wake up everyone */
num_of_active_cores = num_possible_cpus();
for (i = 1; i < num_of_active_cores; i++) {
cpu_up(i);
}
screen_off_limit(false);
wakeup_boost();
queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
msecs_to_jiffies(10));
}
示例10: thunderplug_hp_style_store
static ssize_t __ref thunderplug_hp_style_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
int val, last_val;
sscanf(buf, "%d", &val);
last_val = tplug_hp_style;
switch(val)
{
case HOTPLUG_PERCORE:
case HOTPLUG_SCHED:
tplug_hp_style = val;
break;
default:
pr_info("%s : invalid choice\n", THUNDERPLUG);
break;
}
if(tplug_hp_style == HOTPLUG_PERCORE && tplug_hp_style != last_val) {
pr_info("%s: Switching to Per-core hotplug model\n", THUNDERPLUG);
sched_set_boost(DISABLED);
queue_delayed_work_on(0, tplug_wq, &tplug_work,
msecs_to_jiffies(sampling_time));
}
else if(tplug_hp_style==2) {
pr_info("%s: Switching to sched based hotplug model\n", THUNDERPLUG);
set_sched_profile(tplug_sched_mode);
}
return count;
}
示例11: do_input_boost
static void do_input_boost(struct work_struct *work)
{
unsigned int i, ret;
struct cpu_sync *i_sync_info;
struct cpufreq_policy policy;
get_online_cpus();
for_each_online_cpu(i) {
i_sync_info = &per_cpu(sync_info, i);
ret = cpufreq_get_policy(&policy, i);
if (ret)
continue;
if (policy.cur >= input_boost_freq)
continue;
cancel_delayed_work_sync(&i_sync_info->input_boost_rem);
i_sync_info->input_boost_min = input_boost_freq;
cpufreq_update_policy(i);
queue_delayed_work_on(i_sync_info->cpu, cpu_boost_wq,
&i_sync_info->input_boost_rem,
msecs_to_jiffies(input_boost_ms));
}
put_online_cpus();
}
示例12: xio_schedwork_add
/*---------------------------------------------------------------------------*/
int xio_schedwork_add(struct xio_schedwork *sched_work,
int msec_duration, void *data,
void (*timer_fn)(void *data),
xio_schedwork_handle_t *handle_out)
{
struct xio_delayed_work *xdwork;
struct xio_context *ctx = sched_work->ctx;
unsigned long delay_jiffies;
xdwork = kmalloc(sizeof(*xdwork), GFP_KERNEL);
if (!xdwork) {
ERROR_LOG("kmalloc failed.\n");
return -1;
}
xdwork->data = data;
xdwork->timer_fn = timer_fn;
xdwork->ctx = ctx;
INIT_DELAYED_WORK(&xdwork->dwork, xio_work_callback);
delay_jiffies = msecs_to_jiffies(msec_duration);
/* queue the work */
if (!queue_delayed_work_on(ctx->cpuid, sched_work->workqueue,
&xdwork->dwork, delay_jiffies)) {
ERROR_LOG("work already queued?.\n");
return -1;
}
/* for cancellation */
*handle_out = xdwork;
return 0;
}
示例13: load_timer
/*
* Every DELAY, check the average load of online CPUs. If the average load
* is above up_threshold bring online one more CPU if up_timer has expired.
* If the average load is below up_threshold offline one more CPU if the
* down_timer has expired.
*/
static __ref void load_timer(struct work_struct *work)
{
unsigned int cpu;
unsigned int avg_load = 0;
if (down_timer < down_timer_cnt)
down_timer++;
if (up_timer < up_timer_cnt)
up_timer++;
for_each_online_cpu(cpu)
avg_load += cpufreq_quick_get_util(cpu);
avg_load /= num_online_cpus();
#if DEBUG
pr_debug("%s: avg_load: %u, num_online_cpus: %u\n", __func__, avg_load, num_online_cpus());
pr_debug("%s: up_timer: %u, down_timer: %u\n", __func__, up_timer, down_timer);
#endif
if (avg_load >= up_threshold && up_timer >= up_timer_cnt)
up_one();
else if (down_timer >= down_timer_cnt)
down_one();
queue_delayed_work_on(0, dyn_workq, &dyn_work, delay);
}
示例14: intelli_plug_resume
static void __cpuinit intelli_plug_resume(struct early_suspend *handler)
#endif
{
if (intelli_plug_active) {
int cpu;
mutex_lock(&intelli_plug_mutex);
/* keep cores awake long enough for faster wake up */
persist_count = BUSY_PERSISTENCE;
suspended = false;
mutex_unlock(&intelli_plug_mutex);
for_each_possible_cpu(cpu) {
if (cpu == 0)
continue;
cpu_up(cpu);
}
wakeup_boost();
screen_off_limit(false);
}
queue_delayed_work_on(0, intelliplug_wq, &intelli_plug_work,
msecs_to_jiffies(10));
}
示例15: sleepy_plug_work_fn
static void __cpuinit sleepy_plug_work_fn(struct work_struct *work)
{
enum mp_decisions decision = DO_NOTHING;
if (sleepy_plug_active == 1) {
// detect artificial loads or constant loads
// using msm rqstats
decision = mp_decision();
#ifdef DEBUG_SLEEPY_PLUG
pr_info("decision: %d\n",decision);
#endif
if (!suspended) {
if (decision == CPU_UP) {
cpu_up(1);
sampling_time = BUSY_SAMPLING_MS;
} else if(decision == CPU_DOWN){
cpu_down(1);
sampling_time = DEF_SAMPLING_MS;
} else if(decision == DO_NOTHING)
sampling_time = DEF_SAMPLING_MS;
}
#ifdef DEBUG_SLEEPY_PLUG
else
pr_info("sleepy_plug is suspened!\n");
#endif
}
queue_delayed_work_on(0, sleepy_plug_wq, &sleepy_plug_work,
msecs_to_jiffies(sampling_time));
}