Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi acpiec(4): Assert state is free when we start a...
details: https://anonhg.NetBSD.org/src/rev/55f98a7c5c38
branches: trunk
changeset: 377583:55f98a7c5c38
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Jul 18 10:03:59 2023 +0000
description:
acpiec(4): Assert state is free when we start a transaction.
No functional change intended.
diffstat:
sys/dev/acpi/acpi_ec.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (45 lines):
diff -r d14611fb9416 -r 55f98a7c5c38 sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c Tue Jul 18 10:03:46 2023 +0000
+++ b/sys/dev/acpi/acpi_ec.c Tue Jul 18 10:03:59 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_ec.c,v 1.90 2023/07/18 10:03:46 riastradh Exp $ */
+/* $NetBSD: acpi_ec.c,v 1.91 2023/07/18 10:03:59 riastradh Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.90 2023/07/18 10:03:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.91 2023/07/18 10:03:59 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_acpi_ec.h"
@@ -671,6 +671,8 @@ acpiec_read(device_t dv, uint8_t addr, u
curlwp->l_name ? curlwp->l_name : "",
addr);
+ KASSERT(sc->sc_state == EC_STATE_FREE);
+
sc->sc_cur_addr = addr;
sc->sc_state = EC_STATE_READ;
@@ -737,6 +739,8 @@ acpiec_write(device_t dv, uint8_t addr,
curlwp->l_name ? curlwp->l_name : "",
addr, val);
+ KASSERT(sc->sc_state == EC_STATE_FREE);
+
sc->sc_cur_addr = addr;
sc->sc_cur_val = val;
sc->sc_state = EC_STATE_WRITE;
@@ -899,6 +903,8 @@ loop:
DPRINTF(ACPIEC_DEBUG_QUERY, sc, "SCI query\n");
+ KASSERT(sc->sc_state == EC_STATE_FREE);
+
/* The Query command can always be issued, so be defensive here. */
sc->sc_got_sci = false;
sc->sc_state = EC_STATE_QUERY;
Home |
Main Index |
Thread Index |
Old Index