core and triggers: a trigger should start disabled
If the trigger is enabled on creation, it may fire before the cset is ready. This happened to me with "modprobe zio-zero trigger=irq". For this reason it must start disabled. Also, the create method MUST set ti->cset before activating the trigger, because the cset lock is needed to access the enable/disable flag. The commit adds a WARN() if the field is not set after creation, then it leaves it zeroed to ensure the system will crash, instead of having a subtle race. Also, add a pair of FIXME notes about the need to allow changing a trigger type while leaving the new one disabled. Signed-off-by:Alessandro Rubini <rubini@gnudd.com> Acked-by:
Federico Vaga <federico.vaga@gmail.com>
Showing
- doc/zio-manual.in 5 additions, 3 deletionsdoc/zio-manual.in
- helpers.c 0 additions, 4 deletionshelpers.c
- objects.c 18 additions, 5 deletionsobjects.c
- triggers/zio-trig-hrt.c 2 additions, 0 deletionstriggers/zio-trig-hrt.c
- triggers/zio-trig-irq.c 2 additions, 0 deletionstriggers/zio-trig-irq.c
- triggers/zio-trig-timer.c 2 additions, 0 deletionstriggers/zio-trig-timer.c
- triggers/zio-trig-user.c 2 additions, 0 deletionstriggers/zio-trig-user.c
Please register or sign in to comment