From owner-freebsd-drivers@FreeBSD.ORG Mon Feb 9 17:56:48 2009 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D1B10656F9 for ; Mon, 9 Feb 2009 17:56:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EC30A8FC0C for ; Mon, 9 Feb 2009 17:56:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 7E00B46B1A; Mon, 9 Feb 2009 12:56:47 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n19HuN2u005367; Mon, 9 Feb 2009 12:56:41 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Jason Harmening Date: Mon, 9 Feb 2009 12:54:06 -0500 User-Agent: KMail/1.9.7 References: <20090208113202.6d591589@CORONA> <200902090946.46917.jhb@freebsd.org> <2d1264630902090811p761b0a14w997985779aad8748@mail.gmail.com> In-Reply-To: <2d1264630902090811p761b0a14w997985779aad8748@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902091254.06917.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 09 Feb 2009 12:56:41 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8968/Mon Feb 9 10:06:24 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-drivers@freebsd.org Subject: Re: PCI-Express interrupt issues X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 17:56:48 -0000 On Monday 09 February 2009 11:11:20 am Jason Harmening wrote: > On Mon, Feb 9, 2009 at 8:46 AM, John Baldwin wrote: > > On Sunday 08 February 2009 12:32:02 pm Jason Harmening wrote: > >> Hi All, > >> > >> I'm the maintainer for the FreeBSD cx88 driver (multimedia/cx88). I've > >> recently encountered some issues w/ interrupt handling, specifically on > >> PCI-Express systems, and I was hoping someone would be able to help me. > >> > >> Issue #1: > >> > >> The cx88 driver has split interrupt handling between filters and > >> ithreads since filters became available w/ 7.0. For the past year, the > >> filters have been set up to return FILTER_SCHEDULE_THREAD if the status > >> register indicates an interrupt, FILTER_STRAY otherwise. Everything > >> has worked fine. > >> > >> However, I recently stumbled across some documentation indicating that > >> FILTER_SCHEDULE_THREAD shouldn't be returned alone--instead, the filter > >> should return FILTER_HANDLED | FILTER_SCHEDULE_THREAD. So I modified > >> the cx88 driver to do that instead, and that's where things turned > >> strange: > >> > >> On machine #1, which uses a VIA K8T800 chipset, everything still worked > >> fine. > >> > >> On machine #2, which uses a VIA K8T890 chipset, the threaded interrupt > >> handlers were no longer invoked. It's as though the bus driver saw > >> FILTER_HANDLED in the bitmask and assumed the interrupt was already > >> processed without checking to see if an ithread should be scheduled. > >> What's interesting is that the only significant difference between the > >> K8T800 in machine #1 and the K8T890 in machine #2 is that the K8T890 > >> supports PCI-Express, while the K8T800 is PCI-only. > > > > Are you seeing this only on 7.0? Also, do you have 'INTR_FILTER' enabled in > > the kernel? If you don't, then your ithread will never be called if you have > > a filter (actually, the bus_setup_intr() should fail in that case if you > > specify both). > > All machines are running 7.1-STABLE. Filters are enabled across the > board, and reverting to just returning FILTER_SCHEDULE_THREAD fixes > the issue. Do you see a dedicated interrupt thread for your device in top/ps? It should be 'intr: pcm0' (or whatever the device name is). -- John Baldwin