Module Name: src Committed By: snj Date: Sat Sep 23 17:22:49 UTC 2017
Modified Files: src/sys/dev/sysmon [netbsd-8]: sysmon_envsys.c sysmon_envsys_events.c sysmonvar.h Log Message: Pull up following revision(s) (requested by pgoyette in ticket #281): sys/dev/sysmon/sysmon_envsys.c: 1.140-1.141 sys/dev/sysmon/sysmon_envsys_events.c: 1.120-1.121 sys/dev/sysmon/sysmonvar.h: 1.50 Fixes a problem that some driver(e.g. acpitz(4) or coretemp(5)) which 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@. -- Improve tracking of the state of an event's callout, and protect all 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 To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.139.10.1 src/sys/dev/sysmon/sysmon_envsys.c cvs rdiff -u -r1.119 -r1.119.2.1 src/sys/dev/sysmon/sysmon_envsys_events.c cvs rdiff -u -r1.49 -r1.49.10.1 src/sys/dev/sysmon/sysmonvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.