Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jan 2001 15:28:43 +0530 (IST)
From:      Satyajeet Seth <sseth@sasken.com>
To:        <sshoecraft@1-link.net>
Cc:        Mohana Krishna P <pmk@sasken.com>, Brahma Naidu Golla <gbnaidu@sasken.com>, Suma H R <sumahr@sasken.com>, <freebsd-hackers@freebsd.org>
Subject:   RE: interrupt handling routine not called!!! 
Message-ID:  <Pine.GSO.4.30.0101291426290.9960-100000@suns3.sasi.com>
In-Reply-To: <Pine.LNX.4.10.10101271109340.6275-100000@pcs113.sasi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi

> 	Oops.  I meant to say:
>
> 		mask = inb(ICU1);
> 		mask |= (inb(ICU2) << 8);
>
> 	Will give you a mask of the current interrupt lines set.

We checked for the mask in the functions isa_irq_pending() and
update_intr_masks() in intr_machdep.c.

intrmask_t
isa_irq_pending()
{
        u_char irr1;
        u_char irr2;

        irr1 = inb(IO_ICU1);
        irr2 = inb(IO_ICU2);
/* 3 lines added by us*/
	printf("In isa_irq_pending inb(IO_ICU1) = %0x\n", inb(IO_ICU1));
	printf("In isa_irq_pending inb(IO_ICU2) = %0x\n", inb(IO_ICU2));
	printf("In isa_irq_pending mask = %0x\n", inb(IO_ICU1)|inb(IO_ICU2) << 8);
        return ((irr2 << 8) | irr1);
}

int
update_intr_masks(void)
{
        int intr, n=0;B
        u_int mask,*maskptr;

        for (intr=0; intr < ICU_LEN; intr ++) {
#if defined(APIC_IO)
                /* no 8259 SLAVE to ignore */
#else
                if (intr==ICU_SLAVEID) continue;        /* ignore 8259
SLAVE output */
#endif /* APIC_IO */
                maskptr = intr_mptr[intr];
                if (!maskptr)
                        continue;
                *maskptr |= SWI_CLOCK_MASK | (1 << intr);
                mask = *maskptr;
                if (mask != intr_mask[intr]) {
#if 0
                        printf ("intr_mask[%2d] old=%08x new=%08x
ptr=%p.\n",
                                intr, intr_mask[intr], mask, maskptr);
#endif
                        intr_mask[intr]=mask;
                        n++;
                }
/* 3 lines added by us*/
		printf("In isa_irq_pending inb(IO_ICU1) = %0x\n", inb(IO_ICU1));
	        printf("In isa_irq_pending inb(IO_ICU2) = %0x\n", inb(IO_ICU2));
        	printf("In isa_irq_pending mask = %0x\n",inb(IO_ICU1)|inb(IO_ICU2) << 8);


        }
        return (n);
}

The dmesg output is:

In update_irq_masks inb(IO_ICU1) = 1
In update_irq_masks inb(IO_ICU2) = 0
In update_irq_masks mask = 1
...
...
In update_irq_masks inb(IO_ICU1) = 41
In update_irq_masks inb(IO_ICU2) = 0
In update_irq_masks mask = 41
...
...
In isa_irq_pending inb(IO_ICU1) = 41
In isa_irq_pending inb(IO_ICU2) = 0
In isa_irq_pending mask = 41
...
...
In update_irq_masks inb(IO_ICU1) = 41
In update_irq_masks inb(IO_ICU2) = 0
In update_irq_masks mask = 41
...
...
In update_irq_masks inb(IO_ICU1) = 0
In update_irq_masks inb(IO_ICU2) = 0
In update_irq_masks mask = 0
...
...
In update_irq_masks inb(IO_ICU1) = 1
In update_irq_masks inb(IO_ICU2) = 0
In update_irq_masks mask = 1

I think:
1. inb(IO_ICU2) represents the interrupts generated by the hardware?

