Skip to content
  1. Feb 10, 2017
  2. Jan 30, 2017
  3. Jan 20, 2017
  4. Jan 19, 2017
    • Bhumika Goyal's avatar
      pwm: constify pwm_ops structures · b2ec9efc
      Bhumika Goyal authored
      
      
      Declare pwm_ops structures as const as they are only stored in the ops
      field of a pwm_chip structure. This field is of type const struct pwm_ops
      *, so pwm_ops structures having this property can be declared as const.
      Done using Coccinelle:
      
      @r1 disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct pwm_ops i@p={...};
      
      @ok1@
      identifier r1.i;
      position p;
      struct pxa_pwm_chip pwm;
      struct bfin_pwm_chip bwm;
      struct vt8500_chip vp;
      struct imx_chip icp;
      @@
      (
      pwm.chip.ops=&i@p
      |
      bwm.chip.ops=&i@p
      |
      vp.chip.ops=&i@p
      |
      icp.chip.ops=&i@p
      )
      
      @bad@
      position p!={r1.p,ok1.p};
      identifier r1.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r1.i;
      @@
      +const
      struct pwm_ops i;
      
      File size details:
      
         text	   data	    bss	    dec	    hex	filename
         1646	    328	      0	   1974	    7b6	drivers/pwm/pwm-imx.o
         1742	    224	      0	   1966	    7ae	drivers/pwm/pwm-imx.o
      
         1941	    296	      0	   2237	    8bd	drivers/pwm/pwm-pxa.o
         2037	    192	      0	   2229	    8b5	drivers/pwm/pwm-pxa.o
      
         1946	    296	      0	   2242	    8c2	drivers/pwm/pwm-vt8500.o
         2050	    192	      0	   2242	    8c2	drivers/pwm/pwm-vt8500.o
      
      The drivers/pwm/pwm-bfin.o file did not compile.
      
      Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      b2ec9efc
    • Scott Branden's avatar
      pwm: bcm-iproc: Update dependencies for compile-test · 5bf22ff3
      Scott Branden authored
      
      
      Add dependency on COMMON_CLK and allow COMPILE_TEST for broader compile
      coverage. Default to Y for IPROC SoCs. This allows the driver to simply
      be enabled by selecting PWM.
      
      Signed-off-by: default avatarScott Branden <scott.branden@broadcom.com>
      Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
      [thierry.reding@gmail.com: reword commit message]
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      5bf22ff3
    • Mika Westerberg's avatar
      pwm: pca9685: Allow any of the 16 PWMs to be used as a GPIO · bccec89f
      Mika Westerberg authored
      
      
      The PCA9685 controller has full on/off bit for each PWM channel. Setting
      this bit bypasses the PWM control and the line works just as it would be a
      GPIO. Furthermore in Intel Galileo it is actually used as GPIO output for
      discreet muxes on the board.
      
      This patch adds GPIO output only support for the driver so that we can
      control the muxes on Galileo using standard GPIO interfaces available in
      the kernel. GPIO and PWM functionality is exclusive so only one can be
      active at a time on a single PWM channel.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
      bccec89f
  5. Jan 04, 2017
  6. Jan 02, 2017
    • Linus Torvalds's avatar
      Linux 4.10-rc2 · 0c744ea4
      Linus Torvalds authored
      0c744ea4
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 4759d386
      Linus Torvalds authored
      Pull DAX updates from Dan Williams:
       "The completion of Jan's DAX work for 4.10.
      
        As I mentioned in the libnvdimm-for-4.10 pull request, these are some
        final fixes for the DAX dirty-cacheline-tracking invalidation work
        that was merged through the -mm, ext4, and xfs trees in -rc1. These
        patches were prepared prior to the merge window, but we waited for
        4.10-rc1 to have a stable merge base after all the prerequisites were
        merged.
      
        Quoting Jan on the overall changes in these patches:
      
           "So I'd like all these 6 patches to go for rc2. The first three
            patches fix invalidation of exceptional DAX entries (a bug which
            is there for a long time) - without these patches data loss can
            occur on power failure even though user called fsync(2). The other
            three patches change locking of DAX faults so that ->iomap_begin()
            is called in a more relaxed locking context and we are safe to
            start a transaction there for ext4"
      
        These have received a build success notification from the kbuild
        robot, and pass the latest libnvdimm unit tests. There have not been
        any -next releases since -rc1, so they have not appeared there"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        ext4: Simplify DAX fault path
        dax: Call ->iomap_begin without entry lock during dax fault
        dax: Finish fault completely when loading holes
        dax: Avoid page invalidation races and unnecessary radix tree traversals
        mm: Invalidate DAX radix tree entries only if appropriate
        ext2: Return BH_New buffers for zeroed blocks
      4759d386
  7. Dec 31, 2016
    • Linus Torvalds's avatar
      Merge tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux · 238d1d0f
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "Two small fixes:
      
         - A merge error on my part broke the DocBook build. I've
           requisitioned one of tglx's frozen sharks for appropriate
           disciplinary action and resolved to be more careful about testing
           the DocBook stuff as long as it's still around.
      
         - Fix an error in unaligned-memory-access.txt"
      
      * tag 'docs-4.10-rc1-fix' of git://git.lwn.net/linux:
        Documentation/unaligned-memory-access.txt: fix incorrect comparison operator
        docs: Fix build failure
      238d1d0f
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · f3de082c
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "This fixes a boot failure on some platforms when crypto self test is
        enabled along with the new acomp interface"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: testmgr - Use heap buffer for acomp test input
      f3de082c
  8. Dec 30, 2016
    • Olof Johansson's avatar
      mm/filemap: fix parameters to test_bit() · 98473f9f
      Olof Johansson authored
       mm/filemap.c: In function 'clear_bit_unlock_is_negative_byte':
        mm/filemap.c:933:9: error: too few arguments to function 'test_bit'
          return test_bit(PG_waiters);
               ^~~~~~~~
      
      Fixes: b91e1302
      
       ('mm: optimize PageWaiters bit use for unlock_page()')
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Brown-paper-bag-by: default avatarLinus Torvalds <dummy@duh.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      98473f9f
    • Linus Torvalds's avatar
      mm: optimize PageWaiters bit use for unlock_page() · b91e1302
      Linus Torvalds authored
      In commit 62906027
      
       ("mm: add PageWaiters indicating tasks are
      waiting for a page bit") Nick Piggin made our page locking no longer
      unconditionally touch the hashed page waitqueue, which not only helps
      performance in general, but is particularly helpful on NUMA machines
      where the hashed wait queues can bounce around a lot.
      
      However, the "clear lock bit atomically and then test the waiters bit"
      sequence turns out to be much more expensive than it needs to be,
      because you get a nasty stall when trying to access the same word that
      just got updated atomically.
      
      On architectures where locking is done with LL/SC, this would be trivial
      to fix with a new primitive that clears one bit and tests another
      atomically, but that ends up not working on x86, where the only atomic
      operations that return the result end up being cmpxchg and xadd.  The
      atomic bit operations return the old value of the same bit we changed,
      not the value of an unrelated bit.
      
      On x86, we could put the lock bit in the high bit of the byte, and use
      "xadd" with that bit (where the overflow ends up not touching other
      bits), and look at the other bits of the result.  However, an even
      simpler model is to just use a regular atomic "and" to clear the lock
      bit, and then the sign bit in eflags will indicate the resulting state
      of the unrelated bit #7.
      
      So by moving the PageWaiters bit up to bit #7, we can atomically clear
      the lock bit and test the waiters bit on x86 too.  And architectures
      with LL/SC (which is all the usual RISC suspects), the particular bit
      doesn't matter, so they are fine with this approach too.
      
      This avoids the extra access to the same atomic word, and thus avoids
      the costly stall at page unlock time.
      
      The only downside is that the interface ends up being a bit odd and
      specialized: clear a bit in a byte, and test the sign bit.  Nick doesn't
      love the resulting name of the new primitive, but I'd rather make the
      name be descriptive and very clear about the limitation imposed by
      trying to work across all relevant architectures than make it be some
      generic thing that doesn't make the odd semantics explicit.
      
      So this introduces the new architecture primitive
      
          clear_bit_unlock_is_negative_byte();
      
      and adds the trivial implementation for x86.  We have a generic
      non-optimized fallback (that just does a "clear_bit()"+"test_bit(7)"
      combination) which can be overridden by any architecture that can do
      better.  According to Nick, Power has the same hickup x86 has, for
      example, but some other architectures may not even care.
      
      All these optimizations mean that my page locking stress-test (which is
      just executing a lot of small short-lived shell scripts: "make test" in
      the git source tree) no longer makes our page locking look horribly bad.
      Before all these optimizations, just the unlock_page() costs were just
      over 3% of all CPU overhead on "make test".  After this, it's down to
      0.66%, so just a quarter of the cost it used to be.
      
      (The difference on NUMA is bigger, but there this micro-optimization is
      likely less noticeable, since the big issue on NUMA was not the accesses
      to 'struct page', but the waitqueue accesses that were already removed
      by Nick's earlier commit).
      
      Acked-by: default avatarNick Piggin <npiggin@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Bob Peterson <rpeterso@redhat.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Andrew Lutomirski <luto@kernel.org>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b91e1302
  9. Dec 28, 2016
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 2d706e79
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "This fixes a hash corruption bug in the marvell driver"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: marvell - Copy IVDIG before launching partial DMA ahash requests
      2d706e79
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 8f18e4d0
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Various ipvlan fixes from Eric Dumazet and Mahesh Bandewar.
      
          The most important is to not assume the packet is RX just because
          the destination address matches that of the device. Such an
          assumption causes problems when an interface is put into loopback
          mode.
      
       2) If we retry when creating a new tc entry (because we dropped the
          RTNL mutex in order to load a module, for example) we end up with
          -EAGAIN and then loop trying to replay the request. But we didn't
          reset some state when looping back to the top like this, and if
          another thread meanwhile inserted the same tc entry we were trying
          to, we re-link it creating an enless loop in the tc chain. Fix from
          Daniel Borkmann.
      
       3) There are two different WRITE bits in the MDIO address register for
          the stmmac chip, depending upon the chip variant. Due to a bug we
          could set them both, fix from Hock Leong Kweh.
      
       4) Fix mlx4 bug in XDP_TX handling, from Tariq Toukan.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: stmmac: fix incorrect bit set in gmac4 mdio addr register
        r8169: add support for RTL8168 series add-on card.
        net: xdp: remove unused bfp_warn_invalid_xdp_buffer()
        openvswitch: upcall: Fix vlan handling.
        ipv4: Namespaceify tcp_tw_reuse knob
        net: korina: Fix NAPI versus resources freeing
        net, sched: fix soft lockup in tc_classify
        net/mlx4_en: Fix user prio field in XDP forward
        tipc: don't send FIN message from connectionless socket
        ipvlan: fix multicast processing
        ipvlan: fix various issues in ipvlan_process_multicast()
      8f18e4d0
    • Cihangir Akturk's avatar
      Documentation/unaligned-memory-access.txt: fix incorrect comparison operator · 36f671be
      Cihangir Akturk authored
      
      
      In the actual implementation ether_addr_equal function tests for equality to 0
      when returning. It seems in commit 0d74c4 it is somehow overlooked to change
      this operator to reflect the actual function.
      
      Signed-off-by: default avatarCihangir Akturk <cakturk@gmail.com>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      36f671be