From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 30 17:23:06 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 2F9DF16A41F; Wed, 30 Nov 2005 17:23:06 +0000 (GMT) (envelope-from craig@tobuj.gank.org) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id E68AF43D45; Wed, 30 Nov 2005 17:23:03 +0000 (GMT) (envelope-from craig@tobuj.gank.org) Received: by ion.gank.org (mail, from userid 1001) id 7EC392D686; Wed, 30 Nov 2005 11:23:03 -0600 (CST) Date: Wed, 30 Nov 2005 11:23:03 -0600 From: Craig Boston To: John Baldwin Message-ID: <20051130172303.GA57453@nowhere> References: <20051130020734.GA6577@nowhere> <200511301035.14284.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200511301035.14284.jhb@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: Weird PCI interrupt delivery problem 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: Wed, 30 Nov 2005 17:23:06 -0000 On Wed, Nov 30, 2005 at 10:35:13AM -0500, John Baldwin wrote: > > With both ACPI & APIC enabled, it only lasts a few seconds. > > You didn't have to futz with the routing in this case? No, I just took the default routing specified by ACPI. > > With ACPI disabled, the system panics because the mptable is broken. > > However, I was able to hack the kernel to override the mptable and > > route the interrupts to the correct pins. > > You know that you can override individual routings just using tunables > without having to hack the table. Just use something like: Oh yeah, thanks, I forgot about that. Though I think I would have to hack the table anyway just to get the system booted -- it panics due to the bogus entries long before it tries to route any INTs. > hw.pci0.2.INTA.irq=17 to route pci bus 0, slot 2, pin A# to IRQ 17 > (apic 0, intpin 17). Determining the correct intpins can be tricky > though. I studied the _PRT entries in the DSDT and compared with what Windows was using to figure out where they should go, I'm 99% sure it's correct. > The code does not assume APIC at all. What does an unmolested kernel > actually do with ACPI enabled but APIC disabled? Whoops, you're right. The first time I tried that I must have made a typo in the hint to disable the APIC because it "ignored" me and used it anyway. Then I read sys/i386/acpica/madt.c to mean that if an MADT table is present it flips on APIC mode unconditionally. A GENERIC kernel with ACPI but no APIC does the same thing, however. Everything ends up on IRQ 11 and it does just that much quicker. vmstat -i shows IRQ 11 frozen at 55 interrupts (the number varies per boot). > > The final thing I tried is both APIC & ACPI disabled > > Do you have a dmesg from this? Preferably a verbose one to see if > your $PIR has routing info for cbb0. Yes, I have verbose dmesgs up at http://www.gank.org/freebsd/l25/ (I've been running RELENG_6, but reverted to a 6.0 GENERIC to create these as to rule out any local patches) 8259.txt is the one with both APIC & ACPI disabled. I don't see a $PIR table anywhere though -- I don't think this board was intended to be run without ACPI... > We mask the IRQs in the PIC while their ithread runs. If your routing > is all screwed up that might result in the problems you are seeing. > Can you boot into Windows and jot down the IRQs it uses for each > device I'm pretty sure the routing is OK, but am game to try anything that might help. I don't have Windows on this machine anymore, so I called a friend with an identical laptop and had him go through device manager. Highlights include USB on IRQ 19, the integrated RealTek NIC on IRQ 21, and the MiniPCI wireless on IRQ 22. It matched exactly with with the IRQ lines that BSD uses with APIC, with or without ACPI. > and then (if you are up to it), provide verbose dmesg's of an > unpatched kernel for the 4 cases of + ACPI + APIC, - ACPI + APIC, + > ACPI - APIC, - ACPI - APIC? Sure, see the link above. The files are: 8259.txt - ACPI - APIC acpi+apic.txt + ACPI + APIC acpi.txt + ACPI - APIC I couldn't get one for - ACPI + APIC as it panics on bootup and this machine doesn't have a serial port. I did post a verbose boot with my patched kernel for that under apic+patches.txt. Also in there is mptable.txt, which shows the broken mptable. mptable-fixed.txt is the output of the mptable command when running with a patched kernel in APIC (no ACPI) mode. Craig