2. inb(IO_ICU2 is always zero. So the hardware is not generating
interrupts.

Am I right?

> >
> > 	If you've got 8259's, master is at 0x20 and slave is at 0xA0.
> >
> > 	You'll have to check out intr_machdep.c to see about
> > the APIC case.

We are using 8259 chip. This is because control reaches inside the
function  isa_irq_pending() in intr_machdep.c. The comment before the
function says:

/*
 * Return a bitmap of the current interrupt requests.  This is
8259-specific
 * and is only suitable for use at probe time.
 */


Thanks
Satya

> >
> > > -----Original Message-----
> > > From: owner-freebsd-hackers@FreeBSD.ORG
> > > [mailto:owner-freebsd-hackers@FreeBSD.ORG]On Behalf Of
> > Mohana Krishna
> > > Penumetcha
> > > Sent: Thursday, January 25, 2001 5:16 AM
> > > To: freebsd-hackers@FreeBSD.ORG
> > > Subject: Re: interrupt handling routine not called!!!
> > >
> > >
> > >
> > >
> > > we have done some further testing and verified the
> > > intr_handler table and
> > > corresponding mask values. everything seems to be correct.
> > > this leaves us
> > > with the hardware. the problem could be either the device is not
> > > activating the interrupt line(i.e. not conssitent with
> > status register
> > > values) or the interrupt is getting lost while being
> > propogated to the
> > > interrupt controller. in our setup, device is connected to
> > > pci bus, which
> > > is connected to host-pci bridge, but is it possible for the
> > > interrupts to
> > > get lost?
> > >
> > > if i want to check the interrupt register of the controller,
> > > to see what
> > > interrupts are active, which part of the o.s. code i needs
> > to modify.
> > > considering this is very critical code, i would like to go
> > > through some
> > > documentation, is there any thing available?
> > >
> > >
> > > thanks,
> > > mohan
> > >
> > >  On Wed, 24 Jan 2001, Mohana Krishna Penumetcha wrote:
> > >
> > > > hi,
> > > >
> > > > we are writing a driver(FreeBSD 4.0) for a switch connected
> > > to a PCI port.
> > > > the interrupt handling routine is not getting called. we
> > checked the
> > > > switch IRQ status register and find some interrupts to be
> > > pending. we
> > > > have no clue about what is happening, can someone give a
> > > few ideas about
> > > > what could be wrong?
> > > >
> > > > some info you may ask for:
> > > >
> > > > vmstat -i doesn't show any thing about the device
> > > >
> > > > there doen't seem to be any conflicts while assigning the
> > > IRQ numbers. and
> > > > the IRQ info in dmesg matches with the interrupt line
> > configuration
> > > > register of the device.
> > > >
> > > > code to register to interrupt routine:
> > > >
> > > > rid = 0;
> > > > sc->edge_irq = bus_alloc_resource(dev,SYS_RES_IRQ,
> > > >                                   &rid, 0,
> > > >                                   ~0,   1,
> > > >                                    RF_SHAREABLE|RF_ACTIVE);
> > > > if(!sc->edge_irq){
> > > >    /*release all resources*/
> > > >    return -1;
> > > > }
> > > > error = bus_setup_intr(dev, sc->edge_irq,
> > > >                        INTR_TYPE_NET,
> > > >                        edge_intr, /*interrupt handler*/
> > > >                        sc,
> > > >                        &sc->edge_intrhand);
> > > > if(error){
> > > >   /*release all resources*/
> > > >   return -1;
> > > > }
> > > >
> > > >
> > > > thanks,
> > > > mohan
> > > >
> > > >
> > > --------------------------------------------------------------
> > > -------------
> > > > 	Creativity is allowing yourself to make mistakes and Art is
> > > > 	knowing which ones to keep.
> > > > 			-Dilbert
> > > >
> > > > Mohana Krishna P.
> > > > ph:- 527 6100/6108 x6352
> > > > Telecom ODC, Sasken Communication Technologies, INDIA.
> > > > http://www.sasken.com
> > > >
> > > --------------------------------------------------------------
> > > -------------
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > > with "unsubscribe freebsd-hackers" in the body of the message
> > >
> >
>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.30.0101291426290.9960-100000>