--- /dev/null
+From 8c3cac5e6a85f03602ffe09c44f14418699e31ec Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@redhat.com>
+Date: Mon, 3 Feb 2014 12:13:07 -0500
+Subject: locks: eliminate BUG() call when there's an unexpected lock on file close
+
+From: Jeff Layton <jlayton@redhat.com>
+
+commit 8c3cac5e6a85f03602ffe09c44f14418699e31ec upstream.
+
+A leftover lock on the list is surely a sign of a problem of some sort,
+but it's not necessarily a reason to panic the box. Instead, just log a
+warning with some info about the lock, and then delete it like we would
+any other lock.
+
+In the event that the filesystem declares a ->lock f_op, we may end up
+leaking something, but that's generally preferable to an immediate
+panic.
+
+Acked-by: J. Bruce Fields <bfields@fieldses.org>
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Cc: Markus Blank-Burian <burian@muenster.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/locks.c | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+--- a/fs/locks.c
++++ b/fs/locks.c
+@@ -2235,16 +2235,28 @@ void locks_remove_flock(struct file *fil
+
+ while ((fl = *before) != NULL) {
+ if (fl->fl_file == filp) {
+- if (IS_FLOCK(fl)) {
+- locks_delete_lock(before);
+- continue;
+- }
+ if (IS_LEASE(fl)) {
+ lease_modify(before, F_UNLCK);
+ continue;
+ }
+- /* What? */
+- BUG();
++
++ /*
++ * There's a leftover lock on the list of a type that
++ * we didn't expect to see. Most likely a classic
++ * POSIX lock that ended up not getting released
++ * properly, or that raced onto the list somehow. Log
++ * some info about it and then just remove it from
++ * the list.
++ */
++ WARN(!IS_FLOCK(fl),
++ "leftover lock: dev=%u:%u ino=%lu type=%hhd flags=0x%x start=%lld end=%lld\n",
++ MAJOR(inode->i_sb->s_dev),
++ MINOR(inode->i_sb->s_dev), inode->i_ino,
++ fl->fl_type, fl->fl_flags,
++ fl->fl_start, fl->fl_end);
++
++ locks_delete_lock(before);
++ continue;
+ }
+ before = &fl->fl_next;
+ }
--- /dev/null
+From 360743814c4082515581aa23ab1d8e699e1fbe88 Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Tue, 7 Oct 2014 16:12:36 +1100
+Subject: powerpc/powernv: Honor the generic "no_64bit_msi" flag
+
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+
+commit 360743814c4082515581aa23ab1d8e699e1fbe88 upstream.
+
+Instead of the arch specific quirk which we are deprecating
+and that drivers don't understand.
+
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/platforms/powernv/pci-ioda.c | 3 +--
+ arch/powerpc/platforms/powernv/pci.c | 4 ++--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+--- a/arch/powerpc/platforms/powernv/pci-ioda.c
++++ b/arch/powerpc/platforms/powernv/pci-ioda.c
+@@ -902,7 +902,6 @@ static int pnv_pci_ioda_msi_setup(struct
+ unsigned int is_64, struct msi_msg *msg)
+ {
+ struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev);
+- struct pci_dn *pdn = pci_get_pdn(dev);
+ struct irq_data *idata;
+ struct irq_chip *ichip;
+ unsigned int xive_num = hwirq - phb->msi_base;
+@@ -918,7 +917,7 @@ static int pnv_pci_ioda_msi_setup(struct
+ return -ENXIO;
+
+ /* Force 32-bit MSI on some broken devices */
+- if (pdn && pdn->force_32bit_msi)
++ if (dev->no_64bit_msi)
+ is_64 = 0;
+
+ /* Assign XIVE to PE */
+--- a/arch/powerpc/platforms/powernv/pci.c
++++ b/arch/powerpc/platforms/powernv/pci.c
+@@ -1,3 +1,4 @@
++
+ /*
+ * Support PCI/PCIe on PowerNV platforms
+ *
+@@ -50,9 +51,8 @@ static int pnv_msi_check_device(struct p
+ {
+ struct pci_controller *hose = pci_bus_to_host(pdev->bus);
+ struct pnv_phb *phb = hose->private_data;
+- struct pci_dn *pdn = pci_get_pdn(pdev);
+
+- if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
++ if (pdev->no_64bit_msi && !phb->msi32_support)
+ return -ENODEV;
+
+ return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV;
drm-radeon-fix-endian-swapping-in-vbios-fetch-for-tdp-table.patch
gpu-radeon-set-flag-to-indicate-broken-64-bit-msi.patch
bitops-fix-shift-overflow-in-genmask-macros.patch
+locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch
+powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch