- 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
This commit is contained in:
John Baldwin 2007-01-04 20:28:17 +00:00
parent 0ea46b3761
commit 4ed23cf283
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165774

View File

@ -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;
}