From owner-svn-src-head@FreeBSD.ORG Sat Apr 18 03:10:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F8C106566B; Sat, 18 Apr 2009 03:10:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 023688FC12; Sat, 18 Apr 2009 03:10:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I3ASFa052312; Sat, 18 Apr 2009 03:10:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I3ASIg052308; Sat, 18 Apr 2009 03:10:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904180310.n3I3ASIg052308@svn.freebsd.org> From: Warner Losh Date: Sat, 18 Apr 2009 03:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191234 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2009 03:10:29 -0000 Author: imp Date: Sat Apr 18 03:10:28 2009 New Revision: 191234 URL: http://svn.freebsd.org/changeset/base/191234 Log: Establish the interrupt handler AFTER we successfully attach. We need to do this in case we have a shared interrupt that fires during the attach process.... Modified: head/sys/dev/ed/if_ed_cbus.c head/sys/dev/ed/if_ed_isa.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/ed/if_ed_pci.c Modified: head/sys/dev/ed/if_ed_cbus.c ============================================================================== --- head/sys/dev/ed/if_ed_cbus.c Sat Apr 18 03:02:44 2009 (r191233) +++ head/sys/dev/ed/if_ed_cbus.c Sat Apr 18 03:10:28 2009 (r191234) @@ -242,15 +242,18 @@ ed_cbus_attach(dev) ed_alloc_irq(dev, sc->irq_rid, 0); - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, edintr, sc, &sc->irq_handle); + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); + error = ed_attach(dev); if (error) { ed_release_resources(dev); return (error); } - if (sc->sc_media_ioctl == NULL) - ed_gen_ifmedia_init(sc); - return ed_attach(dev); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, edintr, sc, &sc->irq_handle); + if (error) + ed_release_resources(dev); + return (error); } /* Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Sat Apr 18 03:02:44 2009 (r191233) +++ head/sys/dev/ed/if_ed_isa.c Sat Apr 18 03:10:28 2009 (r191234) @@ -169,15 +169,18 @@ ed_isa_attach(device_t dev) ed_alloc_irq(dev, sc->irq_rid, 0); - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, edintr, sc, &sc->irq_handle); + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); + error = ed_attach(dev); if (error) { ed_release_resources(dev); return (error); } - if (sc->sc_media_ioctl == NULL) - ed_gen_ifmedia_init(sc); - return ed_attach(dev); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, edintr, sc, &sc->irq_handle); + if (error) + ed_release_resources(dev); + return (error); } static device_method_t ed_isa_methods[] = { Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Sat Apr 18 03:02:44 2009 (r191233) +++ head/sys/dev/ed/if_ed_pccard.c Sat Apr 18 03:10:28 2009 (r191234) @@ -495,13 +495,6 @@ ed_pccard_attach(device_t dev) if (error) goto bad; - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, edintr, sc, &sc->irq_handle); - if (error) { - device_printf(dev, "setup intr failed %d \n", error); - goto bad; - } - /* * There are several ways to get the MAC address for the card. * Some of the above probe routines can fill in the enaddr. If @@ -589,6 +582,14 @@ ed_pccard_attach(device_t dev) } if (sc->modem_rid != -1) ed_pccard_add_modem(dev); + + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, edintr, sc, &sc->irq_handle); + if (error) { + device_printf(dev, "setup intr failed %d \n", error); + goto bad; + } + return (0); bad: ed_detach(dev); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Sat Apr 18 03:02:44 2009 (r191233) +++ head/sys/dev/ed/if_ed_pci.c Sat Apr 18 03:10:28 2009 (r191234) @@ -110,15 +110,15 @@ ed_pci_attach(device_t dev) ed_release_resources(dev); return (error); } - error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, edintr, sc, &sc->irq_handle); + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); + error = ed_attach(dev); if (error) { ed_release_resources(dev); return (error); } - if (sc->sc_media_ioctl == NULL) - ed_gen_ifmedia_init(sc); - error = ed_attach(dev); + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, edintr, sc, &sc->irq_handle); if (error) ed_release_resources(dev); return (error);