Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox | Date | Wed, 21 May 2014 20:14:36 +0200 |
| |
On Wednesday 21 May 2014 18:27:01 Mark Brown wrote: > > + /* The queued TX requests are simply aborted, no callbacks are made */ > > + spin_lock_irqsave(&chan->lock, flags); > > + chan->cl = NULL; > > + chan->active_req = NULL; > > + if (chan->txdone_method == (TXDONE_BY_POLL | TXDONE_BY_ACK)) > > + chan->txdone_method = TXDONE_BY_POLL; > > + > > + module_put(chan->mbox->dev->driver->owner); > > + spin_unlock_irqrestore(&chan->lock, flags); > > Is the module_put() safe in atomic context? >
I'm pretty sure it is:
void module_put(struct module *module) { if (module) { preempt_disable(); smp_wmb(); /* see comment in module_refcount */ __this_cpu_inc(module->refptr->decs);
trace_module_put(module, _RET_IP_); preempt_enable(); } }
This disables preemption around everything it does, so everything inside is definitely safe in nonpreemptible context.
Arnd
| |