From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 5 17:14:44 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4711237B401 for ; Thu, 5 Jun 2003 17:14:44 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4292A43F85 for ; Thu, 5 Jun 2003 17:14:43 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h560EekA034945; Thu, 5 Jun 2003 18:14:40 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 05 Jun 2003 18:14:30 -0600 (MDT) Message-Id: <20030605.181430.22017364.imp@bsdimp.com> To: dmlb@dmlb.org From: "M. Warner Losh" In-Reply-To: References: <20030605.170134.132933173.imp@bsdimp.com> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: interrupt handlers in -current X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 00:14:44 -0000 In message: Duncan Barclay writes: : : On 05-Jun-2003 M. Warner Losh wrote: : > In message: : > Duncan Barclay writes: : >: This is more of a confirmation of my understanding than anything else. : >: In -current, should an interrupt thread be created you set up an interrupt : >: handler? If so, then I'd better check my code because I haven't got one! : > : > No. Just because we handle interrupts in a thread doesn't mean client : > devices need to create a thread. The thread is creted automatically : > and the routine passed to bus_setup_intr() is then called when an : > interrupt happens. : : Rereading what I wrote, I might have mistyped and asked the wrong question. : : I think what you saying is that bus_setup_intr() doesn't create the thread, : (in the sense of it appear in ps -ax?) : but a thread is created automatically when the first interrupt occurs? The thread is created right away. However, if this interrupt is shared with another device, you'll see seomthing like: root 23 0.0 0.0 0 12 ?? WL 11:35AM 0:04.24 (irq10: cbb0 cbb1++) which says taht cbb0 and cbb1 (and others) share irq10. : > So you are doing bus_setup_intr() and that routine is never called? : : Yup. OK. Are you sharing interrupts? If so, can you see if the interrutp is even happening? Can you force the card to interrupt right away? Many cards have a force interrupt bit, so that one can detect if the interrupts are wired right. : If I load the kld for the driver and it attaches, nothing appears : in vmstat -i, or ps -ax. Unfortunately, I've screwed up a lock in the ioctl : hander and witness is panic'ing when I ifconfig the interface. As it : is now bedtime I'll fix it tomorrow morning and report back. OK. You may or may not see anything. I kldload if_an and get the above ps line as the only evidence that happened. : Anyway, I'm pleased with my progress as I can see arp requests hitting : the wire before it panics. Cool! Lemme know if there's anything else I can do help. Warner