public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Using set_irq_handler in set_irq_type callback?
@ 2009-10-07 10:07 Uwe Kleine-König
  2009-10-07 10:22 ` Thomas Gleixner
  2009-10-07 10:28 ` Russell King
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2009-10-07 10:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Russell King, Thomas Gleixner, linux-rt-users, Sascha Hauer

Hallo,

I'm seeing an imx31 (ARCH=arm) based system failing to boot .31.2-rt13.

The reason is that the irq for the ethernet device is level triggered,
but the handler for that interrupt is handle_edge_irq.
As the handler is threaded with PREEMPT_RT=y, the irq is only acked but
neither masked (as it is believed to be an edge irq) nor handled.  This
stucks the machine as the irq is still active.

I think the fix for that is adding something like:

	if (type & IRQ_TYPE_EDGE_BOTH)
		set_irq_handler(irq, handle_edge_irq);
	else
		set_irq_handler(irq, handle_level_irq);

to the chip's .set_type callback.  (Doing this directly fails, as
.set_type holds desc->lock which set_irq_handler acquires, too.  So
maybe I need to code up a handler that checks how a given irq triggers
and then calls handle_edge_irq or handle_level_irq.)

The thing that let's me question that change is that I only found[1] a
single .set_type callback that does something like that (i.e.
arch/blackfin/mach-common/ints-priority.c).

Do I just miss something or are there more than one platforms that are
in the need of handling this issue, too?

Best regards
Uwe

[1] checking files found by 

	git grep -c set_irq_handler | awk -F: '$2 >= 2'

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-07 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 10:07 Using set_irq_handler in set_irq_type callback? Uwe Kleine-König
2009-10-07 10:22 ` Thomas Gleixner
2009-10-07 10:28 ` Russell King
2009-10-07 10:47   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox