From owner-freebsd-hackers Mon Jan 29 1:59:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 9D35237B6A2 for ; Mon, 29 Jan 2001 01:59:26 -0800 (PST) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id PAA22298; Mon, 29 Jan 2001 15:28:45 +0530 (IST) Received: from suns3.sasi.com ([10.0.36.3]) by samar.sasi.com; Mon, 29 Jan 2001 15:28:43 +0000 (IST) Received: from localhost (sseth@localhost) by suns3.sasi.com (8.9.3/8.9.3) with ESMTP id PAA10850; Mon, 29 Jan 2001 15:28:43 +0530 (IST) Date: Mon, 29 Jan 2001 15:28:43 +0530 (IST) From: Satyajeet Seth To: Cc: Mohana Krishna P , Brahma Naidu Golla , Suma H R , Subject: RE: interrupt handling routine not called!!! In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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