diff options
author | imp <imp@FreeBSD.org> | 2001-08-21 18:13:16 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-08-21 18:13:16 +0000 |
commit | db70defc697ebad9df0f3d6ae725fa952e52941e (patch) | |
tree | 76a5589adf62e81a413083cd43ea3a7779f8f305 /sys/pccard | |
parent | 07b2f35f349906964a35688c1027c8aea484b8c9 (diff) | |
download | FreeBSD-src-db70defc697ebad9df0f3d6ae725fa952e52941e.zip FreeBSD-src-db70defc697ebad9df0f3d6ae725fa952e52941e.tar.gz |
It looks like we're doing the wrong thing by catching the setup_intr
request and just calling it when we get a bridge interrupt. The
problem is that if other code wants to block hardware interrupts for a
little bit with splXXX, those masks aren't updated the way we're doing
it. This doesn't matter for -current, but does for -stable.
The whole reason that we were catching interrupts was to detect that
the card was still there. Ian's fixes however ensure that the card
will be there with an interrupt handler, or not there at all. Since
the pcic interrupt is at a high priority, this should be OK.
This should fix the network related crashes people started seeing in
stable after I merged the pcic as a pci device code.
Submitted indirectly by: Ian Dowse
MFC when: Ian has had a chance to do his torture hang testing.
Diffstat (limited to 'sys/pccard')
-rw-r--r-- | sys/pccard/pcic_pci.c | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c index d6b5654..18c7a70 100644 --- a/sys/pccard/pcic_pci.c +++ b/sys/pccard/pcic_pci.c @@ -516,15 +516,6 @@ pcic_pci_intr(void *arg) * in the CD change. */ sp->getb(sp, PCIC_STAT_CHG); - - /* - * If we have a card in the slot with an interrupt handler, then - * call it. Note: This means that each card can have at most one - * interrupt handler for it. Since multifunction cards aren't - * supported, this shouldn't cause a problem in practice. - */ - if (sc->cd_present && sp->intr != NULL) - sp->intr(sp->argp); } /* @@ -785,36 +776,6 @@ pcic_pci_get_memory(device_t dev) return (0); } -static int -pcic_pci_setup_intr(device_t dev, device_t child, struct resource *irq, - int flags, driver_intr_t *intr, void *arg, void **cookiep) -{ - struct pcic_softc *sc = (struct pcic_softc *) device_get_softc(dev); - struct pcic_slot *sp = &sc->slots[0]; - - if (sp->intr) { - device_printf(dev, -"Interrupt already established, possible multiple attach bug.\n"); - return (EINVAL); - } - sp->intr = intr; - sp->argp = arg; - *cookiep = sc; - return (0); -} - -static int -pcic_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, - void *cookie) -{ - struct pcic_softc *sc = (struct pcic_softc *) device_get_softc(dev); - struct pcic_slot *sp = &sc->slots[0]; - - sp->intr = NULL; - sp->argp = NULL; - return (0); -} - static device_method_t pcic_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pcic_pci_probe), @@ -830,8 +791,8 @@ static device_method_t pcic_pci_methods[] = { DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, pcic_activate_resource), DEVMETHOD(bus_deactivate_resource, pcic_deactivate_resource), - DEVMETHOD(bus_setup_intr, pcic_pci_setup_intr), - DEVMETHOD(bus_teardown_intr, pcic_pci_teardown_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* Card interface */ DEVMETHOD(card_set_res_flags, pcic_set_res_flags), |