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): Don't touch sc->sc_state outside sc-...



details:   https://anonhg.NetBSD.org/src/rev/88b8a631ec2a
branches:  trunk
changeset: 377588:88b8a631ec2a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jul 18 10:05:01 2023 +0000

description:
acpiec(4): Don't touch sc->sc_state outside sc->sc_mtx.

diffstat:

 sys/dev/acpi/acpi_ec.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 14fefbe8514d -r 88b8a631ec2a sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c    Tue Jul 18 10:04:50 2023 +0000
+++ b/sys/dev/acpi/acpi_ec.c    Tue Jul 18 10:05:01 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_ec.c,v 1.95 2023/07/18 10:04:50 riastradh Exp $   */
+/*     $NetBSD: acpi_ec.c,v 1.96 2023/07/18 10:05:01 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.95 2023/07/18 10:04:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.96 2023/07/18 10:05:01 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_acpi_ec.h"
@@ -689,10 +689,10 @@ acpiec_read(device_t dv, uint8_t addr, u
                        acpiec_gpe_state_machine(dv);
                }
                if (sc->sc_state != EC_STATE_FREE) {
+                       aprint_error_dev(dv, "command timed out, state %d\n",
+                           sc->sc_state);
                        mutex_exit(&sc->sc_mtx);
                        acpiec_unlock(dv);
-                       aprint_error_dev(dv, "command timed out, state %d\n",
-                           sc->sc_state);
                        return AE_ERROR;
                }
        } else {
@@ -762,10 +762,10 @@ acpiec_write(device_t dv, uint8_t addr, 
                        acpiec_gpe_state_machine(dv);
                }
                if (sc->sc_state != EC_STATE_FREE) {
+                       aprint_error_dev(dv, "command timed out, state %d\n",
+                           sc->sc_state);
                        mutex_exit(&sc->sc_mtx);
                        acpiec_unlock(dv);
-                       aprint_error_dev(dv, "command timed out, state %d\n",
-                           sc->sc_state);
                        return AE_ERROR;
                }
        } else {



Home | Main Index | Thread Index | Old Index