CVS commit: src/sys/dev/acpi/acpica

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 01:23:28 UTC 2023

Modified Files:
src/sys/dev/acpi/acpica: acpi_func.h

Log Message:
acpi(4): Fix membars in ACPI_ACQUIRE/RELEASE_GLOBAL_LOCK.

XXX pullup-8 (by patch with membar_enter/exit)
XXX pullup-9 (by patch with membar_enter/exit)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica/acpi_func.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpica/acpi_func.h
diff -u src/sys/dev/acpi/acpica/acpi_func.h:1.6 src/sys/dev/acpi/acpica/acpi_func.h:1.7
--- src/sys/dev/acpi/acpica/acpi_func.h:1.6	Fri Oct 12 21:36:24 2018
+++ src/sys/dev/acpi/acpica/acpi_func.h	Wed May 10 01:23:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_func.h,v 1.6 2018/10/12 21:36:24 jmcneill Exp $	*/
+/*	$NetBSD: acpi_func.h,v 1.7 2023/05/10 01:23:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Michael Smith
@@ -62,6 +62,7 @@ acpi_acquire_global_lock(uint32_t *lock)
 		((old >> 1) & GL_BIT_PENDING);
 		val = atomic_cas_32(lock, old, new);
 	} while (__predict_false(val != old));
+	membar_acquire();
 
 	return ((new < GL_BIT_MASK) ? GL_ACQUIRED : GL_BUSY);
 }
@@ -71,6 +72,7 @@ acpi_release_global_lock(uint32_t *lock)
 {
 	uint32_t new, old, val;
 
+	membar_release();
 	do {
 		old = *lock;
 		new = old & ~GL_BIT_MASK;



CVS commit: src/sys/dev/acpi/acpica

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 01:23:28 UTC 2023

Modified Files:
src/sys/dev/acpi/acpica: acpi_func.h

Log Message:
acpi(4): Fix membars in ACPI_ACQUIRE/RELEASE_GLOBAL_LOCK.

XXX pullup-8 (by patch with membar_enter/exit)
XXX pullup-9 (by patch with membar_enter/exit)
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpica/acpi_func.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/acpi/acpica

2021-12-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec 31 17:22:15 UTC 2021

Modified Files:
src/sys/dev/acpi/acpica: OsdHardware.c

Log Message:
acpi(9): Return full 64-bit object to caller in PCI config read.

The value of the object will be as small as requested, but the whole
uint64_t object will be written as the caller of a space handler
expects, instead of just part of it.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/acpi/acpica/OsdHardware.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpica/OsdHardware.c
diff -u src/sys/dev/acpi/acpica/OsdHardware.c:1.12 src/sys/dev/acpi/acpica/OsdHardware.c:1.13
--- src/sys/dev/acpi/acpica/OsdHardware.c:1.12	Fri Jan 17 17:06:33 2020
+++ src/sys/dev/acpi/acpica/OsdHardware.c	Fri Dec 31 17:22:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdHardware.c,v 1.12 2020/01/17 17:06:33 jmcneill Exp $	*/
+/*	$NetBSD: OsdHardware.c,v 1.13 2021/12/31 17:22:15 riastradh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.12 2020/01/17 17:06:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.13 2021/12/31 17:22:15 riastradh Exp $");
 
 #include 
 #include 
@@ -224,15 +224,15 @@ AcpiOsReadPciConfiguration(ACPI_PCI_ID *
 
 	switch (Width) {
 	case 8:
-		*(uint8_t *) Value = (tmp >> ((Register & 3) * 8)) & 0xff;
+		*Value = (tmp >> ((Register & 3) * 8)) & 0xff;
 		break;
 
 	case 16:
-		*(uint16_t *) Value = (tmp >> ((Register & 3) * 8)) & 0x;
+		*Value = (tmp >> ((Register & 3) * 8)) & 0x;
 		break;
 
 	case 32:
-		*(uint32_t *) Value = tmp;
+		*Value = tmp;
 		break;
 
 	default:



CVS commit: src/sys/dev/acpi/acpica

2021-12-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec 31 17:22:15 UTC 2021

Modified Files:
src/sys/dev/acpi/acpica: OsdHardware.c

Log Message:
acpi(9): Return full 64-bit object to caller in PCI config read.

The value of the object will be as small as requested, but the whole
uint64_t object will be written as the caller of a space handler
expects, instead of just part of it.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/acpi/acpica/OsdHardware.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/acpi/acpica

2021-12-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec 31 14:22:26 UTC 2021

Modified Files:
src/sys/dev/acpi/acpica: OsdSchedule.c

Log Message:
acpi(9): Implement AcpiOsWaitEventsComplete.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/acpi/acpica/OsdSchedule.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpica/OsdSchedule.c
diff -u src/sys/dev/acpi/acpica/OsdSchedule.c:1.19 src/sys/dev/acpi/acpica/OsdSchedule.c:1.20
--- src/sys/dev/acpi/acpica/OsdSchedule.c:1.19	Sun Nov 12 02:59:55 2017
+++ src/sys/dev/acpi/acpica/OsdSchedule.c	Fri Dec 31 14:22:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdSchedule.c,v 1.19 2017/11/12 02:59:55 christos Exp $	*/
+/*	$NetBSD: OsdSchedule.c,v 1.20 2021/12/31 14:22:26 riastradh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.19 2017/11/12 02:59:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.20 2021/12/31 14:22:26 riastradh Exp $");
 
 #include 
 #include 
@@ -101,6 +101,10 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, AC
 {
 	int pri;
 
+	/*
+	 * If you raise any priority here make sure to adjust
+	 * AcpiOsWaitEventsComplete too.
+	 */
 	switch (Type) {
 	case OSL_GPE_HANDLER:
 		pri = 10;
@@ -185,14 +189,13 @@ AcpiOsGetTimer(void)
 }
 
 /*
- *
  * AcpiOsWaitEventsComplete:
  *
- * 	Wait for all asynchronous events to complete. This implementation
- *	does nothing.
+ * 	Wait for all asynchronous events to complete.
  */
 void
 AcpiOsWaitEventsComplete(void)
 {
-	return;
+	/* Highest priority used by AcpiOsExecute.  */
+	sysmon_task_queue_barrier(10);
 }



CVS commit: src/sys/dev/acpi/acpica

2021-12-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Dec 31 14:22:26 UTC 2021

Modified Files:
src/sys/dev/acpi/acpica: OsdSchedule.c

Log Message:
acpi(9): Implement AcpiOsWaitEventsComplete.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/acpi/acpica/OsdSchedule.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/dev/acpi/acpica

2009-03-31 Thread Andrew Doran
On Tue, Mar 31, 2009 at 05:17:47PM +, Matthias Drochner wrote:

 Module Name:  src
 Committed By: drochner
 Date: Tue Mar 31 17:17:47 UTC 2009
 
 Modified Files:
   src/sys/dev/acpi/acpica: OsdSchedule.c OsdSynch.c
 
 Log Message:
 avoid tsleep also during shutdown (and in particular ACPI poweroff),
 should fix PR kern/39141 by Takahiro Kambe and PR port-i386/41110
 by Reinoud Zandijk

Thank you for fixing an annoying panic. However it's one of many hacks to be
applied to this. There's no good reason for interrupts to be off while the
shutdown hooks are being processed.