Skip to content
Snippets Groups Projects
  • Alessandro Rubini's avatar
    core and triggers: a trigger should start disabled · 740978cf
    Alessandro Rubini authored
    
    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: default avatarAlessandro Rubini <rubini@gnudd.com>
    Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
    740978cf