Skip to contentSkip to conversation

Linux 4.9.21

DISCUSSION Greg KH 1 participant 2 messages Apr 8, 2017 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.9.21 kernel.

All users of the 4.9 kernel series must upgrade.

The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                                   |    2 
 arch/arm/boot/dts/bcm5301x.dtsi            |    4 
 arch/arm/mach-bcm/bcm_5301x.c              |   28 +
 arch/mips/lantiq/irq.c                     |   38 +-
 arch/parisc/include/asm/uaccess.h          |   59 ++-
 arch/parisc/kernel/parisc_ksyms.c          |   10 
 arch/parisc/kernel/process.c               |    2 
 arch/parisc/lib/Makefile                   |    2 
 arch/parisc/lib/fixup.S                    |   98 ------
 arch/parisc/lib/lusercopy.S                |  318 ++++++++++++++++++++
 arch/parisc/lib/memcpy.c                   |  461 -----------------------------
 arch/parisc/mm/fault.c                     |   17 +
 arch/x86/lib/memcpy_64.S                   |    2 
 arch/x86/mm/kaslr.c                        |    4 
 arch/x86/xen/setup.c                       |    6 
 block/bio.c                                |   12 
 block/blk-core.c                           |   39 +-
 drivers/acpi/Makefile                      |    1 
 drivers/acpi/acpi_platform.c               |    8 
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c      |    4 
 drivers/gpu/drm/radeon/radeon_ttm.c        |    4 
 drivers/gpu/drm/vc4/vc4_crtc.c             |   13 
 drivers/hid/wacom_sys.c                    |   16 -
 drivers/md/dm.c                            |   29 +
 drivers/md/raid10.c                        |    3 
 drivers/mmc/host/sdhci-of-at91.c           |   11 
 drivers/mmc/host/sdhci.c                   |    6 
 drivers/nvme/host/core.c                   |    6 
 drivers/nvme/host/pci.c                    |    4 
 drivers/pci/host/pcie-iproc-bcma.c         |   24 -
 drivers/pci/host/pcie-iproc-platform.c     |   19 -
 drivers/pci/host/pcie-iproc.h              |    1 
 drivers/scsi/device_handler/scsi_dh_alua.c |   38 +-
 drivers/scsi/libsas/sas_ata.c              |    2 
 drivers/scsi/qla2xxx/qla_attr.c            |    2 
 drivers/scsi/qla2xxx/qla_def.h             |    3 
 drivers/scsi/qla2xxx/qla_init.c            |    1 
 drivers/scsi/qla2xxx/qla_mid.c             |   14 
 drivers/scsi/qla2xxx/qla_os.c              |    1 
 drivers/scsi/sg.c                          |    2 
 drivers/tty/serial/atmel_serial.c          |    8 
 drivers/tty/serial/mxs-auart.c             |    2 
 drivers/usb/core/hcd.c                     |    7 
 fs/nfs/nfs4proc.c                          |    9 
 fs/nfsd/nfsproc.c                          |    1 
 fs/xfs/libxfs/xfs_ag_resv.c                |   70 +++-
 fs/xfs/libxfs/xfs_bmap.c                   |  211 +++++++------
 fs/xfs/libxfs/xfs_bmap_btree.c             |    6 
 fs/xfs/libxfs/xfs_btree.c                  |    3 
 fs/xfs/libxfs/xfs_btree.h                  |    2 
 fs/xfs/libxfs/xfs_da_btree.c               |    6 
 fs/xfs/libxfs/xfs_da_btree.h               |    2 
 fs/xfs/libxfs/xfs_dir2_node.c              |   51 +++
 fs/xfs/libxfs/xfs_ialloc.c                 |    3 
 fs/xfs/libxfs/xfs_ialloc_btree.c           |   90 +++++
 fs/xfs/libxfs/xfs_ialloc_btree.h           |    3 
 fs/xfs/libxfs/xfs_inode_fork.c             |    9 
 fs/xfs/xfs_aops.c                          |  110 ++----
 fs/xfs/xfs_bmap_util.c                     |   62 +--
 fs/xfs/xfs_bmap_util.h                     |    3 
 fs/xfs/xfs_buf_item.c                      |    1 
 fs/xfs/xfs_extent_busy.c                   |   13 
 fs/xfs/xfs_file.c                          |   26 +
 fs/xfs/xfs_icache.c                        |   61 +--
 fs/xfs/xfs_icache.h                        |    2 
 fs/xfs/xfs_inode.c                         |   76 ++--
 fs/xfs/xfs_iomap.c                         |   18 -
 fs/xfs/xfs_mount.c                         |    3 
 fs/xfs/xfs_mount.h                         |    1 
 fs/xfs/xfs_reflink.c                       |  151 ++++++++-
 fs/xfs/xfs_reflink.h                       |    6 
 fs/xfs/xfs_super.c                         |    2 
 fs/xfs/xfs_trace.h                         |   10 
 include/linux/kvm_host.h                   |    4 
 include/linux/memcontrol.h                 |    6 
 kernel/padata.c                            |    5 
 lib/syscall.c                              |    1 
 mm/hugetlb.c                               |    6 
 mm/rmap.c                                  |    4 
 mm/workingset.c                            |    2 
 net/ceph/messenger.c                       |    6 
 sound/core/seq/seq_fifo.c                  |    4 
 sound/pci/hda/patch_realtek.c              |   12 
 sound/soc/atmel/atmel-classd.c             |    2 
 sound/soc/intel/skylake/skl-topology.c     |    2 
 virt/kvm/eventfd.c                         |    3 
 virt/kvm/kvm_main.c                        |   42 +-
 87 files changed, 1332 insertions(+), 1109 deletions(-)

Aaron Armstrong Skomra (1):
HID: wacom: Don't add ghost interface as shared data

Alan Stern (1):
USB: fix linked-list corruption in rh_call_control()

Baoquan He (1):
x86/mm/KASLR: Exclude EFI region from KASLR VA space randomization

Bart Van Assche (2):
scsi: scsi_dh_alua: Check scsi_device_get() return value
scsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function

Bjorn Helgaas (1):
PCI: iproc: Save host bridge window resource in struct iproc_pcie

Brian Foster (7):
xfs: pull up iolock from xfs_free_eofblocks()
xfs: sync eofblocks scans under iolock are livelock prone
xfs: fix eofblocks race with file extending async dio writes
xfs: handle indlen shortage on delalloc extent merge
xfs: split indlen reservations fairly when under reserved
xfs: don't reserve blocks for right shift transactions
xfs: use iomap new flag for newly allocated delalloc blocks

Chandan Rajendra (2):
xfs: Use xfs_icluster_size_fsb() to calculate inode chunk alignment
xfs: Use xfs_icluster_size_fsb() to calculate inode alignment mask

Christoph Hellwig (9):
xfs: only update mount/resv fields on success in __xfs_ag_resv_init
xfs: use per-AG reservations for the finobt
xfs: update ctime and mtime on clone destinatation inodes
xfs: reject all unaligned direct writes to reflinked files
xfs: don't fail xfs_extent_busy allocation
xfs: tune down agno asserts in the bmap code
xfs: only reclaim unwritten COW extents periodically
xfs: fix and streamline error handling in xfs_end_io
xfs: try any AG when allocating the first btree block when reflinking

Darrick J. Wong (8):
xfs: fix toctou race when locking an inode to access the data map
xfs: fail _dir_open when readahead fails
xfs: filter out obviously bad btree pointers
xfs: check for obviously bad level values in the bmbt root
xfs: verify free block header fields
xfs: allow unwritten extents in the CoW fork
xfs: mark speculative prealloc CoW fork extents unwritten
xfs: fix uninitialized variable in _reflink_convert_cow

David Hildenbrand (1):
KVM: kvm_io_bus_unregister_dev() should never fail

