1. 18 Aug, 2015 1 commit
  2. 15 Aug, 2015 4 commits
  3. 14 Aug, 2015 16 commits
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · fbd9163f
      Linus Torvalds authored
      Pull clock fix from Stephen Boyd:
       "A one-liner for a regression found in the PXA clock driver"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: pxa: pxa3xx: fix CKEN register access
      fbd9163f
    • Benjamin Gaignard's avatar
      Update maintainers for DRM STI driver · 7f11c476
      Benjamin Gaignard authored
      Add Vincent Abriou and myself as maintainers.
      Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Cc: Vincent Abriou <vincent.abriou@st.com>
      Cc: Dave Airlie <airlied@linux.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7f11c476
    • Gregory Fong's avatar
      mm: cma: mark cma_bitmap_maxno() inline in header · f21838e0
      Gregory Fong authored
      cma_bitmap_maxno() was marked as static and not static inline, which can
      cause warnings about this function not being used if this file is included
      in a file that does not call that function, and violates the conventions
      used elsewhere.  The two options are to move the function implementation
      back to mm/cma.c or make it inline here, and it's simple enough for the
      latter to make sense.
      Signed-off-by: default avatarGregory Fong <gregory.0xf0@gmail.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f21838e0
    • Sergey Senozhatsky's avatar
      zram: fix pool name truncation · 4ce321f5
      Sergey Senozhatsky authored
      zram_meta_alloc() constructs a pool name for zs_create_pool() call as
      
          snprintf(pool_name, sizeof(pool_name), "zram%d", device_id);
      
      However, it defines pool name buffer to be only 8 bytes long (minus
      trailing zero), which means that we can have only 1000 pool names: zram0
      -- zram999.
      
      With CONFIG_ZSMALLOC_STAT enabled an attempt to create a device zram1000
      can fail if device zram100 already exists, because snprintf() will
      truncate new pool name to zram100 and pass it debugfs_create_dir(),
      causing:
      
        debugfs dir <zram100> creation failed
        zram: Error creating memory pool
      
      ... and so on.
      
      Fix it by passing zram->disk->disk_name to zram_meta_alloc() instead of
      divice_id.  We construct zram%d name earlier and keep it as a ->disk_name,
      no need to snprintf() it again.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4ce321f5
    • Xishi Qiu's avatar
      memory-hotplug: fix wrong edge when hot add a new node · f9126ab9
      Xishi Qiu authored
      When we add a new node, the edge of memory may be wrong.
      
      e.g. system has 4 nodes, and node3 is movable, node3 mem:[24G-32G],
      
      1. hotremove the node3,
      2. then hotadd node3 with a part of memory, mem:[26G-30G],
      3. call hotadd_new_pgdat()
              free_area_init_node()
                      get_pfn_range_for_nid()
      4. it will return wrong start_pfn and end_pfn, because we have not
      update the memblock.
      
      This patch also fixes a BUG_ON during hot-addition, please see
      http://marc.info/?l=linux-kernel&m=142961156129456&w=2Signed-off-by: default avatarXishi Qiu <qiuxishi@huawei.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Taku Izumi <izumi.taku@jp.fujitsu.com>
      Cc: Tang Chen <tangchen@cn.fujitsu.com>
      Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f9126ab9
    • Andrey Ryabinin's avatar
      .mailmap: Andrey Ryabinin has moved · 2baf9e89
      Andrey Ryabinin authored
      Update my email address.
      Signed-off-by: default avatarAndrey Ryabinin <ryabinin.a.a@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2baf9e89
    • Manfred Spraul's avatar
      ipc/sem.c: update/correct memory barriers · 3ed1f8a9
      Manfred Spraul authored
      sem_lock() did not properly pair memory barriers:
      
      !spin_is_locked() and spin_unlock_wait() are both only control barriers.
      The code needs an acquire barrier, otherwise the cpu might perform read
      operations before the lock test.
      
      As no primitive exists inside <include/spinlock.h> and since it seems
      noone wants another primitive, the code creates a local primitive within
      ipc/sem.c.
      
      With regards to -stable:
      
      The change of sem_wait_array() is a bugfix, the change to sem_lock() is a
      nop (just a preprocessor redefinition to improve the readability).  The
      bugfix is necessary for all kernels that use sem_wait_array() (i.e.:
      starting from 3.10).
      Signed-off-by: default avatarManfred Spraul <manfred@colorfullife.com>
      Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Kirill Tkhai <ktkhai@parallels.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: <stable@vger.kernel.org>	[3.10+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3ed1f8a9
    • Wanpeng Li's avatar
      mm/hwpoison: fix panic due to split huge zero page · 7f6bf39b
      Wanpeng Li authored
      Bug:
      
        ------------[ cut here ]------------
        kernel BUG at mm/huge_memory.c:1957!
        invalid opcode: 0000 [#1] SMP
        Modules linked in: snd_hda_codec_hdmi i915 rpcsec_gss_krb5 snd_hda_codec_realtek snd_hda_codec_generic nfsv4 dns_re
        CPU: 2 PID: 2576 Comm: test_huge Not tainted 4.2.0-rc5-mm1+ #27
        Hardware name: Dell Inc. OptiPlex 7020/0F5C5X, BIOS A03 01/08/2015
        task: ffff880204e3d600 ti: ffff8800db16c000 task.ti: ffff8800db16c000
        RIP: split_huge_page_to_list+0xdb/0x120
        Call Trace:
          memory_failure+0x32e/0x7c0
          madvise_hwpoison+0x8b/0x160
          SyS_madvise+0x40/0x240
          ? do_page_fault+0x37/0x90
          entry_SYSCALL_64_fastpath+0x12/0x71
        Code: ff f0 41 ff 4c 24 30 74 0d 31 c0 48 83 c4 08 5b 41 5c 41 5d c9 c3 4c 89 e7 e8 e2 58 fd ff 48 83 c4 08 31 c0
        RIP  split_huge_page_to_list+0xdb/0x120
         RSP <ffff8800db16fde8>
        ---[ end trace aee7ce0df8e44076 ]---
      
      Testcase:
      
          #define _GNU_SOURCE
          #include <stdlib.h>
          #include <stdio.h>
          #include <sys/mman.h>
          #include <unistd.h>
          #include <fcntl.h>
          #include <sys/types.h>
          #include <errno.h>
          #include <string.h>
      
          #define MB 1024*1024
      
          int main(void)
          {
                  char *mem;
      
                  posix_memalign((void **)&mem, 2 * MB, 200 * MB);
      
                  madvise(mem, 200 * MB, MADV_HWPOISON);
      
                  free(mem);
      
                  return 0;
          }
      
      Huge zero page is allocated if page fault w/o FAULT_FLAG_WRITE flag.
      The get_user_pages_fast() which called in madvise_hwpoison() will get
      huge zero page if the page is not allocated before.  Huge zero page is a
      tranparent huge page, however, it is not an anonymous page.
      memory_failure will split the huge zero page and trigger
      BUG_ON(is_huge_zero_page(page));
      
      After commit 98ed2b00 ("mm/memory-failure: give up error handling
      for non-tail-refcounted thp"), memory_failure will not catch non anon
      thp from madvise_hwpoison path and this bug occur.
      
      Fix it by catching non anon thp in memory_failure in order to not split
      huge zero page in madvise_hwpoison path.
      
      After this patch:
      
        Injecting memory failure for page 0x202800 at 0x7fd8ae800000
        MCE: 0x202800: non anonymous thp
        [...]
      
      [akpm@linux-foundation.org: remove second split, per Wanpeng]
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Acked-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7f6bf39b
    • Herton R. Krzesinski's avatar
      ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem() · a9795584
      Herton R. Krzesinski authored
      After we acquire the sma->sem_perm lock in exit_sem(), we are protected
      against a racing IPC_RMID operation.  Also at that point, we are the last
      user of sem_undo_list.  Therefore it isn't required that we acquire or use
      ulp->lock.
      Signed-off-by: default avatarHerton R. Krzesinski <herton@redhat.com>
      Acked-by: default avatarManfred Spraul <manfred@colorfullife.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Rafael Aquini <aquini@redhat.com>
      CC: Aristeu Rozanski <aris@redhat.com>
      Cc: David Jeffery <djeffery@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a9795584
    • Herton R. Krzesinski's avatar
      ipc,sem: fix use after free on IPC_RMID after a task using same semaphore set exits · 602b8593
      Herton R. Krzesinski authored
      The current semaphore code allows a potential use after free: in
      exit_sem we may free the task's sem_undo_list while there is still
      another task looping through the same semaphore set and cleaning the
      sem_undo list at freeary function (the task called IPC_RMID for the same
      semaphore set).
      
      For example, with a test program [1] running which keeps forking a lot
      of processes (which then do a semop call with SEM_UNDO flag), and with
      the parent right after removing the semaphore set with IPC_RMID, and a
      kernel built with CONFIG_SLAB, CONFIG_SLAB_DEBUG and
      CONFIG_DEBUG_SPINLOCK, you can easily see something like the following
      in the kernel log:
      
         Slab corruption (Not tainted): kmalloc-64 start=ffff88003b45c1c0, len=64
         000: 6b 6b 6b 6b 6b 6b 6b 6b 00 6b 6b 6b 6b 6b 6b 6b  kkkkkkkk.kkkkkkk
         010: ff ff ff ff 6b 6b 6b 6b ff ff ff ff ff ff ff ff  ....kkkk........
         Prev obj: start=ffff88003b45c180, len=64
         000: 00 00 00 00 ad 4e ad de ff ff ff ff 5a 5a 5a 5a  .....N......ZZZZ
         010: ff ff ff ff ff ff ff ff c0 fb 01 37 00 88 ff ff  ...........7....
         Next obj: start=ffff88003b45c200, len=64
         000: 00 00 00 00 ad 4e ad de ff ff ff ff 5a 5a 5a 5a  .....N......ZZZZ
         010: ff ff ff ff ff ff ff ff 68 29 a7 3c 00 88 ff ff  ........h).<....
         BUG: spinlock wrong CPU on CPU#2, test/18028
         general protection fault: 0000 [#1] SMP
         Modules linked in: 8021q mrp garp stp llc nf_conntrack_ipv4 nf_defrag_ipv4 ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables binfmt_misc ppdev input_leds joydev parport_pc parport floppy serio_raw virtio_balloon virtio_rng virtio_console virtio_net iosf_mbi crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcspkr qxl ttm drm_kms_helper drm snd_hda_codec_generic i2c_piix4 snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore crc32c_intel virtio_pci virtio_ring virtio pata_acpi ata_generic [last unloaded: speedstep_lib]
         CPU: 2 PID: 18028 Comm: test Not tainted 4.2.0-rc5+ #1
         Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014
         RIP: spin_dump+0x53/0xc0
         Call Trace:
           spin_bug+0x30/0x40
           do_raw_spin_unlock+0x71/0xa0
           _raw_spin_unlock+0xe/0x10
           freeary+0x82/0x2a0
           ? _raw_spin_lock+0xe/0x10
           semctl_down.clone.0+0xce/0x160
           ? __do_page_fault+0x19a/0x430
           ? __audit_syscall_entry+0xa8/0x100
           SyS_semctl+0x236/0x2c0
           ? syscall_trace_leave+0xde/0x130
           entry_SYSCALL_64_fastpath+0x12/0x71
         Code: 8b 80 88 03 00 00 48 8d 88 60 05 00 00 48 c7 c7 a0 2c a4 81 31 c0 65 8b 15 eb 40 f3 7e e8 08 31 68 00 4d 85 e4 44 8b 4b 08 74 5e <45> 8b 84 24 88 03 00 00 49 8d 8c 24 60 05 00 00 8b 53 04 48 89
         RIP  [<ffffffff810d6053>] spin_dump+0x53/0xc0
          RSP <ffff88003750fd68>
         ---[ end trace 783ebb76612867a0 ]---
         NMI watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [test:18053]
         Modules linked in: 8021q mrp garp stp llc nf_conntrack_ipv4 nf_defrag_ipv4 ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables binfmt_misc ppdev input_leds joydev parport_pc parport floppy serio_raw virtio_balloon virtio_rng virtio_console virtio_net iosf_mbi crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcspkr qxl ttm drm_kms_helper drm snd_hda_codec_generic i2c_piix4 snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore crc32c_intel virtio_pci virtio_ring virtio pata_acpi ata_generic [last unloaded: speedstep_lib]
         CPU: 3 PID: 18053 Comm: test Tainted: G      D         4.2.0-rc5+ #1
         Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014
         RIP: native_read_tsc+0x0/0x20
         Call Trace:
           ? delay_tsc+0x40/0x70
           __delay+0xf/0x20
           do_raw_spin_lock+0x96/0x140
           _raw_spin_lock+0xe/0x10
           sem_lock_and_putref+0x11/0x70
           SYSC_semtimedop+0x7bf/0x960
           ? handle_mm_fault+0xbf6/0x1880
           ? dequeue_task_fair+0x79/0x4a0
           ? __do_page_fault+0x19a/0x430
           ? kfree_debugcheck+0x16/0x40
           ? __do_page_fault+0x19a/0x430
           ? __audit_syscall_entry+0xa8/0x100
           ? do_audit_syscall_entry+0x66/0x70
           ? syscall_trace_enter_phase1+0x139/0x160
           SyS_semtimedop+0xe/0x10
           SyS_semop+0x10/0x20
           entry_SYSCALL_64_fastpath+0x12/0x71
         Code: 47 10 83 e8 01 85 c0 89 47 10 75 08 65 48 89 3d 1f 74 ff 7e c9 c3 0f 1f 44 00 00 55 48 89 e5 e8 87 17 04 00 66 90 c9 c3 0f 1f 00 <55> 48 89 e5 0f 31 89 c1 48 89 d0 48 c1 e0 20 89 c9 48 09 c8 c9
         Kernel panic - not syncing: softlockup: hung tasks
      
      I wasn't able to trigger any badness on a recent kernel without the
      proper config debugs enabled, however I have softlockup reports on some
      kernel versions, in the semaphore code, which are similar as above (the
      scenario is seen on some servers running IBM DB2 which uses semaphore
      syscalls).
      
      The patch here fixes the race against freeary, by acquiring or waiting
      on the sem_undo_list lock as necessary (exit_sem can race with freeary,
      while freeary sets un->semid to -1 and removes the same sem_undo from
      list_proc or when it removes the last sem_undo).
      
      After the patch I'm unable to reproduce the problem using the test case
      [1].
      
      [1] Test case used below:
      
          #include <stdio.h>
          #include <sys/types.h>
          #include <sys/ipc.h>
          #include <sys/sem.h>
          #include <sys/wait.h>
          #include <stdlib.h>
          #include <time.h>
          #include <unistd.h>
          #include <errno.h>
      
          #define NSEM 1
          #define NSET 5
      
          int sid[NSET];
      
          void thread()
          {
                  struct sembuf op;
                  int s;
                  uid_t pid = getuid();
      
                  s = rand() % NSET;
                  op.sem_num = pid % NSEM;
                  op.sem_op = 1;
                  op.sem_flg = SEM_UNDO;
      
                  semop(sid[s], &op, 1);
                  exit(EXIT_SUCCESS);
          }
      
          void create_set()
          {
                  int i, j;
                  pid_t p;
                  union {
                          int val;
                          struct semid_ds *buf;
                          unsigned short int *array;
                          struct seminfo *__buf;
                  } un;
      
                  /* Create and initialize semaphore set */
                  for (i = 0; i < NSET; i++) {
                          sid[i] = semget(IPC_PRIVATE , NSEM, 0644 | IPC_CREAT);
                          if (sid[i] < 0) {
                                  perror("semget");
                                  exit(EXIT_FAILURE);
                          }
                  }
                  un.val = 0;
                  for (i = 0; i < NSET; i++) {
                          for (j = 0; j < NSEM; j++) {
                                  if (semctl(sid[i], j, SETVAL, un) < 0)
                                          perror("semctl");
                          }
                  }
      
                  /* Launch threads that operate on semaphore set */
                  for (i = 0; i < NSEM * NSET * NSET; i++) {
                          p = fork();
                          if (p < 0)
                                  perror("fork");
                          if (p == 0)
                                  thread();
                  }
      
                  /* Free semaphore set */
                  for (i = 0; i < NSET; i++) {
                          if (semctl(sid[i], NSEM, IPC_RMID))
                                  perror("IPC_RMID");
                  }
      
                  /* Wait for forked processes to exit */
                  while (wait(NULL)) {
                          if (errno == ECHILD)
                                  break;
                  };
          }
      
          int main(int argc, char **argv)
          {
                  pid_t p;
      
                  srand(time(NULL));
      
                  while (1) {
                          p = fork();
                          if (p < 0) {
                                  perror("fork");
                                  exit(EXIT_FAILURE);
                          }
                          if (p == 0) {
                                  create_set();
                                  goto end;
                          }
      
                          /* Wait for forked processes to exit */
                          while (wait(NULL)) {
                                  if (errno == ECHILD)
                                          break;
                          };
                  }
          end:
                  return 0;
          }
      
      [akpm@linux-foundation.org: use normal comment layout]
      Signed-off-by: default avatarHerton R. Krzesinski <herton@redhat.com>
      Acked-by: default avatarManfred Spraul <manfred@colorfullife.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Rafael Aquini <aquini@redhat.com>
      CC: Aristeu Rozanski <aris@redhat.com>
      Cc: David Jeffery <djeffery@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      602b8593
    • Wanpeng Li's avatar
      mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held · 03613808
      Wanpeng Li authored
      Hugetlbfs pages will get a refcount in get_any_page() or
      madvise_hwpoison() if soft offlining through madvise.  The refcount which
      is held by the soft offline path should be released if we fail to isolate
      hugetlbfs pages.
      
      Fix it by reducing the refcount for both isolation success and failure.
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Acked-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: <stable@vger.kernel.org>	[3.9+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      03613808
    • Wanpeng Li's avatar
      mm/hwpoison: fix page refcount of unknown non LRU page · 4f32be67
      Wanpeng Li authored
      After trying to drain pages from pagevec/pageset, we try to get reference
      count of the page again, however, the reference count of the page is not
      reduced if the page is still not on LRU list.
      
      Fix it by adding the put_page() to drop the page reference which is from
      __get_any_page().
      Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
      Acked-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: <stable@vger.kernel.org>	[3.9+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4f32be67
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3670901f
      Linus Torvalds authored
      Pull timer fix from Ingo Molnar:
       "A single clocksource driver suspend/resume fix"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clockevents/drivers/sh_cmt: Only perform clocksource suspend/resume if enabled
      3670901f
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b25c6cee
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Misc fixes: PMU driver corner cases, tooling fixes, and an 'AUX'
        (Intel PT) race related core fix"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/cqm: Do not access cpu_data() from CPU_UP_PREPARE handler
        perf/x86/intel: Fix memory leak on hot-plug allocation fail
        perf: Fix PERF_EVENT_IOC_PERIOD migration race
        perf: Fix double-free of the AUX buffer
        perf: Fix fasync handling on inherited events
        perf tools: Fix test build error when bindir contains double slash
        perf stat: Fix transaction lenght metrics
        perf: Fix running time accounting
      b25c6cee
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5e5013c6
      Linus Torvalds authored
      Pull locking fix from Ingo Molnar:
       "A single fix for a locking self-test crash"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/pvqspinlock: Fix kernel panic in locking-selftest
      5e5013c6
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · c6797654
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Back from holidays, found these in the cracks: one nouveau revert, one
        vmwgfx locking fix and a bunch of exynos fixes"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        Revert "drm/nouveau/fifo/gk104: kick channels when deactivating them"
        drm/vmwgfx: Fix execbuf locking issues
        drm/exynos/fimc: fix runtime pm support
        drm/exynos/mixer: always update INT_EN cache
        drm/exynos/mixer: correct vsync configuration sequence
        drm/exynos/mixer: fix interrupt clearing
        drm/exynos/hdmi: fix edid memory leak
        drm/exynos: gsc: fix wrong bitwise operation for swap detection
      c6797654
  4. 13 Aug, 2015 15 commits
    • Alexandre Courbot's avatar
      Revert "drm/nouveau/fifo/gk104: kick channels when deactivating them" · d211d87e
      Alexandre Courbot authored
      This reverts commit 1addc126
      
      This commit seems to cause crashes in gk104_fifo_intr_runlist() by
      returning 0xbad0da00 when register 0x2a00 is read. Since this commit was
      intended for GM20B which is not completely supported yet, let's revert
      it for the time being.
      Reported-by: default avatarEric Biggers <ebiggers3@gmail.com>
      Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Tested-by: default avatarAfzal Mohammed <afzal.mohd.ma@gmail.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      d211d87e
    • Thomas Hellstrom's avatar
      drm/vmwgfx: Fix execbuf locking issues · 3e04e2fe
      Thomas Hellstrom authored
      This addresses two issues that cause problems with viewperf maya-03 in
      situation with memory pressure.
      
      The first issue causes attempts to unreserve buffers if batched
      reservation fails due to, for example, a signal pending. While previously
      the ttm_eu api was resistant against this type of error, it is no longer
      and the lockdep code will complain about attempting to unreserve buffers
      that are not reserved. The issue is resolved by avoid calling
      ttm_eu_backoff_reservation in the buffer reserve error path.
      
      The second issue is that the binding_mutex may be held when user-space
      fence objects are created and hence during memory reclaims. This may cause
      recursive attempts to grab the binding mutex. The issue is resolved by not
      holding the binding mutex across fence creation and submission.
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: default avatarSinclair Yeh <syeh@vmware.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      3e04e2fe
    • Dave Airlie's avatar
      Merge branch 'exynos-drm-fixes' of... · 3c6d45b4
      Dave Airlie authored
      Merge branch 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
      
         This pull request fixes memory leak and some issues related to
         mixer and gscaler driver issues.
      
      * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
        drm/exynos/fimc: fix runtime pm support
        drm/exynos/mixer: always update INT_EN cache
        drm/exynos/mixer: correct vsync configuration sequence
        drm/exynos/mixer: fix interrupt clearing
        drm/exynos/hdmi: fix edid memory leak
        drm/exynos: gsc: fix wrong bitwise operation for swap detection
      3c6d45b4
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm · 7ddab733
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Another few small ARM fixes, mostly addressing some VDSO issues"
      
      * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
        ARM: 8410/1: VDSO: fix coarse clock monotonicity regression
        ARM: 8409/1: Mark ret_fast_syscall as a function
        ARM: 8408/1: Fix the secondary_startup function in Big Endian case
        ARM: 8405/1: VDSO: fix regression with toolchains lacking ld.bfd executable
      7ddab733
    • Linus Torvalds's avatar
      x86: fix error handling for 32-bit compat out-of-range system call numbers · cd88ec23
      Linus Torvalds authored
      Commit 3f5159a9 ("x86/asm/entry/32: Update -ENOSYS handling to match
      the 64-bit logic") broke the ENOSYS handling for the 32-bit compat case.
      The proper error return value was never loaded into %rax, except if
      things just happened to go through the audit paths, which ended up
      reloading the return value.
      
      This moves the loading or %rax into the normal system call path, just to
      make sure the error case triggers it.  It's kind of sad, since it adds a
      useless instruction to reload the register to the fast path, but it's
      not like that single load from the stack is going to be noticeable.
      Reported-by: default avatarDavid Drysdale <drysdale@google.com>
      Tested-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd88ec23
    • Linus Torvalds's avatar
      Merge tag 'dm-4.2-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · 5b3e2e14
      Linus Torvalds authored
      Pull device mapper fixes from Mike Snitzer:
      
       - two stable fixes for corruption seen in a snapshot of thinp metadata;
         metadata snapshots aren't widely used but help provide a consistent
         view of the metadata associated with an active thin-pool.
      
       - a dm-cache fix for the 4.2 "default" policy switch from "mq" to "smq"
      
      * tag 'dm-4.2-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm cache policy smq: move 'dm-cache-default' module alias to SMQ
        dm btree: add ref counting ops for the leaves of top level btrees
        dm thin metadata: delete btrees when releasing metadata snapshot
      5b3e2e14
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · ebcbf166
      Linus Torvalds authored
      Pull xen block driver fixes from Jens Axboe:
       "A few small bug fixes for xen-blk{front,back} that have been sitting
        over my vacation"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
        xen-blkfront: don't add indirect pages to list when !feature_persistent
        xen-blkfront: introduce blkfront_gather_backend_features()
      ebcbf166
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 6b476e11
      Linus Torvalds authored
      Pull xen bug fixes from David Vrabel:
      
       - revert a fix from 4.2-rc5 that was causing lots of WARNING spam.
      
       - fix a memory leak affecting backends in HVM guests.
      
       - fix PV domU hang with certain configurations.
      
      * tag 'for-linus-4.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/xenbus: Don't leak memory when unmapping the ring on HVM backend
        Revert "xen/events/fifo: Handle linked events when closing a port"
        x86/xen: build "Xen PV" APIC driver for domU as well
      6b476e11
    • Linus Torvalds's avatar
      Revert x86 sigcontext cleanups · ed596cde
      Linus Torvalds authored
      This reverts commits 9a036b93 ("x86/signal/64: Remove 'fs' and 'gs'
      from sigcontext") and c6f20629 ("x86/signal/64: Fix SS handling for
      signals delivered to 64-bit programs").
      
      They were cleanups, but they break dosemu by changing the signal return
      behavior (and removing 'fs' and 'gs' from the sigcontext struct - while
      not actually changing any behavior - causes build problems).
      Reported-and-tested-by: default avatarStas Sergeev <stsp@list.ru>
      Acked-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ed596cde
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 26b552e0
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Workaround hw bug when acquiring PCI bos ownership of iwlwifi
          devices, from Emmanuel Grumbach.
      
       2) Falling back to vmalloc in conntrack should not emit a warning, from
          Pablo Neira Ayuso.
      
       3) Fix NULL deref when rtlwifi driver is used as an AP, from Luis
          Felipe Dominguez Vega.
      
       4) Rocker doesn't free netdev on device removal, from Ido Schimmel.
      
       5) UDP multicast early sock demux has route handling races, from Eric
          Dumazet.
      
       6) Fix L4 checksum handling in openvswitch, from Glenn Griffin.
      
       7) Fix use-after-free in skb_set_peeked, from Herbert Xu.
      
       8) Don't advertize NETIF_F_FRAGLIST in virtio_net driver, this can lead
          to fraglists longer than the driver can support.  From Jason Wang.
      
       9) Fix mlx5 on non-4k-pagesize systems, from Carol L Soto.
      
      10) Fix interrupt storm in bna driver, from Ivan Vecera.
      
      11) Don't propagate -EBUSY from netlink_insert(), from Daniel Borkmann.
      
      12) Fix inet request sock leak, from Eric Dumazet.
      
      13) Fix TX interrupt masking and marking in TX descriptors of fs_enet
          driver, from LEROY Christophe.
      
      14) Get rid of rule optimizer in gianfar driver, it's buggy and unlikely
          to get fixed any time soon.  From Jakub Kicinski
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (61 commits)
        cosa: missing error code on failure in probe()
        gianfar: remove faulty filer optimizer
        gianfar: correct list membership accounting
        gianfar: correct filer table writing
        bonding: Gratuitous ARP gets dropped when first slave added
        net: dsa: Do not override PHY interface if already configured
        net: fs_enet: mask interrupts for TX partial frames.
        net: fs_enet: explicitly remove I flag on TX partial frames
        inet: fix possible request socket leak
        inet: fix races with reqsk timers
        mkiss: Fix error handling in mkiss_open()
        bnx2x: Free NVRAM lock at end of each page
        bnx2x: Prevent null pointer dereference on SKB release
        cxgb4: missing curly braces in t4_setup_debugfs()
        net-timestamp: Update skb_complete_tx_timestamp comment
        ipv6: don't reject link-local nexthop on other interface
        netlink: make sure -EBUSY won't escape from netlink_insert
        bna: fix interrupts storm caused by erroneous packets
        net: mvpp2: replace TX coalescing interrupts with hrtimer
        net: mvpp2: enable proper per-CPU TX buffers unmapping
        ...
      26b552e0
    • Linus Torvalds's avatar
      Merge tag 'edac_fix_for_4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 2331d30d
      Linus Torvalds authored
      Pull EDAC fix from Borislav Petkov:
       "A ppc4xx_edac fix for accessing ->csrows properly.  This driver was
        missed during the conversion a couple of years ago"
      
      * tag 'edac_fix_for_4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC, ppc4xx: Access mci->csrows array elements properly
      2331d30d
    • Maarten Lankhorst's avatar
      drm/i915: Commit planes on each crtc separately. · d2944cf2
      Maarten Lankhorst authored
      This patch is based on the upstream commit 5ac1c4bc and amended
      for v4.2 to make sure it works as intended.
      
      Repeated calls to begin_crtc_commit can cause warnings like this:
      [  169.127746] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:616
      [  169.127835] in_atomic(): 0, irqs_disabled(): 1, pid: 1947, name: kms_flip
      [  169.127840] 3 locks held by kms_flip/1947:
      [  169.127843]  #0:  (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffff814774bc>] __drm_modeset_lock_all+0x9c/0x130
      [  169.127860]  #1:  (crtc_ww_class_acquire){+.+.+.}, at: [<ffffffff814774cd>] __drm_modeset_lock_all+0xad/0x130
      [  169.127870]  #2:  (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffff81477178>] drm_modeset_lock+0x38/0x110
      [  169.127879] irq event stamp: 665690
      [  169.127882] hardirqs last  enabled at (665689): [<ffffffff817ffdb5>] _raw_spin_unlock_irqrestore+0x55/0x70
      [  169.127889] hardirqs last disabled at (665690): [<ffffffffc0197a23>] intel_pipe_update_start+0x113/0x5c0 [i915]
      [  169.127936] softirqs last  enabled at (665470): [<ffffffff8108a766>] __do_softirq+0x236/0x650
      [  169.127942] softirqs last disabled at (665465): [<ffffffff8108ae75>] irq_exit+0xc5/0xd0
      [  169.127951] CPU: 1 PID: 1947 Comm: kms_flip Not tainted 4.1.0-rc4-patser+ #4039
      [  169.127954] Hardware name: LENOVO 2349AV8/2349AV8, BIOS G1ETA5WW (2.65 ) 04/15/2014
      [  169.127957]  ffff8800c49036f0 ffff8800cde5fa28 ffffffff817f6907 0000000080000001
      [  169.127964]  0000000000000000 ffff8800cde5fa58 ffffffff810aebed 0000000000000046
      [  169.127970]  ffffffff81c5d518 0000000000000268 0000000000000000 ffff8800cde5fa88
      [  169.127981] Call Trace:
      [  169.127992]  [<ffffffff817f6907>] dump_stack+0x4f/0x7b
      [  169.128001]  [<ffffffff810aebed>] ___might_sleep+0x16d/0x270
      [  169.128008]  [<ffffffff810aed38>] __might_sleep+0x48/0x90
      [  169.128017]  [<ffffffff817fc359>] mutex_lock_nested+0x29/0x410
      [  169.128073]  [<ffffffffc01635f0>] ? vgpu_write64+0x220/0x220 [i915]
      [  169.128138]  [<ffffffffc017fddf>] ? ironlake_update_primary_plane+0x2ff/0x410 [i915]
      [  169.128198]  [<ffffffffc0190e75>] intel_frontbuffer_flush+0x25/0x70 [i915]
      [  169.128253]  [<ffffffffc01831ac>] intel_finish_crtc_commit+0x4c/0x180 [i915]
      [  169.128279]  [<ffffffffc00784ac>] drm_atomic_helper_commit_planes+0x12c/0x240 [drm_kms_helper]
      [  169.128338]  [<ffffffffc0184264>] __intel_set_mode+0x684/0x830 [i915]
      [  169.128378]  [<ffffffffc018a84a>] intel_crtc_set_config+0x49a/0x620 [i915]
      [  169.128385]  [<ffffffff817fdd39>] ? mutex_unlock+0x9/0x10
      [  169.128391]  [<ffffffff81467b69>] drm_mode_set_config_internal+0x69/0x120
      [  169.128398]  [<ffffffff8119b547>] ? might_fault+0x57/0xb0
      [  169.128403]  [<ffffffff8146bf93>] drm_mode_setcrtc+0x253/0x620
      [  169.128409]  [<ffffffff8145c600>] drm_ioctl+0x1a0/0x6a0
      [  169.128415]  [<ffffffff810b3b41>] ? get_parent_ip+0x11/0x50
      [  169.128424]  [<ffffffff811e9ab8>] do_vfs_ioctl+0x2f8/0x530
      [  169.128429]  [<ffffffff810d0fcd>] ? trace_hardirqs_on+0xd/0x10
      [  169.128435]  [<ffffffff812e7676>] ? selinux_file_ioctl+0x56/0x100
      [  169.128439]  [<ffffffff811e9d71>] SyS_ioctl+0x81/0xa0
      [  169.128445]  [<ffffffff81800697>] system_call_fastpath+0x12/0x6f
      
      Solve it by using the newly introduced drm_atomic_helper_commit_planes_on_crtc.
      
      The problem here was that the drm_atomic_helper_commit_planes() helper
      we were using was basically designed to do
      
          begin_crtc_commit(crtc #1)
          begin_crtc_commit(crtc #2)
          ...
          commit all planes
          finish_crtc_commit(crtc #1)
          finish_crtc_commit(crtc #2)
      
      The problem here is that since our hardware relies on vblank evasion,
      our CRTC 'begin' function waits until we're out of the danger zone in
      which register writes might wind up straddling the vblank, then disables
      interrupts; our 'finish' function re-enables interrupts after the
      registers have been written.  The expectation is that the operations between
      'begin' and 'end' must be performed without sleeping (since interrupts
      are disabled) and should happen as quickly as possible.  By clumping all
      of the 'begin' calls together, we introducing a couple problems:
       * Subsequent 'begin' invocations might sleep (which is illegal)
       * The first 'begin' ensured that we were far enough from the vblank that
         we could write our registers safely and ensure they all fell within
         the same frame.  Adding extra delay waiting for subsequent CRTC's
         wasn't accounted for and could put us back into the 'danger zone' for
         CRTC #1.
      
      This commit solves the problem by using a new helper that allows an
      order of operations like:
      
         for each crtc {
              begin_crtc_commit(crtc)  // sleep (maybe), then disable interrupts
              commit planes for this specific CRTC
              end_crtc_commit(crtc)    // reenable interrupts
         }
      
      so that sleeps will only be performed while interrupts are enabled and
      we can be sure that registers for a CRTC will be written immediately
      once we know we're in the safe zone.
      
      The crtc->config->base.crtc update may seem unrelated, but the helper
      will use it to obtain the crtc for the state. Without the update it
      will dereference NULL and crash.
      
      Changes since v1:
      - Use Matt Roper's commit message.
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=90398Reviewed-by: default avatarAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      d2944cf2
    • Maarten Lankhorst's avatar
      f0fdc55d
    • Daniel Vetter's avatar
      drm/i915: Only dither on 6bpc panels · e8fa4270
      Daniel Vetter authored
      In
      
      commit d328c9d7
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Apr 10 16:22:37 2015 +0200
      
          drm/i915: Select starting pipe bpp irrespective or the primary plane
      
      we started to select the pipe bpp from sink capabilities and not from
      the primary framebuffer - that one might change (and we don't want to
      incur a modeset) and sprites might contain higher bpp content too.
      
      We also selected dithering on a 8 bpc screen displaying a 24bpp rgb
      primary, because pipe_bpp is 24 for such a typical 8 bpc sink, but since
      the commit mentioned above, base_bpp is always the absolute maximum
      supported by the hardware, e.g., 36 bpp on my Ironlake chip. Iow. the
      only way to not get dithering would have been to connect a deep color 12
      bpc display, so pipe_bpp == 36 == base_bpp.
      
      Hence only enable dithering on 6bpc screens where we difinitely and
      always want it.
      
      Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
      Reported-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-and-tested-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      e8fa4270
    • Michael Walle's avatar
      EDAC, ppc4xx: Access mci->csrows array elements properly · 5c16179b
      Michael Walle authored
      The commit
      
        de3910eb ("edac: change the mem allocation scheme to
      		 make Documentation/kobject.txt happy")
      
      changed the memory allocation for the csrows member. But ppc4xx_edac was
      forgotten in the patch. Fix it.
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Cc: <stable@vger.kernel.org>
      Cc: linux-edac <linux-edac@vger.kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Link: http://lkml.kernel.org/r/1437469253-8611-1-git-send-email-michael@walle.ccSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
      5c16179b
  5. 12 Aug, 2015 4 commits
    • Dan Carpenter's avatar
      cosa: missing error code on failure in probe() · e6d00693
      Dan Carpenter authored
      If register_hdlc_device() fails, the current code returns 0 but we
      should return an error code instead.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6d00693
    • David S. Miller's avatar
      Merge branch 'gianfar-fixes' · e941ba86
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      gianfar: filer changes
      
      respinning with examples as requested.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e941ba86
    • Jakub Kicinski's avatar
      gianfar: remove faulty filer optimizer · 1f2b7293
      Jakub Kicinski authored
      Current filer rule optimization is broken in several ways:
       (1) Can perform reads/writes beyond end of allocated tables.
           (gianfar_ethtool.c:1326).
      
      (2) It breaks badly for rules with more than 2 specifiers
           (e.g. matching ip, port, tos).
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1 tos 1 action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2 tos 2 action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3 tos 3 action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: TOS  == 00000003 AND         Q:00           ctrl:0000008a prop:00000003
      05: DIA  == 0a000003 AND         Q:11           ctrl:0000448c prop:0a000003
      06: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      07: TOS  == 00000002 AND         Q:00           ctrl:0000008a prop:00000002
      08: DIA  == 0a000002 AND         Q:09           ctrl:0000248c prop:0a000002
      09: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      0a: DPT  == 00000001 AND         Q:00           ctrl:0000008e prop:00000001
      0b: TOS  == 00000001     CLE     Q:01           ctrl:0000060a prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      (Entire cluster gets AND-ed together).
      
       (3) We observed that the masking rules it generates do not
           play well with clustering on P2020.  Only first rule
           of the cluster would ever fire.  Given that optimizer
           relies heavily on masking this is very hard to fix.
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1  action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2  action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3  action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: DIA  == 0a000003             Q:11           ctrl:0000440c prop:0a000003
      05: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      06: DIA  == 0a000002             Q:09           ctrl:0000240c prop:0a000002
      07: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      08: DPT  == 00000001     CLE     Q:01           ctrl:0000060e prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      Which looks correct according to the spec but only the first
      (eth id 252)/last added rule for 10.0.0.3 will ever trigger.
      As if filer did not treat the AND CLE as cluster start but
      also kept AND-ing the rules.  We found no errata covering this.
      
      The fact that nobody noticed (2) or (3) makes me think
      that this feature is not very widely used and we should just
      remove it.
      Reported-by: default avatarAleksander Dutkowski <adutkowski@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kubakici@wp.pl>
      Acked-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f2b7293
    • Jakub Kicinski's avatar
      gianfar: correct list membership accounting · b5c8c890
      Jakub Kicinski authored
      At a cost of one line let's make sure .count is correct
      when calling gfar_process_filer_changes().
      Signed-off-by: default avatarJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b5c8c890