From owner-freebsd-mobile Sat Jan 15 1:37:58 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from afs.itc.keio.ac.jp (afs.itc.keio.ac.jp [131.113.212.3]) by hub.freebsd.org (Postfix) with SMTP id 9DBF415022 for ; Sat, 15 Jan 2000 01:37:55 -0800 (PST) (envelope-from hosokawa@itc.keio.ac.jp) Received: (qmail 12473 invoked from network); 15 Jan 2000 09:37:54 -0000 Received: from ppp169.dialup.st.keio.ac.jp (HELO ringo.FromTo.Cc) (131.113.27.169) by afs.itc.keio.ac.jp with SMTP; 15 Jan 2000 09:37:54 -0000 Date: Sat, 15 Jan 2000 18:39:05 +0900 Message-ID: <86ln5rhdxi.wl@ringo.FromTo.Cc> From: Tatsumi Hosokawa To: mobile@FreeBSD.org Subject: Working pcic polling mode patch (Re: Polling mode of pcic as default?) In-Reply-To: In your message of "Sat, 15 Jan 2000 17:42:51 +0900" <86oganhgj8.wl@ringo.FromTo.Cc> References: <86oganhgj8.wl@ringo.FromTo.Cc> User-Agent: Wanderlust/2.2.13 (Keep The Faith) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) MULE XEmacs/21.1 (patch 8) (Bryce Canyon) (i386--freebsd) MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org At Sat, 15 Jan 2000 17:42:51 +0900, Tatsumi Hosokawa wrote: > I think that better default behavior of pcic is polling mode (for > instetion/removal of cards) because, > > 1. IRQ mode does not work on some pc-card controller on -current > and coming 4.0-RELEASE (Toshiba ToPIC, TI-1250, etc.). > > 2. IRQ is very expensive resource. > > 3. Cost of polling mode is little. I tested polling mode of -current and it does not work. I wrote a patch to fix this bug. If there's no objection, I'll commit it as soon as possible because 4.0 will soon be frozen. --- pcic.c Fri Dec 10 16:02:41 1999 +++ /home/hosokawa/pcic.c Sat Jan 15 18:35:37 2000 @@ -263,7 +263,7 @@ char *name; int i; int error; - struct resource *res; + struct resource *res = 0; int rid; static int maybe_vlsi = 0; @@ -454,8 +454,9 @@ if (!getenv_int("machdep.pccard.pcic_irq", &pcic_irq)) pcic_irq = 0; rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, pcic_irq, ~0, 1, RF_ACTIVE); + if (pcic_irq) + res = bus_alloc_resource(dev, SYS_RES_IRQ, + &rid, pcic_irq, ~0, 1, RF_ACTIVE); if (res) { error = bus_setup_intr(dev, res, INTR_TYPE_MISC, pcicintr, NULL, &ih); @@ -496,6 +497,8 @@ */ if (pcic_irq > 0) sp->putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF); + else if (pcic_irq == 0) + sp->putb(sp, PCIC_STAT_INT, 0xF); } if (validslots && pcic_irq <= 0) pcictimeout_ch = timeout(pcictimeout, 0, hz/2); -- --------------------------- Tatsumi Hosokawa hosokawa@itc.keio.ac.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message