Eric Anholt (1):
drm/vc4: Allocate the right amount of space for boot-time CRTC state.

Felix Fietkau (1):
MIPS: Lantiq: Fix cascaded IRQ setup

Greg Kroah-Hartman (1):

      Linux 4.9.21

Hans de Goede (1):
mmc: sdhci: Disable runtime pm when the sdio_irq is enabled

Helge Deller (3):
parisc: Clean up fixup routines for get_user()/put_user()
parisc: Avoid stalled CPU warnings after system shutdown
parisc: Fix access fault handling in pa_memcpy()

Hou Tao (1):
xfs: reset b_first_retry_time when clear the retry status of xfs_buf_t

Hui Wang (1):
ALSA: hda - fix a problem for lineout on a Dell AIO machine

Ilya Dryomov (1):
libceph: force GFP_NOIO for socket allocations

Jason A. Donenfeld (1):
padata: avoid race in reordering

Joe Carnuccio (1):
qla2xxx: Allow vref count to timeout on vport delete.

Joerg Roedel (1):
ACPI: Do not create a platform_device for IOAPIC/IOxAPIC

Johannes Weiner (2):
mm: rmap: fix huge file mmap accounting in the memcg stats
mm: workingset: fix premature shadow node shrinking with cgroups

John Garry (1):
scsi: libsas: fix ata xfer length

Jon Mason (1):
ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags

Josh Poimboeuf (1):
ACPI: Fix incompatibility with mcount-based function graph tracing

Kees Cook (1):
lib/syscall: Clear return values when no stack

Keith Busch (2):
nvme/core: Fix race kicking freed request_queue nvme/pci: Disable on removal when disconnected

Kinglong Mee (1):
nfsd: map the ENOKEY to nfserr_perm for avoiding warning

Lucas Stach (1):
drm/etnaviv: (re-)protect fence allocation with GPU mutex

Ludovic Desroches (1):
mmc: sdhci-of-at91: fix MMC_DDR_52 timing selection

Michel Dänzer (1):
drm/radeon: Override fpfn for all VRAM placements in radeon_evict_flags

Naoya Horiguchi (1):
mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()

NeilBrown (2):
blk: improve order of bio handling in generic_make_request()
blk: Ensure users for current->bio_list can see the full list.

Nicolas Ferre (1):
tty/serial: atmel: fix TX path in atmel_console_write()

Olga Kornievskaia (1):
NFSv4.1 fix infinite loop on IO BAD_STATEID error

Peter Xu (1):
KVM: x86: clear bus pointer when destroyed

Rafał Miłecki (1):
ARM: BCM5301X: Add back handler ignoring external imprecise aborts

Richard Genoud (1):
tty/serial: atmel: fix race condition (TX+DMA)

Ross Lagerwall (1):
xen/setup: Don't relocate p2m over existing one

Songjun Wu (1):
ASoC: atmel-classd: fix audio clock rate

Takashi Iwai (1):
ALSA: seq: Fix race during FIFO resize

Takashi Sakamoto (1):
ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer

Tony Luck (1):
x86/mce: Fix copy/paste error in exception table entries

Uwe Kleine-König (1):
serial: mxs-auart: Fix baudrate calculation

peter chang (1):
scsi: sg: check length passed to SG_NEXT_CMD_LEN

author maintainer
#1 lore raw
Makefile +1 -1
index 44960184701a..1523557bd61f 100644
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 20
+SUBLEVEL = 21
 EXTRAVERSION =
 NAME = Roaring Lionus
 
arch/arm/boot/dts/bcm5301x.dtsi +2 -2
index ae4b3880616d..4616452ce74d 100644
@@ -66,14 +66,14 @@
 		timer@20200 {
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x20200 0x100>;
-			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&periph_clk>;
 		};
 
 		local-timer@20600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x20600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&periph_clk>;
 		};
 
arch/arm/mach-bcm/bcm_5301x.c +28 -0
index c8830a2b0d60..fe067f6cebb6 100644
@@ -9,14 +9,42 @@
 #include <asm/hardware/cache-l2x0.h>
 
 #include <asm/mach/arch.h>
+#include <asm/siginfo.h>
+#include <asm/signal.h>
+
+#define FSR_EXTERNAL		(1 << 12)
+#define FSR_READ		(0 << 10)
+#define FSR_IMPRECISE		0x0406
 
 static const char *const bcm5301x_dt_compat[] __initconst = {
 	"brcm,bcm4708",
 	NULL,
 };
 
+static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
+				  struct pt_regs *regs)
+{
+	/*
+	 * We want to ignore aborts forwarded from the PCIe bus that are
+	 * expected and shouldn't really be passed by the PCIe controller.
+	 * The biggest disadvantage is the same FSR code may be reported when
+	 * reading non-existing APB register and we shouldn't ignore that.
+	 */
+	if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE))
+		return 0;
+
+	return 1;
+}
+
+static void __init bcm5301x_init_early(void)
+{
+	hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
+			"imprecise external abort");
+}
+
 DT_MACHINE_START(BCM5301X, "BCM5301X")
 	.l2c_aux_val	= 0,
 	.l2c_aux_mask	= ~0,
 	.dt_compat	= bcm5301x_dt_compat,
+	.init_early	= bcm5301x_init_early,
 MACHINE_END
arch/mips/lantiq/irq.c +17 -21
index 8ac0e5994ed2..0ddf3698b85d 100644
@@ -269,6 +269,11 @@ static void ltq_hw5_irqdispatch(void)
 DEFINE_HWx_IRQDISPATCH(5)
 #endif
 
