diff options
author | John Baldwin <jhb@FreeBSD.org> | 2007-01-04 20:28:17 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2007-01-04 20:28:17 +0000 |
commit | 4ed23cf2833b8e59e7417469e699b54833feea17 (patch) | |
tree | d7d5624c550ba3cdbf4efd2b0b663172ad1a79f2 /sys/dev/hptmv | |
parent | 0ea46b37611c0733a09250e5f7d8eef85ce24ff0 (diff) | |
download | src-4ed23cf2833b8e59e7417469e699b54833feea17.tar.gz src-4ed23cf2833b8e59e7417469e699b54833feea17.zip |
- Use a regular mutex rather than a spin mutex. This driver doesn't need
a spin mutex since it doesn't have an INTR_FAST interrupt handler.
Beyond that the driver is still under Giant anyway.
- Remove unneeded locking during attach across operations that can't be
called with locks held (such as bus_dma_tag_create()).
MFC after: 1 week
Not objected to by: scottl
Notes
Notes:
svn path=/head/; revision=165774
Diffstat (limited to 'sys/dev/hptmv')
-rw-r--r-- | sys/dev/hptmv/entry.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index a7bc1f532bf4..5361f8b34a37 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -166,12 +166,12 @@ intrmask_t lock_driver() { intrmask_t spl = 0; - mtx_lock_spin(&driver_lock); + mtx_lock(&driver_lock); return spl; } void unlock_driver(intrmask_t spl) { - mtx_unlock_spin(&driver_lock); + mtx_unlock(&driver_lock); } #else static int driver_locked = 0; @@ -1168,7 +1168,7 @@ dmamap_put(PBUS_DMAMAP p) #if __FreeBSD_version >= 500000 static void hpt_init(void *dummy) { - mtx_init(&driver_lock, "hptlock", NULL, MTX_SPIN); + mtx_init(&driver_lock, "hptlock", NULL, MTX_DEF); } SYSINIT(hptinit, SI_SUB_CONFIGURE, SI_ORDER_FIRST, hpt_init, NULL); #endif @@ -1183,8 +1183,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) PVDevice pVDev; - intrmask_t oldspl = lock_driver(); - pAdapter->next = 0; if(gIal_Adapter == 0){ @@ -1225,7 +1223,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) if (hptmv_allocate_edma_queues(pAdapter)) { MV_ERROR("RR182x: Failed to allocate memory for EDMA queues\n"); - unlock_driver(oldspl); return ENOMEM; } @@ -1238,7 +1235,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR182x: Failed to remap memory space\n"); hptmv_free_edma_queues(pAdapter); - unlock_driver(oldspl); return ENXIO; } else @@ -1268,7 +1264,6 @@ init_adapter(IAL_ADAPTER_T *pAdapter) unregister: bus_release_resource(pAdapter->hpt_dev, SYS_RES_MEMORY, rid, pAdapter->mem_res); hptmv_free_edma_queues(pAdapter); - unlock_driver(oldspl); return ENXIO; } pAdapter->ver_601 = pMvSataAdapter->pcbVersion; @@ -1411,7 +1406,6 @@ unregister: #endif mvSataUnmaskAdapterInterrupt(pMvSataAdapter); - unlock_driver(oldspl); return 0; } |