diff options
Diffstat (limited to 'sys/dev/ips/ips_pci.c')
-rw-r--r-- | sys/dev/ips/ips_pci.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c index 5431c96..3b76c93 100644 --- a/sys/dev/ips/ips_pci.c +++ b/sys/dev/ips/ips_pci.c @@ -123,7 +123,7 @@ static int ips_pci_attach(device_t dev) device_printf(dev, "irq allocation failed\n"); goto error; } - if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO, sc->ips_adapter_intr, sc, &sc->irqcookie)){ + if(bus_setup_intr(dev, sc->irqres, INTR_TYPE_BIO|INTR_MPSAFE, sc->ips_adapter_intr, sc, &sc->irqcookie)){ device_printf(dev, "irq setup failed\n"); goto error; } @@ -138,8 +138,8 @@ static int ips_pci_attach(device_t dev) /* numsegs */ IPS_MAX_SG_ELEMENTS, /* maxsegsize*/ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &sc->adapter_dmatag) != 0) { printf("IPS can't alloc dma tag\n"); goto error; @@ -147,6 +147,7 @@ static int ips_pci_attach(device_t dev) sc->ips_ich.ich_func = ips_intrhook; sc->ips_ich.ich_arg = sc; mtx_init(&sc->queue_mtx, "IPS bioqueue lock", MTX_DEF, 0); + sema_init(&sc->cmd_sema, 0, "IPS Command Semaphore"); bioq_init(&sc->queue); if (config_intrhook_establish(&sc->ips_ich) != 0) { printf("IPS can't establish configuration hook\n"); @@ -181,6 +182,8 @@ static int ips_pci_free(ips_softc_t *sc) if(sc->iores) bus_release_resource(sc->dev, sc->iotype, sc->rid, sc->iores); sc->configured = 0; + mtx_destroy(&sc->queue_mtx); + sema_destroy(&sc->cmd_sema); return 0; } |