+static void ltq_hw_irq_handler(struct irq_desc *desc)
+{
+	ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2);
+}
+
 #ifdef CONFIG_MIPS_MT_SMP
 void __init arch_init_ipiirq(int irq, struct irqaction *action)
 {
@@ -313,23 +318,19 @@ static struct irqaction irq_call = {
 asmlinkage void plat_irq_dispatch(void)
 {
 	unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
-	unsigned int i;
-
-	if ((MIPS_CPU_TIMER_IRQ == 7) && (pending & CAUSEF_IP7)) {
-		do_IRQ(MIPS_CPU_TIMER_IRQ);
-		goto out;
-	} else {
-		for (i = 0; i < MAX_IM; i++) {
-			if (pending & (CAUSEF_IP2 << i)) {
-				ltq_hw_irqdispatch(i);
-				goto out;
-			}
-		}
+	int irq;
+
+	if (!pending) {
+		spurious_interrupt();
+		return;
 	}
-	pr_alert("Spurious IRQ: CAUSE=0x%08x\n", read_c0_status());
 
-out:
-	return;
+	pending >>= CAUSEB_IP;
+	while (pending) {
+		irq = fls(pending) - 1;
+		do_IRQ(MIPS_CPU_IRQ_BASE + irq);
+		pending &= ~BIT(irq);
+	}
 }
 
 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
@@ -354,11 +355,6 @@ static const struct irq_domain_ops irq_domain_ops = {
 	.map = icu_map,
 };
 
-static struct irqaction cascade = {
-	.handler = no_action,
-	.name = "cascade",
-};
-
 int __init icu_of_init(struct device_node *node, struct device_node *parent)
 {
 	struct device_node *eiu_node;
@@ -390,7 +386,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
 	mips_cpu_irq_init();
 
 	for (i = 0; i < MAX_IM; i++)
-		setup_irq(i + 2, &cascade);
+		irq_set_chained_handler(i + 2, ltq_hw_irq_handler);
 
 	if (cpu_has_vint) {
 		pr_info("Setting up vectored interrupts\n");
arch/parisc/include/asm/uaccess.h +34 -25

101 lines not on this page · raw message

arch/parisc/kernel/parisc_ksyms.c +0 -10
index 3cad8aadc69e..4e6f0d93154f 100644
@@ -47,16 +47,6 @@ EXPORT_SYMBOL(__cmpxchg_u64);
 EXPORT_SYMBOL(lclear_user);
 EXPORT_SYMBOL(lstrnlen_user);
 
-/* Global fixups - defined as int to avoid creation of function pointers */
-extern int fixup_get_user_skip_1;
-extern int fixup_get_user_skip_2;
-extern int fixup_put_user_skip_1;
-extern int fixup_put_user_skip_2;
-EXPORT_SYMBOL(fixup_get_user_skip_1);
-EXPORT_SYMBOL(fixup_get_user_skip_2);
-EXPORT_SYMBOL(fixup_put_user_skip_1);
-EXPORT_SYMBOL(fixup_put_user_skip_2);
-
 #ifndef CONFIG_64BIT
 /* Needed so insmod can set dp value */
 extern int $global$;
arch/parisc/kernel/process.c +2 -0
index e81afc378850..e7ffde2758fc 100644
@@ -140,6 +140,8 @@ void machine_power_off(void)
 	printk(KERN_EMERG "System shut down completed.\n"
 	       "Please power this system off now.");
 
+	/* prevent soft lockup/stalled CPU messages for endless loop. */
+	rcu_sysrq_start();
 	for (;;);
 }
 
arch/parisc/lib/Makefile +1 -1
index 8fa92b8d839a..f2dac4d73b1b 100644
@@ -2,7 +2,7 @@
 # Makefile for parisc-specific library files
 #
 
-lib-y	:= lusercopy.o bitops.o checksum.o io.o memset.o fixup.o memcpy.o \
+lib-y	:= lusercopy.o bitops.o checksum.o io.o memset.o memcpy.o \
 	   ucmpdi2.o delay.o
 
 obj-y	:= iomap.o
arch/parisc/lib/fixup.S deleted +0 -98

98 lines not on this page · raw message

arch/parisc/lib/lusercopy.S +318 -0

328 lines not on this page · raw message

arch/parisc/lib/memcpy.c +3 -458

489 lines not on this page · raw message

arch/parisc/mm/fault.c +17 -0
index 1a0b4f63f0e9..040c48fc5391 100644
@@ -149,6 +149,23 @@ int fixup_exception(struct pt_regs *regs)
 		d->fault_space = regs->isr;
 		d->fault_addr = regs->ior;
 
+		/*
+		 * Fix up get_user() and put_user().
+		 * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() sets the least-significant
+		 * bit in the relative address of the fixup routine to indicate
+		 * that %r8 should be loaded with -EFAULT to report a userspace
+		 * access error.
+		 */
+		if (fix->fixup & 1) {
+			regs->gr[8] = -EFAULT;
+
+			/* zero target register for get_user() */
+			if (parisc_acctyp(0, regs->iir) == VM_READ) {
+				int treg = regs->iir & 0x1f;
+				regs->gr[treg] = 0;
+			}
+		}
+
 		regs->iaoq[0] = (unsigned long)&fix->fixup + fix->fixup;
 		regs->iaoq[0] &= ~3;
 		/*
arch/x86/lib/memcpy_64.S +1 -1
index 779782f58324..9a53a06e5a3e 100644
@@ -290,7 +290,7 @@ EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled)
 	_ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w0, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w1, .L_memcpy_mcsafe_fail)
-	_ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
+	_ASM_EXTABLE_FAULT(.L_cache_w2, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w4, .L_memcpy_mcsafe_fail)
 	_ASM_EXTABLE_FAULT(.L_cache_w5, .L_memcpy_mcsafe_fail)
arch/x86/mm/kaslr.c +2 -2
index 887e57182716..aed206475aa7 100644
@@ -48,7 +48,7 @@ static const unsigned long vaddr_start = __PAGE_OFFSET_BASE;
 #if defined(CONFIG_X86_ESPFIX64)
 static const unsigned long vaddr_end = ESPFIX_BASE_ADDR;
 #elif defined(CONFIG_EFI)
-static const unsigned long vaddr_end = EFI_VA_START;
+static const unsigned long vaddr_end = EFI_VA_END;
 #else
 static const unsigned long vaddr_end = __START_KERNEL_map;
 #endif
@@ -105,7 +105,7 @@ void __init kernel_randomize_memory(void)
 	 */
 	BUILD_BUG_ON(vaddr_start >= vaddr_end);
 	BUILD_BUG_ON(IS_ENABLED(CONFIG_X86_ESPFIX64) &&
-		     vaddr_end >= EFI_VA_START);
+		     vaddr_end >= EFI_VA_END);
 	BUILD_BUG_ON((IS_ENABLED(CONFIG_X86_ESPFIX64) ||
 		      IS_ENABLED(CONFIG_EFI)) &&
 		     vaddr_end >= __START_KERNEL_map);
arch/x86/xen/setup.c +3 -3
index f8960fca0827..9f21b0c5945d 100644
@@ -713,10 +713,9 @@ static void __init xen_reserve_xen_mfnlist(void)
 		size = PFN_PHYS(xen_start_info->nr_p2m_frames);
 	}
 
-	if (!xen_is_e820_reserved(start, size)) {
-		memblock_reserve(start, size);
+	memblock_reserve(start, size);
+	if (!xen_is_e820_reserved(start, size))
 		return;
-	}
 
 #ifdef CONFIG_X86_32
 	/*
@@ -727,6 +726,7 @@ static void __init xen_reserve_xen_mfnlist(void)
 	BUG();
 #else
 	xen_relocate_p2m();
+	memblock_free(start, size);
 #endif
 }
 
block/bio.c +9 -3
index db85c5753a76..655c9016052a 100644
@@ -372,10 +372,14 @@ static void punt_bios_to_rescuer(struct bio_set *bs)
 	bio_list_init(&punt);
 	bio_list_init(&nopunt);
 
-	while ((bio = bio_list_pop(current->bio_list)))
+	while ((bio = bio_list_pop(&current->bio_list[0])))
 		bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
+	current->bio_list[0] = nopunt;
 
-	*current->bio_list = nopunt;
+	bio_list_init(&nopunt);
+	while ((bio = bio_list_pop(&current->bio_list[1])))
+		bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
+	current->bio_list[1] = nopunt;
 
 	spin_lock(&bs->rescue_lock);
 	bio_list_merge(&bs->rescue_list, &punt);
@@ -462,7 +466,9 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
 		 * we retry with the original gfp_flags.
 		 */
 
-		if (current->bio_list && !bio_list_empty(current->bio_list))
+		if (current->bio_list &&
+		    (!bio_list_empty(&current->bio_list[0]) ||
+		     !bio_list_empty(&current->bio_list[1])))
 			gfp_mask &= ~__GFP_DIRECT_RECLAIM;
 
 		p = mempool_alloc(bs->bio_pool, gfp_mask);
block/blk-core.c +31 -8
index 14d7c0740dc0..d1f2801ce836 100644
@@ -1994,7 +1994,14 @@ generic_make_request_checks(struct bio *bio)
  */
 blk_qc_t generic_make_request(struct bio *bio)
 {
-	struct bio_list bio_list_on_stack;
+	/*
+	 * bio_list_on_stack[0] contains bios submitted by the current
+	 * make_request_fn.
+	 * bio_list_on_stack[1] contains bios that were submitted before
+	 * the current make_request_fn, but that haven't been processed
+	 * yet.
+	 */
+	struct bio_list bio_list_on_stack[2];
 	blk_qc_t ret = BLK_QC_T_NONE;
 
 	if (!generic_make_request_checks(bio))
@@ -2011,7 +2018,7 @@ blk_qc_t generic_make_request(struct bio *bio)
 	 * should be added at the tail
 	 */
 	if (current->bio_list) {
-		bio_list_add(current->bio_list, bio);
+		bio_list_add(&current->bio_list[0], bio);
 		goto out;
 	}
 
@@ -2030,23 +2037,39 @@ blk_qc_t generic_make_request(struct bio *bio)
 	 * bio_list, and call into ->make_request() again.
 	 */
 	BUG_ON(bio->bi_next);
-	bio_list_init(&bio_list_on_stack);
-	current->bio_list = &bio_list_on_stack;
+	bio_list_init(&bio_list_on_stack[0]);
+	current->bio_list = bio_list_on_stack;
 	do {
 		struct request_queue *q = bdev_get_queue(bio->bi_bdev);
 
 		if (likely(blk_queue_enter(q, false) == 0)) {
+			struct bio_list lower, same;
+
+			/* Create a fresh bio_list for all subordinate requests */
+			bio_list_on_stack[1] = bio_list_on_stack[0];
+			bio_list_init(&bio_list_on_stack[0]);
 			ret = q->make_request_fn(q, bio);
 
 			blk_queue_exit(q);
 
-			bio = bio_list_pop(current->bio_list);
+			/* sort new bios into those for a lower level
+			 * and those for the same level
+			 */
+			bio_list_init(&lower);
+			bio_list_init(&same);
+			while ((bio = bio_list_pop(&bio_list_on_stack[0])) != NULL)
+				if (q == bdev_get_queue(bio->bi_bdev))
+					bio_list_add(&same, bio);
+				else
+					bio_list_add(&lower, bio);
+			/* now assemble so we handle the lowest level first */
+			bio_list_merge(&bio_list_on_stack[0], &lower);
+			bio_list_merge(&bio_list_on_stack[0], &same);
+			bio_list_merge(&bio_list_on_stack[0], &bio_list_on_stack[1]);
 		} else {
-			struct bio *bio_next = bio_list_pop(current->bio_list);
-
 			bio_io_error(bio);
-			bio = bio_next;
 		}
+		bio = bio_list_pop(&bio_list_on_stack[0]);
 	} while (bio);
 	current->bio_list = NULL; /* deactivate */
 
drivers/acpi/Makefile +0 -1
index 9ed087853dee..4c5678cfa9c4 100644
@@ -2,7 +2,6 @@
 # Makefile for the Linux ACPI interpreter
 #
 
-ccflags-y			:= -Os
 ccflags-$(CONFIG_ACPI_DEBUG)	+= -DACPI_DEBUG_OUTPUT
 
 #
drivers/acpi/acpi_platform.c +5 -3
index b4c1a6a51da4..03250e1f1103 100644
@@ -25,9 +25,11 @@
 ACPI_MODULE_NAME("platform");
 
 static const struct acpi_device_id forbidden_id_list[] = {
-	{"PNP0000", 0},	/* PIC */
-	{"PNP0100", 0},	/* Timer */
-	{"PNP0200", 0},	/* AT DMA Controller */
+	{"PNP0000",  0},	/* PIC */
+	{"PNP0100",  0},	/* Timer */
+	{"PNP0200",  0},	/* AT DMA Controller */
+	{"ACPI0009", 0},	/* IOxAPIC */
+	{"ACPI000A", 0},	/* IOAPIC */
 	{"", 0},
 };
 
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +2 -2
index b1254f885fed..b87d27859141 100644
@@ -1299,6 +1299,8 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 		goto out_pm_put;
 	}
 
+	mutex_lock(&gpu->lock);
+
 	fence = etnaviv_gpu_fence_alloc(gpu);
 	if (!fence) {
 		event_free(gpu, event);
@@ -1306,8 +1308,6 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 		goto out_pm_put;
 	}
 
-	mutex_lock(&gpu->lock);
-
 	gpu->event[event].fence = fence;
 	submit->fence = fence->seqno;
 	gpu->active_fence = submit->fence;
drivers/gpu/drm/radeon/radeon_ttm.c +2 -2
index 3de5e6e21662..4ce04e06d9ac 100644
@@ -213,8 +213,8 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo,
 			rbo->placement.num_busy_placement = 0;
 			for (i = 0; i < rbo->placement.num_placement; i++) {
 				if (rbo->placements[i].flags & TTM_PL_FLAG_VRAM) {
-					if (rbo->placements[0].fpfn < fpfn)
-						rbo->placements[0].fpfn = fpfn;
+					if (rbo->placements[i].fpfn < fpfn)
+						rbo->placements[i].fpfn = fpfn;
 				} else {
 					rbo->placement.busy_placement =
 						&rbo->placements[i];
drivers/gpu/drm/vc4/vc4_crtc.c +12 -1
index 7aadce1f7e7a..c7e6c9839c9a 100644
@@ -842,6 +842,17 @@ static void vc4_crtc_destroy_state(struct drm_crtc *crtc,
 	drm_atomic_helper_crtc_destroy_state(crtc, state);
 }
 
+static void
+vc4_crtc_reset(struct drm_crtc *crtc)
+{
+	if (crtc->state)
+		__drm_atomic_helper_crtc_destroy_state(crtc->state);
+
+	crtc->state = kzalloc(sizeof(struct vc4_crtc_state), GFP_KERNEL);
+	if (crtc->state)
+		crtc->state->crtc = crtc;
+}
+
 static const struct drm_crtc_funcs vc4_crtc_funcs = {
 	.set_config = drm_atomic_helper_set_config,
 	.destroy = vc4_crtc_destroy,
@@ -849,7 +860,7 @@ static const struct drm_crtc_funcs vc4_crtc_funcs = {
 	.set_property = NULL,
 	.cursor_set = NULL, /* handled by drm_mode_cursor_universal */
 	.cursor_move = NULL, /* handled by drm_mode_cursor_universal */
-	.reset = drm_atomic_helper_crtc_reset,
+	.reset = vc4_crtc_reset,
 	.atomic_duplicate_state = vc4_crtc_duplicate_state,
 	.atomic_destroy_state = vc4_crtc_destroy_state,
 	.gamma_set = vc4_crtc_gamma_set,
drivers/hid/wacom_sys.c +8 -8
index 5e7a5648e708..0c535d0f3b95 100644
@@ -2017,6 +2017,14 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
 
 	wacom_update_name(wacom, wireless ? " (WL)" : "");
 
+	/* pen only Bamboo neither support touch nor pad */
+	if ((features->type == BAMBOO_PEN) &&
+	    ((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
+	    (features->device_type & WACOM_DEVICETYPE_PAD))) {
+		error = -ENODEV;
+		goto fail;
+	}
+
 	error = wacom_add_shared_data(hdev);
 	if (error)
 		goto fail;
@@ -2064,14 +2072,6 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
 		goto fail_quirks;
 	}
 
-	/* pen only Bamboo neither support touch nor pad */
-	if ((features->type == BAMBOO_PEN) &&
-	    ((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
-	    (features->device_type & WACOM_DEVICETYPE_PAD))) {
-		error = -ENODEV;
-		goto fail_quirks;
-	}
-
 	if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
 		error = hid_hw_open(hdev);
 
drivers/md/dm.c +16 -13
index 628ba001bb3c..e66f4040d84b 100644
@@ -986,26 +986,29 @@ static void flush_current_bio_list(struct blk_plug_cb *cb, bool from_schedule)
 	struct dm_offload *o = container_of(cb, struct dm_offload, cb);
 	struct bio_list list;
 	struct bio *bio;
+	int i;
 
 	INIT_LIST_HEAD(&o->cb.list);
 
 	if (unlikely(!current->bio_list))
 		return;
 
-	list = *current->bio_list;
-	bio_list_init(current->bio_list);
-
-	while ((bio = bio_list_pop(&list))) {
-		struct bio_set *bs = bio->bi_pool;
-		if (unlikely(!bs) || bs == fs_bio_set) {
-			bio_list_add(current->bio_list, bio);
-			continue;
+	for (i = 0; i < 2; i++) {
+		list = current->bio_list[i];
+		bio_list_init(&current->bio_list[i]);
+
+		while ((bio = bio_list_pop(&list))) {
+			struct bio_set *bs = bio->bi_pool;
+			if (unlikely(!bs) || bs == fs_bio_set) {
+				bio_list_add(&current->bio_list[i], bio);
+				continue;
+			}
+
+			spin_lock(&bs->rescue_lock);
+			bio_list_add(&bs->rescue_list, bio);
+			queue_work(bs->rescue_workqueue, &bs->rescue_work);
+			spin_unlock(&bs->rescue_lock);
 		}
-
-		spin_lock(&bs->rescue_lock);
-		bio_list_add(&bs->rescue_list, bio);
-		queue_work(bs->rescue_workqueue, &bs->rescue_work);
-		spin_unlock(&bs->rescue_lock);
 	}
 }
 
drivers/md/raid10.c +2 -1
index 55b5e0e77b17..4c4aab02e311 100644
@@ -941,7 +941,8 @@ static void wait_barrier(struct r10conf *conf)
 				    !conf->barrier ||
 				    (atomic_read(&conf->nr_pending) &&
 				     current->bio_list &&
-				     !bio_list_empty(current->bio_list)),
+				     (!bio_list_empty(&current->bio_list[0]) ||
+				      !bio_list_empty(&current->bio_list[1]))),
 				    conf->resync_lock);
 		conf->nr_waiting--;
 		if (!conf->nr_waiting)
drivers/mmc/host/sdhci-of-at91.c +10 -1
index 387ae1cbf698..a8b430ff117b 100644
@@ -29,6 +29,8 @@
 
 #include "sdhci-pltfm.h"
 
+#define SDMMC_MC1R	0x204
+#define		SDMMC_MC1R_DDR		BIT(3)
 #define SDMMC_CACR	0x230
 #define		SDMMC_CACR_CAPWREN	BIT(0)
 #define		SDMMC_CACR_KEY		(0x46 << 8)
@@ -103,11 +105,18 @@ static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode,
 	sdhci_set_power_noreg(host, mode, vdd);
 }
 
+void sdhci_at91_set_uhs_signaling(struct sdhci_host *host, unsigned int timing)
+{
+	if (timing == MMC_TIMING_MMC_DDR52)
+		sdhci_writeb(host, SDMMC_MC1R_DDR, SDMMC_MC1R);
+	sdhci_set_uhs_signaling(host, timing);
+}
+
 static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
 	.set_clock		= sdhci_at91_set_clock,
 	.set_bus_width		= sdhci_set_bus_width,
 	.reset			= sdhci_reset,
-	.set_uhs_signaling	= sdhci_set_uhs_signaling,
+	.set_uhs_signaling	= sdhci_at91_set_uhs_signaling,
 	.set_power		= sdhci_at91_set_power,
 };
 
drivers/mmc/host/sdhci.c +6 -0
index a983ba0349fb..7d275e72903a 100644
@@ -1823,6 +1823,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
 	struct sdhci_host *host = mmc_priv(mmc);
 	unsigned long flags;
 
+	if (enable)
+		pm_runtime_get_noresume(host->mmc->parent);
+
 	spin_lock_irqsave(&host->lock, flags);
 	if (enable)
 		host->flags |= SDHCI_SDIO_IRQ_ENABLED;
@@ -1831,6 +1834,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
 
 	sdhci_enable_sdio_irq_nolock(host, enable);
 	spin_unlock_irqrestore(&host->lock, flags);
+
+	if (!enable)
+		pm_runtime_put_noidle(host->mmc->parent);
 }
 
 static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
drivers/nvme/host/core.c +3 -3
index da10b484bd25..bde769b11e3b 100644
@@ -2057,9 +2057,9 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl)
 		 * Revalidating a dead namespace sets capacity to 0. This will
 		 * end buffered writers dirtying pages that can't be synced.
 		 */
-		if (ns->disk && !test_and_set_bit(NVME_NS_DEAD, &ns->flags))
-			revalidate_disk(ns->disk);
-
+		if (!ns->disk || test_and_set_bit(NVME_NS_DEAD, &ns->flags))
+			continue;
+		revalidate_disk(ns->disk);
 		blk_set_queue_dying(ns->queue);
 		blk_mq_abort_requeue_list(ns->queue);
 		blk_mq_start_stopped_hw_queues(ns->queue, true);
drivers/nvme/host/pci.c +3 -1
index 5e52034ab010..8a9c186898c7 100644
@@ -1983,8 +1983,10 @@ static void nvme_remove(struct pci_dev *pdev)
 
 	pci_set_drvdata(pdev, NULL);
 
-	if (!pci_device_is_present(pdev))
+	if (!pci_device_is_present(pdev)) {
 		nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
+		nvme_dev_disable(dev, false);
+	}
 
 	flush_work(&dev->reset_work);
 	nvme_uninit_ctrl(&dev->ctrl);
drivers/pci/host/pcie-iproc-bcma.c +12 -12
index 8ce089043a27..46ca8ed031fe 100644
@@ -44,8 +44,7 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 {
 	struct device *dev = &bdev->dev;
 	struct iproc_pcie *pcie;
-	LIST_HEAD(res);
-	struct resource res_mem;
+	LIST_HEAD(resources);
 	int ret;
 
 	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
@@ -62,22 +61,23 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev)
 
 	pcie->base_addr = bdev->addr;
 
-	res_mem.start = bdev->addr_s[0];
-	res_mem.end = bdev->addr_s[0] + SZ_128M - 1;
-	res_mem.name = "PCIe MEM space";
-	res_mem.flags = IORESOURCE_MEM;
-	pci_add_resource(&res, &res_mem);
+	pcie->mem.start = bdev->addr_s[0];
+	pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1;
+	pcie->mem.name = "PCIe MEM space";
+	pcie->mem.flags = IORESOURCE_MEM;
+	pci_add_resource(&resources, &pcie->mem);
 
 	pcie->map_irq = iproc_pcie_bcma_map_irq;
 
-	ret = iproc_pcie_setup(pcie, &res);
-	if (ret)
+	ret = iproc_pcie_setup(pcie, &resources);
+	if (ret) {
 		dev_err(dev, "PCIe controller setup failed\n");
-
-	pci_free_resource_list(&res);
+		pci_free_resource_list(&resources);
+		return ret;
+	}
 
 	bcma_set_drvdata(bdev, pcie);
-	return ret;
+	return 0;
 }
 
 static void iproc_pcie_bcma_remove(struct bcma_device *bdev)
drivers/pci/host/pcie-iproc-platform.c +10 -9
index a3de087976b3..7dcaddcd2f16 100644
@@ -46,7 +46,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct resource reg;
 	resource_size_t iobase = 0;
-	LIST_HEAD(res);
+	LIST_HEAD(resources);
 	int ret;
 
 	of_id = of_match_device(iproc_pcie_of_match_table, dev);
@@ -108,23 +108,24 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
 		pcie->phy = NULL;
 	}
 
