summaryrefslogtreecommitdiff
path: root/sys/dev/sysmon
AgeCommit message (Collapse)Author
2020-06-07Pull up following revision(s) (requested by riastradh in ticket #946):martin
sys/dev/sysmon/sysmon_envsys.c: revision 1.145 Don't queue sysmon refresh until the rndsource is attached. Using the rndsource, as refreshing the sensors will do, is not allowed until _after_ rnd_source_attach. XXX pullup-7 XXX pullup-8 XXX pullup-9
2019-09-01Pull up following revision(s) (requested by maxv in ticket #128):martin
sys/dev/sysmon/sysmon_power.c: revision 1.61 Fix info leak, not all of 'pev' is initialized.
2019-08-26Pull up following revision(s) (requested by nakayama in ticket #118):martin
sys/dev/sysmon/sysmon.c: revision 1.30 Module class of sysmon_envsys, sysmon_wdog and sysmon_power is MODULE_CLASS_DRIVER, not MODULE_CLASS_MISC. Fix that invoking envsys without sysmon_envsys kernel module failes with: WARNING: module error: incompatible module class for `sysmon_envsys' (1 != 3)
2019-04-26Set the "required modules" to NULL, not to an empty string.pgoyette
It really doesn't make that much difference to the code, but the output from modstat(8) is different! (With an empty string in the MODULE() macro modstat reports an empty string, but with a NULL in the macro, modstat prints a '-' just like it does for other "empty" fields.)
2019-03-27Don't create the driver's workqueue twice!pgoyette
The driver is modular, so its modcmd(MOULE_CMD_INIT) always gets called whether or not the driver is built-in to the kernel. The modcmd init code always calls swwdogattach() which creates the workqueue. Therefore there's no need to also create it in swwdog_attach() (used to attach a device instance).
2019-03-26in sysmon_envsys_unregister(): loop over sme_sensors_list with TAILQ_FIRSTbad
instead of TAILQ_FOREACH. sysmon_envsys_sensor_detach() removes the sensor from sme_sensors_list. Hence using TAILQ_FOREACH is not safe. Suggested by thorpej and jmcneill. Thanks!
2019-03-01Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as brieflypgoyette
discussed on irc. NFCI intended. Ride the earlier kernel bump - it;s getting crowded.
2019-01-27Merge the [pgoyette-compat] branchpgoyette
2018-05-27Add support for light sensors that report Illuminance in lux.thorpej
2018-05-26Avoid dereferencing NULL if we attempt to look up an known unit type.thorpej
2018-05-05Defend against some table-lookup-not-found errors.pgoyette
2018-02-08Typos.dholland
2017-10-25Use C99 initializer for filteropsmaya
Mostly done with spatch with touchups for indentation @@ expression a; identifier b,c,d; identifier p; @@ const struct filterops p = - { a, b, c, d + { + .f_isfd = a, + .f_attach = b, + .f_detach = c, + .f_event = d, };
2017-09-11Improve tracking of the state of an event's callout, and protect allpgoyette
queries or modifications of the state with the sme_mtx mutex. Detach the rndsrc before re-attaching it (with potentially new values). Clean up some lock-ordering issues. And a couple of KNF issues for good measure! Should address PR kern/52533 XXX Pullup-8 along with the previous fixes from msaitoh@ XXX http://mail-index.netbsd.org/source-changes/2017/09/06/msg088028.html ~ ~
2017-09-06 Fixes a problem that some driver(e.g. acpitz(4) or coretemp(5)) whichmsaitoh
use sysmon_envsys sleep waiting at "rndsrc" when "drvctl -d". Don't call rnd_detach_source() in sme_remove_event() which is called from sme_event_unregister_all(). Instead, call rnd_detach_source() in sysmon_envsys_sensor_detach() and call sysmon_envsys_sensor_detach() before sme_event_unregister_sensor(). Each sensor(envsys_data) has each rnd_src, but some sme_events point to the same rnd_src in a sensor. Calling rnd_detach_souce() twice with the same rnd_src brokes a reference count in rnd_src. OK'd by pgoyette@.
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
2015-12-14sysmon's components need to be MODULE_CLASS_DRIVER so they will getpgoyette
initialized before we configure/initialize any devices that interact with them. Thanks, marty!
2015-12-13Note the sensor number in the error output. Useful for drivers addingjdc
multiple sensors.
2015-10-15As proposed inbouyer
https://mail-index.netbsd.org/tech-kern/2015/10/14/msg019511.html don't sleep on sme->sme_mtx in the callout but use mutex_tryenter() and just reschedule the callout if we can't get the mutex now. This fixes a deadlock which can happen if the backed wants to sleep with timeout (e.g. cv_timedwait()) as the backed is called with sme->sme_mtx held. This is a stopgap measure for netbsd-7; sysmon should be changed to not sleep (or call a backend which will sleep) with mutexes held.
2015-08-24to garnish, dust with _KERNEL_OPTpooka
2015-06-23Separate the two conditions for the KASSERT, so we can tell whichpgoyette
one occurred.
2015-06-23Fix the KASSERT - we want to make sure that _both_ pointers are non-NULL,pgoyette
n ot just that one or the other is non-NULL!
2015-06-05Move callout_init to wdog_preinitmatt
2015-05-12Finish work started in previous commit. Ensure that initializationpgoyette
code is only called once for built-in variants of the module.
2015-05-12Don't manipulate the autoconfig databases for built-in module.pgoyette
Thanks, christos!
2015-05-05Optimize a bit - don't re-enter the mutex if we're just going to exit.pgoyette
While here, remove some parens around a return value.
2015-05-05If module_autoload() returns an error, just return that value insteadpgoyette
of overwriting with ENODEV. Thanks, christos!
2015-05-04If autoload of the subcomponent module fails, don't try to call itspgoyette
open routine. Just return an error. Hopefully this will fix the recently reported issues with atf tests running on xen guest.
2015-04-29At suggestion from riastradh@ ...pgoyette
Remove auto_configure(9) goop from sysmon device. It does make things a bit cleaner, and also reduces source code by about 10%. Tested via QEMU with no obvious side-effects.
2015-04-28sysmon_task_queue_sched needs to RUN_ONCE(tq_preinit) as well, it canmartin
be called from sysmon_envsys_register() early.
2015-04-27Replace a home-grown run-once implementation with the real RUN_ONCE()pgoyette
2015-04-25Remove another debug printf() that snuck in.pgoyette
2015-04-25Handle early initialization requirements - thanks martin@ and otherspgoyette
2015-04-25Correctly check return status when registering with pmfpgoyette
2015-04-25Fix typo - thanks, riz@pgoyette
2015-04-25Register the sysmon pseudo-device with power management framework so wepgoyette
can properly suspend the system. Thanks, mrg, for pointing this out.
2015-04-25make things boot again, from martin.christos
2015-04-25Use tabs for indentation.pgoyette
2015-04-25Release the mutex in the error path.pgoyette
2015-04-24We only need the _cd when we are a module.christos
2015-04-24The sysmon_envsys module also depends on sysmon_power (for delivery ofpgoyette
sensor events to userland).
2015-04-24With new (corrected) configuration declarations file, the cdevsw ispgoyette
already included by config. So, for built-in sysmon module we don't need to add the cdevsw to the table.
2015-04-24Update configuration definitions for new sysmonpgoyette
2015-04-24Remove a left-over debugging printf()pgoyette
2015-04-24This really does need to return an error code, so change thepgoyette
sysmon_task_queue_fini() function to have a non-void type.
2015-04-24It's a function returning void; don't return an error code.agc
2015-04-23Update module dependencies for all the existing modules that depend on ↵pgoyette
sysmon components.
2015-04-23Modularize sysmon and its componentspgoyette
2015-04-18Remove some debugging printf()s that were erroneously committed.pgoyette
2015-04-18use unsigned type for flag bits.mlelstv