1. 10 Apr, 2018 9 commits
  2. 04 Apr, 2018 2 commits
  3. 27 Mar, 2018 6 commits
  4. 19 Mar, 2018 2 commits
  5. 06 Mar, 2018 1 commit
    • Qi Hou's avatar
      dmaengine: pl330: fix a race condition in case of threaded irqs · a3ca8312
      Qi Hou authored
      When booting up with "threadirqs" in command line, all irq handlers of the DMA
      controller pl330 will be threaded forcedly. These threads will race for the same
      list, pl330->req_done.
      
      Before the callback, the spinlock was released. And after it, the spinlock was
      taken. This opened an race window where another threaded irq handler could steal
      the spinlock and be permitted to delete entries of the list, pl330->req_done.
      
      If the later deleted an entry that was still referred to by the former, there would
      be a kernel panic when the former was scheduled and tried to get the next sibling
      of the deleted entry.
      
      The scenario could be depicted as below:
      
        Thread: T1  pl330->req_done  Thread: T2
            |             |              |
            |          -A-B-C-D-         |
          Locked          |              |
            |             |           Waiting
          Del A           |              |
            |          -B-C-D-           |
          Unlocked        |              |
            |             |           Locked
          Waiting         |              |
            |             |            Del B
            |             |              |
            |           -C-D-         Unlocked
          Waiting         |              |
            |
          Locked
            |
         get C via B
            \
             - Kernel panic
      
      The kernel panic looked like as below:
      
      Unable to handle kernel paging request at virtual address dead000000000108
      pgd = ffffff8008c9e000
      [dead000000000108] *pgd=000000027fffe003, *pud=000000027fffe003, *pmd=0000000000000000
      Internal error: Oops: 96000044 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 85 Comm: irq/59-66330000 Not tainted 4.8.24-WR9.0.0.12_standard #2
      Hardware name: Broadcom NS2 SVK (DT)
      task: ffffffc1f5cc3c00 task.stack: ffffffc1f5ce0000
      PC is at pl330_irq_handler+0x27c/0x390
      LR is at pl330_irq_handler+0x2a8/0x390
      pc : [<ffffff80084cb694>] lr : [<ffffff80084cb6c0>] pstate: 800001c5
      sp : ffffffc1f5ce3d00
      x29: ffffffc1f5ce3d00 x28: 0000000000000140
      x27: ffffffc1f5c530b0 x26: dead000000000100
      x25: dead000000000200 x24: 0000000000418958
      x23: 0000000000000001 x22: ffffffc1f5ccd668
      x21: ffffffc1f5ccd590 x20: ffffffc1f5ccd418
      x19: dead000000000060 x18: 0000000000000001
      x17: 0000000000000007 x16: 0000000000000001
      x15: ffffffffffffffff x14: ffffffffffffffff
      x13: ffffffffffffffff x12: 0000000000000000
      x11: 0000000000000001 x10: 0000000000000840
      x9 : ffffffc1f5ce0000 x8 : ffffffc1f5cc3338
      x7 : ffffff8008ce2020 x6 : 0000000000000000
      x5 : 0000000000000000 x4 : 0000000000000001
      x3 : dead000000000200 x2 : dead000000000100
      x1 : 0000000000000140 x0 : ffffffc1f5ccd590
      
      Process irq/59-66330000 (pid: 85, stack limit = 0xffffffc1f5ce0020)
      Stack: (0xffffffc1f5ce3d00 to 0xffffffc1f5ce4000)
      3d00: ffffffc1f5ce3d80 ffffff80080f09d0 ffffffc1f5ca0c00 ffffffc1f6f7c600
      3d20: ffffffc1f5ce0000 ffffffc1f6f7c600 ffffffc1f5ca0c00 ffffff80080f0998
      3d40: ffffffc1f5ce0000 ffffff80080f0000 0000000000000000 0000000000000000
      3d60: ffffff8008ce202c ffffff8008ce2020 ffffffc1f5ccd668 ffffffc1f5c530b0
      3d80: ffffffc1f5ce3db0 ffffff80080f0d70 ffffffc1f5ca0c40 0000000000000001
      3da0: ffffffc1f5ce0000 ffffff80080f0cfc ffffffc1f5ce3e20 ffffff80080bf4f8
      3dc0: ffffffc1f5ca0c80 ffffff8008bf3798 ffffff8008955528 ffffffc1f5ca0c00
      3de0: ffffff80080f0c30 0000000000000000 0000000000000000 0000000000000000
      3e00: 0000000000000000 0000000000000000 0000000000000000 ffffff80080f0b68
      3e20: 0000000000000000 ffffff8008083690 ffffff80080bf420 ffffffc1f5ca0c80
      3e40: 0000000000000000 0000000000000000 0000000000000000 ffffff80080cb648
      3e60: ffffff8008b1c780 0000000000000000 0000000000000000 ffffffc1f5ca0c00
      3e80: ffffffc100000000 ffffff8000000000 ffffffc1f5ce3e90 ffffffc1f5ce3e90
      3ea0: 0000000000000000 ffffff8000000000 ffffffc1f5ce3eb0 ffffffc1f5ce3eb0
      3ec0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3ee0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3f00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3f20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3f40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3f60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3f80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3fa0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      3fc0: 0000000000000000 0000000000000005 0000000000000000 0000000000000000
      3fe0: 0000000000000000 0000000000000000 0000000275ce3ff0 0000000275ce3ff8
      Call trace:
      Exception stack(0xffffffc1f5ce3b30 to 0xffffffc1f5ce3c60)
      3b20:                                   dead000000000060 0000008000000000
      3b40: ffffffc1f5ce3d00 ffffff80084cb694 0000000000000008 0000000000000e88
      3b60: ffffffc1f5ce3bb0 ffffff80080dac68 ffffffc1f5ce3b90 ffffff8008826fe4
      3b80: 00000000000001c0 00000000000001c0 ffffffc1f5ce3bb0 ffffff800848dfcc
      3ba0: 0000000000020000 ffffff8008b15ae4 ffffffc1f5ce3c00 ffffff800808f000
      3bc0: 0000000000000010 ffffff80088377f0 ffffffc1f5ccd590 0000000000000140
      3be0: dead000000000100 dead000000000200 0000000000000001 0000000000000000
      3c00: 0000000000000000 ffffff8008ce2020 ffffffc1f5cc3338 ffffffc1f5ce0000
      3c20: 0000000000000840 0000000000000001 0000000000000000 ffffffffffffffff
      3c40: ffffffffffffffff ffffffffffffffff 0000000000000001 0000000000000007
      [<ffffff80084cb694>] pl330_irq_handler+0x27c/0x390
      [<ffffff80080f09d0>] irq_forced_thread_fn+0x38/0x88
      [<ffffff80080f0d70>] irq_thread+0x140/0x200
      [<ffffff80080bf4f8>] kthread+0xd8/0xf0
      [<ffffff8008083690>] ret_from_fork+0x10/0x40
      Code: f2a00838 f9405763 aa1c03e1 aa1503e0 (f9000443)
      ---[ end trace f50005726d31199c ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      SMP: stopping secondary CPUs
      SMP: failed to stop secondary CPUs 0-1
      Kernel Offset: disabled
      Memory Limit: none
      ---[ end Kernel panic - not syncing: Fatal exception in interrupt
      
      To fix this, re-start with the list-head after dropping the lock then
      re-takeing it.
      Reviewed-by: default avatarFrank Mori Hess <fmh6jj@gmail.com>
      Tested-by: default avatarFrank Mori Hess <fmh6jj@gmail.com>
      Signed-off-by: default avatarQi Hou <qi.hou@windriver.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      a3ca8312
  6. 05 Mar, 2018 3 commits
  7. 01 Mar, 2018 5 commits
  8. 12 Feb, 2018 3 commits
  9. 11 Feb, 2018 9 commits
    • Linus Torvalds's avatar
      Linux 4.16-rc1 · 7928b2cb
      Linus Torvalds authored
      7928b2cb
    • Al Viro's avatar
      unify {de,}mangle_poll(), get rid of kernel-side POLL... · 7a163b21
      Al Viro authored
      except, again, POLLFREE and POLL_BUSY_LOOP.
      
      With this, we finally get to the promised end result:
      
       - POLL{IN,OUT,...} are plain integers and *not* in __poll_t, so any
         stray instances of ->poll() still using those will be caught by
         sparse.
      
       - eventpoll.c and select.c warning-free wrt __poll_t
      
       - no more kernel-side definitions of POLL... - userland ones are
         visible through the entire kernel (and used pretty much only for
         mangle/demangle)
      
       - same behavior as after the first series (i.e. sparc et.al. epoll(2)
         working correctly).
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7a163b21
    • Linus Torvalds's avatar
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds authored
      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: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
    • Linus Torvalds's avatar
      Merge branch 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · ee5daa13
      Linus Torvalds authored
      Pull more poll annotation updates from Al Viro:
       "This is preparation to solving the problems you've mentioned in the
        original poll series.
      
        After this series, the kernel is ready for running
      
            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
      
        as a for bulk search-and-replace.
      
        After that, the kernel is ready to apply the patch to unify
        {de,}mangle_poll(), and then get rid of kernel-side POLL... uses
        entirely, and we should be all done with that stuff.
      
        Basically, that's what you suggested wrt KPOLL..., except that we can
        use EPOLL... instead - they already are arch-independent (and equal to
        what is currently kernel-side POLL...).
      
        After the preparations (in this series) switch to returning EPOLL...
        from ->poll() instances is completely mechanical and kernel-side
        POLL... can go away. The last step (killing kernel-side POLL... and
        unifying {de,}mangle_poll() has to be done after the
        search-and-replace job, since we need userland-side POLL... for
        unified {de,}mangle_poll(), thus the cherry-pick at the last step.
      
        After that we will have:
      
         - POLL{IN,OUT,...} *not* in __poll_t, so any stray instances of
           ->poll() still using those will be caught by sparse.
      
         - eventpoll.c and select.c warning-free wrt __poll_t
      
         - no more kernel-side definitions of POLL... - userland ones are
           visible through the entire kernel (and used pretty much only for
           mangle/demangle)
      
         - same behavior as after the first series (i.e. sparc et.al. epoll(2)
           working correctly)"
      
      * 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        annotate ep_scan_ready_list()
        ep_send_events_proc(): return result via esed->res
        preparation to switching ->poll() to returning EPOLL...
        add EPOLLNVAL, annotate EPOLL... and event_poll->event
        use linux/poll.h instead of asm/poll.h
        xen: fix poll misannotation
        smc: missing poll annotations
      ee5daa13
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20180211' of git://github.com/jcmvbkbc/linux-xtensa · 3fc928dc
      Linus Torvalds authored
      Pull xtense fix from Max Filippov:
       "Build fix for xtensa architecture with KASAN enabled"
      
      * tag 'xtensa-20180211' of git://github.com/jcmvbkbc/linux-xtensa:
        xtensa: fix build with KASAN
      3fc928dc
    • Linus Torvalds's avatar
      Merge tag 'nios2-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 · 60d7a21a
      Linus Torvalds authored
      Pull nios2 update from Ley Foon Tan:
      
       - clean up old Kconfig options from defconfig
      
       - remove leading 0x and 0s from bindings notation in dts files
      
      * tag 'nios2-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
        nios2: defconfig: Cleanup from old Kconfig options
        nios2: dts: Remove leading 0x and 0s from bindings notation
      60d7a21a
    • Max Filippov's avatar
      xtensa: fix build with KASAN · f8d0cbf2
      Max Filippov authored
      The commit 917538e2 ("kasan: clean up KASAN_SHADOW_SCALE_SHIFT
      usage") removed KASAN_SHADOW_SCALE_SHIFT definition from
      include/linux/kasan.h and added it to architecture-specific headers,
      except for xtensa. This broke the xtensa build with KASAN enabled.
      Define KASAN_SHADOW_SCALE_SHIFT in arch/xtensa/include/asm/kasan.h
      
      Reported by: kbuild test robot <fengguang.wu@intel.com>
      Fixes: 917538e2 ("kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage")
      Acked-by: default avatarAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      f8d0cbf2
    • Krzysztof Kozlowski's avatar
      nios2: defconfig: Cleanup from old Kconfig options · e0691ebb
      Krzysztof Kozlowski authored
      Remove old, dead Kconfig option INET_LRO. It is gone since
      commit 7bbf3cae ("ipv4: Remove inet_lro library").
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Acked-by: default avatarLey Foon Tan <ley.foon.tan@intel.com>
      e0691ebb
    • Mathieu Malaterre's avatar
      nios2: dts: Remove leading 0x and 0s from bindings notation · 5d13c731
      Mathieu Malaterre authored
      Improve the DTS files by removing all the leading "0x" and zeros to fix the
      following dtc warnings:
      
      Warning (unit_address_format): Node /XXX unit name should not have leading "0x"
      
      and
      
      Warning (unit_address_format): Node /XXX unit name should not have leading 0s
      
      Converted using the following command:
      
      find . -type f \( -iname *.dts -o -iname *.dtsi \) -exec sed -E -i -e "s/@0x([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" -e "s/@0+([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" {} +
      
      For simplicity, two sed expressions were used to solve each warnings separately.
      
      To make the regex expression more robust a few other issues were resolved,
      namely setting unit-address to lower case, and adding a whitespace before the
      the opening curly brace:
      
      https://elinux.org/Device_Tree_Linux#Linux_conventions
      
      This is a follow up to commit 4c9847b7 ("dt-bindings: Remove leading 0x from bindings notation")
      Reported-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      Suggested-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMathieu Malaterre <malat@debian.org>
      Acked-by: default avatarLey Foon Tan <ley.foon.tan@intel.com>
      5d13c731