1. 18 2月, 2018 1 次提交
  2. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  3. 08 1月, 2018 1 次提交
  4. 29 11月, 2017 1 次提交
  5. 02 3月, 2017 1 次提交
  6. 11 1月, 2017 6 次提交
  7. 24 9月, 2016 1 次提交
  8. 06 9月, 2016 1 次提交
  9. 21 8月, 2016 1 次提交
    • B
      iio: fix sched WARNING "do not call blocking ops when !TASK_RUNNING" · fcf68f3c
      Brian Norris 提交于
      When using CONFIG_DEBUG_ATOMIC_SLEEP, the scheduler nicely points out
      that we're calling sleeping primitives within the wait_event loop, which
      means we might clobber the task state:
      
      [   10.831289] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffc00026b610>]
      [   10.845531] ------------[ cut here ]------------
      [   10.850161] WARNING: at kernel/sched/core.c:7630
      ...
      [   12.164333] ---[ end trace 45409966a9a76438 ]---
      [   12.168942] Call trace:
      [   12.171391] [<ffffffc00024ed44>] __might_sleep+0x64/0x90
      [   12.176699] [<ffffffc000954774>] mutex_lock_nested+0x50/0x3fc
      [   12.182440] [<ffffffc0007b9424>] iio_kfifo_buf_data_available+0x28/0x4c
      [   12.189043] [<ffffffc0007b76ac>] iio_buffer_ready+0x60/0xe0
      [   12.194608] [<ffffffc0007b7834>] iio_buffer_read_first_n_outer+0x108/0x1a8
      [   12.201474] [<ffffffc000370d48>] __vfs_read+0x58/0x114
      [   12.206606] [<ffffffc000371740>] vfs_read+0x94/0x118
      [   12.211564] [<ffffffc0003720f8>] SyS_read+0x64/0xb4
      [   12.216436] [<ffffffc000203cb4>] el0_svc_naked+0x24/0x28
      
      To avoid this, we should (a la https://lwn.net/Articles/628628/) use the
      wait_woken() function, which avoids the nested sleeping while still
      handling races between waiting / wake-events.
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Cc: <Stable@vger.kernel.org> # 3.19+ for introduction of wake_woken
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      fcf68f3c
  10. 28 3月, 2016 1 次提交
    • I
      iio: fix config watermark initial value · 1bef2c1d
      Irina Tirdea 提交于
      config structure is set to 0 when updating the buffers, so by
      default config->watermark will be 0. When computing the minimum
      between config->watermark and the buffer->watermark or
      insert_buffer-watermark, this will always be 0 regardless of the
      value set by the user for the buffer.
      
      Set as initial value for config->watermark the maximum allowed
      value so that the minimum value will always be set from one of the
      buffers.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Fixes: f0566c0c ("iio: Set device watermark based on watermark of all
      attached buffers")
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      1bef2c1d
  11. 07 2月, 2016 1 次提交
  12. 22 11月, 2015 1 次提交
  13. 25 10月, 2015 4 次提交
  14. 13 8月, 2015 1 次提交
  15. 03 8月, 2015 1 次提交
  16. 21 6月, 2015 1 次提交
  17. 01 6月, 2015 4 次提交
  18. 23 5月, 2015 3 次提交
    • L
      iio: __iio_update_buffers: Leave device in sane state on error · 1250186a
      Lars-Peter Clausen 提交于
      Currently when something goes wrong at some step when disabling the buffers
      we immediately abort. This has the effect that the enable/disable calls are
      no longer balanced. So make sure that even if one step in the disable
      sequence fails the other steps are still executed.
      
      The other issue is that when either enable or disable fails buffers that
      were active at that time stay active while the device itself is disabled.
      This leaves things in a inconsistent state and can cause unbalanced
      enable/disable calls. Furthermore when enable fails we restore the old scan
      mask, but still keeps things disabled.
      
      Given that verification of the configuration was performed earlier and it
      is valid at the point where we try to enable/disable the most likely reason
      of failure is a communication failure with the device or maybe a
      out-of-memory situation. There is not really a good recovery strategy in
      such a case, so it makes sense to leave the device disabled, but we should
      still leave it in a consistent state.
      
      What the patch does if disable/enable fails is to deactivate all buffers
      and make sure that the device will be in the same state as if all buffers
      had been manually disabled.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      1250186a
    • L
      iio: __iio_update_buffers: Split enable and disable path into helper functions · 623d74e3
      Lars-Peter Clausen 提交于
      __iio_update_buffers is already a rather large function with many different
      error paths and it is going to get even larger. This patch factors out the
      device enable and device disable paths into separate helper functions.
      
      The patch also re-implements iio_disable_all_buffers() using the new
      iio_disable_buffers() function removing a fair bit of redundant code.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      623d74e3
    • L
      iio: __iio_update_buffers: Verify configuration before starting to apply it · 6e509c4d
      Lars-Peter Clausen 提交于
      Currently __iio_update_buffers() verifies whether the new configuration
      will work in the middle of the update sequence. This means if the new
      configuration is invalid we need to rollback the changes already made. This
      patch moves the validation of the new configuration at the beginning of
      __iio_update_buffers() and will not start to make any changes if the new
      configuration is invalid.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      6e509c4d
  19. 17 5月, 2015 3 次提交
  20. 29 3月, 2015 2 次提交
    • O
      iio: add support for hardware fifo · f4f4673b
      Octavian Purdila 提交于
      Some devices have hardware buffers that can store a number of samples
      for later consumption. Hardware usually provides interrupts to notify
      the processor when the FIFO is full or when it has reached a certain
      watermark level. This helps with reducing the number of interrupts to
      the host processor and thus it helps decreasing the power consumption.
      
      This patch enables usage of hardware FIFOs for IIO devices in
      conjunction with software device buffers. When the hardware FIFO is
      enabled the samples are stored in the hardware FIFO. The samples are
      later flushed to the device software buffer when the number of entries
      in the hardware FIFO reaches the hardware watermark or when a flush
      operation is triggered by the user when doing a non-blocking read
      on an empty software device buffer.
      
      In order to implement hardware FIFO support the device drivers must
      implement the following new operations: setting and getting the
      hardware FIFO watermark level, flushing the hardware FIFO to the
      software device buffer. The device must also expose information about
      the hardware FIFO such it's minimum and maximum watermark and if
      necessary a list of supported watermark values. Finally, the device
      driver must activate the hardware FIFO when the device buffer is
      enabled, if the current device settings allows it.
      
      The software device buffer watermark is passed by the IIO core to the
      device driver as a hint for the hardware FIFO watermark. The device
      driver can adjust this value to allow for hardware limitations (such
      as capping it to the maximum hardware watermark or adjust it to a
      value that is supported by the hardware). It can also disable the
      hardware watermark (and implicitly the hardware FIFO) it this value is
      below the minimum hardware watermark.
      
      Since a driver may support hardware FIFO only when not in triggered
      buffer mode (due to different semantics of hardware FIFO sampling and
      triggered sampling) this patch changes the IIO core code to allow
      falling back to non-triggered buffered mode if no trigger is enabled.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      f4f4673b
    • J
      iio: add watermark logic to iio read and poll · 37d34556
      Josselin Costanzi 提交于
      Currently the IIO buffer blocking read only wait until at least one
      data element is available.
      This patch makes the reader sleep until enough data is collected before
      returning to userspace. This should limit the read() calls count when
      trying to get data in batches.
      
      Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr>
      Signed-off-by: NJosselin Costanzi <josselin.costanzi@mobile-devices.fr>
      [rebased and remove buffer timeout]
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      37d34556
  21. 05 2月, 2015 1 次提交
  22. 26 1月, 2015 1 次提交
  23. 06 1月, 2015 1 次提交
  24. 12 12月, 2014 1 次提交