diff options
author | imp <imp@FreeBSD.org> | 2003-04-10 05:12:45 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-04-10 05:12:45 +0000 |
commit | a7cc0ce91edc0b0b05e03eee868559ff872194d7 (patch) | |
tree | 8a49e3a329b214e661248279207e7a44442d5b7d /sys/dev/an/if_an_pci.c | |
parent | 0b41fd998b452c7ec8d7ba1da74ab2d3aeca7668 (diff) | |
download | FreeBSD-src-a7cc0ce91edc0b0b05e03eee868559ff872194d7.zip FreeBSD-src-a7cc0ce91edc0b0b05e03eee868559ff872194d7.tar.gz |
Don't lock in the attach routine. It isn't required. Register the
interrupt handler last. This gets rid of the sleep while locked
messages.
Reviewed by: ambrisko
Diffstat (limited to 'sys/dev/an/if_an_pci.c')
-rw-r--r-- | sys/dev/an/if_an_pci.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c index b3cbb4e..2969daa 100644 --- a/sys/dev/an/if_an_pci.c +++ b/sys/dev/an/if_an_pci.c @@ -229,14 +229,17 @@ an_attach_pci(dev) goto fail; } - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, - an_intr, sc, &sc->irq_handle); + sc->an_dev = dev; + error = an_attach(sc, device_get_unit(dev), flags); if (error) { goto fail; } - sc->an_dev = dev; - error = an_attach(sc, device_get_unit(dev), flags); + /* + * Must setup the interrupt after the an_attach to prevent racing. + */ + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, + an_intr, sc, &sc->irq_handle); fail: if (error) |