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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to