]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 19:55:36 +0000 (12:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 19:55:36 +0000 (12:55 -0700)
added patches:
amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch
cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch
dt-document-correct-tegra20-30-pinctrl-slew-rate-name.patch
iommu-tegra-smmu-fix-deadly-typo.patch
pinctrl-fix-missing-unlock-on-error-in.patch
pinctrl-remove-mutex-lock-in-groups-show.patch
pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch
pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch
revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch
revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch

queue-3.6/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch [new file with mode: 0644]
queue-3.6/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch [new file with mode: 0644]
queue-3.6/dt-document-correct-tegra20-30-pinctrl-slew-rate-name.patch [new file with mode: 0644]
queue-3.6/iommu-tegra-smmu-fix-deadly-typo.patch [new file with mode: 0644]
queue-3.6/pinctrl-fix-missing-unlock-on-error-in.patch [new file with mode: 0644]
queue-3.6/pinctrl-remove-mutex-lock-in-groups-show.patch [new file with mode: 0644]
queue-3.6/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch [new file with mode: 0644]
queue-3.6/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch [new file with mode: 0644]
queue-3.6/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch [new file with mode: 0644]
queue-3.6/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch [new file with mode: 0644]
queue-3.6/series

diff --git a/queue-3.6/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch b/queue-3.6/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch
new file mode 100644 (file)
index 0000000..d07d1a4
--- /dev/null
@@ -0,0 +1,59 @@
+From 168bfeef7bba3f9784f7540b053e4ac72b769ce9 Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm@linux-foundation.org>
+Date: Tue, 23 Oct 2012 14:09:39 -0700
+Subject: amd64_edac:__amd64_set_scrub_rate(): avoid overindexing scrubrates[]
+
+From: Andrew Morton <akpm@linux-foundation.org>
+
+commit 168bfeef7bba3f9784f7540b053e4ac72b769ce9 upstream.
+
+If none of the elements in scrubrates[] matches, this loop will cause
+__amd64_set_scrub_rate() to incorrectly use the n+1th element.
+
+As the function is designed to use the final scrubrates[] element in the
+case of no match, we can fix this bug by simply terminating the array
+search at the n-1th element.
+
+Boris: this code is fragile anyway, see here why:
+http://marc.info/?l=linux-kernel&m=135102834131236&w=2
+
+It will be rewritten more robustly soonish.
+
+Reported-by: Denis Kirjanov <kirjanov@gmail.com>
+Cc: Doug Thompson <dougthompson@xmission.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/edac/amd64_edac.c |   11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+--- a/drivers/edac/amd64_edac.c
++++ b/drivers/edac/amd64_edac.c
+@@ -170,8 +170,11 @@ static int __amd64_set_scrub_rate(struct
+        * memory controller and apply to register. Search for the first
+        * bandwidth entry that is greater or equal than the setting requested
+        * and program that. If at last entry, turn off DRAM scrubbing.
++       *
++       * If no suitable bandwidth is found, turn off DRAM scrubbing entirely
++       * by falling back to the last element in scrubrates[].
+        */
+-      for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
++      for (i = 0; i < ARRAY_SIZE(scrubrates) - 1; i++) {
+               /*
+                * skip scrub rates which aren't recommended
+                * (see F10 BKDG, F3x58)
+@@ -181,12 +184,6 @@ static int __amd64_set_scrub_rate(struct
+               if (scrubrates[i].bandwidth <= new_bw)
+                       break;
+-
+-              /*
+-               * if no suitable bandwidth found, turn off DRAM scrubbing
+-               * entirely by falling back to the last element in the
+-               * scrubrates array.
+-               */
+       }
+       scrubval = scrubrates[i].scrubval;
diff --git a/queue-3.6/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch b/queue-3.6/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch
new file mode 100644 (file)
index 0000000..0ce6891
--- /dev/null
@@ -0,0 +1,55 @@
+From 1f5320d5972aa50d3e8d2b227b636b370e608359 Mon Sep 17 00:00:00 2001
+From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
+Date: Thu, 4 Oct 2012 16:37:16 +0900
+Subject: cgroup: notify_on_release may not be triggered in some cases
+
+From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
+
+commit 1f5320d5972aa50d3e8d2b227b636b370e608359 upstream.
+
+notify_on_release must be triggered when the last process in a cgroup is
+move to another. But if the first(and only) process in a cgroup is moved to
+another, notify_on_release is not triggered.
+
+       # mkdir /cgroup/cpu/SRC
+       # mkdir /cgroup/cpu/DST
+       #
+       # echo 1 >/cgroup/cpu/SRC/notify_on_release
+       # echo 1 >/cgroup/cpu/DST/notify_on_release
+       #
+       # sleep 300 &
+       [1] 8629
+       #
+       # echo 8629 >/cgroup/cpu/SRC/tasks
+       # echo 8629 >/cgroup/cpu/DST/tasks
+       -> notify_on_release for /SRC must be triggered at this point,
+          but it isn't.
+
+This is because put_css_set() is called before setting CGRP_RELEASABLE
+in cgroup_task_migrate(), and is a regression introduce by the
+commit:74a1166d(cgroups: make procs file writable), which was merged
+into v3.0.
+
+Acked-by: Li Zefan <lizefan@huawei.com>
+Cc: Ben Blum <bblum@andrew.cmu.edu>
+Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cgroup.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -1923,9 +1923,8 @@ static void cgroup_task_migrate(struct c
+        * trading it for newcg is protected by cgroup_mutex, we're safe to drop
+        * it here; it will be freed under RCU.
+        */
+-      put_css_set(oldcg);
+-
+       set_bit(CGRP_RELEASABLE, &oldcgrp->flags);
++      put_css_set(oldcg);
+ }
+ /**
diff --git a/queue-3.6/dt-document-correct-tegra20-30-pinctrl-slew-rate-name.patch b/queue-3.6/dt-document-correct-tegra20-30-pinctrl-slew-rate-name.patch
new file mode 100644 (file)
index 0000000..d69bf8c
--- /dev/null
@@ -0,0 +1,44 @@
+From d6ec6b60a56a1e7d99da1fc69c031fa5ab54ba94 Mon Sep 17 00:00:00 2001
+From: Pritesh Raithatha <praithatha@nvidia.com>
+Date: Wed, 17 Oct 2012 17:07:00 +0530
+Subject: dt: Document: correct tegra20/30 pinctrl slew-rate name
+
+From: Pritesh Raithatha <praithatha@nvidia.com>
+
+commit d6ec6b60a56a1e7d99da1fc69c031fa5ab54ba94 upstream.
+
+change nvidia,slew_rate* to nvidia,slew-rate*
+
+Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Tested-by: Stephen Warren <swarren@nvidia.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt |    2 +-
+ Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt
++++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt
+@@ -93,7 +93,7 @@ Valid values for pin and group names are
+     With some exceptions, these support nvidia,high-speed-mode,
+     nvidia,schmitt, nvidia,low-power-mode, nvidia,pull-down-strength,
+-    nvidia,pull-up-strength, nvidia,slew_rate-rising, nvidia,slew_rate-falling.
++    nvidia,pull-up-strength, nvidia,slew-rate-rising, nvidia,slew-rate-falling.
+     drive_ao1, drive_ao2, drive_at1, drive_at2, drive_cdev1, drive_cdev2,
+     drive_csus, drive_dap1, drive_dap2, drive_dap3, drive_dap4, drive_dbg,
+--- a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt
++++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt
+@@ -83,7 +83,7 @@ Valid values for pin and group names are
+   drive groups:
+     These all support nvidia,pull-down-strength, nvidia,pull-up-strength,
+-    nvidia,slew_rate-rising, nvidia,slew_rate-falling. Most but not all
++    nvidia,slew-rate-rising, nvidia,slew-rate-falling. Most but not all
+     support nvidia,high-speed-mode, nvidia,schmitt, nvidia,low-power-mode.
+     ao1, ao2, at1, at2, at3, at4, at5, cdev1, cdev2, cec, crt, csus, dap1,
diff --git a/queue-3.6/iommu-tegra-smmu-fix-deadly-typo.patch b/queue-3.6/iommu-tegra-smmu-fix-deadly-typo.patch
new file mode 100644 (file)
index 0000000..a120ad9
--- /dev/null
@@ -0,0 +1,31 @@
+From d0078e72314df2e5ede03f2102cddde06767c374 Mon Sep 17 00:00:00 2001
+From: Hiro Sugawara <hsugawara@nvidia.com>
+Date: Thu, 18 Oct 2012 08:35:10 +0300
+Subject: iommu/tegra: smmu: Fix deadly typo
+
+From: Hiro Sugawara <hsugawara@nvidia.com>
+
+commit d0078e72314df2e5ede03f2102cddde06767c374 upstream.
+
+Fix a deadly typo in macro definition.
+
+Signed-off-by: Hiro Sugawara <hsugawara@nvidia.com>
+Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iommu/tegra-smmu.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iommu/tegra-smmu.c
++++ b/drivers/iommu/tegra-smmu.c
+@@ -146,7 +146,7 @@
+ #define SMMU_ADDR_TO_PFN(addr)        ((addr) >> 12)
+ #define SMMU_ADDR_TO_PDN(addr)        ((addr) >> 22)
+-#define SMMU_PDN_TO_ADDR(addr)        ((pdn) << 22)
++#define SMMU_PDN_TO_ADDR(pdn) ((pdn) << 22)
+ #define _READABLE     (1 << SMMU_PTB_DATA_ASID_READABLE_SHIFT)
+ #define _WRITABLE     (1 << SMMU_PTB_DATA_ASID_WRITABLE_SHIFT)
diff --git a/queue-3.6/pinctrl-fix-missing-unlock-on-error-in.patch b/queue-3.6/pinctrl-fix-missing-unlock-on-error-in.patch
new file mode 100644 (file)
index 0000000..694f958
--- /dev/null
@@ -0,0 +1,34 @@
+From b4dd784ba8af03bf1f9ee5118c792d7abd4919bd Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Date: Mon, 22 Oct 2012 12:58:09 +0800
+Subject: pinctrl: fix missing unlock on error in pinctrl_groups_show()
+
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+
+commit b4dd784ba8af03bf1f9ee5118c792d7abd4919bd upstream.
+
+Add the missing unlock on the error handle path in function
+pinctrl_groups_show().
+
+Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/core.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/pinctrl/core.c
++++ b/drivers/pinctrl/core.c
+@@ -1059,8 +1059,10 @@ static int pinctrl_groups_show(struct se
+                       seq_printf(s, "group: %s\n", gname);
+                       for (i = 0; i < num_pins; i++) {
+                               pname = pin_get_name(pctldev, pins[i]);
+-                              if (WARN_ON(!pname))
++                              if (WARN_ON(!pname)) {
++                                      mutex_unlock(&pinctrl_mutex);
+                                       return -EINVAL;
++                              }
+                               seq_printf(s, "pin %d (%s)\n", pins[i], pname);
+                       }
+                       seq_puts(s, "\n");
diff --git a/queue-3.6/pinctrl-remove-mutex-lock-in-groups-show.patch b/queue-3.6/pinctrl-remove-mutex-lock-in-groups-show.patch
new file mode 100644 (file)
index 0000000..ed4ae69
--- /dev/null
@@ -0,0 +1,41 @@
+From 7ae9d71e8df27a3ab60a05ae3add08728debc09c Mon Sep 17 00:00:00 2001
+From: Haojian Zhuang <haojian.zhuang@gmail.com>
+Date: Thu, 18 Oct 2012 17:07:01 +0800
+Subject: pinctrl: remove mutex lock in groups show
+
+From: Haojian Zhuang <haojian.zhuang@gmail.com>
+
+commit 7ae9d71e8df27a3ab60a05ae3add08728debc09c upstream.
+
+Mutex is locked duplicatly by pinconf_groups_show() and
+pin_config_group_get(). It results dead lock. So avoid to lock mutex
+in pinconf_groups_show().
+
+Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/pinconf.c |    4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/pinctrl/pinconf.c
++++ b/drivers/pinctrl/pinconf.c
+@@ -537,8 +537,6 @@ static int pinconf_groups_show(struct se
+       seq_puts(s, "Pin config settings per pin group\n");
+       seq_puts(s, "Format: group (name): configs\n");
+-      mutex_lock(&pinctrl_mutex);
+-
+       while (selector < ngroups) {
+               const char *gname = pctlops->get_group_name(pctldev, selector);
+@@ -549,8 +547,6 @@ static int pinconf_groups_show(struct se
+               selector++;
+       }
+-      mutex_unlock(&pinctrl_mutex);
+-
+       return 0;
+ }
diff --git a/queue-3.6/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch b/queue-3.6/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch
new file mode 100644 (file)
index 0000000..952429c
--- /dev/null
@@ -0,0 +1,79 @@
+From a03690e44468dcd3088f6600ab036d17bd2130ff Mon Sep 17 00:00:00 2001
+From: Pritesh Raithatha <praithatha@nvidia.com>
+Date: Wed, 17 Oct 2012 11:51:37 +0530
+Subject: pinctrl: tegra: correct bank for pingroup and drv pingroup
+
+From: Pritesh Raithatha <praithatha@nvidia.com>
+
+commit a03690e44468dcd3088f6600ab036d17bd2130ff upstream.
+
+Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Tested-by: Stephen Warren <swarren@nvidia.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/pinctrl-tegra30.c |   24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+--- a/drivers/pinctrl/pinctrl-tegra30.c
++++ b/drivers/pinctrl/pinctrl-tegra30.c
+@@ -3345,10 +3345,10 @@ static const struct tegra_function tegra
+       FUNCTION(vi_alt3),
+ };
+-#define MUXCTL_REG_A  0x3000
+-#define PINGROUP_REG_A        0x868
++#define DRV_PINGROUP_REG_A    0x868   /* bank 0 */
++#define PINGROUP_REG_A                0x3000  /* bank 1 */
+-#define PINGROUP_REG_Y(r) ((r) - MUXCTL_REG_A)
++#define PINGROUP_REG_Y(r) ((r) - PINGROUP_REG_A)
+ #define PINGROUP_REG_N(r) -1
+ #define PINGROUP(pg_name, f0, f1, f2, f3, f_safe, r, od, ior) \
+@@ -3364,25 +3364,25 @@ static const struct tegra_function tegra
+               },                                              \
+               .func_safe = TEGRA_MUX_ ## f_safe,              \
+               .mux_reg = PINGROUP_REG_Y(r),                   \
+-              .mux_bank = 0,                                  \
++              .mux_bank = 1,                                  \
+               .mux_bit = 0,                                   \
+               .pupd_reg = PINGROUP_REG_Y(r),                  \
+-              .pupd_bank = 0,                                 \
++              .pupd_bank = 1,                                 \
+               .pupd_bit = 2,                                  \
+               .tri_reg = PINGROUP_REG_Y(r),                   \
+-              .tri_bank = 0,                                  \
++              .tri_bank = 1,                                  \
+               .tri_bit = 4,                                   \
+               .einput_reg = PINGROUP_REG_Y(r),                \
+-              .einput_bank = 0,                               \
++              .einput_bank = 1,                               \
+               .einput_bit = 5,                                \
+               .odrain_reg = PINGROUP_REG_##od(r),             \
+-              .odrain_bank = 0,                               \
++              .odrain_bank = 1,                               \
+               .odrain_bit = 6,                                \
+               .lock_reg = PINGROUP_REG_Y(r),                  \
+-              .lock_bank = 0,                                 \
++              .lock_bank = 1,                                 \
+               .lock_bit = 7,                                  \
+               .ioreset_reg = PINGROUP_REG_##ior(r),           \
+-              .ioreset_bank = 0,                              \
++              .ioreset_bank = 1,                              \
+               .ioreset_bit = 8,                               \
+               .drv_reg = -1,                                  \
+       }
+@@ -3401,8 +3401,8 @@ static const struct tegra_function tegra
+               .odrain_reg = -1,                               \
+               .lock_reg = -1,                                 \
+               .ioreset_reg = -1,                              \
+-              .drv_reg = ((r) - PINGROUP_REG_A),              \
+-              .drv_bank = 1,                                  \
++              .drv_reg = ((r) - DRV_PINGROUP_REG_A),          \
++              .drv_bank = 0,                                  \
+               .hsm_bit = hsm_b,                               \
+               .schmitt_bit = schmitt_b,                       \
+               .lpmd_bit = lpmd_b,                             \
diff --git a/queue-3.6/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch b/queue-3.6/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch
new file mode 100644 (file)
index 0000000..a942b63
--- /dev/null
@@ -0,0 +1,30 @@
+From 154f3ebf53edcfbe28728452b4ab37a118581125 Mon Sep 17 00:00:00 2001
+From: Pritesh Raithatha <praithatha@nvidia.com>
+Date: Wed, 17 Oct 2012 17:09:36 +0530
+Subject: pinctrl: tegra: set low power mode bank width to 2
+
+From: Pritesh Raithatha <praithatha@nvidia.com>
+
+commit 154f3ebf53edcfbe28728452b4ab37a118581125 upstream.
+
+Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Tested-by: Stephen Warren <swarren@nvidia.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/pinctrl-tegra.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/pinctrl/pinctrl-tegra.c
++++ b/drivers/pinctrl/pinctrl-tegra.c
+@@ -466,7 +466,7 @@ static int tegra_pinconf_reg(struct tegr
+               *bank = g->drv_bank;
+               *reg = g->drv_reg;
+               *bit = g->lpmd_bit;
+-              *width = 1;
++              *width = 2;
+               break;
+       case TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH:
+               *bank = g->drv_bank;
diff --git a/queue-3.6/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch b/queue-3.6/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch
new file mode 100644 (file)
index 0000000..636c301
--- /dev/null
@@ -0,0 +1,73 @@
+From 9bb71308b8133d643648776243e4d5599b1c193d Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Thu, 18 Oct 2012 17:52:07 -0700
+Subject: Revert "cgroup: Drop task_lock(parent) on cgroup_fork()"
+
+From: Tejun Heo <tj@kernel.org>
+
+commit 9bb71308b8133d643648776243e4d5599b1c193d upstream.
+
+This reverts commit 7e381b0eb1e1a9805c37335562e8dc02e7d7848c.
+
+The commit incorrectly assumed that fork path always performed
+threadgroup_change_begin/end() and depended on that for
+synchronization against task exit and cgroup migration paths instead
+of explicitly grabbing task_lock().
+
+threadgroup_change is not locked when forking a new process (as
+opposed to a new thread in the same process) and even if it were it
+wouldn't be effective as different processes use different threadgroup
+locks.
+
+Revert the incorrect optimization.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+LKML-Reference: <20121008020000.GB2575@localhost>
+Acked-by: Li Zefan <lizefan@huawei.com>
+Bitterly-Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cgroup.c |   23 ++++++-----------------
+ 1 file changed, 6 insertions(+), 17 deletions(-)
+
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -4694,31 +4694,20 @@ static const struct file_operations proc
+  *
+  * A pointer to the shared css_set was automatically copied in
+  * fork.c by dup_task_struct().  However, we ignore that copy, since
+- * it was not made under the protection of RCU, cgroup_mutex or
+- * threadgroup_change_begin(), so it might no longer be a valid
+- * cgroup pointer.  cgroup_attach_task() might have already changed
+- * current->cgroups, allowing the previously referenced cgroup
+- * group to be removed and freed.
+- *
+- * Outside the pointer validity we also need to process the css_set
+- * inheritance between threadgoup_change_begin() and
+- * threadgoup_change_end(), this way there is no leak in any process
+- * wide migration performed by cgroup_attach_proc() that could otherwise
+- * miss a thread because it is too early or too late in the fork stage.
++ * it was not made under the protection of RCU or cgroup_mutex, so
++ * might no longer be a valid cgroup pointer.  cgroup_attach_task() might
++ * have already changed current->cgroups, allowing the previously
++ * referenced cgroup group to be removed and freed.
+  *
+  * At the point that cgroup_fork() is called, 'current' is the parent
+  * task, and the passed argument 'child' points to the child task.
+  */
+ void cgroup_fork(struct task_struct *child)
+ {
+-      /*
+-       * We don't need to task_lock() current because current->cgroups
+-       * can't be changed concurrently here. The parent obviously hasn't
+-       * exited and called cgroup_exit(), and we are synchronized against
+-       * cgroup migration through threadgroup_change_begin().
+-       */
++      task_lock(current);
+       child->cgroups = current->cgroups;
+       get_css_set(child->cgroups);
++      task_unlock(current);
+       INIT_LIST_HEAD(&child->cg_list);
+ }
diff --git a/queue-3.6/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch b/queue-3.6/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch
new file mode 100644 (file)
index 0000000..5085b1d
--- /dev/null
@@ -0,0 +1,58 @@
+From d87838321124061f6c935069d97f37010fa417e6 Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Thu, 18 Oct 2012 17:40:30 -0700
+Subject: Revert "cgroup: Remove task_lock() from cgroup_post_fork()"
+
+From: Tejun Heo <tj@kernel.org>
+
+commit d87838321124061f6c935069d97f37010fa417e6 upstream.
+
+This reverts commit 7e3aa30ac8c904a706518b725c451bb486daaae9.
+
+The commit incorrectly assumed that fork path always performed
+threadgroup_change_begin/end() and depended on that for
+synchronization against task exit and cgroup migration paths instead
+of explicitly grabbing task_lock().
+
+threadgroup_change is not locked when forking a new process (as
+opposed to a new thread in the same process) and even if it were it
+wouldn't be effective as different processes use different threadgroup
+locks.
+
+Revert the incorrect optimization.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+LKML-Reference: <20121008020000.GB2575@localhost>
+Acked-by: Li Zefan <lizefan@huawei.com>
+Cc: Frederic Weisbecker <fweisbec@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cgroup.c |   15 +++------------
+ 1 file changed, 3 insertions(+), 12 deletions(-)
+
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -4771,19 +4771,10 @@ void cgroup_post_fork(struct task_struct
+        */
+       if (use_task_css_set_links) {
+               write_lock(&css_set_lock);
+-              if (list_empty(&child->cg_list)) {
+-                      /*
+-                       * It's safe to use child->cgroups without task_lock()
+-                       * here because we are protected through
+-                       * threadgroup_change_begin() against concurrent
+-                       * css_set change in cgroup_task_migrate(). Also
+-                       * the task can't exit at that point until
+-                       * wake_up_new_task() is called, so we are protected
+-                       * against cgroup_exit() setting child->cgroup to
+-                       * init_css_set.
+-                       */
++              task_lock(child);
++              if (list_empty(&child->cg_list))
+                       list_add(&child->cg_list, &child->cgroups->tasks);
+-              }
++              task_unlock(child);
+               write_unlock(&css_set_lock);
+       }
+ }
index 9048fb99d8a962b01fd26f0ac8938d33b8ae18c8..3a4abe626098550fbf9c41b7f13fb960ddf26512 100644 (file)
@@ -47,3 +47,13 @@ usb-don-t-enable-lpm-if-the-exit-latency-is-zero.patch
 usb-enable-lpm-after-a-failed-probe.patch
 usb-send-set-sel-before-enabling-parent-u1-u2-timeout.patch
 usb-fix-port-probing-and-removal-in-garmin_gps.patch
+cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch
+revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch
+revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch
+pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch
+dt-document-correct-tegra20-30-pinctrl-slew-rate-name.patch
+pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch
+pinctrl-remove-mutex-lock-in-groups-show.patch
+pinctrl-fix-missing-unlock-on-error-in.patch
+iommu-tegra-smmu-fix-deadly-typo.patch
+amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch