linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* openpic_init() functionality
@ 2005-08-01  2:00 Daniel Ann
  2005-08-01  3:44 ` Eugene Surovegin
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Ann @ 2005-08-01  2:00 UTC (permalink / raw)
  To: linuxppc-embedded

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

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

* Re: openpic_init() functionality
  2005-08-01  2:00 openpic_init() functionality Daniel Ann
@ 2005-08-01  3:44 ` Eugene Surovegin
  0 siblings, 0 replies; 2+ messages in thread
From: Eugene Surovegin @ 2005-08-01  3:44 UTC (permalink / raw)
  To: Daniel Ann; +Cc: linuxppc-embedded

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

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

end of thread, other threads:[~2005-08-01  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01  2:00 openpic_init() functionality Daniel Ann
2005-08-01  3:44 ` Eugene Surovegin

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).