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

Collapse All | Expand All

(-)linux-2.6.5-rc2/drivers/acpi/acpi_ksyms.c~new_acpi_thread_sync (-1 / +1 lines)
Lines 106-112 EXPORT_SYMBOL(acpi_os_signal_semaphore); Link Here
106
EXPORT_SYMBOL(acpi_os_create_semaphore);
106
EXPORT_SYMBOL(acpi_os_create_semaphore);
107
EXPORT_SYMBOL(acpi_os_delete_semaphore);
107
EXPORT_SYMBOL(acpi_os_delete_semaphore);
108
EXPORT_SYMBOL(acpi_os_wait_semaphore);
108
EXPORT_SYMBOL(acpi_os_wait_semaphore);
109
109
EXPORT_SYMBOL(acpi_os_wait_events_complete);
110
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
110
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
111
111
112
/* ACPI Utilities (acpi_utils.c) */
112
/* ACPI Utilities (acpi_utils.c) */
(-)linux-2.6.5-rc2/drivers/acpi/osl.c~new_acpi_thread_sync (+29 lines)
Lines 1132-1137 static inline void acpi_os_run_workqueue Link Here
1132
	spin_unlock_irqrestore(&ev->lock, flags);
1132
	spin_unlock_irqrestore(&ev->lock, flags);
1133
}
1133
}
1134
1134
1135
/* Wait deferred tasks complete, 'context' is the task's context
1136
 * if 'context' is NULL, wait all tasks complete
1137
 */
1138
void
1139
acpi_os_wait_events_complete(
1140
	void * context)
1141
{
1142
	unsigned long flags;
1143
	int 		over = 0;
1144
	struct list_head *node, *next;
1145
	
1146
	while (!over) {
1147
		over = 1;
1148
		spin_lock_irqsave(&acpi_os_events.lock, flags);
1149
		list_for_each_safe(node, next, &acpi_os_events.worklist) {
1150
			struct acpi_os_work_struct *work =
1151
				container_of(node, struct acpi_os_work_struct, entry);
1152
			if(!context || work->data == context ) {
1153
				over = 0;
1154
				break;
1155
			}
1156
		}
1157
		spin_unlock_irqrestore(&acpi_os_events.lock, flags);
1158
		if (over)
1159
			return;
1160
		acpi_os_run_workqueue(&acpi_os_events);
1161
	}
1162
}
1163
1135
static int __acpi_os_event_thread(
1164
static int __acpi_os_event_thread(
1136
	struct acpi_os_events_struct *ev)
1165
	struct acpi_os_events_struct *ev)
1137
{
1166
{
(-)linux-2.6.5-rc2/include/acpi/acpiosxf.h~new_acpi_thread_sync (+4 lines)
Lines 213-218 acpi_os_queue_for_execution ( Link Here
213
	void                            *context);
213
	void                            *context);
214
214
215
void
215
void
216
acpi_os_wait_events_complete(
217
	void * context);
218
219
void
216
acpi_os_sleep (
220
acpi_os_sleep (
217
	u32                             seconds,
221
	u32                             seconds,
218
	u32                             milliseconds);
222
	u32                             milliseconds);
(-)linux-2.6.5-rc2/drivers/acpi/events/evxface.c~new_acpi_thread_sync (+27 lines)
Lines 406-411 acpi_remove_notify_handler ( Link Here
406
			goto unlock_and_exit;
406
			goto unlock_and_exit;
407
		}
407
		}
408
408
409
		/* Make sure all deferred tasks are completed */
410
411
		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
412
		acpi_os_wait_events_complete(NULL);
413
		status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
414
		if (ACPI_FAILURE (status)) {
415
			return_ACPI_STATUS (status);
416
 		}
417
409
		if (handler_type == ACPI_SYSTEM_NOTIFY) {
418
		if (handler_type == ACPI_SYSTEM_NOTIFY) {
410
			acpi_gbl_system_notify.node  = NULL;
419
			acpi_gbl_system_notify.node  = NULL;
411
			acpi_gbl_system_notify.handler = NULL;
420
			acpi_gbl_system_notify.handler = NULL;
Lines 452-457 acpi_remove_notify_handler ( Link Here
452
			goto unlock_and_exit;
461
			goto unlock_and_exit;
453
		}
462
		}
454
463
464
		/* Make sure all deferred tasks are completed */
465
466
		(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
467
		acpi_os_wait_events_complete(NULL);
468
		status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
469
		if (ACPI_FAILURE (status)) {
470
			return_ACPI_STATUS (status);
471
 		}
472
455
		/* Remove the handler */
473
		/* Remove the handler */
456
474
457
		if (handler_type == ACPI_SYSTEM_NOTIFY) {
475
		if (handler_type == ACPI_SYSTEM_NOTIFY) {
Lines 614-619 acpi_remove_gpe_handler ( Link Here
614
		goto unlock_and_exit;
632
		goto unlock_and_exit;
615
	}
633
	}
616
634
635
	/* Make sure all deferred tasks are completed */
636
637
	(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
638
	acpi_os_wait_events_complete(NULL);
639
	status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
640
	if (ACPI_FAILURE (status)) {
641
		return_ACPI_STATUS (status);
642
 	}
643
617
	/* Remove the handler */
644
	/* Remove the handler */
618
645
619
	acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
646
	acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
(-)linux-2.6.5-rc2/drivers/acpi/scan.c~new_acpi_thread_sync (+2 lines)
Lines 311-318 static int acpi_driver_detach(struct acp Link Here
311
		struct acpi_device * dev = container_of(node,struct acpi_device,g_list);
311
		struct acpi_device * dev = container_of(node,struct acpi_device,g_list);
312
312
313
		if (dev->driver == drv) {
313
		if (dev->driver == drv) {
314
			spin_unlock(&acpi_device_lock);
314
			if (drv->ops.remove)
315
			if (drv->ops.remove)
315
				drv->ops.remove(dev,ACPI_BUS_REMOVAL_NORMAL);
316
				drv->ops.remove(dev,ACPI_BUS_REMOVAL_NORMAL);
317
			spin_lock(&acpi_device_lock);
316
			dev->driver = NULL;
318
			dev->driver = NULL;
317
			dev->driver_data = NULL;
319
			dev->driver_data = NULL;
318
			atomic_dec(&drv->references);
320
			atomic_dec(&drv->references);

Return to bug 2515