Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Defer power monitor polling to the sysmon taskq ...



details:   https://anonhg.NetBSD.org/src/rev/21d6d7e78f32
branches:  trunk
changeset: 460784:21d6d7e78f32
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 03 22:55:34 2019 +0000

description:
Defer power monitor polling to the sysmon taskq thread to avoid i2c transactions in intr context

diffstat:

 sys/dev/i2c/tps65217pmic.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r 1e147c02cb31 -r 21d6d7e78f32 sys/dev/i2c/tps65217pmic.c
--- a/sys/dev/i2c/tps65217pmic.c        Sun Nov 03 13:45:57 2019 +0000
+++ b/sys/dev/i2c/tps65217pmic.c        Sun Nov 03 22:55:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tps65217pmic.c,v 1.13 2019/10/27 20:11:13 jmcneill Exp $ */
+/*     $NetBSD: tps65217pmic.c,v 1.14 2019/11/03 22:55:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_fdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.13 2019/10/27 20:11:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.14 2019/11/03 22:55:34 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -49,6 +49,7 @@
 #include <dev/i2c/i2cvar.h>
 
 #include <dev/sysmon/sysmonvar.h>
+#include <dev/sysmon/sysmon_taskq.h>
 
 #include <dev/i2c/tps65217pmicreg.h>
 #include <dev/i2c/tps65217pmicvar.h>
@@ -419,7 +420,7 @@
 }
 
 static void
-tps65217pmic_power_monitor(void *aux)
+tps65217pmic_power_monitor_task(void *aux)
 {
        struct tps65217pmic_softc *sc;
        uint8_t status;
@@ -462,6 +463,12 @@
 }
 
 static void
+tps65217pmic_power_monitor(void *aux)
+{
+       sysmon_task_queue_sched(0, tps65217pmic_power_monitor_task, aux);
+}
+
+static void
 tps65217pmic_wled_init(struct tps65217pmic_softc *sc, int isel, int fdim,
                       int brightness)
 {



Home | Main Index | Thread Index | Old Index