-	ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &res, &iobase);
+	ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &resources,
+					       &iobase);
 	if (ret) {
-		dev_err(dev,
-			"unable to get PCI host bridge resources\n");
+		dev_err(dev, "unable to get PCI host bridge resources\n");
 		return ret;
 	}
 
 	pcie->map_irq = of_irq_parse_and_map_pci;
 
-	ret = iproc_pcie_setup(pcie, &res);
-	if (ret)
+	ret = iproc_pcie_setup(pcie, &resources);
+	if (ret) {
 		dev_err(dev, "PCIe controller setup failed\n");
-
-	pci_free_resource_list(&res);
+		pci_free_resource_list(&resources);
+		return ret;
+	}
 
 	platform_set_drvdata(pdev, pcie);
-	return ret;
+	return 0;
 }
 
 static int iproc_pcie_pltfm_remove(struct platform_device *pdev)
drivers/pci/host/pcie-iproc.h +1 -0
index e84d93c53c7b..fa4226742bcd 100644
@@ -68,6 +68,7 @@ struct iproc_pcie {
 #ifdef CONFIG_ARM
 	struct pci_sys_data sysdata;
 #endif
+	struct resource mem;
 	struct pci_bus *root_bus;
 	struct phy *phy;
 	int (*map_irq)(const struct pci_dev *, u8, u8);
drivers/scsi/device_handler/scsi_dh_alua.c +24 -14
index 7bb20684e9fa..d3145799b92f 100644
@@ -113,7 +113,7 @@ struct alua_queue_data {
 #define ALUA_POLICY_SWITCH_ALL		1
 
 static void alua_rtpg_work(struct work_struct *work);
-static void alua_rtpg_queue(struct alua_port_group *pg,
+static bool alua_rtpg_queue(struct alua_port_group *pg,
 			    struct scsi_device *sdev,
 			    struct alua_queue_data *qdata, bool force);
 static void alua_check(struct scsi_device *sdev, bool force);
@@ -862,7 +862,13 @@ static void alua_rtpg_work(struct work_struct *work)
 	kref_put(&pg->kref, release_port_group);
 }
 
-static void alua_rtpg_queue(struct alua_port_group *pg,
+/**
+ * alua_rtpg_queue() - cause RTPG to be submitted asynchronously
+ *
+ * Returns true if and only if alua_rtpg_work() will be called asynchronously.
+ * That function is responsible for calling @qdata->fn().
+ */
+static bool alua_rtpg_queue(struct alua_port_group *pg,
 			    struct scsi_device *sdev,
 			    struct alua_queue_data *qdata, bool force)
 {
@@ -870,8 +876,8 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
 	unsigned long flags;
 	struct workqueue_struct *alua_wq = kaluad_wq;
 
-	if (!pg)
-		return;
+	if (!pg || scsi_device_get(sdev))
+		return false;
 
 	spin_lock_irqsave(&pg->lock, flags);
 	if (qdata) {
@@ -884,14 +890,12 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
 		pg->flags |= ALUA_PG_RUN_RTPG;
 		kref_get(&pg->kref);
 		pg->rtpg_sdev = sdev;
-		scsi_device_get(sdev);
 		start_queue = 1;
 	} else if (!(pg->flags & ALUA_PG_RUN_RTPG) && force) {
 		pg->flags |= ALUA_PG_RUN_RTPG;
 		/* Do not queue if the worker is already running */
 		if (!(pg->flags & ALUA_PG_RUNNING)) {
 			kref_get(&pg->kref);
-			sdev = NULL;
 			start_queue = 1;
 		}
 	}
@@ -900,13 +904,17 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
 		alua_wq = kaluad_sync_wq;
 	spin_unlock_irqrestore(&pg->lock, flags);
 
-	if (start_queue &&
-	    !queue_delayed_work(alua_wq, &pg->rtpg_work,
-				msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) {
-		if (sdev)
-			scsi_device_put(sdev);
-		kref_put(&pg->kref, release_port_group);
+	if (start_queue) {
+		if (queue_delayed_work(alua_wq, &pg->rtpg_work,
+				msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS)))
+			sdev = NULL;
+		else
+			kref_put(&pg->kref, release_port_group);
 	}
+	if (sdev)
+		scsi_device_put(sdev);
+
+	return true;
 }
 
 /*
@@ -1007,11 +1015,13 @@ static int alua_activate(struct scsi_device *sdev,
 		mutex_unlock(&h->init_mutex);
 		goto out;
 	}
-	fn = NULL;
 	rcu_read_unlock();
 	mutex_unlock(&h->init_mutex);
 
-	alua_rtpg_queue(pg, sdev, qdata, true);
+	if (alua_rtpg_queue(pg, sdev, qdata, true))
+		fn = NULL;
+	else
+		err = SCSI_DH_DEV_OFFLINED;
 	kref_put(&pg->kref, release_port_group);
 out:
 	if (fn)
drivers/scsi/libsas/sas_ata.c +1 -1
index 763f012fdeca..87f5e694dbed 100644
@@ -221,7 +221,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
 		task->num_scatter = qc->n_elem;
 	} else {
 		for_each_sg(qc->sg, sg, qc->n_elem, si)
-			xfer += sg->length;
+			xfer += sg_dma_len(sg);
 
 		task->total_xfer_len = xfer;
 		task->num_scatter = si;
drivers/scsi/qla2xxx/qla_attr.c +0 -2
index fe7469c901f7..ad33238cef17 100644
@@ -2153,8 +2153,6 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 		    "Timer for the VP[%d] has stopped\n", vha->vp_idx);
 	}
 
-	BUG_ON(atomic_read(&vha->vref_count));
-
 	qla2x00_free_fcports(vha);
 
 	mutex_lock(&ha->vport_lock);
drivers/scsi/qla2xxx/qla_def.h +3 -0
index 73b12e41d992..8e63a7b90277 100644
@@ -3742,6 +3742,7 @@ typedef struct scsi_qla_host {
 	struct qla8044_reset_template reset_tmplt;
 	struct qla_tgt_counters tgt_counters;
 	uint16_t	bbcr;
+	wait_queue_head_t vref_waitq;
 } scsi_qla_host_t;
 
 struct qla27xx_image_status {
@@ -3780,6 +3781,7 @@ struct qla_tgt_vp_map {
 	mb();						     \
 	if (__vha->flags.delete_progress) {		     \
 		atomic_dec(&__vha->vref_count);		     \
+		wake_up(&__vha->vref_waitq);		\
 		__bail = 1;				     \
 	} else {					     \
 		__bail = 0;				     \
@@ -3788,6 +3790,7 @@ struct qla_tgt_vp_map {
 
 #define QLA_VHA_MARK_NOT_BUSY(__vha) do {		     \
 	atomic_dec(&__vha->vref_count);			     \
+	wake_up(&__vha->vref_waitq);			\
 } while (0)
 
 /*
drivers/scsi/qla2xxx/qla_init.c +1 -0
index 5b09296b46a3..8f12f6baa6b8 100644
@@ -4356,6 +4356,7 @@ qla2x00_update_fcports(scsi_qla_host_t *base_vha)
 			}
 		}
 		atomic_dec(&vha->vref_count);
+		wake_up(&vha->vref_waitq);
 	}
 	spin_unlock_irqrestore(&ha->vport_slock, flags);
 }
drivers/scsi/qla2xxx/qla_mid.c +8 -6
index cf7ba52bae66..3dfb54abc874 100644
@@ -74,13 +74,14 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
 	 * ensures no active vp_list traversal while the vport is removed
 	 * from the queue)
 	 */
-	spin_lock_irqsave(&ha->vport_slock, flags);
-	while (atomic_read(&vha->vref_count)) {
-		spin_unlock_irqrestore(&ha->vport_slock, flags);
-
-		msleep(500);
+	wait_event_timeout(vha->vref_waitq, atomic_read(&vha->vref_count),
+	    10*HZ);
 
-		spin_lock_irqsave(&ha->vport_slock, flags);
+	spin_lock_irqsave(&ha->vport_slock, flags);
+	if (atomic_read(&vha->vref_count)) {
+		ql_dbg(ql_dbg_vport, vha, 0xfffa,
+		    "vha->vref_count=%u timeout\n", vha->vref_count.counter);
+		vha->vref_count = (atomic_t)ATOMIC_INIT(0);
 	}
 	list_del(&vha->list);
 	qlt_update_vp_map(vha, RESET_VP_IDX);
@@ -269,6 +270,7 @@ qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
 
 			spin_lock_irqsave(&ha->vport_slock, flags);
 			atomic_dec(&vha->vref_count);
+			wake_up(&vha->vref_waitq);
 		}
 		i++;
 	}
drivers/scsi/qla2xxx/qla_os.c +1 -0
index bea819e5336d..4f361d8d84be 100644
@@ -4045,6 +4045,7 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht,
 
 	spin_lock_init(&vha->work_lock);
 	spin_lock_init(&vha->cmd_list_lock);
+	init_waitqueue_head(&vha->vref_waitq);
 
 	sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no);
 	ql_dbg(ql_dbg_init, vha, 0x0041,
drivers/scsi/sg.c +2 -0
index 121de0aaa6ad..f753df25ba34 100644
@@ -998,6 +998,8 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
 		result = get_user(val, ip);
 		if (result)
 			return result;
+		if (val > SG_MAX_CDB_SIZE)
+			return -ENOMEM;
 		sfp->next_cmd_len = (val > 0) ? val : 0;
 		return 0;
 	case SG_GET_VERSION_NUM:
drivers/tty/serial/atmel_serial.c +8 -0
index fabbe76203bb..4d079cdaa7a3 100644
@@ -1938,6 +1938,11 @@ static void atmel_flush_buffer(struct uart_port *port)
 		atmel_uart_writel(port, ATMEL_PDC_TCR, 0);
 		atmel_port->pdc_tx.ofs = 0;
 	}
+	/*
+	 * in uart_flush_buffer(), the xmit circular buffer has just
+	 * been cleared, so we have to reset tx_len accordingly.
+	 */
+	atmel_port->tx_len = 0;
 }
 
 /*
@@ -2471,6 +2476,9 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
 	pdc_tx = atmel_uart_readl(port, ATMEL_PDC_PTSR) & ATMEL_PDC_TXTEN;
 	atmel_uart_writel(port, ATMEL_PDC_PTCR, ATMEL_PDC_TXTDIS);
 
+	/* Make sure that tx path is actually able to send characters */
+	atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN);
+
 	uart_console_write(port, s, count, atmel_console_putchar);
 
 	/*
drivers/tty/serial/mxs-auart.c +1 -1
index 770454e0dfa3..07390f8c3681 100644
@@ -1085,7 +1085,7 @@ static void mxs_auart_settermios(struct uart_port *u,
 					AUART_LINECTRL_BAUD_DIV_MAX);
 		baud_max = u->uartclk * 32 / AUART_LINECTRL_BAUD_DIV_MIN;
 		baud = uart_get_baud_rate(u, termios, old, baud_min, baud_max);
-		div = u->uartclk * 32 / baud;
+		div = DIV_ROUND_CLOSEST(u->uartclk * 32, baud);
 	}
 
 	ctrl |= AUART_LINECTRL_BAUD_DIVFRAC(div & 0x3F);
drivers/usb/core/hcd.c +5 -2
index 479e223f9cff..f029aad67183 100644
@@ -520,8 +520,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 	 */
 	tbuf_size =  max_t(u16, sizeof(struct usb_hub_descriptor), wLength);
 	tbuf = kzalloc(tbuf_size, GFP_KERNEL);
