--- /dev/null
+From: Will Deacon <will.deacon@arm.com>
+Date: Fri, 20 Apr 2012 17:21:08 +0100
+Subject: ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit f154fe9b806574437b47f08e924ad10c0e240b23 upstream.
+
+The workaround for PL310 erratum #753970 can lead to deadlock on systems
+with an L220 cache controller.
+
+This patch makes the workaround effective only when the cache controller
+is identified as a PL310 at probe time.
+
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+[bwh: Backported to 3.2: adjust context]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mm/cache-l2x0.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/arch/arm/mm/cache-l2x0.c
++++ b/arch/arm/mm/cache-l2x0.c
+@@ -32,6 +32,7 @@ static void __iomem *l2x0_base;
+ static DEFINE_RAW_SPINLOCK(l2x0_lock);
+ static uint32_t l2x0_way_mask; /* Bitmask of active ways */
+ static uint32_t l2x0_size;
++static unsigned long sync_reg_offset = L2X0_CACHE_SYNC;
+
+ struct l2x0_regs l2x0_saved_regs;
+
+@@ -61,12 +62,7 @@ static inline void cache_sync(void)
+ {
+ void __iomem *base = l2x0_base;
+
+-#ifdef CONFIG_PL310_ERRATA_753970
+- /* write to an unmmapped register */
+- writel_relaxed(0, base + L2X0_DUMMY_REG);
+-#else
+- writel_relaxed(0, base + L2X0_CACHE_SYNC);
+-#endif
++ writel_relaxed(0, base + sync_reg_offset);
+ cache_wait(base + L2X0_CACHE_SYNC, 1);
+ }
+
+@@ -331,6 +327,10 @@ void __init l2x0_init(void __iomem *base
+ else
+ ways = 8;
+ type = "L310";
++#ifdef CONFIG_PL310_ERRATA_753970
++ /* Unmapped register. */
++ sync_reg_offset = L2X0_DUMMY_REG;
++#endif
+ break;
+ case L2X0_CACHE_ID_PART_L210:
+ ways = (aux >> 13) & 0xf;
--- /dev/null
+From ab4d536890853ab6675ede65db40e2c0980cb0ea Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon@arm.com>
+Date: Fri, 20 Apr 2012 17:22:11 +0100
+Subject: ARM: 7398/1: l2x0: only write to debug registers on PL310
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit ab4d536890853ab6675ede65db40e2c0980cb0ea upstream.
+
+PL310 errata #588369 and #727915 require writes to the debug registers
+of the cache controller to work around known problems. Writing these
+registers on L220 may cause deadlock, so ensure that we only perform
+this operation when we identify a PL310 at probe time.
+
+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@linuxfoundation.org>
+
+---
+ arch/arm/mm/cache-l2x0.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+--- a/arch/arm/mm/cache-l2x0.c
++++ b/arch/arm/mm/cache-l2x0.c
+@@ -81,10 +81,13 @@ static inline void l2x0_inv_line(unsigne
+ }
+
+ #if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
++static inline void debug_writel(unsigned long val)
++{
++ if (outer_cache.set_debug)
++ outer_cache.set_debug(val);
++}
+
+-#define debug_writel(val) outer_cache.set_debug(val)
+-
+-static void l2x0_set_debug(unsigned long val)
++static void pl310_set_debug(unsigned long val)
+ {
+ writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
+ }
+@@ -94,7 +97,7 @@ static inline void debug_writel(unsigned
+ {
+ }
+
+-#define l2x0_set_debug NULL
++#define pl310_set_debug NULL
+ #endif
+
+ #ifdef CONFIG_PL310_ERRATA_588369
+@@ -331,6 +334,7 @@ void __init l2x0_init(void __iomem *base
+ /* Unmapped register. */
+ sync_reg_offset = L2X0_DUMMY_REG;
+ #endif
++ outer_cache.set_debug = pl310_set_debug;
+ break;
+ case L2X0_CACHE_ID_PART_L210:
+ ways = (aux >> 13) & 0xf;
+@@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base
+ outer_cache.flush_all = l2x0_flush_all;
+ outer_cache.inv_all = l2x0_inv_all;
+ outer_cache.disable = l2x0_disable;
+- outer_cache.set_debug = l2x0_set_debug;
+
+ printk(KERN_INFO "%s cache controller enabled\n", type);
+ printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",
--- /dev/null
+From 9dc4e6c4d1182d34604ea40fef641775f5b15456 Mon Sep 17 00:00:00 2001
+From: "J. Bruce Fields" <bfields@redhat.com>
+Date: Mon, 9 Apr 2012 18:06:49 -0400
+Subject: nfsd: don't fail unchecked creates of non-special files
+
+From: "J. Bruce Fields" <bfields@redhat.com>
+
+commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.
+
+Allow a v3 unchecked open of a non-regular file succeed as if it were a
+lookup; typically a client in such a case will want to fall back on a
+local open, so succeeding and giving it the filehandle is more useful
+than failing with nfserr_exist, which makes it appear that nothing at
+all exists by that name.
+
+Similarly for v4, on an open-create, return the same errors we would on
+an attempt to open a non-regular file, instead of returning
+nfserr_exist.
+
+This fixes a problem found doing a v4 open of a symlink with
+O_RDONLY|O_CREAT, which resulted in the current client returning EEXIST.
+
+Thanks also to Trond for analysis.
+
+Reported-by: Orion Poplawski <orion@cora.nwra.com>
+Tested-by: Orion Poplawski <orion@cora.nwra.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+[bwh: Backported to 3.2 and 3.3: use &resfh, not resfh]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfsd/nfs4proc.c | 8 ++++----
+ fs/nfsd/vfs.c | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/fs/nfsd/nfs4proc.c
++++ b/fs/nfsd/nfs4proc.c
+@@ -231,17 +231,17 @@ do_open_lookup(struct svc_rqst *rqstp, s
+ */
+ if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
+ open->op_bmval[1] = (FATTR4_WORD1_TIME_ACCESS |
+- FATTR4_WORD1_TIME_MODIFY);
++ FATTR4_WORD1_TIME_MODIFY);
+ } else {
+ status = nfsd_lookup(rqstp, current_fh,
+ open->op_fname.data, open->op_fname.len, &resfh);
+ fh_unlock(current_fh);
+- if (status)
+- goto out;
+- status = nfsd_check_obj_isreg(&resfh);
+ }
+ if (status)
+ goto out;
++ status = nfsd_check_obj_isreg(&resfh);
++ if (status)
++ goto out;
+
+ if (is_create_with_attrs(open) && open->op_acl != NULL)
+ do_set_nfs4_acl(rqstp, &resfh, open->op_acl, open->op_bmval);
+--- a/fs/nfsd/vfs.c
++++ b/fs/nfsd/vfs.c
+@@ -1450,7 +1450,7 @@ do_nfsd_create(struct svc_rqst *rqstp, s
+ switch (createmode) {
+ case NFS3_CREATE_UNCHECKED:
+ if (! S_ISREG(dchild->d_inode->i_mode))
+- err = nfserr_exist;
++ goto out;
+ else if (truncp) {
+ /* in nfsv4, we need to treat this case a little
+ * differently. we don't want to truncate the
mtip32xx-fix-incorrect-value-set-for-drv_cleanup_done-and.patch
mtip32xx-fix-error-handling-in-mtip_init.patch
block-mtip32xx-remove-hotplug_pci_pcie-dependancy.patch
+nfsd-don-t-fail-unchecked-creates-of-non-special-files.patch
+arm-7397-1-l2x0-only-apply-workaround-for-erratum-753970.patch
+arm-7398-1-l2x0-only-write-to-debug-registers-on-pl310.patch