Re: wlcore: might_sleep operation in interrupt handler

3 messages, 2 authors, 2012-08-01 · open the first message on its own page

Re: wlcore: might_sleep operation in interrupt handler

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2012-07-31 20:15:10

On Tue, 2012-07-31 at 22:28 +0400, Denis Yefremov wrote:
Interrupt handler wlcore_irq in wlcore/main.c file
invokes mutex_lock that is might sleep operation.
int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
{
...
        ret = request_threaded_irq(wl->irq, wl12xx_hardirq, wlcore_irq,
                                   irqflags,
                                   pdev->name, wl);
Yes, umm, why do you think they're using a *threaded* IRQ? :-)

johannes

Re: wlcore: might_sleep operation in interrupt handler

From: Denis Yefremov <hidden>
Date: 2012-07-31 20:48:20

More precise (IRQF_ONESHOT flag may be used):

int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
{
...
        if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
                irqflags = IRQF_TRIGGER_RISING;
        else
                irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;

        ret = request_threaded_irq(wl->irq, wl12xx_hardirq, wlcore_irq,
                                   irqflags,
                                   pdev->name, wl);


2012/8/1 Johannes Berg [off-list ref]:
On Tue, 2012-07-31 at 22:28 +0400, Denis Yefremov wrote:
quoted
Interrupt handler wlcore_irq in wlcore/main.c file
invokes mutex_lock that is might sleep operation.
quoted
int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
{
...
        ret = request_threaded_irq(wl->irq, wl12xx_hardirq, wlcore_irq,
                                   irqflags,
                                   pdev->name, wl);
Yes, umm, why do you think they're using a *threaded* IRQ? :-)

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: wlcore: might_sleep operation in interrupt handler

From: Denis Yefremov <hidden>
Date: 2012-08-01 10:48:24

Sorry. My mistake. In this case it seems that sleep functions can
be called from thread_fn, since interrupt line is disabled globally.
And nothing bad will happen if you know that device can be
blocked for relatively long time.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help