From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 13 15:46:12 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 4C1CC16A41F for ; Sun, 13 Nov 2005 15:46:12 +0000 (GMT) (envelope-from bland@FreeBSD.org) Received: from mvs3.plala.or.jp (c158131.vh.plala.or.jp [210.150.158.131]) by mx1.FreeBSD.org (Postfix) with ESMTP id B12A543D55 for ; Sun, 13 Nov 2005 15:46:11 +0000 (GMT) (envelope-from bland@FreeBSD.org) Received: from hub.bbnest.net ([58.89.186.214]) by mvs3.plala.or.jp with ESMTP id <20051113154609.DBIX15688.mvs3.plala.or.jp@hub.bbnest.net>; Mon, 14 Nov 2005 00:46:09 +0900 Received: from [10.0.1.2] (egg.bbnest.net [10.0.1.2]) by hub.bbnest.net (8.13.4/8.13.4) with ESMTP id jADFk6vX001357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Nov 2005 00:46:09 +0900 (JST) (envelope-from bland@FreeBSD.org) Message-ID: <43775FBF.9050306@FreeBSD.org> Date: Mon, 14 Nov 2005 00:46:07 +0900 From: Alexander Nedotsukov User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: "M. Warner Losh" References: <437309BD.7010704@FreeBSD.org> <20051111.093141.122160674.imp@bsdimp.com> In-Reply-To: <20051111.093141.122160674.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Sun, 13 Nov 2005 15:46:12 -0000 Warner, Unfortunately my BIOS do not allow IRQ reservation for ISA devices. But in I noticed Interrupt Mode menu with PIC/APIC options. This pushed me to go through another round of tests. First with PIC mode and back again with APIC but now with "device apic" added to kernel config. After few attempts to use different IRQs I finally got interrupts on IRQ9. Well. This is good and I can move forward with driver. Though I still confused the way it done. I will be really appreciated if some good will explain me what is behind all this woodoo I did. Is it necessary to have "device apic" today? And still what is the nature of those ?lost in hardware? interrupts? BTW. Here is a quote from dmesg which may be connected to the case. ACPI APIC Table: ioapic0 irqs 0-23 on motherboard acpi0: Overriding SCI Interrupt from IRQ 9 to IRQ 20 Another bits of info. Windows automagically assigns IRQ7 to device and works fine. But I can not use IRQ7 on FreeBSD even with "device apic" in kernel. I do have hardware which is not in use ATM (PCI TV card). But I do not have any driver installed on Windows too. So if this is the case Windows somehow makes better guess of what driver can use. Anyway thanks everyone who tried to help! All the best, Alexander. M. Warner Losh wrote: > 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 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >