View | Details | Raw Unified | Return to bug 252445 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/vmware/vmci/vmci.c (-3 / +6 lines)
Lines 242-249 vmci_detach(device_t dev) Link Here
242
242
243
	vmci_components_cleanup();
243
	vmci_components_cleanup();
244
244
245
	taskqueue_drain(taskqueue_thread, &sc->vmci_delayed_work_task);
245
	if mtx_initialized(&sc->vmci_spinlock) {
246
	mtx_destroy(&sc->vmci_delayed_work_lock);
246
		taskqueue_drain(taskqueue_thread, &sc->vmci_delayed_work_task);
247
		mtx_destroy(&sc->vmci_delayed_work_lock);
248
	}
247
249
248
	if (sc->vmci_res0 != NULL)
250
	if (sc->vmci_res0 != NULL)
249
		bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0,
251
		bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0,
Lines 254-260 vmci_detach(device_t dev) Link Here
254
256
255
	vmci_unmap_bars(sc);
257
	vmci_unmap_bars(sc);
256
258
257
	mtx_destroy(&sc->vmci_spinlock);
259
	if mtx_initialized(&sc->vmci_spinlock)
260
		mtx_destroy(&sc->vmci_spinlock);
258
261
259
	pci_disable_busmaster(dev);
262
	pci_disable_busmaster(dev);
260
263
(-)b/sys/dev/vmware/vmci/vmci_event.c (+3 lines)
Lines 594-599 vmci_event_unregister_subscription(vmci_id sub_id) Link Here
594
{
594
{
595
	struct vmci_subscription *s;
595
	struct vmci_subscription *s;
596
596
597
	if (!vmci_initialized_lock(&subscriber_lock))
598
		return NULL;
599
597
	vmci_grab_lock_bh(&subscriber_lock);
600
	vmci_grab_lock_bh(&subscriber_lock);
598
	s = vmci_event_find(sub_id);
601
	s = vmci_event_find(sub_id);
599
	if (s != NULL) {
602
	if (s != NULL) {
(-)b/sys/dev/vmware/vmci/vmci_kernel_if.c (+45 lines)
Lines 165-170 vmci_release_lock_bh(vmci_lock *lock) Link Here
165
	mtx_unlock(lock);
165
	mtx_unlock(lock);
166
}
166
}
167
167
168
/*
169
 *------------------------------------------------------------------------------
170
 *
171
 * vmci_initialized_lock
172
 *
173
 *     Returns whether a lock has been initialized.
174
 *
175
 * Results:
176
 *     Return 1 if initialized or 0 if unininitialized.
177
 *
178
 * Side effects:
179
 *     None
180
 *
181
 *------------------------------------------------------------------------------
182
 */
183
184
int
185
vmci_initialized_lock(vmci_lock *lock)
186
{
187
188
	return mtx_initialized(lock);
189
}
190
168
/*
191
/*
169
 *------------------------------------------------------------------------------
192
 *------------------------------------------------------------------------------
170
 *
193
 *
Lines 446-451 vmci_mutex_release(vmci_mutex *mutex) Link Here
446
	mtx_unlock(mutex);
469
	mtx_unlock(mutex);
447
}
470
}
448
471
472
/*
473
 *------------------------------------------------------------------------------
474
 *
475
 * vmci_mutex_initialized
476
 *
477
 *     Returns whether a mutex has been initialized.
478
 *
479
 * Results:
480
 *     Return 1 if initialized or 0 if unininitialized.
481
 *
482
 * Side effects:
483
 *     None
484
 *
485
 *------------------------------------------------------------------------------
486
 */
487
488
int
489
vmci_mutex_initialized(vmci_mutex *mutex)
490
{
491
492
	return mtx_initialized(mutex);
493
}
449
/*
494
/*
450
 *------------------------------------------------------------------------------
495
 *------------------------------------------------------------------------------
451
 *
496
 *
(-)b/sys/dev/vmware/vmci/vmci_kernel_if.h (+2 lines)
Lines 48-53 void vmci_grab_lock(vmci_lock *lock); Link Here
48
void	vmci_release_lock(vmci_lock *lock);
48
void	vmci_release_lock(vmci_lock *lock);
49
void	vmci_grab_lock_bh(vmci_lock *lock);
49
void	vmci_grab_lock_bh(vmci_lock *lock);
50
void	vmci_release_lock_bh(vmci_lock *lock);
50
void	vmci_release_lock_bh(vmci_lock *lock);
51
int	vmci_initialized_lock(vmci_lock *lock);
51
52
52
void	*vmci_alloc_kernel_mem(size_t size, int flags);
53
void	*vmci_alloc_kernel_mem(size_t size, int flags);
53
void	vmci_free_kernel_mem(void *ptr, size_t size);
54
void	vmci_free_kernel_mem(void *ptr, size_t size);
Lines 72-77 int vmci_mutex_init(vmci_mutex *mutex, char *name); Link Here
72
void	vmci_mutex_destroy(vmci_mutex *mutex);
73
void	vmci_mutex_destroy(vmci_mutex *mutex);
73
void	vmci_mutex_acquire(vmci_mutex *mutex);
74
void	vmci_mutex_acquire(vmci_mutex *mutex);
74
void	vmci_mutex_release(vmci_mutex *mutex);
75
void	vmci_mutex_release(vmci_mutex *mutex);
76
int	vmci_mutex_initialized(vmci_mutex *mutex);
75
77
76
void	*vmci_alloc_queue(uint64_t size, uint32_t flags);
78
void	*vmci_alloc_queue(uint64_t size, uint32_t flags);
77
void	vmci_free_queue(void *q, uint64_t size);
79
void	vmci_free_queue(void *q, uint64_t size);
(-)b/sys/dev/vmware/vmci/vmci_queue_pair.c (+3 lines)
Lines 338-343 vmci_qp_guest_endpoints_exit(void) Link Here
338
{
338
{
339
	struct qp_guest_endpoint *entry;
339
	struct qp_guest_endpoint *entry;
340
340
341
	if (!vmci_mutex_initialized(&qp_guest_endpoints.mutex))
342
		return;
343
341
	vmci_mutex_acquire(&qp_guest_endpoints.mutex);
344
	vmci_mutex_acquire(&qp_guest_endpoints.mutex);
342
345
343
	while ((entry =
346
	while ((entry =

Return to bug 252445