openpic_init() functionality

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

openpic_init() functionality

From: Daniel Ann <hidden>
Date: 2005-08-01 02:00:30

Hi folks,

Just been reading openpic_init() function and found something weird,
so I thought I might turn to pro.
It's a part where it initialises all external sources. Code goes
something like this,
[begin]
    /* Init all external sources, including possibly the cascade. */
    for (i =3D 0; i < NumSources; i++) {
        int sense;

        if (ISR[i] =3D=3D 0)
            continue;
[snip]
      openpic_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK),
              (sense & IRQ_SENSE_MASK));
[end]

I can see what openpic_initirq does. But what I dont see is enable
part. openpic_initirq only configures interrupt but does not enable
it. And going thru the rest of the code, nothing calls
openpic_enable_irq().
Can somebody tell me how should these interrupts get enabled ?

Reason is, if I dont force openpic_enable_irq() after
openpic_initirq(), then at the end of booting, I see none of my
interrupts enabled. Im sure somewhere down the line it should get
enabled, but where ?

I'd appreciate your thoughts on this.

--=20
Daniel

Re: openpic_init() functionality

From: Eugene Surovegin <hidden>
Date: 2005-08-01 03:44:31

On Mon, Aug 01, 2005 at 11:00:29AM +0900, Daniel Ann wrote:
Hi folks,

Just been reading openpic_init() function and found something weird,
so I thought I might turn to pro.
It's a part where it initialises all external sources. Code goes
something like this,
[begin]
    /* Init all external sources, including possibly the cascade. */
    for (i = 0; i < NumSources; i++) {
        int sense;

        if (ISR[i] == 0)
            continue;
[snip]
      openpic_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK),
              (sense & IRQ_SENSE_MASK));
[end]

I can see what openpic_initirq does. But what I dont see is enable
part. openpic_initirq only configures interrupt but does not enable
it. And going thru the rest of the code, nothing calls
openpic_enable_irq().
Can somebody tell me how should these interrupts get enabled ?

Reason is, if I dont force openpic_enable_irq() after
openpic_initirq(), then at the end of booting, I see none of my
interrupts enabled. Im sure somewhere down the line it should get
enabled, but where ?
It's enabled when somebody calls request_irq, for example.

Generic IRQ code is linked to OpenPIC implementation through 
'struct hw_interrupt_type open_pic'.

Next time, try adding printk to a function at question and you'll 
easily see that it's being called.

-- 
Eugene
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help