From owner-freebsd-arch Tue Oct 26 13:11:47 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id E39ED14CAE for ; Tue, 26 Oct 1999 13:11:33 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id WAA24462 for ; Tue, 26 Oct 1999 22:11:31 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id WAA22536 for freebsd-arch@freebsd.org; Tue, 26 Oct 1999 22:11:30 +0200 (MET DST) Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id BC91A14CAE for ; Tue, 26 Oct 1999 13:09:29 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (ind.alcatel.com 2.3 [OUT])) id NAA23271; Tue, 26 Oct 1999 13:08:33 -0700 (PDT) Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id NAA15793; Tue, 26 Oct 1999 13:08:33 -0700 Received: from softweyr.com (dyn7.utah.xylan.com) by omni.xylan.com (4.1/SMI-4.1 (xylan engr [SPOOL])) id AA04732; Tue, 26 Oct 99 13:08:22 PDT Message-Id: <38160A3D.F32AE9E4@softweyr.com> Date: Tue, 26 Oct 1999 14:08:29 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en Mime-Version: 1.0 To: Bill Fumerola Cc: Nate Williams , Terry Lambert , imp@village.org, arch@freebsd.org Subject: Re: Racing interrupts References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bill Fumerola wrote: > > On Mon, 25 Oct 1999, Nate Williams wrote: > > > > The system will not crash as a result of this. > > > > Not true, it will hang the system. I can show this if more proof is > > needed on my laptop. There is no software solution that will avoid all > > problems. > > Then you have borked drivers or some other bogon. I can cleanly do all > of the things Terry says without problem. This alone means it is not only > possible, but there exists a method to do it properly. Try this: hang a disk drive off a SlimSCSI and start something I/O intensive on the drive, like a disk benchmark write test. Now pop the SCSI card out during the I/O. > I'm trying not to add noise because I have no idea of the technical workings > behind pccard ejection, but lets certainly not discount it just because > on someone's laptop it doesn't work. First you should know PCMCIA was designed with memory cards in mind. The ejection mechanism tells you the card is going away by providing an interrupt. It's the same interrupt that all other notifications from the card use. It does this by having a short pin on the connector; when the short pin becomes detached the PCMCIA Controller in your system generates the interrupt. You have some small amount of time before the rest of the pins become detached in which you can still communicate with the card, but this time is not fixed, it will depend on the card, the ejector, and on how hard the user pushes the ejector button. If you've just begun to process another interrupt from the card, such as I/O ready or I/O complete, you won't be able to process the ejection interrupt until your current interrupt completes, but what happens if the card goes away before your current interrupt completes? Then you're attempting to read and write I/O ports and/or memory locations that no longer exist, but you don't know they no longer exist. The "right" thing to do would be for the hardware controller to generate a bus error if you try to write registers or memory addresses for a card that has gone away, but it doesn't. You're also left with questions about what to do with outstanding I/O requests when the device goes away, and how to handle the open references to the device. None of the design is simple, and it is complicated by the fact that PCMCIA wasn't developed for I/O devices. If you want to jump in and help, I'm sure everyone involved would welcome the help. Buy the PCMCIA and CardBus architecture books, familiarize yourself with the code, and ponder how to handle these and other stick issues as cleanly as possible. Submit working patches, ask intelligent questions, and give intelligent answers. You know, kind of like working on FreeBSD. ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message