Merge tag 'tasklets-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull tasklets API update from Kees Cook: "These are the infrastructure updates needed to support converting the tasklet API to something more modern (and hopefully for removal further down the road). There is a 300-patch series waiting in the wings to get set out to subsystem maintainers, but these changes need to be present in the kernel first. Since this has some treewide changes, I carried this series for -next instead of paining Thomas with it in -tip, but it's got his Ack. This is similar to the timer_struct modernization from a while back, but not nearly as messy (I hope). :) - Prepare for tasklet API modernization (Romain Perier, Allen Pais, Kees Cook)" * tag 'tasklets-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: tasklet: Introduce new initialization API treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() usb: gadget: udc: Avoid tasklet passing a global
This commit is contained in:
@@ -29,7 +29,7 @@ static void backtrace_test_irq_callback(unsigned long data)
|
||||
complete(&backtrace_work);
|
||||
}
|
||||
|
||||
static DECLARE_TASKLET(backtrace_tasklet, &backtrace_test_irq_callback, 0);
|
||||
static DECLARE_TASKLET_OLD(backtrace_tasklet, &backtrace_test_irq_callback);
|
||||
|
||||
static void backtrace_test_irq(void)
|
||||
{
|
||||
|
@@ -1068,7 +1068,7 @@ static void kgdb_tasklet_bpt(unsigned long ing)
|
||||
atomic_set(&kgdb_break_tasklet_var, 0);
|
||||
}
|
||||
|
||||
static DECLARE_TASKLET(kgdb_tasklet_breakpoint, kgdb_tasklet_bpt, 0);
|
||||
static DECLARE_TASKLET_OLD(kgdb_tasklet_breakpoint, kgdb_tasklet_bpt);
|
||||
|
||||
void kgdb_schedule_breakpoint(void)
|
||||
{
|
||||
|
@@ -45,7 +45,7 @@ static void resend_irqs(unsigned long arg)
|
||||
}
|
||||
|
||||
/* Tasklet to handle resend: */
|
||||
static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);
|
||||
static DECLARE_TASKLET_OLD(resend_tasklet, resend_irqs);
|
||||
|
||||
static int irq_sw_resend(struct irq_desc *desc)
|
||||
{
|
||||
|
@@ -553,7 +553,10 @@ static void tasklet_action_common(struct softirq_action *a,
|
||||
if (!test_and_clear_bit(TASKLET_STATE_SCHED,
|
||||
&t->state))
|
||||
BUG();
|
||||
t->func(t->data);
|
||||
if (t->use_callback)
|
||||
t->callback(t);
|
||||
else
|
||||
t->func(t->data);
|
||||
tasklet_unlock(t);
|
||||
continue;
|
||||
}
|
||||
@@ -579,6 +582,18 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
|
||||
tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
|
||||
}
|
||||
|
||||
void tasklet_setup(struct tasklet_struct *t,
|
||||
void (*callback)(struct tasklet_struct *))
|
||||
{
|
||||
t->next = NULL;
|
||||
t->state = 0;
|
||||
atomic_set(&t->count, 0);
|
||||
t->callback = callback;
|
||||
t->use_callback = true;
|
||||
t->data = 0;
|
||||
}
|
||||
EXPORT_SYMBOL(tasklet_setup);
|
||||
|
||||
void tasklet_init(struct tasklet_struct *t,
|
||||
void (*func)(unsigned long), unsigned long data)
|
||||
{
|
||||
@@ -586,6 +601,7 @@ void tasklet_init(struct tasklet_struct *t,
|
||||
t->state = 0;
|
||||
atomic_set(&t->count, 0);
|
||||
t->func = func;
|
||||
t->use_callback = false;
|
||||
t->data = data;
|
||||
}
|
||||
EXPORT_SYMBOL(tasklet_init);
|
||||
|
Reference in New Issue
Block a user