-	if (!tbuf)
-		return -ENOMEM;
+	if (!tbuf) {
+		status = -ENOMEM;
+		goto err_alloc;
+	}
 
 	bufp = tbuf;
 
@@ -734,6 +736,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 	}
 
 	kfree(tbuf);
+ err_alloc:
 
 	/* any errors get returned through the urb completion */
 	spin_lock_irq(&hcd_root_hub_lock);
fs/nfs/nfs4proc.c +3 -6
index 1536aeb0abab..4e894d301c88 100644
@@ -2532,17 +2532,14 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state)
 	}
 
 	nfs4_stateid_copy(&stateid, &delegation->stateid);
-	if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
+	if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags) ||
+		!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED,
+			&delegation->flags)) {
 		rcu_read_unlock();
 		nfs_finish_clear_delegation_stateid(state, &stateid);
 		return;
 	}
 
-	if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) {
-		rcu_read_unlock();
-		return;
-	}
-
 	cred = get_rpccred(delegation->cred);
 	rcu_read_unlock();
 	status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);
fs/nfsd/nfsproc.c +1 -0
index 010aff5c5a79..536009e50387 100644
@@ -790,6 +790,7 @@ nfserrno (int errno)
 		{ nfserr_serverfault, -ESERVERFAULT },
 		{ nfserr_serverfault, -ENFILE },
 		{ nfserr_io, -EUCLEAN },
