Skip to content
Snippets Groups Projects
  1. Jan 21, 2013
  2. Jan 18, 2013
  3. Jan 17, 2013
  4. Jan 10, 2013
    • Alessandro Rubini's avatar
      bugfix for buffer change (long standing race condition) · 2672b21a
      Alessandro Rubini authored
      
      When the current buffer is changed, there should be no
      users on the channels (otherwise, either a user block
      is being produced/consumed or there's somebody sleeping
      on the wq of the buffer instance).
      
      This prevents changing the buffer if in use, and prevents
      users from opening a channel if the buffer is being changed.
      We use the "disabled" flag for the buffer, not used so far.
      
      We noticed this while working on buffer changes (see previous
      commit). I'm unable to backport this to the proper place in the
      history because it relies on the new locking introduced by this branch.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
      2672b21a
    • Alessandro Rubini's avatar
      713d29ad
    • Alessandro Rubini's avatar
      zio.h and docs: introduce ZIO_CSET_SELF_TIMED · 23236075
      Alessandro Rubini authored
      
      The flag is need so self-timed devices, like a TDC, can have their
      trigger continuously armed (see next commit).
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
      23236075
    • Alessandro Rubini's avatar
      zio-trigger.h: offer zio_generic_data_done() as inline function · 90c6f046
      Alessandro Rubini authored
      
      The function used to be called __zio_internal_data_done, in
      heklpers.c.  Being used once only, it was expanded inline by the
      compiler, so nothing changes for previous code.
      
      However, if a trigger needs to implement its own data_done method, it
      will most likely need to replicate this code, so it's better made
      avaiable directly to everybody.  An alternative would be running this
      code every time, before or after calling t_op->data_done, but we'd
      better let each trigger choose the order of its own operations.
      
      Actually, there is one difference: the input active block is set to NULL
      after being stored to the current buffer, so the later implementation
      of stop_io (used in zio-irq-tdc.c) won't expose a bug.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
      90c6f046
    • Alessandro Rubini's avatar
      core: change some internals for triggers · a496ca04
      Alessandro Rubini authored
      
      This is the first step of a series of changes aimed at a cleaner and
      more flexible management of triggers, as well as a really transparent
      "user" trigger.
      
      This commit does the following:
      
      - zio_fire_trigger renamed to zio_arm_trigger: the trigger is
      actually armed by software, and then it fires by hardware. This
      distinction is especially important for the transparent trigger: when
      devices have internal timing, the software trigger must arm it
      immediately (as opposed to the dumb devices, where the software trigger
      really causes I/O to happen).
      
      - ZIO_TI_BUSY renamed to ZIO_TI_ARMED. Also, ZIO_TI_COMPLETING is
      removed. The new, simplified policy is like this: the trigger is armed
      by software (the trigger module), but completion is driven by hardware
      (the device module).  There is no need for a COMPLETING flag, because
      the ARMED flag is only cleared after data_done is over for all channels
      in the cset.
      
      - the cset spinlock is used to protect all changes of the ti flags.
      
      - change_current_trigger completely revised and fixed to match new
      conventions.
      
      - trigger->abort now takes "ti" instead of "cset" as argument; it is
      more natural do do so, and no current trigger implements abort so no
      harm is done.
      
      - the trigger->abort and trigger->change_status methods are now
      always called while holding the cset spinlock. ZIO core calls abort
      when changing the current trigger type, to ensure no pending blocks
      are there.
      
      - zio_trigger_abort is renamed to zio_trigger_abort_disable, with
      an additional argument to state whether the trigger must be atomically
      disabled after the abort is over. This avoids a race condition on
      trigger removal. It returns the previous "disabled" bit, to be used
      when changing a buffer type while preserving trigger status.
      
      - minor unrelated improvements in error management in objects.c.
      
      - documentation update to match the new locking, and a few typos fixed.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
      a496ca04
  5. Nov 29, 2012
  6. Nov 25, 2012
  7. Nov 24, 2012
  8. Nov 11, 2012
  9. Nov 09, 2012
  10. Nov 08, 2012
  11. Nov 05, 2012
  12. Nov 04, 2012
  13. Nov 03, 2012
  14. Nov 01, 2012
  15. Oct 31, 2012
  16. Oct 29, 2012
    • Alessandro Rubini's avatar
      buffers: properly handle retr_block called by push · 2300e624
      Alessandro Rubini authored
      
      buffer->store_block calls trigger->push_block when it receives the
      first block. The trigger user fires directly , and if the device
      accepts the data immediately, our data_done() will retr_block from the
      buffer.  This happens with zio-zero, cset 1, and leads to a deadlock.
      
      To allow immediate success of push_block down to device level, release
      the lock before calling push_block. The code here also handles
      pathologic situations like two processes storing at the same time.
      
      Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
      Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
      2300e624
  17. Oct 26, 2012