Skip to content
  • Alessandro Rubini's avatar
    bugfix: sysfs: change interaction of configuration and data I/O · 12b314ea
    Alessandro Rubini authored
    
    
    When a process is writing and another process is changing the
    configuration, it may happen that the trigger-related store calling
    abort_disable() zeroes the active_block that is already being pushed
    by the other process.
    
    This fixes the interaction by keeping the cset spinlock during the whole
    configuration of a sysfs attribute, thus preventing a write to sneak in.
    
    After changing parameters, if the trigger was armed, the code re-arms
    it, and this covers self-timed devices.  The choice helps simple tests
    from the shell, but serious users will likely want to manually disable
    the trigger before reconfiguring it.
    
    Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
    Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
    12b314ea