From: Greg Kroah-Hartman Date: Thu, 25 Oct 2012 19:55:32 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.49~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=335c12d53e471cfedf18cce2b384d78ec3687709;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch iommu-tegra-smmu-fix-deadly-typo.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 --- diff --git a/queue-3.4/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch b/queue-3.4/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch new file mode 100644 index 00000000000..d07d1a4a987 --- /dev/null +++ b/queue-3.4/amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch @@ -0,0 +1,59 @@ +From 168bfeef7bba3f9784f7540b053e4ac72b769ce9 Mon Sep 17 00:00:00 2001 +From: Andrew Morton +Date: Tue, 23 Oct 2012 14:09:39 -0700 +Subject: amd64_edac:__amd64_set_scrub_rate(): avoid overindexing scrubrates[] + +From: Andrew Morton + +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 +Cc: Doug Thompson +Signed-off-by: Andrew Morton +Signed-off-by: Borislav Petkov +Signed-off-by: Greg Kroah-Hartman + +--- + 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.4/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch b/queue-3.4/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch new file mode 100644 index 00000000000..004bfc7e00c --- /dev/null +++ b/queue-3.4/cgroup-notify_on_release-may-not-be-triggered-in-some-cases.patch @@ -0,0 +1,55 @@ +From 1f5320d5972aa50d3e8d2b227b636b370e608359 Mon Sep 17 00:00:00 2001 +From: Daisuke Nishimura +Date: Thu, 4 Oct 2012 16:37:16 +0900 +Subject: cgroup: notify_on_release may not be triggered in some cases + +From: Daisuke Nishimura + +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 +Cc: Ben Blum +Signed-off-by: Daisuke Nishimura +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/cgroup.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -1868,9 +1868,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.4/iommu-tegra-smmu-fix-deadly-typo.patch b/queue-3.4/iommu-tegra-smmu-fix-deadly-typo.patch new file mode 100644 index 00000000000..666265d826f --- /dev/null +++ b/queue-3.4/iommu-tegra-smmu-fix-deadly-typo.patch @@ -0,0 +1,31 @@ +From d0078e72314df2e5ede03f2102cddde06767c374 Mon Sep 17 00:00:00 2001 +From: Hiro Sugawara +Date: Thu, 18 Oct 2012 08:35:10 +0300 +Subject: iommu/tegra: smmu: Fix deadly typo + +From: Hiro Sugawara + +commit d0078e72314df2e5ede03f2102cddde06767c374 upstream. + +Fix a deadly typo in macro definition. + +Signed-off-by: Hiro Sugawara +Signed-off-by: Hiroshi Doyu +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -148,7 +148,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.4/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch b/queue-3.4/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch new file mode 100644 index 00000000000..8c0df60c26a --- /dev/null +++ b/queue-3.4/pinctrl-tegra-correct-bank-for-pingroup-and-drv-pingroup.patch @@ -0,0 +1,79 @@ +From a03690e44468dcd3088f6600ab036d17bd2130ff Mon Sep 17 00:00:00 2001 +From: Pritesh Raithatha +Date: Wed, 17 Oct 2012 11:51:37 +0530 +Subject: pinctrl: tegra: correct bank for pingroup and drv pingroup + +From: Pritesh Raithatha + +commit a03690e44468dcd3088f6600ab036d17bd2130ff upstream. + +Signed-off-by: Pritesh Raithatha +Acked-by: Stephen Warren +Tested-by: Stephen Warren +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -3343,10 +3343,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) \ +@@ -3362,25 +3362,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, \ + } +@@ -3399,8 +3399,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.4/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch b/queue-3.4/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch new file mode 100644 index 00000000000..e41c45e1a39 --- /dev/null +++ b/queue-3.4/pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch @@ -0,0 +1,30 @@ +From 154f3ebf53edcfbe28728452b4ab37a118581125 Mon Sep 17 00:00:00 2001 +From: Pritesh Raithatha +Date: Wed, 17 Oct 2012 17:09:36 +0530 +Subject: pinctrl: tegra: set low power mode bank width to 2 + +From: Pritesh Raithatha + +commit 154f3ebf53edcfbe28728452b4ab37a118581125 upstream. + +Signed-off-by: Pritesh Raithatha +Acked-by: Stephen Warren +Tested-by: Stephen Warren +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -259,7 +259,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.4/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch b/queue-3.4/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch new file mode 100644 index 00000000000..a7b32ace400 --- /dev/null +++ b/queue-3.4/revert-cgroup-drop-task_lock-parent-on-cgroup_fork.patch @@ -0,0 +1,73 @@ +From 9bb71308b8133d643648776243e4d5599b1c193d Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Thu, 18 Oct 2012 17:52:07 -0700 +Subject: Revert "cgroup: Drop task_lock(parent) on cgroup_fork()" + +From: Tejun Heo + +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 +LKML-Reference: <20121008020000.GB2575@localhost> +Acked-by: Li Zefan +Bitterly-Acked-by: Frederic Weisbecker +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/cgroup.c | 23 ++++++----------------- + 1 file changed, 6 insertions(+), 17 deletions(-) + +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -4462,31 +4462,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.4/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch b/queue-3.4/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch new file mode 100644 index 00000000000..e8360065d10 --- /dev/null +++ b/queue-3.4/revert-cgroup-remove-task_lock-from-cgroup_post_fork.patch @@ -0,0 +1,58 @@ +From d87838321124061f6c935069d97f37010fa417e6 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Thu, 18 Oct 2012 17:40:30 -0700 +Subject: Revert "cgroup: Remove task_lock() from cgroup_post_fork()" + +From: Tejun Heo + +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 +LKML-Reference: <20121008020000.GB2575@localhost> +Acked-by: Li Zefan +Cc: Frederic Weisbecker +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/cgroup.c | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -4539,19 +4539,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); + } + } diff --git a/queue-3.4/series b/queue-3.4/series index b517a643dba..0636236d871 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -17,3 +17,10 @@ usb-acm-fix-the-computation-of-the-number-of-data-bits.patch usb-host-xhci-new-system-added-for-compliance-mode-patch-on-sn65lvpe502cp.patch usb-option-blacklist-net-interface-on-zte-devices.patch usb-option-add-more-zte-devices.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 +pinctrl-tegra-set-low-power-mode-bank-width-to-2.patch +iommu-tegra-smmu-fix-deadly-typo.patch +amd64_edac-__amd64_set_scrub_rate-avoid-overindexing-scrubrates.patch