Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firewire: ohci: Use tasklet_disable_in_atomic() where required

tasklet_disable() is invoked in several places. Some of them are in atomic
context which prevents a conversion of tasklet_disable() to a sleepable
function.

The atomic callchains are:

ar_context_tasklet()
ohci_cancel_packet()
tasklet_disable()

...
ohci_flush_iso_completions()
tasklet_disable()

The invocation of tasklet_disable() from at_context_flush() is always in
preemptible context.

Use tasklet_disable_in_atomic() for the two invocations in
ohci_cancel_packet() and ohci_flush_iso_completions().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210309084242.616379058@linutronix.de

authored by

Sebastian Andrzej Siewior and committed by
Thomas Gleixner
f339fc16 be4017ce

+2 -2
+2 -2
drivers/firewire/ohci.c
··· 2545 2545 struct driver_data *driver_data = packet->driver_data; 2546 2546 int ret = -ENOENT; 2547 2547 2548 - tasklet_disable(&ctx->tasklet); 2548 + tasklet_disable_in_atomic(&ctx->tasklet); 2549 2549 2550 2550 if (packet->ack != 0) 2551 2551 goto out; ··· 3465 3465 struct iso_context *ctx = container_of(base, struct iso_context, base); 3466 3466 int ret = 0; 3467 3467 3468 - tasklet_disable(&ctx->context.tasklet); 3468 + tasklet_disable_in_atomic(&ctx->context.tasklet); 3469 3469 3470 3470 if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) { 3471 3471 context_tasklet((unsigned long)&ctx->context);