--- /dev/null
+From 970317aa48c6ef66cd023c039c2650c897bad927 Mon Sep 17 00:00:00 2001
+From: Li Zefan <lizefan@huawei.com>
+Date: Mon, 30 Jun 2014 11:49:58 +0800
+Subject: cgroup: fix mount failure in a corner case
+
+From: Li Zefan <lizefan@huawei.com>
+
+commit 970317aa48c6ef66cd023c039c2650c897bad927 upstream.
+
+ # cat test.sh
+ #! /bin/bash
+
+ mount -t cgroup -o cpu xxx /cgroup
+ umount /cgroup
+
+ mount -t cgroup -o cpu,cpuacct xxx /cgroup
+ umount /cgroup
+ # ./test.sh
+ mount: xxx already mounted or /cgroup busy
+ mount: according to mtab, xxx is already mounted on /cgroup
+
+It's because the cgroupfs_root of the first mount was under destruction
+asynchronously.
+
+Fix this by delaying and then retrying mount for this case.
+
+v3:
+- put the refcnt immediately after getting it. (Tejun)
+
+v2:
+- use percpu_ref_tryget_live() rather that introducing
+ percpu_ref_alive(). (Tejun)
+- adjust comment.
+
+tj: Updated the comment a bit.
+
+Signed-off-by: Li Zefan <lizefan@huawei.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+[lizf: Backported to 3.15:
+ - s/percpu_ref_tryget_live/atomic_inc_not_zero/
+ - Use goto instead of calling restart_syscall()
+ - Add cgroup_tree_mutex]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cgroup.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -1484,10 +1484,12 @@ static struct dentry *cgroup_mount(struc
+ int flags, const char *unused_dev_name,
+ void *data)
+ {
++ struct cgroup_subsys *ss;
+ struct cgroup_root *root;
+ struct cgroup_sb_opts opts;
+ struct dentry *dentry;
+ int ret;
++ int i;
+ bool new_sb;
+
+ /*
+@@ -1514,6 +1516,29 @@ retry:
+ goto out_unlock;
+ }
+
++ /*
++ * Destruction of cgroup root is asynchronous, so subsystems may
++ * still be dying after the previous unmount. Let's drain the
++ * dying subsystems. We just need to ensure that the ones
++ * unmounted previously finish dying and don't care about new ones
++ * starting. Testing ref liveliness is good enough.
++ */
++ for_each_subsys(ss, i) {
++ if (!(opts.subsys_mask & (1 << i)) ||
++ ss->root == &cgrp_dfl_root)
++ continue;
++
++ if (!atomic_inc_not_zero(&ss->root->cgrp.refcnt)) {
++ mutex_unlock(&cgroup_mutex);
++ mutex_unlock(&cgroup_tree_mutex);
++ msleep(10);
++ mutex_lock(&cgroup_tree_mutex);
++ mutex_lock(&cgroup_mutex);
++ goto retry;
++ }
++ cgroup_put(&ss->root->cgrp);
++ }
++
+ for_each_root(root) {
+ bool name_match = false;
+
--- /dev/null
+From ce9ccb17ef5b5088172f46dd246c92523fd3a524 Mon Sep 17 00:00:00 2001
+From: Jean Sacren <sakiwit@gmail.com>
+Date: Thu, 1 May 2014 14:31:18 +0000
+Subject: i40e: fix passing wrong error code to i40e_open()
+
+From: Jean Sacren <sakiwit@gmail.com>
+
+commit ce9ccb17ef5b5088172f46dd246c92523fd3a524 upstream.
+
+The commit 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(),
+adding i40e_vsi_open()") introduced a new function i40e_vsi_open()
+with the regression by a typo. Due to the commit, the wrong error
+code would be passed to i40e_open(). Fix this error in
+i40e_vsi_open() by turning the macro into a negative value so that
+i40e_open() could return the pertinent error code correctly.
+
+Fixes: 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()")
+Signed-off-by: Jean Sacren <sakiwit@gmail.com>
+Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
+@@ -4310,7 +4310,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
+ goto err_setup_rx;
+
+ if (!vsi->netdev) {
+- err = EINVAL;
++ err = -EINVAL;
+ goto err_setup_rx;
+ }
+ snprintf(int_name, sizeof(int_name) - 1, "%s-%s",
--- /dev/null
+From 2913aae5f9eae2f857cdeff5388bb22d0751aa08 Mon Sep 17 00:00:00 2001
+From: Ted Juan <ted.juan@gmail.com>
+Date: Wed, 28 May 2014 22:33:06 +0800
+Subject: mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
+
+From: Ted Juan <ted.juan@gmail.com>
+
+commit 2913aae5f9eae2f857cdeff5388bb22d0751aa08 upstream.
+
+ Fixes: 2c9f2365d1e1d0e318b068f683f18c99515b80f8
+ mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch
+
+ Fixes: 7bcd1dca1d587ad29f9825ba4414620440e8c8da
+ mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch
+
+Signed-off-by: Ted Juan <ted.juan@gmail.com>
+Acked-by: Pekon Gupta <pekon@ti.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/nand/omap2.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate
+ struct gpmc_nand_regs *gpmc_regs = &info->reg;
+ u8 *ecc_code;
+ unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
+- int i;
++ int i, j;
+
+ nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
+ for (i = 0; i < nsectors; i++) {
+@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate
+ case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
+ /* Add constant polynomial to remainder, so that
+ * ECC of blank pages results in 0x0 on reading back */
+- for (i = 0; i < eccbytes; i++)
+- ecc_calc[i] ^= bch4_polynomial[i];
++ for (j = 0; j < eccbytes; j++)
++ ecc_calc[j] ^= bch4_polynomial[j];
+ break;
+ case OMAP_ECC_BCH4_CODE_HW:
+ /* Set 8th ECC byte as 0x0 for ROM compatibility */
+@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate
+ case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
+ /* Add constant polynomial to remainder, so that
+ * ECC of blank pages results in 0x0 on reading back */
+- for (i = 0; i < eccbytes; i++)
+- ecc_calc[i] ^= bch8_polynomial[i];
++ for (j = 0; j < eccbytes; j++)
++ ecc_calc[j] ^= bch8_polynomial[j];
+ break;
+ case OMAP_ECC_BCH8_CODE_HW:
+ /* Set 14th ECC byte as 0x0 for ROM compatibility */
x86-64-espfix-don-t-leak-bits-31-16-of-esp-returning-to-16-bit-stack.patch
dma-cma-fix-possible-memory-leak.patch
ring-buffer-check-if-buffer-exists-before-polling.patch
+i40e-fix-passing-wrong-error-code-to-i40e_open.patch
+mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch
+cgroup-fix-mount-failure-in-a-corner-case.patch