From owner-freebsd-current Mon Oct 21 20:54:44 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D81D37B404 for ; Mon, 21 Oct 2002 20:54:42 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C49E43E77 for ; Mon, 21 Oct 2002 20:54:41 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9M3sYpk088170; Mon, 21 Oct 2002 21:54:40 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 21 Oct 2002 21:54:20 -0600 (MDT) Message-Id: <20021021.215420.114935035.imp@bsdimp.com> To: stox@imagescape.com Cc: current@FreeBSD.ORG Subject: Re: Dedicating an interrupt to a PC-Card slot From: "M. Warner Losh" In-Reply-To: <1034867226.90253.2801.camel@stox.sa.enteract.com> References: <1034867226.90253.2801.camel@stox.sa.enteract.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <1034867226.90253.2801.camel@stox.sa.enteract.com> "Kenneth P. Stox" writes: : Well, I decided to have some fun and see if I could get a Novatel Merlin : C-201 wireless modem running under FreeBSD. It seems I have run into a : bit of a roadblock. It appears that the C-201 will only speak, through : it's 16550 UART, at a speed of 230400. As such it need to have fast : interrupt support, which only seems possible with a dedicated interrupt. : ACPI and NEWCARD assigns the same interrupt to both of the Cardbus : bridges and to other PCI devices. No, the cbb and cardbus drivers do it. You aren't allowed to not share. Non-fast interrupts would be fine on a fast enough machine, or if our interrupt mechanism didn't use Giant. You might be able to get some machines to work with ISA interrupts, but it would be a lot of work to make work with NEWCARD. You can test this hypothesis by running an OLDCARD kernel, which has some support for doing this. However, I don't plan on supporting that in NEWCARD because it is a royal pain in the backside and generally not needed. As the interrupt latency gets smaller in current, the need will become even less. Also, you don't have to talk to the UART at 230400. I didn't think that sio supported such a fast baud rate, since the standard clock divisor maxes at at 115200, or have you hacked sio to have a faster baud clock? However, you can also hack pccbb to allow the fast interrupt. Given that the card isn't coming and going, it should be safe to have pccbb's interrupt be fast. Since pccbb does the calling of the ISR(s), it wouldn't really be sharing things and could likely be made to work. Since we do at most 2 PCI reads in the ISR (and typically one), the delay should be well within the tolerance of the device. There are some issues with purity of doing this that shouldn't matter in this case so long as there's only one CardBus Bridge in the system. So long as you don't have a second card, it should work. There are those that have a different view, but maybe you should try the above. I think that it would be about 10 lines of diffs to pccbb. However, if you can't assign a dedicated interrupt to the cardbus bridge, it might work. This compiles, but I've not tried it out. Have fun. ==== //depot/user/imp/newcard/dev/pccbb/pccbb.c#31 - /dell/imp/p4/newcard/src/sys/dev/pccbb/pccbb.c ==== @@ -662,8 +662,8 @@ return (ENOMEM); } - if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_AV, cbb_intr, sc, - &sc->intrhand)) { + if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_AV | INTR_FAST, + cbb_intr, sc, &sc->intrhand)) { device_printf(brdev, "couldn't establish interrupt"); goto err; } @@ -782,6 +782,7 @@ struct cbb_intrhand *ih; struct cbb_softc *sc = device_get_softc(dev); +#if 0 /* * You aren't allowed to have fast interrupts for pccard/cardbus * things since those interrupts are PCI and shared. Since we use @@ -790,6 +791,7 @@ */ if ((flags & INTR_FAST) != 0) return (EINVAL); +#endif ih = malloc(sizeof(struct cbb_intrhand), M_DEVBUF, M_NOWAIT); if (ih == NULL) return (ENOMEM); Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message