]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.38 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Apr 2011 22:26:32 +0000 (15:26 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Apr 2011 22:26:32 +0000 (15:26 -0700)
17 files changed:
queue-2.6.38/arm-6864-1-hw_breakpoint-clear-dbgvcr-out-of-reset.patch [new file with mode: 0644]
queue-2.6.38/brk-compat_brk-fix-detection-of-randomized-brk.patch [new file with mode: 0644]
queue-2.6.38/i2c-algo-bit-call-pre-post_xfer-for-bit_test.patch [new file with mode: 0644]
queue-2.6.38/next_pidmap-fix-overflow-condition.patch [new file with mode: 0644]
queue-2.6.38/powerpc-fix-oops-if-scan_dispatch_log-is-called-too-early.patch [new file with mode: 0644]
queue-2.6.38/powerpc-perf_event-skip-updating-kernel-counters-if-register-value-shrinks.patch [new file with mode: 0644]
queue-2.6.38/proc-do-proper-range-check-on-readdir-offset.patch [new file with mode: 0644]
queue-2.6.38/rtc-add-missing-return-0-in-new-alarm-func-for-rtc-bfin.c.patch [new file with mode: 0644]
queue-2.6.38/sched-fix-erroneous-all_pinned-logic.patch [new file with mode: 0644]
queue-2.6.38/series
queue-2.6.38/usb-ftdi_sio-add-ids-for-hameg-ho720-and-ho730.patch [new file with mode: 0644]
queue-2.6.38/usb-ftdi_sio-add-pid-for-oct-dk201-docking-station.patch [new file with mode: 0644]
queue-2.6.38/usb-ftdi_sio-added-ids-for-cti-usb-serial-devices.patch [new file with mode: 0644]
queue-2.6.38/usb-musb-temporarily-make-it-bool.patch [new file with mode: 0644]
queue-2.6.38/usb-option-added-support-for-samsung-gt-b3730-gt-b3710-lte-usb-modem.patch [new file with mode: 0644]
queue-2.6.38/vfs-fix-absolute-rcu-path-walk-failures-due-to-uninitialized-seq-number.patch [new file with mode: 0644]
queue-2.6.38/vmscan-all_unreclaimable-use-zone-all_unreclaimable-as-a-name.patch [new file with mode: 0644]

diff --git a/queue-2.6.38/arm-6864-1-hw_breakpoint-clear-dbgvcr-out-of-reset.patch b/queue-2.6.38/arm-6864-1-hw_breakpoint-clear-dbgvcr-out-of-reset.patch
new file mode 100644 (file)
index 0000000..a8e2c8a
--- /dev/null
@@ -0,0 +1,40 @@
+From e89c0d7090c54d7b11b9b091e495a1ae345dd3ff Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon@arm.com>
+Date: Tue, 5 Apr 2011 13:57:53 +0100
+Subject: ARM: 6864/1: hw_breakpoint: clear DBGVCR out of reset
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit e89c0d7090c54d7b11b9b091e495a1ae345dd3ff upstream.
+
+The DBGVCR, used for configuring vector catch debug events, is UNKNOWN
+out of reset on ARMv7. When enabling monitor mode, this must be zeroed
+to avoid UNPREDICTABLE behaviour.
+
+This patch adds the zeroing code to the debug reset path.
+
+Reported-by: Stepan Moskovchenko <stepanm@codeaurora.org>
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/arm/kernel/hw_breakpoint.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/arch/arm/kernel/hw_breakpoint.c
++++ b/arch/arm/kernel/hw_breakpoint.c
+@@ -868,6 +868,13 @@ static void reset_ctrl_regs(void *info)
+                */
+               asm volatile("mcr p14, 0, %0, c1, c0, 4" : : "r" (0));
+               isb();
++
++              /*
++               * Clear any configured vector-catch events before
++               * enabling monitor mode.
++               */
++              asm volatile("mcr p14, 0, %0, c0, c7, 0" : : "r" (0));
++              isb();
+       }
+       if (enable_monitor_mode())
diff --git a/queue-2.6.38/brk-compat_brk-fix-detection-of-randomized-brk.patch b/queue-2.6.38/brk-compat_brk-fix-detection-of-randomized-brk.patch
new file mode 100644 (file)
index 0000000..ad244c0
--- /dev/null
@@ -0,0 +1,87 @@
+From 4471a675dfc7ca676c165079e91c712b09dc9ce4 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Thu, 14 Apr 2011 15:22:09 -0700
+Subject: brk: COMPAT_BRK: fix detection of randomized brk
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 4471a675dfc7ca676c165079e91c712b09dc9ce4 upstream.
+
+5520e89 ("brk: fix min_brk lower bound computation for COMPAT_BRK")
+tried to get the whole logic of brk randomization for legacy
+(libc5-based) applications finally right.
+
+It turns out that the way to detect whether brk has actually been
+randomized in the end or not introduced by that patch still doesn't work
+for those binaries, as reported by Geert:
+
+: /sbin/init from my old m68k ramdisk exists prematurely.
+:
+: Before the patch:
+:
+: | brk(0x80005c8e)                         = 0x80006000
+:
+: After the patch:
+:
+: | brk(0x80005c8e)                         = 0x80005c8e
+:
+: Old libc5 considers brk() to have failed if the return value is not
+: identical to the requested value.
+
+I don't like it, but currently see no better option than a bit flag in
+task_struct to catch the CONFIG_COMPAT_BRK && randomize_va_space == 2
+case.
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/binfmt_elf.c       |    6 +++++-
+ include/linux/sched.h |    3 +++
+ mm/mmap.c             |    2 +-
+ 3 files changed, 9 insertions(+), 2 deletions(-)
+
+--- a/fs/binfmt_elf.c
++++ b/fs/binfmt_elf.c
+@@ -941,9 +941,13 @@ static int load_elf_binary(struct linux_
+       current->mm->start_stack = bprm->p;
+ #ifdef arch_randomize_brk
+-      if ((current->flags & PF_RANDOMIZE) && (randomize_va_space > 1))
++      if ((current->flags & PF_RANDOMIZE) && (randomize_va_space > 1)) {
+               current->mm->brk = current->mm->start_brk =
+                       arch_randomize_brk(current->mm);
++#ifdef CONFIG_COMPAT_BRK
++              current->brk_randomized = 1;
++#endif
++      }
+ #endif
+       if (current->personality & MMAP_PAGE_ZERO) {
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
+@@ -1254,6 +1254,9 @@ struct task_struct {
+ #endif
+       struct mm_struct *mm, *active_mm;
++#ifdef CONFIG_COMPAT_BRK
++      unsigned brk_randomized:1;
++#endif
+ #if defined(SPLIT_RSS_COUNTING)
+       struct task_rss_stat    rss_stat;
+ #endif
+--- a/mm/mmap.c
++++ b/mm/mmap.c
+@@ -259,7 +259,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
+        * randomize_va_space to 2, which will still cause mm->start_brk
+        * to be arbitrarily shifted
+        */
+-      if (mm->start_brk > PAGE_ALIGN(mm->end_data))
++      if (current->brk_randomized)
+               min_brk = mm->start_brk;
+       else
+               min_brk = mm->end_data;
diff --git a/queue-2.6.38/i2c-algo-bit-call-pre-post_xfer-for-bit_test.patch b/queue-2.6.38/i2c-algo-bit-call-pre-post_xfer-for-bit_test.patch
new file mode 100644 (file)
index 0000000..88bab10
--- /dev/null
@@ -0,0 +1,81 @@
+From d3b3e15da14ded61c9654db05863b04a2435f4cc Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Sun, 17 Apr 2011 10:20:19 +0200
+Subject: i2c-algo-bit: Call pre/post_xfer for bit_test
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+commit d3b3e15da14ded61c9654db05863b04a2435f4cc upstream.
+
+Apparently some distros set i2c-algo-bit.bit_test to 1 by
+default.  In some cases this causes i2c_bit_add_bus
+to fail and prevents the i2c bus from being added.  In the
+radeon case, we fail to add the ddc i2c buses which prevents
+the driver from being able to detect attached monitors.
+The i2c bus works fine even if bit_test fails.  This is likely
+due to gpio switching that is required and handled in the
+pre/post_xfer hooks, so call the pre/post_xfer hooks in the
+bit test as well.
+
+Fixes:
+https://bugs.freedesktop.org/show_bug.cgi?id=36221
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/i2c/algos/i2c-algo-bit.c |   22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+--- a/drivers/i2c/algos/i2c-algo-bit.c
++++ b/drivers/i2c/algos/i2c-algo-bit.c
+@@ -232,9 +232,17 @@ static int i2c_inb(struct i2c_adapter *i
+  * Sanity check for the adapter hardware - check the reaction of
+  * the bus lines only if it seems to be idle.
+  */
+-static int test_bus(struct i2c_algo_bit_data *adap, char *name)
++static int test_bus(struct i2c_adapter *i2c_adap)
+ {
+-      int scl, sda;
++      struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
++      const char *name = i2c_adap->name;
++      int scl, sda, ret;
++
++      if (adap->pre_xfer) {
++              ret = adap->pre_xfer(i2c_adap);
++              if (ret < 0)
++                      return -ENODEV;
++      }
+       if (adap->getscl == NULL)
+               pr_info("%s: Testing SDA only, SCL is not readable\n", name);
+@@ -297,11 +305,19 @@ static int test_bus(struct i2c_algo_bit_
+                      "while pulling SCL high!\n", name);
+               goto bailout;
+       }
++
++      if (adap->post_xfer)
++              adap->post_xfer(i2c_adap);
++
+       pr_info("%s: Test OK\n", name);
+       return 0;
+ bailout:
+       sdahi(adap);
+       sclhi(adap);
++
++      if (adap->post_xfer)
++              adap->post_xfer(i2c_adap);
++
+       return -ENODEV;
+ }
+@@ -607,7 +623,7 @@ static int __i2c_bit_add_bus(struct i2c_
+       int ret;
+       if (bit_test) {
+-              ret = test_bus(bit_adap, adap->name);
++              ret = test_bus(adap);
+               if (ret < 0)
+                       return -ENODEV;
+       }
diff --git a/queue-2.6.38/next_pidmap-fix-overflow-condition.patch b/queue-2.6.38/next_pidmap-fix-overflow-condition.patch
new file mode 100644 (file)
index 0000000..c60996e
--- /dev/null
@@ -0,0 +1,69 @@
+From c78193e9c7bcbf25b8237ad0dec82f805c4ea69b Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Mon, 18 Apr 2011 10:35:30 -0700
+Subject: next_pidmap: fix overflow condition
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit c78193e9c7bcbf25b8237ad0dec82f805c4ea69b upstream.
+
+next_pidmap() just quietly accepted whatever 'last' pid that was passed
+in, which is not all that safe when one of the users is /proc.
+
+Admittedly the proc code should do some sanity checking on the range
+(and that will be the next commit), but that doesn't mean that the
+helper functions should just do that pidmap pointer arithmetic without
+checking the range of its arguments.
+
+So clamp 'last' to PID_MAX_LIMIT.  The fact that we then do "last+1"
+doesn't really matter, the for-loop does check against the end of the
+pidmap array properly (it's only the actual pointer arithmetic overflow
+case we need to worry about, and going one bit beyond isn't going to
+overflow).
+
+[ Use PID_MAX_LIMIT rather than pid_max as per Eric Biederman ]
+
+Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
+Analyzed-by: Robert Święcki <robert@swiecki.net>
+Cc: Eric W. Biederman <ebiederm@xmission.com>
+Cc: Pavel Emelyanov <xemul@openvz.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/pid.h |    2 +-
+ kernel/pid.c        |    5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+--- a/include/linux/pid.h
++++ b/include/linux/pid.h
+@@ -117,7 +117,7 @@ extern struct pid *find_vpid(int nr);
+  */
+ extern struct pid *find_get_pid(int nr);
+ extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
+-int next_pidmap(struct pid_namespace *pid_ns, int last);
++int next_pidmap(struct pid_namespace *pid_ns, unsigned int last);
+ extern struct pid *alloc_pid(struct pid_namespace *ns);
+ extern void free_pid(struct pid *pid);
+--- a/kernel/pid.c
++++ b/kernel/pid.c
+@@ -217,11 +217,14 @@ static int alloc_pidmap(struct pid_names
+       return -1;
+ }
+-int next_pidmap(struct pid_namespace *pid_ns, int last)
++int next_pidmap(struct pid_namespace *pid_ns, unsigned int last)
+ {
+       int offset;
+       struct pidmap *map, *end;
++      if (last >= PID_MAX_LIMIT)
++              return -1;
++
+       offset = (last + 1) & BITS_PER_PAGE_MASK;
+       map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
+       end = &pid_ns->pidmap[PIDMAP_ENTRIES];
diff --git a/queue-2.6.38/powerpc-fix-oops-if-scan_dispatch_log-is-called-too-early.patch b/queue-2.6.38/powerpc-fix-oops-if-scan_dispatch_log-is-called-too-early.patch
new file mode 100644 (file)
index 0000000..aeb3ff8
--- /dev/null
@@ -0,0 +1,45 @@
+From 84ffae55af79d7b8834fd0c08d0d1ebf2c77f91e Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton@samba.org>
+Date: Thu, 7 Apr 2011 21:44:21 +0000
+Subject: powerpc: Fix oops if scan_dispatch_log is called too early
+
+From: Anton Blanchard <anton@samba.org>
+
+commit 84ffae55af79d7b8834fd0c08d0d1ebf2c77f91e upstream.
+
+We currently enable interrupts before the dispatch log for the boot
+cpu is setup. If a timer interrupt comes in early enough we oops in
+scan_dispatch_log:
+
+Unable to handle kernel paging request for data at address 0x00000010
+
+...
+
+.scan_dispatch_log+0xb0/0x170
+.account_system_vtime+0xa0/0x220
+.irq_enter+0x88/0xc0
+.do_IRQ+0x48/0x230
+
+The patch below adds a check to scan_dispatch_log to ensure the
+dispatch log has been allocated.
+
+Signed-off-by: Anton Blanchard <anton@samba.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/kernel/time.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/powerpc/kernel/time.c
++++ b/arch/powerpc/kernel/time.c
+@@ -229,6 +229,9 @@ static u64 scan_dispatch_log(u64 stop_tb
+       u64 stolen = 0;
+       u64 dtb;
++      if (!dtl)
++              return 0;
++
+       if (i == vpa->dtl_idx)
+               return 0;
+       while (i < vpa->dtl_idx) {
diff --git a/queue-2.6.38/powerpc-perf_event-skip-updating-kernel-counters-if-register-value-shrinks.patch b/queue-2.6.38/powerpc-perf_event-skip-updating-kernel-counters-if-register-value-shrinks.patch
new file mode 100644 (file)
index 0000000..b993581
--- /dev/null
@@ -0,0 +1,108 @@
+From 86c74ab317c1ef4d37325e0d7ca8a01a796b0bd7 Mon Sep 17 00:00:00 2001
+From: Eric B Munson <emunson@mgebm.net>
+Date: Fri, 15 Apr 2011 08:12:30 +0000
+Subject: powerpc/perf_event: Skip updating kernel counters if register value shrinks
+
+From: Eric B Munson <emunson@mgebm.net>
+
+commit 86c74ab317c1ef4d37325e0d7ca8a01a796b0bd7 upstream.
+
+Because of speculative event roll back, it is possible for some event coutners
+to decrease between reads on POWER7.  This causes a problem with the way that
+counters are updated.  Delta calues are calculated in a 64 bit value and the
+top 32 bits are masked.  If the register value has decreased, this leaves us
+with a very large positive value added to the kernel counters.  This patch
+protects against this by skipping the update if the delta would be negative.
+This can lead to a lack of precision in the coutner values, but from my testing
+the value is typcially fewer than 10 samples at a time.
+
+Signed-off-by: Eric B Munson <emunson@mgebm.net>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/powerpc/kernel/perf_event.c |   37 ++++++++++++++++++++++++++++++-------
+ 1 file changed, 30 insertions(+), 7 deletions(-)
+
+--- a/arch/powerpc/kernel/perf_event.c
++++ b/arch/powerpc/kernel/perf_event.c
+@@ -398,6 +398,25 @@ static int check_excludes(struct perf_ev
+       return 0;
+ }
++static u64 check_and_compute_delta(u64 prev, u64 val)
++{
++      u64 delta = (val - prev) & 0xfffffffful;
++
++      /*
++       * POWER7 can roll back counter values, if the new value is smaller
++       * than the previous value it will cause the delta and the counter to
++       * have bogus values unless we rolled a counter over.  If a coutner is
++       * rolled back, it will be smaller, but within 256, which is the maximum
++       * number of events to rollback at once.  If we dectect a rollback
++       * return 0.  This can lead to a small lack of precision in the
++       * counters.
++       */
++      if (prev > val && (prev - val) < 256)
++              delta = 0;
++
++      return delta;
++}
++
+ static void power_pmu_read(struct perf_event *event)
+ {
+       s64 val, delta, prev;
+@@ -416,10 +435,11 @@ static void power_pmu_read(struct perf_e
+               prev = local64_read(&event->hw.prev_count);
+               barrier();
+               val = read_pmc(event->hw.idx);
++              delta = check_and_compute_delta(prev, val);
++              if (!delta)
++                      return;
+       } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev);
+-      /* The counters are only 32 bits wide */
+-      delta = (val - prev) & 0xfffffffful;
+       local64_add(delta, &event->count);
+       local64_sub(delta, &event->hw.period_left);
+ }
+@@ -449,8 +469,9 @@ static void freeze_limited_counters(stru
+               val = (event->hw.idx == 5) ? pmc5 : pmc6;
+               prev = local64_read(&event->hw.prev_count);
+               event->hw.idx = 0;
+-              delta = (val - prev) & 0xfffffffful;
+-              local64_add(delta, &event->count);
++              delta = check_and_compute_delta(prev, val);
++              if (delta)
++                      local64_add(delta, &event->count);
+       }
+ }
+@@ -458,14 +479,16 @@ static void thaw_limited_counters(struct
+                                 unsigned long pmc5, unsigned long pmc6)
+ {
+       struct perf_event *event;
+-      u64 val;
++      u64 val, prev;
+       int i;
+       for (i = 0; i < cpuhw->n_limited; ++i) {
+               event = cpuhw->limited_counter[i];
+               event->hw.idx = cpuhw->limited_hwidx[i];
+               val = (event->hw.idx == 5) ? pmc5 : pmc6;
+-              local64_set(&event->hw.prev_count, val);
++              prev = local64_read(&event->hw.prev_count);
++              if (check_and_compute_delta(prev, val))
++                      local64_set(&event->hw.prev_count, val);
+               perf_event_update_userpage(event);
+       }
+ }
+@@ -1197,7 +1220,7 @@ static void record_and_restart(struct pe
+       /* we don't have to worry about interrupts here */
+       prev = local64_read(&event->hw.prev_count);
+-      delta = (val - prev) & 0xfffffffful;
++      delta = check_and_compute_delta(prev, val);
+       local64_add(delta, &event->count);
+       /*
diff --git a/queue-2.6.38/proc-do-proper-range-check-on-readdir-offset.patch b/queue-2.6.38/proc-do-proper-range-check-on-readdir-offset.patch
new file mode 100644 (file)
index 0000000..20e4da5
--- /dev/null
@@ -0,0 +1,42 @@
+From d8bdc59f215e62098bc5b4256fd9928bf27053a1 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Mon, 18 Apr 2011 10:36:54 -0700
+Subject: proc: do proper range check on readdir offset
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit d8bdc59f215e62098bc5b4256fd9928bf27053a1 upstream.
+
+Rather than pass in some random truncated offset to the pid-related
+functions, check that the offset is in range up-front.
+
+This is just cleanup, the previous commit fixed the real problem.
+
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/proc/base.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/fs/proc/base.c
++++ b/fs/proc/base.c
+@@ -3066,11 +3066,16 @@ static int proc_pid_fill_cache(struct fi
+ /* for the /proc/ directory itself, after non-process stuff has been done */
+ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
+ {
+-      unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
+-      struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
++      unsigned int nr;
++      struct task_struct *reaper;
+       struct tgid_iter iter;
+       struct pid_namespace *ns;
++      if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET)
++              goto out_no_task;
++      nr = filp->f_pos - FIRST_PROCESS_ENTRY;
++
++      reaper = get_proc_task(filp->f_path.dentry->d_inode);
+       if (!reaper)
+               goto out_no_task;
diff --git a/queue-2.6.38/rtc-add-missing-return-0-in-new-alarm-func-for-rtc-bfin.c.patch b/queue-2.6.38/rtc-add-missing-return-0-in-new-alarm-func-for-rtc-bfin.c.patch
new file mode 100644 (file)
index 0000000..fcc2985
--- /dev/null
@@ -0,0 +1,35 @@
+From 8c122b96866580c99e44f3f07ac93a993d964ec3 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 18 Mar 2011 04:26:24 -0400
+Subject: RTC: add missing "return 0" in new alarm func for rtc-bfin.c
+
+From: Mike Frysinger <vapier@gentoo.org>
+
+commit 8c122b96866580c99e44f3f07ac93a993d964ec3 upstream.
+
+The new bfin_rtc_alarm_irq_enable function forgot to add a "return 0" to
+the end leading to the build warning:
+       drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
+       drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function
+
+CC: Thomas Gleixner <tglx@linutronix.de>
+CC: Alessandro Zummo <a.zummo@towertech.it>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/rtc/rtc-bfin.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/rtc/rtc-bfin.c
++++ b/drivers/rtc/rtc-bfin.c
+@@ -276,6 +276,8 @@ static int bfin_rtc_alarm_irq_enable(str
+               bfin_rtc_int_set_alarm(rtc);
+       else
+               bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
++
++      return 0;
+ }
+ static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)
diff --git a/queue-2.6.38/sched-fix-erroneous-all_pinned-logic.patch b/queue-2.6.38/sched-fix-erroneous-all_pinned-logic.patch
new file mode 100644 (file)
index 0000000..5067d5e
--- /dev/null
@@ -0,0 +1,93 @@
+From b30aef17f71cf9e24b10c11cbb5e5f0ebe8a85ab Mon Sep 17 00:00:00 2001
+From: Ken Chen <kenchen@google.com>
+Date: Fri, 8 Apr 2011 12:20:16 -0700
+Subject: sched: Fix erroneous all_pinned logic
+
+From: Ken Chen <kenchen@google.com>
+
+commit b30aef17f71cf9e24b10c11cbb5e5f0ebe8a85ab upstream.
+
+The scheduler load balancer has specific code to deal with cases of
+unbalanced system due to lots of unmovable tasks (for example because of
+hard CPU affinity). In those situation, it excludes the busiest CPU that
+has pinned tasks for load balance consideration such that it can perform
+second 2nd load balance pass on the rest of the system.
+
+This all works as designed if there is only one cgroup in the system.
+
+However, when we have multiple cgroups, this logic has false positives and
+triggers multiple load balance passes despite there are actually no pinned
+tasks at all.
+
+The reason it has false positives is that the all pinned logic is deep in
+the lowest function of can_migrate_task() and is too low level:
+
+load_balance_fair() iterates each task group and calls balance_tasks() to
+migrate target load. Along the way, balance_tasks() will also set a
+all_pinned variable. Given that task-groups are iterated, this all_pinned
+variable is essentially the status of last group in the scanning process.
+Task group can have number of reasons that no load being migrated, none
+due to cpu affinity. However, this status bit is being propagated back up
+to the higher level load_balance(), which incorrectly think that no tasks
+were moved.  It kick off the all pinned logic and start multiple passes
+attempt to move load onto puller CPU.
+
+To fix this, move the all_pinned aggregation up at the iterator level.
+This ensures that the status is aggregated over all task-groups, not just
+last one in the list.
+
+Signed-off-by: Ken Chen <kenchen@google.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Link: http://lkml.kernel.org/r/BANLkTi=ernzNawaR5tJZEsV_QVnfxqXmsQ@mail.gmail.com
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/sched_fair.c |   11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+--- a/kernel/sched_fair.c
++++ b/kernel/sched_fair.c
+@@ -2043,21 +2043,20 @@ balance_tasks(struct rq *this_rq, int th
+             enum cpu_idle_type idle, int *all_pinned,
+             int *this_best_prio, struct cfs_rq *busiest_cfs_rq)
+ {
+-      int loops = 0, pulled = 0, pinned = 0;
++      int loops = 0, pulled = 0;
+       long rem_load_move = max_load_move;
+       struct task_struct *p, *n;
+       if (max_load_move == 0)
+               goto out;
+-      pinned = 1;
+-
+       list_for_each_entry_safe(p, n, &busiest_cfs_rq->tasks, se.group_node) {
+               if (loops++ > sysctl_sched_nr_migrate)
+                       break;
+               if ((p->se.load.weight >> 1) > rem_load_move ||
+-                  !can_migrate_task(p, busiest, this_cpu, sd, idle, &pinned))
++                  !can_migrate_task(p, busiest, this_cpu, sd, idle,
++                                    all_pinned))
+                       continue;
+               pull_task(busiest, p, this_rq, this_cpu);
+@@ -2092,9 +2091,6 @@ out:
+        */
+       schedstat_add(sd, lb_gained[idle], pulled);
+-      if (all_pinned)
+-              *all_pinned = pinned;
+-
+       return max_load_move - rem_load_move;
+ }
+@@ -3297,6 +3293,7 @@ redo:
+                * still unbalanced. ld_moved simply stays zero, so it is
+                * correctly treated as an imbalance.
+                */
++              all_pinned = 1;
+               local_irq_save(flags);
+               double_rq_lock(this_rq, busiest);
+               ld_moved = move_tasks(this_rq, this_cpu, busiest,
index 1c2b607bec537378c69fed7e23d834fd30433f2f..14797ef74849ea4faef8262255f1fcdbf6b30e1e 100644 (file)
@@ -40,3 +40,19 @@ maintainers-update-stable-branch-info.patch
 ubifs-fix-oops-when-r-o-file-system-is-fsync-ed.patch
 x86-amd-set-arat-feature-on-amd-processors.patch
 x86-amd-disable-garttlbwlkerr-when-bios-forgets-it.patch
+vfs-fix-absolute-rcu-path-walk-failures-due-to-uninitialized-seq-number.patch
+arm-6864-1-hw_breakpoint-clear-dbgvcr-out-of-reset.patch
+i2c-algo-bit-call-pre-post_xfer-for-bit_test.patch
+rtc-add-missing-return-0-in-new-alarm-func-for-rtc-bfin.c.patch
+sched-fix-erroneous-all_pinned-logic.patch
+vmscan-all_unreclaimable-use-zone-all_unreclaimable-as-a-name.patch
+brk-compat_brk-fix-detection-of-randomized-brk.patch
+usb-musb-temporarily-make-it-bool.patch
+usb-ftdi_sio-added-ids-for-cti-usb-serial-devices.patch
+usb-ftdi_sio-add-pid-for-oct-dk201-docking-station.patch
+usb-ftdi_sio-add-ids-for-hameg-ho720-and-ho730.patch
+usb-option-added-support-for-samsung-gt-b3730-gt-b3710-lte-usb-modem.patch
+next_pidmap-fix-overflow-condition.patch
+proc-do-proper-range-check-on-readdir-offset.patch
+powerpc-fix-oops-if-scan_dispatch_log-is-called-too-early.patch
+powerpc-perf_event-skip-updating-kernel-counters-if-register-value-shrinks.patch
diff --git a/queue-2.6.38/usb-ftdi_sio-add-ids-for-hameg-ho720-and-ho730.patch b/queue-2.6.38/usb-ftdi_sio-add-ids-for-hameg-ho720-and-ho730.patch
new file mode 100644 (file)
index 0000000..9416116
--- /dev/null
@@ -0,0 +1,41 @@
+From c53c2fab40cf16e13af66f40bfd27200cda98d2f Mon Sep 17 00:00:00 2001
+From: Paul Friedrich <Paul.Friedrich@hameg.com>
+Date: Fri, 18 Mar 2011 11:13:55 +0100
+Subject: USB: ftdi_sio: add ids for Hameg HO720 and HO730
+
+From: Paul Friedrich <Paul.Friedrich@hameg.com>
+
+commit c53c2fab40cf16e13af66f40bfd27200cda98d2f upstream.
+
+usb serial: ftdi_sio: add two missing USB ID's for Hameg interfaces HO720
+and HO730
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |    2 ++
+ drivers/usb/serial/ftdi_sio_ids.h |    2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -788,6 +788,8 @@ static struct usb_device_id id_table_com
+       { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) },
++      { USB_DEVICE(FTDI_VID, HAMEG_HO720_PID) },
++      { USB_DEVICE(FTDI_VID, HAMEG_HO730_PID) },
+       { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) },
+       { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) },
+       { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -300,6 +300,8 @@
+  * Hameg HO820 and HO870 interface (using VID 0x0403)
+  */
+ #define HAMEG_HO820_PID                       0xed74
++#define HAMEG_HO730_PID                       0xed73
++#define HAMEG_HO720_PID                       0xed72
+ #define HAMEG_HO870_PID                       0xed71
+ /*
diff --git a/queue-2.6.38/usb-ftdi_sio-add-pid-for-oct-dk201-docking-station.patch b/queue-2.6.38/usb-ftdi_sio-add-pid-for-oct-dk201-docking-station.patch
new file mode 100644 (file)
index 0000000..c00bbc5
--- /dev/null
@@ -0,0 +1,40 @@
+From 11a31d84129dc3133417d626643d714c9df5317e Mon Sep 17 00:00:00 2001
+From: Johan Hovold <jhovold@gmail.com>
+Date: Fri, 8 Apr 2011 17:38:22 +0200
+Subject: USB: ftdi_sio: add PID for OCT DK201 docking station
+
+From: Johan Hovold <jhovold@gmail.com>
+
+commit 11a31d84129dc3133417d626643d714c9df5317e upstream.
+
+Add PID 0x0103 for serial port of the OCT DK201 docking station.
+
+Reported-by: Jan Hoogenraad <jan@hoogenraad.net>
+Signed-off-by: Johan Hovold <jhovold@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |    1 +
+ drivers/usb/serial/ftdi_sio_ids.h |    1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -527,6 +527,7 @@ static struct usb_device_id id_table_com
+       { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
+       { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) },
+       { USB_DEVICE(OCT_VID, OCT_US101_PID) },
++      { USB_DEVICE(OCT_VID, OCT_DK201_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk },
+       { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID),
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -572,6 +572,7 @@
+ /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
+ /* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
+ /* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
++#define OCT_DK201_PID         0x0103  /* OCT DK201 USB docking station */
+ #define OCT_US101_PID         0x0421  /* OCT US101 USB to RS-232 */
+ /*
diff --git a/queue-2.6.38/usb-ftdi_sio-added-ids-for-cti-usb-serial-devices.patch b/queue-2.6.38/usb-ftdi_sio-added-ids-for-cti-usb-serial-devices.patch
new file mode 100644 (file)
index 0000000..f42b623
--- /dev/null
@@ -0,0 +1,45 @@
+From 5a9443f08c83c294c5c806a689c1184b27cb26b3 Mon Sep 17 00:00:00 2001
+From: Christian Simon <simon@swine.de>
+Date: Mon, 28 Mar 2011 21:54:47 +0200
+Subject: USB: ftdi_sio: Added IDs for CTI USB Serial Devices
+
+From: Christian Simon <simon@swine.de>
+
+commit 5a9443f08c83c294c5c806a689c1184b27cb26b3 upstream.
+
+I added new ProdutIds for two devices from CTI GmbH Leipzig.
+
+Signed-off-by: Christian Simon <simon@swine.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ftdi_sio.c     |    2 ++
+ drivers/usb/serial/ftdi_sio_ids.h |    9 +++++++++
+ 2 files changed, 11 insertions(+)
+
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -151,6 +151,8 @@ static struct ftdi_sio_quirk ftdi_stmcli
+  * /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
+  */
+ static struct usb_device_id id_table_combined [] = {
++      { USB_DEVICE(FTDI_VID, FTDI_CTI_MINI_PID) },
++      { USB_DEVICE(FTDI_VID, FTDI_CTI_NANO_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
+--- a/drivers/usb/serial/ftdi_sio_ids.h
++++ b/drivers/usb/serial/ftdi_sio_ids.h
+@@ -1140,3 +1140,12 @@
+ #define QIHARDWARE_VID                        0x20B7
+ #define MILKYMISTONE_JTAGSERIAL_PID   0x0713
++/*
++ * CTI GmbH RS485 Converter http://www.cti-lean.com/
++ */
++/* USB-485-Mini*/
++#define FTDI_CTI_MINI_PID     0xF608
++/* USB-Nano-485*/
++#define FTDI_CTI_NANO_PID     0xF60B
++
++
diff --git a/queue-2.6.38/usb-musb-temporarily-make-it-bool.patch b/queue-2.6.38/usb-musb-temporarily-make-it-bool.patch
new file mode 100644 (file)
index 0000000..2ff9b5d
--- /dev/null
@@ -0,0 +1,53 @@
+From 7a180e70cfc56e131bfe4796773df2acfc7d4180 Mon Sep 17 00:00:00 2001
+From: Felipe Balbi <balbi@ti.com>
+Date: Tue, 22 Mar 2011 11:31:37 +0200
+Subject: usb: musb: temporarily make it bool
+
+From: Felipe Balbi <balbi@ti.com>
+
+commit 7a180e70cfc56e131bfe4796773df2acfc7d4180 upstream.
+
+Due to the recent changes to musb's glue layers,
+we can't compile musb-hdrc as a module - compilation
+will break due to undefined symbol musb_debug. In
+order to fix that, we need a big re-work of the
+debug support on the MUSB driver.
+
+Because that would mean a lot of new code coming
+into the -rc series, it's best to defer that to
+next merge window and for now just disable module
+support for MUSB.
+
+Once we get the refactor of the debugging support
+done, we can simply revert this patch and things
+will go back to normal again.
+
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/musb/Kconfig |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/musb/Kconfig
++++ b/drivers/usb/musb/Kconfig
+@@ -14,7 +14,7 @@ config USB_MUSB_HDRC
+       select TWL4030_USB if MACH_OMAP_3430SDP
+       select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
+       select USB_OTG_UTILS
+-      tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
++      bool 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
+       help
+         Say Y here if your system has a dual role high speed USB
+         controller based on the Mentor Graphics silicon IP.  Then
+@@ -30,8 +30,8 @@ config USB_MUSB_HDRC
+         If you do not know what this is, please say N.
+-        To compile this driver as a module, choose M here; the
+-        module will be called "musb-hdrc".
++#       To compile this driver as a module, choose M here; the
++#       module will be called "musb-hdrc".
+ choice
+       prompt "Platform Glue Layer"
diff --git a/queue-2.6.38/usb-option-added-support-for-samsung-gt-b3730-gt-b3710-lte-usb-modem.patch b/queue-2.6.38/usb-option-added-support-for-samsung-gt-b3730-gt-b3710-lte-usb-modem.patch
new file mode 100644 (file)
index 0000000..c77e543
--- /dev/null
@@ -0,0 +1,39 @@
+From 80f9df3e0093ad9f1eeefd2ff7fd27daaa518d25 Mon Sep 17 00:00:00 2001
+From: Marius B. Kotsbak <marius@kotsbak.com>
+Date: Tue, 22 Mar 2011 00:01:53 +0100
+Subject: USB: option: Added support for Samsung GT-B3730/GT-B3710 LTE USB modem.
+
+From: Marius B. Kotsbak <marius@kotsbak.com>
+
+commit 80f9df3e0093ad9f1eeefd2ff7fd27daaa518d25 upstream.
+
+Bind only modem AT command endpoint to option.
+
+Signed-off-by: Marius B. Kotsbak <marius@kotsbak.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/option.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -407,6 +407,10 @@ static void option_instat_callback(struc
+ /* ONDA MT825UP HSDPA 14.2 modem */
+ #define ONDA_MT825UP         0x000b
++/* Samsung products */
++#define SAMSUNG_VENDOR_ID                       0x04e8
++#define SAMSUNG_PRODUCT_GT_B3730                0x6889
++
+ /* some devices interfaces need special handling due to a number of reasons */
+ enum option_blacklist_reason {
+               OPTION_BLACKLIST_NONE = 0,
+@@ -968,6 +972,7 @@ static const struct usb_device_id option
+       { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
+       { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
+       { USB_DEVICE(ONDA_VENDOR_ID, ONDA_MT825UP) }, /* ONDA MT825UP modem */
++      { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730/GT-B3710 LTE USB modem.*/
+       { } /* Terminating entry */
+ };
+ MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/queue-2.6.38/vfs-fix-absolute-rcu-path-walk-failures-due-to-uninitialized-seq-number.patch b/queue-2.6.38/vfs-fix-absolute-rcu-path-walk-failures-due-to-uninitialized-seq-number.patch
new file mode 100644 (file)
index 0000000..71c89e9
--- /dev/null
@@ -0,0 +1,39 @@
+From c1530019e311c91d14b24d8e74d233152d806e45 Mon Sep 17 00:00:00 2001
+From: Tim Chen <tim.c.chen@linux.intel.com>
+Date: Fri, 15 Apr 2011 11:39:29 -0700
+Subject: vfs: Fix absolute RCU path walk failures due to uninitialized seq number
+
+From: Tim Chen <tim.c.chen@linux.intel.com>
+
+commit c1530019e311c91d14b24d8e74d233152d806e45 upstream.
+
+During RCU walk in path_lookupat and path_openat, the rcu lookup
+frequently failed if looking up an absolute path, because when root
+directory was looked up, seq number was not properly set in nameidata.
+
+We dropped out of RCU walk in nameidata_drop_rcu due to mismatch in
+directory entry's seq number.  We reverted to slow path walk that need
+to take references.
+
+With the following patch, I saw a 50% increase in an exim mail server
+benchmark throughput on a 4-socket Nehalem-EX system.
+
+Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
+Reviewed-by: Andi Kleen <ak@linux.intel.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/namei.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -712,6 +712,7 @@ static __always_inline void set_root_rcu
+               do {
+                       seq = read_seqcount_begin(&fs->seq);
+                       nd->root = fs->root;
++                      nd->seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
+               } while (read_seqcount_retry(&fs->seq, seq));
+       }
+ }
diff --git a/queue-2.6.38/vmscan-all_unreclaimable-use-zone-all_unreclaimable-as-a-name.patch b/queue-2.6.38/vmscan-all_unreclaimable-use-zone-all_unreclaimable-as-a-name.patch
new file mode 100644 (file)
index 0000000..7a5f168
--- /dev/null
@@ -0,0 +1,146 @@
+From 929bea7c714220fc76ce3f75bef9056477c28e74 Mon Sep 17 00:00:00 2001
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Date: Thu, 14 Apr 2011 15:22:12 -0700
+Subject: vmscan: all_unreclaimable() use zone->all_unreclaimable as a name
+
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+
+commit 929bea7c714220fc76ce3f75bef9056477c28e74 upstream.
+
+all_unreclaimable check in direct reclaim has been introduced at 2.6.19
+by following commit.
+
+       2006 Sep 25; commit 408d8544; oom: use unreclaimable info
+
+And it went through strange history. firstly, following commit broke
+the logic unintentionally.
+
+       2008 Apr 29; commit a41f24ea; page allocator: smarter retry of
+                                     costly-order allocations
+
+Two years later, I've found obvious meaningless code fragment and
+restored original intention by following commit.
+
+       2010 Jun 04; commit bb21c7ce; vmscan: fix do_try_to_free_pages()
+                                     return value when priority==0
+
+But, the logic didn't works when 32bit highmem system goes hibernation
+and Minchan slightly changed the algorithm and fixed it .
+
+       2010 Sep 22: commit d1908362: vmscan: check all_unreclaimable
+                                     in direct reclaim path
+
+But, recently, Andrey Vagin found the new corner case. Look,
+
+       struct zone {
+         ..
+               int                     all_unreclaimable;
+         ..
+               unsigned long           pages_scanned;
+         ..
+       }
+
+zone->all_unreclaimable and zone->pages_scanned are neigher atomic
+variables nor protected by lock.  Therefore zones can become a state of
+zone->page_scanned=0 and zone->all_unreclaimable=1.  In this case, current
+all_unreclaimable() return false even though zone->all_unreclaimabe=1.
+
+This resulted in the kernel hanging up when executing a loop of the form
+
+1. fork
+2. mmap
+3. touch memory
+4. read memory
+5. munmmap
+
+as described in
+http://www.gossamer-threads.com/lists/linux/kernel/1348725#1348725
+
+Is this ignorable minor issue?  No.  Unfortunately, x86 has very small dma
+zone and it become zone->all_unreclamble=1 easily.  and if it become
+all_unreclaimable=1, it never restore all_unreclaimable=0.  Why?  if
+all_unreclaimable=1, vmscan only try DEF_PRIORITY reclaim and
+a-few-lru-pages>>DEF_PRIORITY always makes 0.  that mean no page scan at
+all!
+
+Eventually, oom-killer never works on such systems.  That said, we can't
+use zone->pages_scanned for this purpose.  This patch restore
+all_unreclaimable() use zone->all_unreclaimable as old.  and in addition,
+to add oom_killer_disabled check to avoid reintroduce the issue of commit
+d1908362 ("vmscan: check all_unreclaimable in direct reclaim path").
+
+Reported-by: Andrey Vagin <avagin@openvz.org>
+Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Cc: Nick Piggin <npiggin@kernel.dk>
+Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
+Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+Acked-by: David Rientjes <rientjes@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/vmscan.c |   24 +++++++++++++-----------
+ 1 file changed, 13 insertions(+), 11 deletions(-)
+
+--- a/mm/vmscan.c
++++ b/mm/vmscan.c
+@@ -41,6 +41,7 @@
+ #include <linux/memcontrol.h>
+ #include <linux/delayacct.h>
+ #include <linux/sysctl.h>
++#include <linux/oom.h>
+ #include <asm/tlbflush.h>
+ #include <asm/div64.h>
+@@ -1988,17 +1989,12 @@ static bool zone_reclaimable(struct zone
+       return zone->pages_scanned < zone_reclaimable_pages(zone) * 6;
+ }
+-/*
+- * As hibernation is going on, kswapd is freezed so that it can't mark
+- * the zone into all_unreclaimable. It can't handle OOM during hibernation.
+- * So let's check zone's unreclaimable in direct reclaim as well as kswapd.
+- */
++/* All zones in zonelist are unreclaimable? */
+ static bool all_unreclaimable(struct zonelist *zonelist,
+               struct scan_control *sc)
+ {
+       struct zoneref *z;
+       struct zone *zone;
+-      bool all_unreclaimable = true;
+       for_each_zone_zonelist_nodemask(zone, z, zonelist,
+                       gfp_zone(sc->gfp_mask), sc->nodemask) {
+@@ -2006,13 +2002,11 @@ static bool all_unreclaimable(struct zon
+                       continue;
+               if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
+                       continue;
+-              if (zone_reclaimable(zone)) {
+-                      all_unreclaimable = false;
+-                      break;
+-              }
++              if (!zone->all_unreclaimable)
++                      return false;
+       }
+-      return all_unreclaimable;
++      return true;
+ }
+ /*
+@@ -2108,6 +2102,14 @@ out:
+       if (sc->nr_reclaimed)
+               return sc->nr_reclaimed;
++      /*
++       * As hibernation is going on, kswapd is freezed so that it can't mark
++       * the zone into all_unreclaimable. Thus bypassing all_unreclaimable
++       * check.
++       */
++      if (oom_killer_disabled)
++              return 0;
++
+       /* top priority shrink_zones still had more to do? don't OOM, then */
+       if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc))
+               return 1;