From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 11 16:31:29 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B79AE16A420; Fri, 11 Nov 2005 16:31:29 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0F0C43D6B; Fri, 11 Nov 2005 16:31:22 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jABGV5iD074655; Fri, 11 Nov 2005 09:31:05 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 11 Nov 2005 09:31:41 -0700 (MST) Message-Id: <20051111.093141.122160674.imp@bsdimp.com> To: bland@freebsd.org From: "M. Warner Losh" In-Reply-To: <437309BD.7010704@FreeBSD.org> References: <437309BD.7010704@FreeBSD.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 11 Nov 2005 09:31:05 -0700 (MST) Cc: freebsd-hackers@freebsd.org Subject: Re: No interrupts coming to device driver. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2005 16:31:29 -0000 In message: <437309BD.7010704@FreeBSD.org> Alexander Nedotsukov writes: : I trying to create small lirc (www.lirc.org) compatible CIR driver for : it8705 chip (sits on ISA bus). My problem is I can not get interrupts : coming to driver. I believe I configured chip (carrier freq. + baudrate : divisor) and enabled interrupt mode the same way it windows driver does. : It also seems to be correct according to chip specs. But nothing. vmstat : -i shows zeros for assigned irq. And my IRS stay cold. I wrote small : userland program which polls CIRs IIR (interrupt identefication : register) and it shows interrupt pending bit set on right after I press : key on remote control. Looks like I missed something fundamental. Does : anyone can give me a hint where to look? If it is on the ISA bus, then you can look at the IRQ line that you are using for this card on the scope. Set it to trigger on an edge (either falling if the signal is high or rising if the signal is low, usually it is high). Make sure that the IRQ that you are using is not shared with anything else, even hardware you aren't using. That's forbidden in the ISA world (although some hacks exist to do interrupt sharing with two devices on the ISA bus, (a) almost nobody does them and (b) they don't work when sharing with pci). Make sure that the IRQ is set in the BIOS as Legacy/ISA rather than ISAPNP/PCI (or some variants of those phrases). See if there's a way to force an interrupt on the chip by writing to a register of some sort. It doesn't matter if you are going to use this, but it will be good for testing. It almost certainly isn't an unacknowledged interrupt (unless it is left over from before your chip reset). In my experience, those cause vmstat of 1. It might be worth checking the chip initialization sequence to make sure that you clear any possible interrupts AFTER you've done the bus_setup_inter() call to register your interrupt handler. That's all I can think of at the moment, but it should keep you busy for a few hours :-) Warner