+		{ nfserr_perm, -ENOKEY },
 	};
 	int	i;
 
fs/xfs/libxfs/xfs_ag_resv.c +55 -15

121 lines not on this page · raw message

fs/xfs/libxfs/xfs_bmap.c +127 -84

452 lines not on this page · raw message

fs/xfs/libxfs/xfs_bmap_btree.c +3 -3
index f76c1693ff01..5c3918678bb6 100644
@@ -453,8 +453,8 @@ xfs_bmbt_alloc_block(
 
 	if (args.fsbno == NULLFSBLOCK) {
 		args.fsbno = be64_to_cpu(start->l);
-try_another_ag:
 		args.type = XFS_ALLOCTYPE_START_BNO;
+try_another_ag:
 		/*
 		 * Make sure there is sufficient room left in the AG to
 		 * complete a full tree split for an extent insert.  If
@@ -494,8 +494,8 @@ xfs_bmbt_alloc_block(
 	if (xfs_sb_version_hasreflink(&cur->bc_mp->m_sb) &&
 	    args.fsbno == NULLFSBLOCK &&
 	    args.type == XFS_ALLOCTYPE_NEAR_BNO) {
-		cur->bc_private.b.dfops->dop_low = true;
 		args.fsbno = cur->bc_private.b.firstblock;
+		args.type = XFS_ALLOCTYPE_FIRST_AG;
 		goto try_another_ag;
 	}
 
@@ -512,7 +512,7 @@ xfs_bmbt_alloc_block(
 			goto error0;
 		cur->bc_private.b.dfops->dop_low = true;
 	}
-	if (args.fsbno == NULLFSBLOCK) {
+	if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) {
 		XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT);
 		*stat = 0;
 		return 0;
fs/xfs/libxfs/xfs_btree.c +2 -1
index 21e6a6ab6b9a..2849d3fa3d0b 100644
@@ -810,7 +810,8 @@ xfs_btree_read_bufl(
 	xfs_daddr_t		d;		/* real disk block address */
 	int			error;
 
-	ASSERT(fsbno != NULLFSBLOCK);
+	if (!XFS_FSB_SANITY_CHECK(mp, fsbno))
+		return -EFSCORRUPTED;
 	d = XFS_FSB_TO_DADDR(mp, fsbno);
 	error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
 				   mp->m_bsize, lock, &bp, ops);
fs/xfs/libxfs/xfs_btree.h +1 -1
index c2b01d1c79ee..3b0fc1afada5 100644
@@ -491,7 +491,7 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block)
 #define	XFS_FILBLKS_MAX(a,b)	max_t(xfs_filblks_t, (a), (b))
 
 #define	XFS_FSB_SANITY_CHECK(mp,fsb)	\
