[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5277579.yApJqY0s9l@wuerfel>
Date: Wed, 21 May 2014 20:14:36 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Mark Brown <broonie@...nel.org>
Cc: Jassi Brar <jassisinghbrar@...il.com>,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
s-anna@...com, loic.pallardy@...com, lftan.linux@...il.com,
slapdau@...oo.com.au, courtney.cavin@...ymobile.com,
robherring2@...il.com, joshc@...eaurora.org,
linus.walleij@...aro.org, galak@...eaurora.org,
ks.giri@...sung.com, Jassi Brar <jaswinder.singh@...aro.org>
Subject: Re: [PATCHv5 2/4] mailbox: Introduce framework for mailbox
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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists