Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2002 21:54:20 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        stox@imagescape.com
Cc:        current@FreeBSD.ORG
Subject:   Re: Dedicating an interrupt to a PC-Card slot
Message-ID:  <20021021.215420.114935035.imp@bsdimp.com>
In-Reply-To: <1034867226.90253.2801.camel@stox.sa.enteract.com>
References:  <1034867226.90253.2801.camel@stox.sa.enteract.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <1034867226.90253.2801.camel@stox.sa.enteract.com>
            "Kenneth P. Stox" <stox@imagescape.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021021.215420.114935035.imp>