* wlcore: might_sleep operation in interrupt handler
@ 2012-07-31 18:28 Denis Yefremov
2012-07-31 20:14 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Denis Yefremov @ 2012-07-31 18:28 UTC (permalink / raw)
To: Luciano Coelho
Cc: John W. Linville, Eliad Peller, Arik Nemtsov, Eyal Shapira,
linux-wireless, netdev, linux-kernel, ldv-project
Interrupt handler wlcore_irq in wlcore/main.c file
invokes mutex_lock that is might sleep operation.
Found by Linux Driver Verification project (linuxtesting.org)
within my participation in the GSoC 2012 program.
drivers/net/wireless/ti/wlcore/main.c
static irqreturn_t wlcore_irq(int irq, void *cookie)
{
int ret;
unsigned long flags;
struct wl1271 *wl = cookie;
/* TX might be handled here, avoid redundant work */
set_bit(WL1271_FLAG_TX_PENDING, &wl->flags);
cancel_work_sync(&wl->tx_work);
mutex_lock(&wl->mutex);
...
}
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);
...
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: wlcore: might_sleep operation in interrupt handler
2012-07-31 18:28 wlcore: might_sleep operation in interrupt handler Denis Yefremov
@ 2012-07-31 20:14 ` Johannes Berg
2012-07-31 20:48 ` Denis Yefremov
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2012-07-31 20:14 UTC (permalink / raw)
To: Denis Yefremov
Cc: Luciano Coelho, John W. Linville, Eliad Peller, Arik Nemtsov,
Eyal Shapira, linux-wireless, netdev, linux-kernel, ldv-project
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: wlcore: might_sleep operation in interrupt handler
2012-07-31 20:14 ` Johannes Berg
@ 2012-07-31 20:48 ` Denis Yefremov
2012-08-01 10:48 ` Denis Yefremov
0 siblings, 1 reply; 4+ messages in thread
From: Denis Yefremov @ 2012-07-31 20:48 UTC (permalink / raw)
To: Johannes Berg
Cc: Luciano Coelho, John W. Linville, Eliad Peller, Arik Nemtsov,
Eyal Shapira, linux-wireless, netdev, linux-kernel, ldv-project
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 <johannes@sipsolutions.net>:
> 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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: wlcore: might_sleep operation in interrupt handler
2012-07-31 20:48 ` Denis Yefremov
@ 2012-08-01 10:48 ` Denis Yefremov
0 siblings, 0 replies; 4+ messages in thread
From: Denis Yefremov @ 2012-08-01 10:48 UTC (permalink / raw)
To: Johannes Berg
Cc: Luciano Coelho, John W. Linville, Eliad Peller, Arik Nemtsov,
Eyal Shapira, linux-wireless, netdev, linux-kernel, ldv-project
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-01 10:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 18:28 wlcore: might_sleep operation in interrupt handler Denis Yefremov
2012-07-31 20:14 ` Johannes Berg
2012-07-31 20:48 ` Denis Yefremov
2012-08-01 10:48 ` Denis Yefremov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).