1. 07 Oct, 2016 1 commit
  2. 09 Sep, 2016 2 commits
  3. 22 Aug, 2016 8 commits
  4. 21 Aug, 2016 9 commits
    • Colin Ian King's avatar
      staging: wilc1000: correctly check if associatedsta has not been found · 6c08fda0
      Colin Ian King authored
      The current check for associatedsta being set to -1 to indicate it has
      not been found is not working because associatedsta is initialized to
      zero and will never be -1.  Fix this by initializing it to ~0 and checking
      for ~0 instead.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c08fda0
    • Dan Carpenter's avatar
      staging: wilc1000: NULL dereference on error · 23436825
      Dan Carpenter authored
      We can't pass NULL pointers to destroy_workqueue().
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      23436825
    • Binoy Jayan's avatar
      staging: wilc1000: txq_event: Fix coding error · 23535c13
      Binoy Jayan authored
      Fix incorrect usage of completion interface by replacing
      'wait_for_completion' with 'complete'. This error was introduced
      accidentally while replacing semaphores with mutexes.
      Reported-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarBinoy Jayan <binoy.jayan@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      23535c13
    • Ian Abbott's avatar
      staging: comedi: ni_mio_common: fix AO inttrig backwards compatibility · f0f4b0cc
      Ian Abbott authored
      Commit ebb657ba ("staging: comedi: ni_mio_common: clarify the
      cmd->start_arg validation and use") introduced a backwards compatibility
      issue in the use of asynchronous commands on the AO subdevice when
      `start_src` is `TRIG_EXT`.  Valid values for `start_src` are `TRIG_INT`
      (for internal, software trigger), and `TRIG_EXT` (for external trigger).
      When set to `TRIG_EXT`.  In both cases, the driver relies on an
      internal, software trigger to set things up (allowing the user
      application to write sufficient samples to the data buffer before the
      trigger), so it acts as a software "pre-trigger" in the `TRIG_EXT` case.
      The software trigger is handled by `ni_ao_inttrig()`.
      
      Prior to the above change, when `start_src` was `TRIG_INT`, `start_arg`
      was required to be 0, and `ni_ao_inttrig()` checked that the software
      trigger number was also 0.  After the above change, when `start_src` was
      `TRIG_INT`, any value was allowed for `start_arg`, and `ni_ao_inttrig()`
      checked that the software trigger number matched this `start_arg` value.
      The backwards compatibility issue is that the internal trigger number
      now has to match `start_arg` when `start_src` is `TRIG_EXT` when it
      previously had to be 0.
      
      Fix the backwards compatibility issue in `ni_ao_inttrig()` by always
      allowing software trigger number 0 when `start_src` is something other
      than `TRIG_INT`.
      
      Thanks to Spencer Olson for reporting the issue.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reported-by: default avatarSpencer Olson <olsonse@umich.edu>
      Fixes: ebb657ba ("staging: comedi: ni_mio_common: clarify the cmd->start_arg validation and use")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0f4b0cc
    • Dan Carpenter's avatar
      staging: comedi: dt2811: fix a precedence bug · 5ac5c3bc
      Dan Carpenter authored
      Bitwise | has higher precedence than ?: so we need to add some
      parenthesis for this to work as intended.
      
      Fixes: 7c957409 ('staging: comedi: dt2811: simplify A/D reference configuration')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ac5c3bc
    • Phil Turnbull's avatar
      staging: comedi: adv_pci1760: Do not return EINVAL for CMDF_ROUND_DOWN. · c71f20ee
      Phil Turnbull authored
      The CMDF_ROUND_DOWN case falls through and so always returns -EINVAL.
      
      Fixes: 14b93bb6 ("staging: comedi: adv_pci_dio: separate out PCI-1760 support")
      Signed-off-by: default avatarPhil Turnbull <phil.turnbull@oracle.com>
      Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c71f20ee
    • Ian Abbott's avatar
      staging: comedi: ni_mio_common: fix wrong insn_write handler · 5ca05345
      Ian Abbott authored
      For counter subdevices, the `s->insn_write` handler is being set to the
      wrong function, `ni_tio_insn_read()`.  It should be
      `ni_tio_insn_write()`.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reported-by: default avatarÉric Piel <piel@delmic.com>
      Fixes: 10f74377 ("staging: comedi: ni_tio: make ni_tio_winsn() a
        proper comedi (*insn_write)"
      Cc: <stable@vger.kernel.org> # 3.17+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ca05345
    • Ian Abbott's avatar
      staging: comedi: comedi_test: fix timer race conditions · 403fe7f3
      Ian Abbott authored
      Commit 73e0e4df ("staging: comedi: comedi_test: fix timer lock-up")
      fixed a lock-up in the timer routine `waveform_ai_timer()` (which was
      called `waveform_ai_interrupt()` at the time) caused by
      commit 24051247 ("staging: comedi: comedi_test: use
      comedi_handle_events()").  However, it introduced a race condition that
      can result in the timer routine misbehaving, such as accessing freed
      memory or dereferencing a NULL pointer.
      
      73e0... changed the timer routine to do nothing unless a
      `WAVEFORM_AI_RUNNING` flag was set, and changed `waveform_ai_cancel()`
      to clear the flag and replace a call to `del_timer_sync()` with a call
      to `del_timer()`.  `waveform_ai_cancel()` may be called from the timer
      routine itself (via `comedi_handle_events()`), or from `do_cancel()`.
      (`do_cancel()` is called as a result of a file operation (usually a
      `COMEDI_CANCEL` ioctl command, or a release), or during device removal.)
      When called from `do_cancel()`, the call to `waveform_ai_cancel()` is
      followed by a call to `do_become_nonbusy()`, which frees up stuff for
      the current asynchronous command under the assumption that it is now
      safe to do so.  The race condition occurs when the timer routine
      `waveform_ai_timer()` checks the `WAVEFORM_AI_RUNNING` flag just before
      it is cleared by `waveform_ai_cancel()`, and is still running during the
      call to `do_become_nonbusy()`.  In particular, it can lead to a NULL
      pointer dereference:
      
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<ffffffffc0c63add>] waveform_ai_timer+0x17d/0x290 [comedi_test]
      
      That corresponds to this line in `waveform_ai_timer()`:
      
      		unsigned int chanspec = cmd->chanlist[async->cur_chan];
      
      but `do_become_nonbusy()` frees `cmd->chanlist` and sets it to `NULL`.
      
      Fix the race by calling `del_timer_sync()` instead of `del_timer()` in
      `waveform_ai_cancel()` when not in an interrupt context.  The only time
      `waveform_ai_cancel()` is called in an interrupt context is when it is
      called from the timer routine itself, via `comedi_handle_events()`.
      
      There is no longer any need for the `WAVEFORM_AI_RUNNING` flag, so get
      rid of it.
      
      The bug was copied from the AI subdevice to the AO when support for
      commands on the AO subdevice was added by commit 0cf55bbe ("staging:
      comedi: comedi_test: implement commands on AO subdevice").  That
      involves the timer routine `waveform_ao_timer()`, the comedi "cancel"
      routine `waveform_ao_cancel()`, and the flag `WAVEFORM_AO_RUNNING`.  Fix
      it in the same way as for the AI subdevice.
      
      Fixes: 73e0e4df ("staging: comedi: comedi_test: fix timer lock-up")
      Fixes: 0cf55bbe ("staging: comedi: comedi_test: implement commands
       on AO subdevice")
      Reported-by: default avatarÉric Piel <piel@delmic.com>
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Cc: <stable@vger.kernel.org> # 4.4+
      Cc: Éric Piel <piel@delmic.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      403fe7f3
    • Ian Abbott's avatar
      staging: comedi: daqboard2000: bug fix board type matching code · 80e162ee
      Ian Abbott authored
      `daqboard2000_find_boardinfo()` is supposed to check if the
      DaqBoard/2000 series model is supported, based on the PCI subvendor and
      subdevice ID.  The current code is wrong as it is comparing the PCI
      device's subdevice ID to an expected, fixed value for the subvendor ID.
      It should be comparing the PCI device's subvendor ID to this fixed
      value.  Correct it.
      
      Fixes: 7e8401b2 ("staging: comedi: daqboard2000: add back
      subsystem_device check")
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Cc: <stable@vger.kernel.org> # 3.7+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80e162ee
  5. 15 Aug, 2016 2 commits
  6. 31 Jul, 2016 1 commit
  7. 30 Jul, 2016 1 commit
  8. 28 Jul, 2016 4 commits
    • Hans Verkuil's avatar
      [media] cec: fix off-by-one memset · 292eaf50
      Hans Verkuil authored
      The unused bytes of the features array should be zeroed, but the start index was one
      byte too early. This caused the device features byte to be overwritten by 0.
      
      The compliance test for the CEC_S_LOG_ADDRS ioctl didn't catch this because it tested
      byte continuation with the second device features byte being 0 :-(
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      292eaf50
    • Arnd Bergmann's avatar
      [media] staging: add MEDIA_SUPPORT dependency · cd70c37b
      Arnd Bergmann authored
      staging media drivers tend to have a build time dependency on the
      media support. In particular, the newly added pulse8 cec driver can
      only be a loadable module if MEDIA_SUPPORT=m, but its build dependency
      is on a 'bool' symbol (MEDIA_CEC), so a randconfig build can fail
      with pulse8_cec built-in:
      
      drivers/staging/built-in.o: In function `pulse8_disconnect':
      dgnc_utils.c:(.text+0x114): undefined reference to `cec_unregister_adapter'
      drivers/staging/built-in.o: In function `pulse8_irq_work_handler':
      dgnc_utils.c:(.text+0x1bc): undefined reference to `cec_transmit_done'
      dgnc_utils.c:(.text+0x1d8): undefined reference to `cec_received_msg'
      dgnc_utils.c:(.text+0x1f4): undefined reference to `cec_transmit_done'
      dgnc_utils.c:(.text+0x218): undefined reference to `cec_transmit_done'
      dgnc_utils.c:(.text+0x23c): undefined reference to `cec_transmit_done'
      drivers/staging/built-in.o: In function `pulse8_connect':
      dgnc_utils.c:(.text+0x844): undefined reference to `cec_allocate_adapter'
      dgnc_utils.c:(.text+0x8a4): undefined reference to `cec_delete_adapter'
      dgnc_utils.c:(.text+0xa10): undefined reference to `cec_register_adapter'
      
      Originally, MEDIA_CEC itself was a tristate symbol, which would have
      prevented this, but since 5bb2399a ("[media] cec: fix Kconfig
      dependency problems"), it doesn't work like that any more.
      
      This encloses all of the staging media drivers in a CONFIG_MEDIA_SUPPORT
      dependency in Kconfig, which solves the problem by enforcing that none
      of the drivers can be built-in if the media core is a module.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      cd70c37b
    • Mel Gorman's avatar
      mm: move most file-based accounting to the node · 11fb9989
      Mel Gorman authored
      There are now a number of accounting oddities such as mapped file pages
      being accounted for on the node while the total number of file pages are
      accounted on the zone.  This can be coped with to some extent but it's
      confusing so this patch moves the relevant file-based accounted.  Due to
      throttling logic in the page allocator for reliable OOM detection, it is
      still necessary to track dirty and writeback pages on a per-zone basis.
      
      [mgorman@techsingularity.net: fix NR_ZONE_WRITE_PENDING accounting]
        Link: http://lkml.kernel.org/r/1468404004-5085-5-git-send-email-mgorman@techsingularity.net
      Link: http://lkml.kernel.org/r/1467970510-21195-20-git-send-email-mgorman@techsingularity.netSigned-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Rik van Riel <riel@surriel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11fb9989
    • Mel Gorman's avatar
      mm, vmscan: move LRU lists to node · 599d0c95
      Mel Gorman authored
      This moves the LRU lists from the zone to the node and related data such
      as counters, tracing, congestion tracking and writeback tracking.
      
      Unfortunately, due to reclaim and compaction retry logic, it is
      necessary to account for the number of LRU pages on both zone and node
      logic.  Most reclaim logic is based on the node counters but the retry
      logic uses the zone counters which do not distinguish inactive and
      active sizes.  It would be possible to leave the LRU counters on a
      per-zone basis but it's a heavier calculation across multiple cache
      lines that is much more frequent than the retry checks.
      
      Other than the LRU counters, this is mostly a mechanical patch but note
      that it introduces a number of anomalies.  For example, the scans are
      per-zone but using per-node counters.  We also mark a node as congested
      when a zone is congested.  This causes weird problems that are fixed
      later but is easier to review.
      
      In the event that there is excessive overhead on 32-bit systems due to
      the nodes being on LRU then there are two potential solutions
      
      1. Long-term isolation of highmem pages when reclaim is lowmem
      
         When pages are skipped, they are immediately added back onto the LRU
         list. If lowmem reclaim persisted for long periods of time, the same
         highmem pages get continually scanned. The idea would be that lowmem
         keeps those pages on a separate list until a reclaim for highmem pages
         arrives that splices the highmem pages back onto the LRU. It potentially
         could be implemented similar to the UNEVICTABLE list.
      
         That would reduce the skip rate with the potential corner case is that
         highmem pages have to be scanned and reclaimed to free lowmem slab pages.
      
      2. Linear scan lowmem pages if the initial LRU shrink fails
      
         This will break LRU ordering but may be preferable and faster during
         memory pressure than skipping LRU pages.
      
      Link: http://lkml.kernel.org/r/1467970510-21195-4-git-send-email-mgorman@techsingularity.netSigned-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Rik van Riel <riel@surriel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      599d0c95
  9. 26 Jul, 2016 1 commit
    • Arnd Bergmann's avatar
      staging: emxx_udc: allow modular build · 0bf048ab
      Arnd Bergmann authored
      A change to the usb gadget core allowed certain API functions to be
      part of a loadable module, which breaks having emxx_udc built-in:
      
      drivers/staging/built-in.o: In function `nbu2ss_drv_probe':
      (.text+0x2428): undefined reference to `usb_ep_set_maxpacket_limit'
      
      The original patch already fixed tons of other cases that have the
      added dependency but apparently missed this one that now appears
      in an ARM allmodconfig build.
      
      This patch makes the symbol "tristate", which lets the Kconfig
      dependency tracking handle it correctly. To make the module
      actually usable, I also revert 0af61e66 ("drivers/staging:
      make emxx_udc.c explicitly non-modular"), which Paul Gortmaker
      added after noticing that the Kconfig symbol was 'bool'.
      Compared to the original version however, I leave out the
      '__exit' annotation on the remove callback, as Paul pointed
      out that this was incorrect.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 5a8d651a ("usb: gadget: move gadget API functions to udc-core")
      Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bf048ab
  10. 20 Jul, 2016 1 commit
  11. 19 Jul, 2016 8 commits
  12. 15 Jul, 2016 2 commits