-	(XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
+	(fsb && XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
 		XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)
 
 /*
fs/xfs/libxfs/xfs_da_btree.c +2 -4
index f2dc1a950c85..1bdf2888295b 100644
@@ -2633,7 +2633,7 @@ xfs_da_read_buf(
 /*
  * Readahead the dir/attr block.
  */
-xfs_daddr_t
+int
 xfs_da_reada_buf(
 	struct xfs_inode	*dp,
 	xfs_dablk_t		bno,
@@ -2664,7 +2664,5 @@ xfs_da_reada_buf(
 	if (mapp != &map)
 		kmem_free(mapp);
 
-	if (error)
-		return -1;
-	return mappedbno;
+	return error;
 }
fs/xfs/libxfs/xfs_da_btree.h +1 -1
index 98c75cbe6ac2..4e29cb6a3627 100644
@@ -201,7 +201,7 @@ int	xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
 			       xfs_dablk_t bno, xfs_daddr_t mappedbno,
 			       struct xfs_buf **bpp, int whichfork,
 			       const struct xfs_buf_ops *ops);
-xfs_daddr_t	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
+int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
 				xfs_daddr_t mapped_bno, int whichfork,
 				const struct xfs_buf_ops *ops);
 int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
fs/xfs/libxfs/xfs_dir2_node.c +49 -2

