From owner-freebsd-current@FreeBSD.ORG Mon Jul 16 15:16:32 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D65EE16A401; Mon, 16 Jul 2007 15:16:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8504513C48E; Mon, 16 Jul 2007 15:16:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l6GFDDku030652; Mon, 16 Jul 2007 09:13:13 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 16 Jul 2007 09:13:15 -0600 (MDT) Message-Id: <20070716.091315.-432838580.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <200707160850.46259.jhb@freebsd.org> References: <20070617053746.GV4602@funkthat.com> <20070616.235659.-1947354616.imp@bsdimp.com> <200707160850.46259.jhb@freebsd.org> X-Mailer: Mew version 5.2 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]); Mon, 16 Jul 2007 09:13:14 -0600 (MDT) Cc: gurney_j@resnet.uoregon.edu, current@freebsd.org, wsk@gddsn.org.cn, freebsd-current@freebsd.org, mobile@freebsd.org, simokawa@freebsd.org Subject: Re: kernel panic with pccard insert on recent 7.0 CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2007 15:16:32 -0000 In message: <200707160850.46259.jhb@freebsd.org> John Baldwin writes: : On Sunday 17 June 2007 01:56:59 am M. Warner Losh wrote: : > In message: <20070617053746.GV4602@funkthat.com> : > John-Mark Gurney writes: : > : Warner Losh wrote this message on Sat, Jun 16, 2007 at 21:12 -0600: : > : > In message: <20070617024935.GU4602@funkthat.com> : > : > John-Mark Gurney writes: : > : > : Warner Losh wrote this message on Sat, Jun 16, 2007 at 17:33 -0600: : > : > : > Also, I'm unclear on the difference between FILTER_STRAY and : > : > : > FILTER_HANDLED. : > : > : : > : > : The interrupt filter is suppose to return one of FILTER_STRAY or : > : > : FILTER_HANDLED... If you _HANDLED it return that, otherwise return : > : > : _STRAY... If you need to schedule the ithread, return _HANDLED or'd : > : > : with _SCHEDULE_THREAD... : > : > : > : > Will _HANDLED cause all the other handlers to not get called, or just : > : > the stray interrupt code from not happening? : > : : > : It will cause the remaining (not yet called) handlers not to get called... : > : > I'm not sure that's right, especially for edge triggered devices.\ : : They shouldn't share interrupts then. Do we support shared interrupts on edge : triggered devices? We support sharing interrupts on edge triggered devices. At least it has worked on FreeBSD 2.2.1 through 6.2. We have to continue to support it, and to do that, we can't have HANDLED stop processing. It is a sad fact of life, but we have to continue to support that. As an aside, some ISA hardware cannot support sharing of interrupts, but simple modification of the drivers allows one to share ISA interrupts. My company has been doing this successfully for about 12 years, and using FreeBSD to do it for at least the past 10 years. : > : intr_event_handle calls intr_filter_loop which will return on the first : > : non-_STRAY handler and return it... Which intr_event_handle eoi's... : > : : > : It looks like this code is designed for level triggered interrupts and : > : not edge triggered... : > : > Yes. I'm pretty sure that's wrong. All ISA and PC Card devices use : > edge triggered interrupts. Also, it is inefficient for level : > triggered interrupts, since two interrupt sources on the same : > interrupt may trigger at about the same time... : : It works fine since the second device will interrupt again and we will fall : through to its routine on the second interrupt. The idea is that : simultaneous interrupts are rare enough that it is worth optimizing the : common case. Actually, PC Card devices aren't necessarily edge triggered, but can be either edge triggered or level triggered. They can live in bridges that are either Edge triggered or level triggered depending on the topology of the bus they live on. In any event, the current code is incorrect and needs to be fixed. Warner