From: Paul M. <le...@li...> - 2007-08-06 10:36:58
|
On Mon, Aug 06, 2007 at 06:47:14PM +0900, Paul Mundt wrote: > On Mon, Aug 06, 2007 at 06:33:10PM +0900, Magnus Damm wrote: > > I understand that you want to setup your priorities somehow, but I > > think there must exist better and cleaner ways to do it. I know Paul > > was thinking about adding some function to set interrupt priority > > similar to set_irq_type(), but I wonder if it may be better to allow > > the user to select the priorities from sysfs or something. Probably > > not, at least not as a first step. > > > > So if some generic function like set_irq_type() could be used that > > would be great - otherwise I think just adding some intc specific > > function is good enough. So this is what I would prefer something like > > this: > > > > void board_irq_setup() > > { > > /* first register the board specific interrupts */ > > register_intc_controller(&intc_desc); > > > > /* then setup interrupt priorities for this board */ > > set_irq_priority(STNIC_IRQ, 12); > > set_irq_priority(CF_IRQ, 3); > > } > > > > Does that solve what you are want to do? > > > > Speaking about interrupt priorities, the irq code in > > arch/sh/boards/se/770x/irq.c seem to set a priority that is very > > similar to the IRQ value. Do you know anything about this? Is this > > priority value similar by pure coincidence, or is this related to the > > IRL interrupt number? > > > Yes, I was thinking of something like the following. > > This does restrict the range of allowable priorities at request_irq() > time, but if someone has a use case for an explicit priority, > set_irq_prio() can be used for kicking that down to the chip handler. > > I would wager that 99.99999% of all use cases will fit in with > default/high/low priorities, though. If someone has a non-academic use > case that won't fit in this model, I'd be interested in hearing it. > Reworked it a bit: http://marc.info/?l=linux-kernel&m=118639637304482&w=2 |