66 lines not on this page · raw message

fs/xfs/libxfs/xfs_ialloc.c +1 -2
index d45c03779dae..a2818f6e8598 100644
@@ -51,8 +51,7 @@ xfs_ialloc_cluster_alignment(
 	struct xfs_mount	*mp)
 {
 	if (xfs_sb_version_hasalign(&mp->m_sb) &&
-	    mp->m_sb.sb_inoalignmt >=
-			XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size))
+	    mp->m_sb.sb_inoalignmt >= xfs_icluster_size_fsb(mp))
 		return mp->m_sb.sb_inoalignmt;
 	return 1;
 }
fs/xfs/libxfs/xfs_ialloc_btree.c +87 -3

120 lines not on this page · raw message

fs/xfs/libxfs/xfs_ialloc_btree.h +3 -0
index bd88453217ce..aa81e2e63f3f 100644
@@ -72,4 +72,7 @@ int xfs_inobt_rec_check_count(struct xfs_mount *,
 #define xfs_inobt_rec_check_count(mp, rec)	0
 #endif	/* DEBUG */
 
+int xfs_finobt_calc_reserves(struct xfs_mount *mp, xfs_agnumber_t agno,
+		xfs_extlen_t *ask, xfs_extlen_t *used);
+
 #endif	/* __XFS_IALLOC_BTREE_H__ */
fs/xfs/libxfs/xfs_inode_fork.c +6 -3
index 222e103356c6..25c1e078aef6 100644
@@ -26,6 +26,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 #include "xfs_inode_item.h"
+#include "xfs_btree.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
@@ -429,11 +430,13 @@ xfs_iformat_btree(
 	/* REFERENCED */
 	int			nrecs;
 	int			size;
+	int			level;
 
 	ifp = XFS_IFORK_PTR(ip, whichfork);
 	dfp = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
 	size = XFS_BMAP_BROOT_SPACE(mp, dfp);
 	nrecs = be16_to_cpu(dfp->bb_numrecs);
+	level = be16_to_cpu(dfp->bb_level);
 
 	/*
 	 * blow out if -- fork has less extents than can fit in
@@ -446,7 +449,8 @@ xfs_iformat_btree(
 					XFS_IFORK_MAXEXT(ip, whichfork) ||
 		     XFS_BMDR_SPACE_CALC(nrecs) >
 					XFS_DFORK_SIZE(dip, mp, whichfork) ||
-		     XFS_IFORK_NEXTENTS(ip, whichfork) > ip->i_d.di_nblocks)) {
+		     XFS_IFORK_NEXTENTS(ip, whichfork) > ip->i_d.di_nblocks) ||
+		     level == 0 || level > XFS_BTREE_MAXLEVELS) {
 		xfs_warn(mp, "corrupt inode %Lu (btree).",
 					(unsigned long long) ip->i_ino);
 		XFS_CORRUPTION_ERROR("xfs_iformat_btree", XFS_ERRLEVEL_LOW,
@@ -497,15 +501,14 @@ xfs_iread_extents(
 	 * We know that the size is valid (it's checked in iformat_btree)
 	 */
 	ifp->if_bytes = ifp->if_real_bytes = 0;
-	ifp->if_flags |= XFS_IFEXTENTS;
 	xfs_iext_add(ifp, 0, nextents);
 	error = xfs_bmap_read_extents(tp, ip, whichfork);
 	if (error) {
 		xfs_iext_destroy(ifp);
-		ifp->if_flags &= ~XFS_IFEXTENTS;
 		return error;
 	}
 	xfs_validate_extents(ifp, nextents, XFS_EXTFMT_INODE(ip));
+	ifp->if_flags |= XFS_IFEXTENTS;
 	return 0;
 }
 /*
fs/xfs/xfs_aops.c +33 -77

150 lines not on this page · raw message

fs/xfs/xfs_bmap_util.c +28 -34

74 lines not on this page · raw message

fs/xfs/xfs_bmap_util.h +1 -2
index 68a621a8e0c0..f1005393785c 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_buf_item.c +1 -0
index 2975cb2319f4..0306168af332 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_extent_busy.c +1 -12
index 162dc186cf04..29c2f997aedf 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_file.c +20 -6
index 9a5d64b5f35a..1209ad29e902 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_icache.c +18 -43

61 lines not on this page · raw message

fs/xfs/xfs_icache.h +0 -2
index a1e02f4708ab..8a7c849b4dea 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_inode.c +41 -35

76 lines not on this page · raw message

fs/xfs/xfs_iomap.c +12 -6
index e8889614cec3..360562484e7b 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_mount.c +1 -2
index b341f10cf481..13796f212f98 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_mount.h +1 -0
index 819b80b15bfb..1bf878b0492c 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_reflink.c +133 -18

151 lines not on this page · raw message

fs/xfs/xfs_reflink.h +4 -2
index 97ea9b487884..a57966fc7ddd 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_super.c +1 -1
index ade4691e3f74..dbbd3f1fd2b7 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_trace.h +7 -3
index 0907752be62d..828f383df121 100644

Lines of this file are not shown. View the raw message.

include/linux/kvm_host.h +2 -2
index 01c0b9cc3915..8c58db2c09c6 100644

Lines of this file are not shown. View the raw message.

include/linux/memcontrol.h +6 -0
index 254698856b8f..8b35bdbdc214 100644

Lines of this file are not shown. View the raw message.

kernel/padata.c +3 -2
index 7848f0566403..b4a3c0ae649b 100644

Lines of this file are not shown. View the raw message.

lib/syscall.c +1 -0
index 63239e097b13..a72cd0996230 100644

Lines of this file are not shown. View the raw message.

mm/hugetlb.c +4 -2
index b6adedbafaf5..65c36acf8a6b 100644

Lines of this file are not shown. View the raw message.

mm/rmap.c +2 -2
index 1ef36404e7b2..cd37c1c7e21b 100644

Lines of this file are not shown. View the raw message.

mm/workingset.c +1 -1
index 33f6f4db32fd..4c4f05655e6e 100644

Lines of this file are not shown. View the raw message.

net/ceph/messenger.c +6 -0
index 2efb335deada..25a30be862e9 100644

Lines of this file are not shown. View the raw message.

sound/core/seq/seq_fifo.c +4 -0
index 3f4efcb85df5..3490d21ab9e7 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/patch_realtek.c +11 -1
index 112caa2d3c14..bb1aad39d987 100644

Lines of this file are not shown. View the raw message.

sound/soc/atmel/atmel-classd.c +1 -1
index 89ac5f5a93eb..7ae46c2647d4 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/skylake/skl-topology.c +1 -1
index b5b1934d8550..bef8a4546c12 100644

Lines of this file are not shown. View the raw message.

virt/kvm/eventfd.c +2 -1
index a29786dd9522..4d28a9ddbee0 100644

Lines of this file are not shown. View the raw message.

virt/kvm/kvm_main.c +30 -12

42 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.