From b510ff9f1565a3eaa23cf6002adc167e40dc1893 Mon Sep 17 00:00:00 2001 From: djStolen Date: Mon, 15 Jan 2024 17:17:46 +0100 Subject: [PATCH] Linux Kernel 3.10.1 compiles and runs (.rej cleaned up) Applied: /LineageOS/android/kernel/sony/msm8994$ patch -p1 -R < /home/dj/Downloads/linuxkernelpatches/patch-3.10.1-2 Change-Id: Ib3b345f638d6220208eb03707a3ee86533dfcd33 --- Documentation/parisc/registers | 8 -- Makefile | 2 +- arch/arm/boot/dts/imx23.dtsi | 8 +- arch/arm/boot/dts/imx28.dtsi | 8 +- arch/arm/boot/dts/imx6dl.dtsi | 2 - arch/arm/boot/dts/imx6q.dtsi | 4 - arch/arm/include/asm/mmu_context.h | 10 +-- arch/arm/kernel/perf_event.c | 1 - arch/arm/kernel/smp_tlb.c | 18 +++- arch/arm/kernel/smp_twd.c | 2 +- arch/arm/mach-shmobile/setup-emev2.c | 8 +- arch/arm/mach-shmobile/setup-r8a73a4.c | 2 +- arch/arm/mm/context.c | 55 +++--------- arch/arm/mm/init.c | 2 +- arch/c6x/mm/init.c | 1 - arch/parisc/include/asm/special_insns.h | 9 +- arch/parisc/include/asm/tlbflush.h | 5 +- arch/parisc/kernel/cache.c | 2 +- arch/parisc/lib/memcpy.c | 79 +++++++----------- arch/x86/boot/compressed/eboot.c | 20 +---- arch/x86/xen/time.c | 17 +++- drivers/acpi/Makefile | 1 - drivers/acpi/acpi_cmos_rtc.c | 92 --------------------- drivers/acpi/acpica/hwxfsleep.c | 8 +- drivers/acpi/device_pm.c | 23 ++---- drivers/acpi/ec.c | 4 - drivers/acpi/internal.h | 5 -- drivers/acpi/scan.c | 1 - drivers/ata/ahci.c | 2 - drivers/ata/libahci.c | 3 +- drivers/block/nbd.c | 7 +- drivers/dma/pl330.c | 4 +- drivers/hid/hid-apple.c | 6 -- drivers/hid/hid-core.c | 6 -- drivers/hid/hid-ids.h | 3 - drivers/hv/ring_buffer.c | 10 +-- drivers/hv/vmbus_drv.c | 2 +- drivers/input/mouse/bcm5974.c | 36 +------- drivers/net/wireless/iwlwifi/pcie/tx.c | 13 --- drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 2 +- drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 - drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 6 +- drivers/parisc/lba_pci.c | 56 ------------- drivers/pci/iov.c | 5 +- drivers/pci/probe.c | 14 ++-- drivers/pci/quirks.c | 2 - drivers/pci/xen-pcifront.c | 7 +- drivers/pcmcia/at91_cf.c | 4 +- drivers/rtc/rtc-rv3029c2.c | 2 +- drivers/tty/serial/pch_uart.c | 5 -- drivers/usb/gadget/f_mass_storage.c | 2 - drivers/usb/host/ehci-omap.c | 11 +-- drivers/usb/host/xhci-mem.c | 4 - drivers/usb/host/xhci-plat.c | 1 - drivers/usb/serial/option.c | 4 + drivers/usb/serial/qcserial.c | 8 +- fs/btrfs/ctree.c | 13 ++- fs/btrfs/send.c | 35 -------- fs/cifs/cifs_unicode.h | 8 +- fs/cifs/cifsencrypt.c | 6 +- fs/cifs/file.c | 9 +- fs/cifs/inode.c | 5 -- fs/ext3/namei.c | 7 +- fs/ext4/balloc.c | 4 +- fs/ext4/extents.c | 4 +- fs/ext4/file.c | 14 ++-- fs/ext4/inline.c | 2 +- fs/ext4/inode.c | 15 ++-- fs/ext4/mballoc.c | 11 +-- fs/ext4/namei.c | 7 +- fs/ext4/resize.c | 4 +- fs/ext4/super.c | 14 +++- fs/jbd2/journal.c | 3 +- fs/jbd2/transaction.c | 2 +- fs/ocfs2/xattr.c | 10 --- fs/ubifs/super.c | 2 +- include/linux/cgroup.h | 58 +++---------- include/linux/nbd.h | 1 - kernel/cgroup.c | 25 ++---- kernel/irq/manage.c | 6 +- kernel/timer.c | 8 +- mm/memcontrol.c | 8 ++ mm/page_alloc.c | 4 - mm/slab.c | 2 +- 84 files changed, 235 insertions(+), 675 deletions(-) delete mode 100644 drivers/acpi/acpi_cmos_rtc.c diff --git a/Documentation/parisc/registers b/Documentation/parisc/registers index 10c7d1730f5d..dd3caddd1ad9 100644 --- a/Documentation/parisc/registers +++ b/Documentation/parisc/registers @@ -77,14 +77,6 @@ PSW default E value 0 Shadow Registers used by interruption handler code TOC enable bit 1 -========================================================================= - -The PA-RISC architecture defines 7 registers as "shadow registers". -Those are used in RETURN FROM INTERRUPTION AND RESTORE instruction to reduce -the state save and restore time by eliminating the need for general register -(GR) saves and restores in interruption handlers. -Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25. - ========================================================================= Register usage notes, originally from John Marvin, with some additional notes from Randolph Chung. diff --git a/Makefile b/Makefile index bb8b486585f3..3d2e27235c81 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 2 +SUBLEVEL = 1 EXTRAVERSION = NAME = Unicycling Gorilla diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi index 587ceef81e45..73fd7d0887b5 100644 --- a/arch/arm/boot/dts/imx23.dtsi +++ b/arch/arm/boot/dts/imx23.dtsi @@ -23,12 +23,8 @@ }; cpus { - #address-cells = <0>; - #size-cells = <0>; - - cpu { - compatible = "arm,arm926ej-s"; - device_type = "cpu"; + cpu@0 { + compatible = "arm,arm926ejs"; }; }; diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index 4c10a1968c0e..600f7cb51f3e 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi @@ -32,12 +32,8 @@ }; cpus { - #address-cells = <0>; - #size-cells = <0>; - - cpu { - compatible = "arm,arm926ej-s"; - device_type = "cpu"; + cpu@0 { + compatible = "arm,arm926ejs"; }; }; diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi index 62dc78126795..5bcdf3a90bb3 100644 --- a/arch/arm/boot/dts/imx6dl.dtsi +++ b/arch/arm/boot/dts/imx6dl.dtsi @@ -18,14 +18,12 @@ cpu@0 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <0>; next-level-cache = <&L2>; }; cpu@1 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <1>; next-level-cache = <&L2>; }; diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index dc54a72a3bcd..21e675848bd1 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -18,7 +18,6 @@ cpu@0 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <0>; next-level-cache = <&L2>; operating-points = < @@ -40,21 +39,18 @@ cpu@1 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <1>; next-level-cache = <&L2>; }; cpu@2 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <2>; next-level-cache = <&L2>; }; cpu@3 { compatible = "arm,cortex-a9"; - device_type = "cpu"; reg = <3>; next-level-cache = <&L2>; }; diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index dc90203c6ddb..a7b85e0d0cc1 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h @@ -27,15 +27,7 @@ void __check_vmalloc_seq(struct mm_struct *mm); void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); #define init_new_context(tsk,mm) ({ atomic64_set(&mm->context.id, 0); 0; }) -#ifdef CONFIG_ARM_ERRATA_798181 -void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, - cpumask_t *mask); -#else /* !CONFIG_ARM_ERRATA_798181 */ -static inline void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, - cpumask_t *mask) -{ -} -#endif /* CONFIG_ARM_ERRATA_798181 */ +DECLARE_PER_CPU(atomic64_t, active_asids); #else /* !CONFIG_CPU_HAS_ASID */ diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index d947ac07a8b9..02c8c2215c3e 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -658,7 +658,6 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) return; } - perf_callchain_store(entry, regs->ARM_pc); tail = (struct frame_tail __user *)regs->ARM_fp - 1; while ((entry->nr < PERF_MAX_STACK_DEPTH) && diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index a98b62dca2fa..9a52a07aa40e 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -103,7 +103,7 @@ static void broadcast_tlb_a15_erratum(void) static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) { - int this_cpu; + int cpu, this_cpu; cpumask_t mask = { CPU_BITS_NONE }; if (!erratum_a15_798181()) @@ -111,7 +111,21 @@ static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) dummy_flush_tlb_a15_erratum(); this_cpu = get_cpu(); - a15_erratum_get_cpumask(this_cpu, mm, &mask); + for_each_online_cpu(cpu) { + if (cpu == this_cpu) + continue; + /* + * We only need to send an IPI if the other CPUs are running + * the same ASID as the one being invalidated. There is no + * need for locking around the active_asids check since the + * switch_mm() function has at least one dmb() (as required by + * this workaround) in case a context switch happens on + * another CPU after the condition below. + */ + if (atomic64_read(&mm->context.id) == + atomic64_read(&per_cpu(active_asids, cpu))) + cpumask_set_cpu(cpu, &mask); + } smp_call_function_many(&mask, ipi_flush_tlb_a15_erratum, NULL, 1); put_cpu(); } diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index f6fd1d4398c6..90525d9d290b 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -120,7 +120,7 @@ static int twd_rate_change(struct notifier_block *nb, * changing cpu. */ if (flags == POST_RATE_CHANGE) - on_each_cpu(twd_update_frequency, + smp_call_function(twd_update_frequency, (void *)&cnd->new_rate, 1); return NOTIFY_OK; diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index 1ccddd228112..899a86c31ec9 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -287,14 +287,14 @@ static struct gpio_em_config gio3_config = { static struct resource gio3_resources[] = { [0] = { .name = "GIO_096", - .start = 0xe0050180, - .end = 0xe00501ab, + .start = 0xe0050100, + .end = 0xe005012b, .flags = IORESOURCE_MEM, }, [1] = { .name = "GIO_096", - .start = 0xe00501c0, - .end = 0xe00501df, + .start = 0xe0050140, + .end = 0xe005015f, .flags = IORESOURCE_MEM, }, [2] = { diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index 7f45c2edbca9..c5a75a7a508f 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c @@ -62,7 +62,7 @@ enum { SCIFA0, SCIFA1, SCIFB0, SCIFB1, SCIFB2, SCIFB3 }; static const struct plat_sci_port scif[] = { SCIFA_DATA(SCIFA0, 0xe6c40000, gic_spi(144)), /* SCIFA0 */ SCIFA_DATA(SCIFA1, 0xe6c50000, gic_spi(145)), /* SCIFA1 */ - SCIFB_DATA(SCIFB0, 0xe6c20000, gic_spi(148)), /* SCIFB0 */ + SCIFB_DATA(SCIFB0, 0xe6c50000, gic_spi(145)), /* SCIFB0 */ SCIFB_DATA(SCIFB1, 0xe6c30000, gic_spi(149)), /* SCIFB1 */ SCIFB_DATA(SCIFB2, 0xe6ce0000, gic_spi(150)), /* SCIFB2 */ SCIFB_DATA(SCIFB3, 0xe6cf0000, gic_spi(151)), /* SCIFB3 */ diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 77d4a27c4f4b..fac0ef9e1853 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c @@ -40,43 +40,19 @@ * non 64-bit operations. */ #define ASID_FIRST_VERSION (1ULL << ASID_BITS) -#define NUM_USER_ASIDS ASID_FIRST_VERSION +#define NUM_USER_ASIDS (ASID_FIRST_VERSION - 1) + +#define ASID_TO_IDX(asid) ((asid & ~ASID_MASK) - 1) +#define IDX_TO_ASID(idx) ((idx + 1) & ~ASID_MASK) static DEFINE_RAW_SPINLOCK(cpu_asid_lock); static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION); static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS); -static DEFINE_PER_CPU(atomic64_t, active_asids); +DEFINE_PER_CPU(atomic64_t, active_asids); static DEFINE_PER_CPU(u64, reserved_asids); static cpumask_t tlb_flush_pending; -#ifdef CONFIG_ARM_ERRATA_798181 -void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, - cpumask_t *mask) -{ - int cpu; - unsigned long flags; - u64 context_id, asid; - - raw_spin_lock_irqsave(&cpu_asid_lock, flags); - context_id = mm->context.id.counter; - for_each_online_cpu(cpu) { - if (cpu == this_cpu) - continue; - /* - * We only need to send an IPI if the other CPUs are - * running the same ASID as the one being invalidated. - */ - asid = per_cpu(active_asids, cpu).counter; - if (asid == 0) - asid = per_cpu(reserved_asids, cpu); - if (context_id == asid) - cpumask_set_cpu(cpu, mask); - } - raw_spin_unlock_irqrestore(&cpu_asid_lock, flags); -} -#endif - #ifdef CONFIG_ARM_LPAE static void cpu_set_reserved_ttbr0(void) { @@ -154,16 +130,7 @@ static void flush_context(unsigned int cpu) asid = 0; } else { asid = atomic64_xchg(&per_cpu(active_asids, i), 0); - /* - * If this CPU has already been through a - * rollover, but hasn't run another task in - * the meantime, we must preserve its reserved - * ASID, as this is the only trace we have of - * the process it is still running. - */ - if (asid == 0) - asid = per_cpu(reserved_asids, i); - __set_bit(asid & ~ASID_MASK, asid_map); + __set_bit(ASID_TO_IDX(asid), asid_map); } per_cpu(reserved_asids, i) = asid; } @@ -202,19 +169,17 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu) /* * Allocate a free ASID. If we can't find one, take a * note of the currently active ASIDs and mark the TLBs - * as requiring flushes. We always count from ASID #1, - * as we reserve ASID #0 to switch via TTBR0 and indicate - * rollover events. + * as requiring flushes. */ - asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1); + asid = find_first_zero_bit(asid_map, NUM_USER_ASIDS); if (asid == NUM_USER_ASIDS) { generation = atomic64_add_return(ASID_FIRST_VERSION, &asid_generation); flush_context(cpu); - asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1); + asid = find_first_zero_bit(asid_map, NUM_USER_ASIDS); } __set_bit(asid, asid_map); - asid |= generation; + asid = generation | IDX_TO_ASID(asid); cpumask_clear(mm_cpumask(mm)); } diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 08fdf848b190..8e2f0f75987f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -735,7 +735,7 @@ void __init mem_init(void) #ifdef CONFIG_SA1111 /* now that our DMA memory is actually so designated, we can free it */ - free_reserved_area(__va(PHYS_OFFSET), swapper_pg_dir, 0, NULL); + free_reserved_area(__va(PHYS_PFN_OFFSET), swapper_pg_dir, 0, NULL); #endif free_highpages(); diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c index ef87abbceebb..23f05d17a32a 100644 --- a/arch/c6x/mm/init.c +++ b/arch/c6x/mm/init.c @@ -18,7 +18,6 @@ #include #include -#include /* * ZERO_PAGE is a special page that is used for zero-initialized diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h index e1509308899f..d306b75bc77f 100644 --- a/arch/parisc/include/asm/special_insns.h +++ b/arch/parisc/include/asm/special_insns.h @@ -32,12 +32,9 @@ static inline void set_eiem(unsigned long val) cr; \ }) -#define mtsp(val, cr) \ - { if (__builtin_constant_p(val) && ((val) == 0)) \ - __asm__ __volatile__("mtsp %%r0,%0" : : "i" (cr) : "memory"); \ - else \ - __asm__ __volatile__("mtsp %0,%1" \ +#define mtsp(gr, cr) \ + __asm__ __volatile__("mtsp %0,%1" \ : /* no outputs */ \ - : "r" (val), "i" (cr) : "memory"); } + : "r" (gr), "i" (cr) : "memory") #endif /* __PARISC_SPECIAL_INSNS_H */ diff --git a/arch/parisc/include/asm/tlbflush.h b/arch/parisc/include/asm/tlbflush.h index 9d086a599fa0..5273da991e06 100644 --- a/arch/parisc/include/asm/tlbflush.h +++ b/arch/parisc/include/asm/tlbflush.h @@ -63,14 +63,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm) static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { - unsigned long flags, sid; + unsigned long flags; /* For one page, it's not worth testing the split_tlb variable */ mb(); - sid = vma->vm_mm->context; + mtsp(vma->vm_mm->context,1); purge_tlb_start(flags); - mtsp(sid, 1); pdtlb(addr); pitlb(addr); purge_tlb_end(flags); diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 2e65aa54bd10..65fb4cbc3a0f 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -440,8 +440,8 @@ void __flush_tlb_range(unsigned long sid, unsigned long start, else { unsigned long flags; - purge_tlb_start(flags); mtsp(sid, 1); + purge_tlb_start(flags); if (split_tlb) { while (npages--) { pdtlb(start); diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c index ac4370b1ca40..a49cc812df8a 100644 --- a/arch/parisc/lib/memcpy.c +++ b/arch/parisc/lib/memcpy.c @@ -2,7 +2,6 @@ * Optimized memory copy routines. * * Copyright (C) 2004 Randolph Chung - * Copyright (C) 2013 Helge Deller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,21 +153,17 @@ static inline void prefetch_dst(const void *addr) #define prefetch_dst(addr) do { } while(0) #endif -#define PA_MEMCPY_OK 0 -#define PA_MEMCPY_LOAD_ERROR 1 -#define PA_MEMCPY_STORE_ERROR 2 - /* Copy from a not-aligned src to an aligned dst, using shifts. Handles 4 words * per loop. This code is derived from glibc. */ -static inline unsigned long copy_dstaligned(unsigned long dst, - unsigned long src, unsigned long len) +static inline unsigned long copy_dstaligned(unsigned long dst, unsigned long src, unsigned long len, unsigned long o_dst, unsigned long o_src, unsigned long o_len) { /* gcc complains that a2 and a3 may be uninitialized, but actually * they cannot be. Initialize a2/a3 to shut gcc up. */ register unsigned int a0, a1, a2 = 0, a3 = 0; int sh_1, sh_2; + struct exception_data *d; /* prefetch_src((const void *)src); */ @@ -202,7 +197,7 @@ static inline unsigned long copy_dstaligned(unsigned long dst, goto do2; case 0: if (len == 0) - return PA_MEMCPY_OK; + return 0; /* a3 = ((unsigned int *) src)[0]; a0 = ((unsigned int *) src)[1]; */ ldw(s_space, 0, src, a3, cda_ldw_exc); @@ -261,35 +256,42 @@ static inline unsigned long copy_dstaligned(unsigned long dst, preserve_branch(handle_load_error); preserve_branch(handle_store_error); - return PA_MEMCPY_OK; + return 0; handle_load_error: __asm__ __volatile__ ("cda_ldw_exc:\n"); - return PA_MEMCPY_LOAD_ERROR; + d = &__get_cpu_var(exception_data); + DPRINTF("cda_ldw_exc: o_len=%lu fault_addr=%lu o_src=%lu ret=%lu\n", + o_len, d->fault_addr, o_src, o_len - d->fault_addr + o_src); + return o_len * 4 - d->fault_addr + o_src; handle_store_error: __asm__ __volatile__ ("cda_stw_exc:\n"); - return PA_MEMCPY_STORE_ERROR; + d = &__get_cpu_var(exception_data); + DPRINTF("cda_stw_exc: o_len=%lu fault_addr=%lu o_dst=%lu ret=%lu\n", + o_len, d->fault_addr, o_dst, o_len - d->fault_addr + o_dst); + return o_len * 4 - d->fault_addr + o_dst; } -/* Returns PA_MEMCPY_OK, PA_MEMCPY_LOAD_ERROR or PA_MEMCPY_STORE_ERROR. - * In case of an access fault the faulty address can be read from the per_cpu - * exception data struct. */ -static unsigned long pa_memcpy_internal(void *dstp, const void *srcp, - unsigned long len) +/* Returns 0 for success, otherwise, returns number of bytes not transferred. */ +static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len) { register unsigned long src, dst, t1, t2, t3; register unsigned char *pcs, *pcd; register unsigned int *pws, *pwd; register double *pds, *pdd; - unsigned long ret; + unsigned long ret = 0; + unsigned long o_dst, o_src, o_len; + struct exception_data *d; src = (unsigned long)srcp; dst = (unsigned long)dstp; pcs = (unsigned char *)srcp; pcd = (unsigned char *)dstp; + o_dst = dst; o_src = src; o_len = len; + /* prefetch_src((const void *)srcp); */ if (len < THRESHOLD) @@ -399,7 +401,7 @@ static unsigned long pa_memcpy_internal(void *dstp, const void *srcp, len--; } - return PA_MEMCPY_OK; + return 0; unaligned_copy: /* possibly we are aligned on a word, but not on a double... */ @@ -436,7 +438,8 @@ static unsigned long pa_memcpy_internal(void *dstp, const void *srcp, src = (unsigned long)pcs; } - ret = copy_dstaligned(dst, src, len / sizeof(unsigned int)); + ret = copy_dstaligned(dst, src, len / sizeof(unsigned int), + o_dst, o_src, o_len); if (ret) return ret; @@ -451,41 +454,17 @@ static unsigned long pa_memcpy_internal(void *dstp, const void *srcp, handle_load_error: __asm__ __volatile__ ("pmc_load_exc:\n"); - return PA_MEMCPY_LOAD_ERROR; + d = &__get_cpu_var(exception_data); + DPRINTF("pmc_load_exc: o_len=%lu fault_addr=%lu o_src=%lu ret=%lu\n", + o_len, d->fault_addr, o_src, o_len - d->fault_addr + o_src); + return o_len - d->fault_addr + o_src; handle_store_error: __asm__ __volatile__ ("pmc_store_exc:\n"); - return PA_MEMCPY_STORE_ERROR; -} - - -/* Returns 0 for success, otherwise, returns number of bytes not transferred. */ -static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len) -{ - unsigned long ret, fault_addr, reference; - struct exception_data *d; - - ret = pa_memcpy_internal(dstp, srcp, len); - if (likely(ret == PA_MEMCPY_OK)) - return 0; - - /* if a load or store fault occured we can get the faulty addr */ d = &__get_cpu_var(exception_data); - fault_addr = d->fault_addr; - - /* error in load or store? */ - if (ret == PA_MEMCPY_LOAD_ERROR) - reference = (unsigned long) srcp; - else - reference = (unsigned long) dstp; - - DPRINTF("pa_memcpy: fault type = %lu, len=%lu fault_addr=%lu ref=%lu\n", - ret, len, fault_addr, reference); - - if (fault_addr >= reference) - return len - (fault_addr - reference); - else - return len; + DPRINTF("pmc_store_exc: o_len=%lu fault_addr=%lu o_dst=%lu ret=%lu\n", + o_len, d->fault_addr, o_dst, o_len - d->fault_addr + o_dst); + return o_len - d->fault_addr + o_dst; } #ifdef __KERNEL__ diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index d606463aa6d6..c205035a6b96 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -992,20 +992,18 @@ static efi_status_t exit_boot(struct boot_params *boot_params, efi_memory_desc_t *mem_map; efi_status_t status; __u32 desc_version; - bool called_exit = false; u8 nr_entries; int i; size = sizeof(*mem_map) * 32; again: - size += sizeof(*mem_map) * 2; + size += sizeof(*mem_map); _size = size; status = low_alloc(size, 1, (unsigned long *)&mem_map); if (status != EFI_SUCCESS) return status; -get_map: status = efi_call_phys5(sys_table->boottime->get_memory_map, &size, mem_map, &key, &desc_size, &desc_version); if (status == EFI_BUFFER_TOO_SMALL) { @@ -1031,20 +1029,8 @@ static efi_status_t exit_boot(struct boot_params *boot_params, /* Might as well exit boot services now */ status = efi_call_phys2(sys_table->boottime->exit_boot_services, handle, key); - if (status != EFI_SUCCESS) { - /* - * ExitBootServices() will fail if any of the event - * handlers change the memory map. In which case, we - * must be prepared to retry, but only once so that - * we're guaranteed to exit on repeated failures instead - * of spinning forever. - */ - if (called_exit) - goto free_mem_map; - - called_exit = true; - goto get_map; - } + if (status != EFI_SUCCESS) + goto free_mem_map; /* Historic? */ boot_params->alt_mem_k = 32 * 1024; diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 13e8935e2eab..3d88bfdf9e1c 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -36,8 +36,9 @@ static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate); /* snapshots of runstate info */ static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate_snapshot); -/* unused ns of stolen time */ +/* unused ns of stolen and blocked time */ static DEFINE_PER_CPU(u64, xen_residual_stolen); +static DEFINE_PER_CPU(u64, xen_residual_blocked); /* return an consistent snapshot of 64-bit time/counter value */ static u64 get64(const u64 *p) @@ -114,7 +115,7 @@ static void do_stolen_accounting(void) { struct vcpu_runstate_info state; struct vcpu_runstate_info *snap; - s64 runnable, offline, stolen; + s64 blocked, runnable, offline, stolen; cputime_t ticks; get_runstate_snapshot(&state); @@ -124,6 +125,7 @@ static void do_stolen_accounting(void) snap = &__get_cpu_var(xen_runstate_snapshot); /* work out how much time the VCPU has not been runn*ing* */ + blocked = state.time[RUNSTATE_blocked] - snap->time[RUNSTATE_blocked]; runnable = state.time[RUNSTATE_runnable] - snap->time[RUNSTATE_runnable]; offline = state.time[RUNSTATE_offline] - snap->time[RUNSTATE_offline]; @@ -139,6 +141,17 @@ static void do_stolen_accounting(void) ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen); __this_cpu_write(xen_residual_stolen, stolen); account_steal_ticks(ticks); + + /* Add the appropriate number of ticks of blocked time, + including any left-overs from last time. */ + blocked += __this_cpu_read(xen_residual_blocked); + + if (blocked < 0) + blocked = 0; + + ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked); + __this_cpu_write(xen_residual_blocked, blocked); + account_idle_ticks(ticks); } /* Get the TSC speed from Xen */ diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 97c949abfabb..536562c626a2 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -43,7 +43,6 @@ acpi-y += acpi_platform.o acpi-y += power.o acpi-y += event.o acpi-y += sysfs.o -acpi-$(CONFIG_X86) += acpi_cmos_rtc.o acpi-$(CONFIG_DEBUG_FS) += debugfs.o acpi-$(CONFIG_ACPI_NUMA) += numa.o acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c deleted file mode 100644 index 84190ed89c04..000000000000 --- a/drivers/acpi/acpi_cmos_rtc.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * ACPI support for CMOS RTC Address Space access - * - * Copyright (C) 2013, Intel Corporation - * Authors: Lan Tianyu - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include - -#include "internal.h" - -#define PREFIX "ACPI: " - -ACPI_MODULE_NAME("cmos rtc"); - -static const struct acpi_device_id acpi_cmos_rtc_ids[] = { - { "PNP0B00" }, - { "PNP0B01" }, - { "PNP0B02" }, - {} -}; - -static acpi_status -acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address, - u32 bits, u64 *value64, - void *handler_context, void *region_context) -{ - int i; - u8 *value = (u8 *)&value64; - - if (address > 0xff || !value64) - return AE_BAD_PARAMETER; - - if (function != ACPI_WRITE && function != ACPI_READ) - return AE_BAD_PARAMETER; - - spin_lock_irq(&rtc_lock); - - for (i = 0; i < DIV_ROUND_UP(bits, 8); ++i, ++address, ++value) - if (function == ACPI_READ) - *value = CMOS_READ(address); - else - CMOS_WRITE(*value, address); - - spin_unlock_irq(&rtc_lock); - - return AE_OK; -} - -static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev, - const struct acpi_device_id *id) -{ - acpi_status status; - - status = acpi_install_address_space_handler(adev->handle, - ACPI_ADR_SPACE_CMOS, - &acpi_cmos_rtc_space_handler, - NULL, NULL); - if (ACPI_FAILURE(status)) { - pr_err(PREFIX "Error installing CMOS-RTC region handler\n"); - return -ENODEV; - } - - return 0; -} - -static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev) -{ - if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle, - ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler))) - pr_err(PREFIX "Error removing CMOS-RTC region handler\n"); -} - -static struct acpi_scan_handler cmos_rtc_handler = { - .ids = acpi_cmos_rtc_ids, - .attach = acpi_install_cmos_rtc_space_handler, - .detach = acpi_remove_cmos_rtc_space_handler, -}; - -void __init acpi_cmos_rtc_init(void) -{ - acpi_scan_add_handler(&cmos_rtc_handler); -} diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c index 09b06e2feff8..35eebdac0f9d 100644 --- a/drivers/acpi/acpica/hwxfsleep.c +++ b/drivers/acpi/acpica/hwxfsleep.c @@ -240,14 +240,12 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id) &acpi_sleep_dispatch[function_id]; #if (!ACPI_REDUCED_HARDWARE) + /* * If the Hardware Reduced flag is set (from the FADT), we must - * use the extended sleep registers (FADT). Note: As per the ACPI - * specification, these extended registers are to be used for HW-reduced - * platforms only. They are not general-purpose replacements for the - * legacy PM register sleep support. + * use the extended sleep registers */ - if (acpi_gbl_reduced_hardware) { + if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { status = sleep_functions->extended_function(sleep_state); } else { /* Legacy sleep */ diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 553527c2532b..31c217a42839 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -324,27 +324,14 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p) if (result) return result; - if (state == ACPI_STATE_UNKNOWN) { + if (state == ACPI_STATE_UNKNOWN) state = ACPI_STATE_D0; - result = acpi_device_set_power(device, state); - if (result) - return result; - } else { - if (device->power.flags.power_resources) { - /* - * We don't need to really switch the state, bu we need - * to update the power resources' reference counters. - */ - result = acpi_power_transition(device, state); - if (result) - return result; - } - device->power.state = state; - } - if (state_p) + + result = acpi_device_set_power(device, state); + if (!result && state_p) *state_p = state; - return 0; + return result; } EXPORT_SYMBOL_GPL(acpi_bus_update_power); diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 80403c1a89f8..edc00818c803 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -983,10 +983,6 @@ static struct dmi_system_id __initdata ec_dmi_table[] = { ec_enlarge_storm_threshold, "CLEVO hardware", { DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."), DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL}, - { - ec_skip_dsdt_scan, "HP Folio 13", { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13"),}, NULL}, {}, }; diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 63a08549bfa2..c610a76d92c4 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -50,11 +50,6 @@ void acpi_memory_hotplug_init(void); #else static inline void acpi_memory_hotplug_init(void) {} #endif -#ifdef CONFIG_X86 -void acpi_cmos_rtc_init(void); -#else -static inline void acpi_cmos_rtc_init(void) {} -#endif void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, const char *name); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 14807e53ccae..27da63061e11 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2040,7 +2040,6 @@ int __init acpi_scan_init(void) acpi_pci_link_init(); acpi_platform_init(); acpi_lpss_init(); - acpi_cmos_rtc_init(); acpi_container_init(); acpi_memory_hotplug_init(); acpi_dock_init(); diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b112625482ca..2b50dfdf1cfc 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -291,7 +291,6 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(INTEL, 0x8d64), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */ - { PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */ /* JMicron 360/1/3/5/6, match class to avoid IDE function */ { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, @@ -311,7 +310,6 @@ static const struct pci_device_id ahci_pci_tbl[] = { /* AMD */ { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */ - { PCI_VDEVICE(AMD, 0x7900), board_ahci }, /* AMD CZ */ /* AMD is using RAID class only for ahci controllers */ { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 7b9bdd822c62..a70ff154f586 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1560,7 +1560,8 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) u32 fbs = readl(port_mmio + PORT_FBS); int pmp = fbs >> PORT_FBS_DWE_OFFSET; - if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) { + if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links) && + ata_link_online(&ap->pmp_link[pmp])) { link = &ap->pmp_link[pmp]; fbs_need_dec = true; } diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7f9fc0d883bc..f5f40b38f9fb 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -623,10 +623,8 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, if (!nbd->sock) return -EINVAL; - nbd->disconnect = 1; - nbd_send_req(nbd, &sreq); - return 0; + return 0; } case NBD_CLEAR_SOCK: { @@ -656,7 +654,6 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, nbd->sock = SOCKET_I(inode); if (max_part > 0) bdev->bd_invalidated = 1; - nbd->disconnect = 0; /* we're connected now */ return 0; } else { fput(file); @@ -746,8 +743,6 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, set_capacity(nbd->disk, 0); if (max_part > 0) ioctl_by_bdev(bdev, BLKRRPART, 0); - if (nbd->disconnect) /* user requested, ignore socket errors */ - return 0; return nbd->harderror; } diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 7ec82f0667eb..a17553f7c028 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2485,10 +2485,10 @@ static void pl330_free_chan_resources(struct dma_chan *chan) struct dma_pl330_chan *pch = to_pchan(chan); unsigned long flags; - tasklet_kill(&pch->task); - spin_lock_irqsave(&pch->lock, flags); + tasklet_kill(&pch->task); + pl330_release_channel(pch->pl330_chid); pch->pl330_chid = NULL; diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index c7710b5c69af..feae88b53fcd 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -524,12 +524,6 @@ static const struct hid_device_id apple_devices[] = { .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI), - .driver_data = APPLE_HAS_FN }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO), - .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS), - .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 7e0d3e41fa76..dd709f704d73 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1555,9 +1555,6 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) }, @@ -2192,9 +2189,6 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) }, - { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { } diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 2959dc6bb8f5..a932d23a55b4 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -140,9 +140,6 @@ #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS 0x023b #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI 0x0255 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO 0x0256 -#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0291 -#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0292 -#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0293 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b #define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240 diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 791f45dfc85d..d6fbb5772b8d 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -32,7 +32,7 @@ void hv_begin_read(struct hv_ring_buffer_info *rbi) { rbi->ring_buffer->interrupt_mask = 1; - mb(); + smp_mb(); } u32 hv_end_read(struct hv_ring_buffer_info *rbi) @@ -41,7 +41,7 @@ u32 hv_end_read(struct hv_ring_buffer_info *rbi) u32 write; rbi->ring_buffer->interrupt_mask = 0; - mb(); + smp_mb(); /* * Now check to see if the ring buffer is still empty. @@ -71,7 +71,7 @@ u32 hv_end_read(struct hv_ring_buffer_info *rbi) static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi) { - mb(); + smp_mb(); if (rbi->ring_buffer->interrupt_mask) return false; @@ -442,7 +442,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info, sizeof(u64)); /* Issue a full memory barrier before updating the write index */ - mb(); + smp_mb(); /* Now, update the write location */ hv_set_next_write_location(outring_info, next_write_location); @@ -549,7 +549,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer, /* Make sure all reads are done before we update the read index since */ /* the writer may start writing to the read area once the read index */ /*is updated */ - mb(); + smp_mb(); /* Update the read index */ hv_set_next_read_location(inring_info, next_read_location); diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 4004e54ef05d..bf421e0efa1e 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -434,7 +434,7 @@ static void vmbus_on_msg_dpc(unsigned long data) * will not deliver any more messages since there is * no empty slot */ - mb(); + smp_mb(); if (msg->header.message_flags.msg_pending) { /* diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 4ef4d5e198ae..2baff1b79a55 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -88,10 +88,6 @@ #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI 0x0259 #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a #define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b -/* MacbookAir6,2 (unibody, June 2013) */ -#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0291 -#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0292 -#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0293 #define BCM5974_DEVICE(prod) { \ .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ @@ -149,10 +145,6 @@ static const struct usb_device_id bcm5974_table[] = { BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI), BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO), BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS), - /* MacbookAir6,2 */ - BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI), - BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ISO), - BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_JIS), /* Terminating entry */ {} }; @@ -180,18 +172,15 @@ struct bt_data { /* trackpad header types */ enum tp_type { TYPE1, /* plain trackpad */ - TYPE2, /* button integrated in trackpad */ - TYPE3 /* additional header fields since June 2013 */ + TYPE2 /* button integrated in trackpad */ }; /* trackpad finger data offsets, le16-aligned */ #define FINGER_TYPE1 (13 * sizeof(__le16)) #define FINGER_TYPE2 (15 * sizeof(__le16)) -#define FINGER_TYPE3 (19 * sizeof(__le16)) /* trackpad button data offsets */ #define BUTTON_TYPE2 15 -#define BUTTON_TYPE3 23 /* list of device capability bits */ #define HAS_INTEGRATED_BUTTON 1 @@ -411,19 +400,6 @@ static const struct bcm5974_config bcm5974_config_table[] = { { SN_COORD, -150, 6730 }, { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } }, - { - USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI, - USB_DEVICE_ID_APPLE_WELLSPRING8_ISO, - USB_DEVICE_ID_APPLE_WELLSPRING8_JIS, - HAS_INTEGRATED_BUTTON, - 0, sizeof(struct bt_data), - 0x83, TYPE3, FINGER_TYPE3, FINGER_TYPE3 + SIZEOF_ALL_FINGERS, - { SN_PRESSURE, 0, 300 }, - { SN_WIDTH, 0, 2048 }, - { SN_COORD, -4620, 5140 }, - { SN_COORD, -150, 6600 }, - { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } - }, {} }; @@ -581,9 +557,6 @@ static int report_tp_state(struct bcm5974 *dev, int size) input_report_key(input, BTN_LEFT, ibt); } - if (c->tp_type == TYPE3) - input_report_key(input, BTN_LEFT, dev->tp_data[BUTTON_TYPE3]); - input_sync(input); return 0; @@ -599,14 +572,9 @@ static int report_tp_state(struct bcm5974 *dev, int size) static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) { + char *data = kmalloc(8, GFP_KERNEL); int retval = 0, size; - char *data; - - /* Type 3 does not require a mode switch */ - if (dev->cfg.tp_type == TYPE3) - return 0; - data = kmalloc(8, GFP_KERNEL); if (!data) { dev_err(&dev->intf->dev, "out of memory\n"); retval = -ENOMEM; diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 48acfc620191..c5e30294c5ac 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c @@ -576,16 +576,10 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) spin_lock_bh(&txq->lock); while (q->write_ptr != q->read_ptr) { - IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n", - txq_id, q->read_ptr); iwl_pcie_txq_free_tfd(trans, txq); q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd); } - txq->active = false; spin_unlock_bh(&txq->lock); - - /* just in case - this queue may have been stopped */ - iwl_wake_queue(trans, txq); } /* @@ -933,12 +927,6 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn, spin_lock_bh(&txq->lock); - if (!txq->active) { - IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n", - txq_id, ssn); - goto out; - } - if (txq->q.read_ptr == tfd_num) goto out; @@ -1115,7 +1103,6 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, (fifo << SCD_QUEUE_STTS_REG_POS_TXF) | (1 << SCD_QUEUE_STTS_REG_POS_WSL) | SCD_QUEUE_STTS_REG_MSK); - trans_pcie->txq[txq_id].active = true; IWL_DEBUG_TX_QUEUES(trans, "Activate queue %d on FIFO %d WrPtr: %d\n", txq_id, fifo, ssn & 0xff); } diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c index 2119313a737b..953f1a0f8532 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c @@ -104,7 +104,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, tx_agc[RF90_PATH_A] = 0x10101010; tx_agc[RF90_PATH_B] = 0x10101010; } else if (rtlpriv->dm.dynamic_txhighpower_lvl == - TXHIGHPWRLEVEL_LEVEL2) { + TXHIGHPWRLEVEL_LEVEL1) { tx_agc[RF90_PATH_A] = 0x00000000; tx_agc[RF90_PATH_B] = 0x00000000; } else{ diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index 2bd598526217..826f085c29dd 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c @@ -359,7 +359,6 @@ static struct usb_device_id rtl8192c_usb_ids[] = { {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ {RTL_USB_DEVICE(0x2019, 0xab2b, rtl92cu_hal_cfg)}, /*Planex -Abocom*/ {RTL_USB_DEVICE(0x20f4, 0x624d, rtl92cu_hal_cfg)}, /*TRENDNet*/ - {RTL_USB_DEVICE(0x2357, 0x0100, rtl92cu_hal_cfg)}, /*TP-Link WN8200ND*/ {RTL_USB_DEVICE(0x7392, 0x7822, rtl92cu_hal_cfg)}, /*Edimax -Edimax*/ {} }; diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c index d9ee2efffe5f..e4c4cdc3eb67 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c @@ -251,7 +251,7 @@ static struct rtl_hal_cfg rtl8723ae_hal_cfg = { .bar_id = 2, .write_readback = true, .name = "rtl8723ae_pci", - .fw_name = "rtlwifi/rtl8723fw.bin", + .fw_name = "rtlwifi/rtl8723aefw.bin", .ops = &rtl8723ae_hal_ops, .mod_params = &rtl8723ae_mod_params, .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, @@ -353,8 +353,8 @@ MODULE_AUTHOR("Realtek WlanFAE "); MODULE_AUTHOR("Larry Finger "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Realtek 8723E 802.11n PCI wireless"); -MODULE_FIRMWARE("rtlwifi/rtl8723fw.bin"); -MODULE_FIRMWARE("rtlwifi/rtl8723fw_B.bin"); +MODULE_FIRMWARE("rtlwifi/rtl8723aefw.bin"); +MODULE_FIRMWARE("rtlwifi/rtl8723aefw_B.bin"); module_param_named(swenc, rtl8723ae_mod_params.sw_crypto, bool, 0444); module_param_named(debug, rtl8723ae_mod_params.debug, int, 0444); diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 19f6f70c67d3..1f05913ae677 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -613,54 +613,6 @@ truncate_pat_collision(struct resource *root, struct resource *new) return 0; /* truncation successful */ } -/* - * extend_lmmio_len: extend lmmio range to maximum length - * - * This is needed at least on C8000 systems to get the ATI FireGL card - * working. On other systems we will currently not extend the lmmio space. - */ -static unsigned long -extend_lmmio_len(unsigned long start, unsigned long end, unsigned long lba_len) -{ - struct resource *tmp; - - pr_debug("LMMIO mismatch: PAT length = 0x%lx, MASK register = 0x%lx\n", - end - start, lba_len); - - lba_len = min(lba_len+1, 256UL*1024*1024); /* limit to 256 MB */ - - pr_debug("LBA: lmmio_space [0x%lx-0x%lx] - original\n", start, end); - - if (boot_cpu_data.cpu_type < mako) { - pr_info("LBA: Not a C8000 system - not extending LMMIO range.\n"); - return end; - } - - end += lba_len; - if (end < start) /* fix overflow */ - end = -1ULL; - - pr_debug("LBA: lmmio_space [0x%lx-0x%lx] - current\n", start, end); - - /* first overlap */ - for (tmp = iomem_resource.child; tmp; tmp = tmp->sibling) { - pr_debug("LBA: testing %pR\n", tmp); - if (tmp->start == start) - continue; /* ignore ourself */ - if (tmp->end < start) - continue; - if (tmp->start > end) - continue; - if (end >= tmp->start) - end = tmp->start - 1; - } - - pr_info("LBA: lmmio_space [0x%lx-0x%lx] - new\n", start, end); - - /* return new end */ - return end; -} - #else #define truncate_pat_collision(r,n) (0) #endif @@ -1042,14 +994,6 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) case PAT_LMMIO: /* used to fix up pre-initialized MEM BARs */ if (!lba_dev->hba.lmmio_space.flags) { - unsigned long lba_len; - - lba_len = ~READ_REG32(lba_dev->hba.base_addr - + LBA_LMMIO_MASK); - if ((p->end - p->start) != lba_len) - p->end = extend_lmmio_len(p->start, - p->end, lba_len); - sprintf(lba_dev->hba.lmmio_name, "PCI%02x LMMIO", (int)lba_dev->hba.bus_num.start); diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index a971a6f6268d..c93071d428f5 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -92,8 +92,6 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset) pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device); pci_setup_device(virtfn); virtfn->dev.parent = dev->dev.parent; - virtfn->physfn = pci_dev_get(dev); - virtfn->is_virtfn = 1; for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { res = dev->resource + PCI_IOV_RESOURCES + i; @@ -115,6 +113,9 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset) pci_device_add(virtfn, virtfn->bus); mutex_unlock(&iov->dev->sriov->lock); + virtfn->physfn = pci_dev_get(dev); + virtfn->is_virtfn = 1; + rc = pci_bus_add_device(virtfn); sprintf(buf, "virtfn%u", id); rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf); diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ea37072e8bf2..70f10fa3c1b2 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1703,16 +1703,12 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, bridge->dev.release = pci_release_bus_bridge_dev; dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(b), bus); error = pcibios_root_bridge_prepare(bridge); - if (error) { - kfree(bridge); - goto err_out; - } + if (error) + goto bridge_dev_reg_err; error = device_register(&bridge->dev); - if (error) { - put_device(&bridge->dev); - goto err_out; - } + if (error) + goto bridge_dev_reg_err; b->bridge = get_device(&bridge->dev); device_enable_async_suspend(b->bridge); pci_set_bus_of_node(b); @@ -1768,6 +1764,8 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, class_dev_reg_err: put_device(&bridge->dev); device_unregister(&bridge->dev); +bridge_dev_reg_err: + kfree(bridge); err_out: kfree(b); return NULL; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index df4655c5c138..7d68aeebf56b 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1022,8 +1022,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode); -DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, 0x7900, quirk_amd_ide_mode); /* * Serverworks CSB5 IDE does not fully support native mode diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c index 0282f1fe9c42..23f083375965 100644 --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -678,9 +678,10 @@ static int pcifront_connect_and_init_dma(struct pcifront_device *pdev) if (!pcifront_dev) { dev_info(&pdev->xdev->dev, "Installing PCI frontend\n"); pcifront_dev = pdev; - } else + } else { + dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n"); err = -EEXIST; - + } spin_unlock(&pcifront_dev_lock); if (!err && !swiotlb_nr_tbl()) { @@ -847,7 +848,7 @@ static int pcifront_try_connect(struct pcifront_device *pdev) goto out; err = pcifront_connect_and_init_dma(pdev); - if (err && err != -EEXIST) { + if (err) { xenbus_dev_fatal(pdev->xdev, err, "Error setting up PCI Frontend"); goto out; diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 1b2c6317c772..01463c781847 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -100,9 +100,9 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp) int vcc = gpio_is_valid(cf->board->vcc_pin); *sp = SS_DETECT | SS_3VCARD; - if (!rdy || gpio_get_value(cf->board->irq_pin)) + if (!rdy || gpio_get_value(rdy)) *sp |= SS_READY; - if (!vcc || gpio_get_value(cf->board->vcc_pin)) + if (!vcc || gpio_get_value(vcc)) *sp |= SS_POWERON; } else *sp = 0; diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c index 9100a3401de1..5032c24ec159 100644 --- a/drivers/rtc/rtc-rv3029c2.c +++ b/drivers/rtc/rtc-rv3029c2.c @@ -310,7 +310,7 @@ static int rv3029c2_rtc_i2c_set_alarm(struct i2c_client *client, dev_dbg(&client->dev, "alarm IRQ armed\n"); } else { /* disable AIE irq */ - ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 0); + ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 1); if (ret) return ret; diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 572d48189de9..21a7e179edf3 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -217,7 +217,6 @@ enum { #define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */ #define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */ #define NTC1_UARTCLK 64000000 /* 64.0000 MHz */ -#define MINNOW_UARTCLK 50000000 /* 50.0000 MHz */ struct pch_uart_buffer { unsigned char *buf; @@ -399,10 +398,6 @@ static int pch_uart_get_uartclk(void) strstr(cmp, "nanoETXexpress-TT"))) return NTC1_UARTCLK; - cmp = dmi_get_system_info(DMI_BOARD_NAME); - if (cmp && strstr(cmp, "MinnowBoard")) - return MINNOW_UARTCLK; - return DEFAULT_UARTCLK; } diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index af98fe8aedb4..d55da9f6cb7c 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -475,7 +475,6 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep) /* Caller must hold fsg->lock */ static void wakeup_thread(struct fsg_common *common) { - smp_wmb(); /* ensure the write of bh->state is complete */ /* Tell the main thread that something has happened */ common->thread_wakeup_needed = 1; if (common->thread_task) @@ -704,7 +703,6 @@ static int sleep_thread(struct fsg_common *common) spin_lock_irq(&common->lock); common->thread_wakeup_needed = 0; spin_unlock_irq(&common->lock); - smp_rmb(); /* ensure the latest bh->state is visible */ return rc; } diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index dda408f2c6e9..16d7150e8557 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -187,12 +187,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) } omap->phy[i] = phy; - - if (pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) { - usb_phy_init(omap->phy[i]); - /* bring PHY out of suspend */ - usb_phy_set_suspend(omap->phy[i], 0); - } } pm_runtime_enable(dev); @@ -217,14 +211,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) } /* - * Bring PHYs out of reset for non PHY modes. + * Bring PHYs out of reset. * Even though HSIC mode is a PHY-less mode, the reset * line exists between the chips and can be modelled * as a PHY device for reset control. */ for (i = 0; i < omap->nports; i++) { - if (!omap->phy[i] || - pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) + if (!omap->phy[i]) continue; usb_phy_init(omap->phy[i]); diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 9c912d8d6bec..48ec1e3aa7a0 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -387,10 +387,6 @@ static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci ctx->size += CTX_SIZE(xhci->hcc_params); ctx->bytes = dma_pool_alloc(xhci->device_pool, flags, &ctx->dma); - if (!ctx->bytes) { - kfree(ctx); - return NULL; - } memset(ctx->bytes, 0, ctx->size); return ctx; } diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 9afd9f354a66..44191f25e3a6 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -212,7 +212,6 @@ static int xhci_plat_remove(struct platform_device *dev) usb_remove_hcd(hcd); iounmap(hcd->regs); - release_mem_region(hcd->rsrc_start, hcd->rsrc_len); usb_put_hcd(hcd); kfree(xhci); diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5dd857de05b0..bd4323ddae1a 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -159,6 +159,8 @@ static void option_instat_callback(struct urb *urb); #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 #define NOVATELWIRELESS_PRODUCT_E362 0x9010 +#define NOVATELWIRELESS_PRODUCT_G1 0xA001 +#define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 #define NOVATELWIRELESS_PRODUCT_G2 0xA010 #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 @@ -728,6 +730,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC547) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, /* Novatel Ovation MC551 a.k.a. Verizon USB551L */ { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) }, diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 2dd956a67fbd..fce0bd882bcf 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -35,13 +35,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_G1K(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */ {DEVICE_G1K(0x413c, 0x8172)}, /* Dell Gobi Modem device */ {DEVICE_G1K(0x413c, 0x8171)}, /* Dell Gobi QDL device */ - {DEVICE_G1K(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */ - {DEVICE_G1K(0x1410, 0xa002)}, /* Novatel Gobi Modem device */ - {DEVICE_G1K(0x1410, 0xa003)}, /* Novatel Gobi Modem device */ - {DEVICE_G1K(0x1410, 0xa004)}, /* Novatel Gobi Modem device */ - {DEVICE_G1K(0x1410, 0xa005)}, /* Novatel Gobi Modem device */ - {DEVICE_G1K(0x1410, 0xa006)}, /* Novatel Gobi Modem device */ - {DEVICE_G1K(0x1410, 0xa007)}, /* Novatel Gobi Modem device */ + {DEVICE_G1K(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ {DEVICE_G1K(0x1410, 0xa008)}, /* Novatel Gobi QDL device */ {DEVICE_G1K(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ {DEVICE_G1K(0x0b05, 0x1774)}, /* Asus Gobi QDL device */ diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 7fb054ba1b60..02fae7f7e42c 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1089,8 +1089,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, btrfs_set_node_ptr_generation(parent, parent_slot, trans->transid); btrfs_mark_buffer_dirty(parent); - if (last_ref) - tree_mod_log_free_eb(root->fs_info, buf); + tree_mod_log_free_eb(root->fs_info, buf); btrfs_free_tree_block(trans, root, buf, parent_start, last_ref); } @@ -1162,8 +1161,8 @@ __tree_mod_log_oldest_root(struct btrfs_fs_info *fs_info, * time_seq). */ static void -__tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, - u64 time_seq, struct tree_mod_elem *first_tm) +__tree_mod_log_rewind(struct extent_buffer *eb, u64 time_seq, + struct tree_mod_elem *first_tm) { u32 n; struct rb_node *next; @@ -1173,7 +1172,6 @@ __tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, unsigned long p_size = sizeof(struct btrfs_key_ptr); n = btrfs_header_nritems(eb); - tree_mod_log_read_lock(fs_info); while (tm && tm->seq >= time_seq) { /* * all the operations are recorded with the operator used for @@ -1228,7 +1226,6 @@ __tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, if (tm->index != first_tm->index) break; } - tree_mod_log_read_unlock(fs_info); btrfs_set_header_nritems(eb, n); } @@ -1277,7 +1274,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, extent_buffer_get(eb_rewin); btrfs_tree_read_lock(eb_rewin); - __tree_mod_log_rewind(fs_info, eb_rewin, time_seq, tm); + __tree_mod_log_rewind(eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) > BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root)); @@ -1353,7 +1350,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) btrfs_set_header_generation(eb, old_generation); } if (tm) - __tree_mod_log_rewind(root->fs_info, eb, time_seq, tm); + __tree_mod_log_rewind(eb, time_seq, tm); else WARN_ON(btrfs_header_level(eb) != 0); WARN_ON(btrfs_header_nritems(eb) > BTRFS_NODEPTRS_PER_BLOCK(root)); diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index ba9690b9ae24..ff40f1c00ce3 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -4579,41 +4579,6 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) send_root = BTRFS_I(file_inode(mnt_file))->root; fs_info = send_root->fs_info; - /* - * This is done when we lookup the root, it should already be complete - * by the time we get here. - */ - WARN_ON(send_root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE); - - /* - * If we just created this root we need to make sure that the orphan - * cleanup has been done and committed since we search the commit root, - * so check its commit root transid with our otransid and if they match - * commit the transaction to make sure everything is updated. - */ - down_read(&send_root->fs_info->extent_commit_sem); - if (btrfs_header_generation(send_root->commit_root) == - btrfs_root_otransid(&send_root->root_item)) { - struct btrfs_trans_handle *trans; - - up_read(&send_root->fs_info->extent_commit_sem); - - trans = btrfs_attach_transaction_barrier(send_root); - if (IS_ERR(trans)) { - if (PTR_ERR(trans) != -ENOENT) { - ret = PTR_ERR(trans); - goto out; - } - /* ENOENT means theres no transaction */ - } else { - ret = btrfs_commit_transaction(trans, send_root); - if (ret) - goto out; - } - } else { - up_read(&send_root->fs_info->extent_commit_sem); - } - arg = memdup_user(arg_, sizeof(*arg)); if (IS_ERR(arg)) { ret = PTR_ERR(arg); diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h index fe8d6276410a..4fb097468e21 100644 --- a/fs/cifs/cifs_unicode.h +++ b/fs/cifs/cifs_unicode.h @@ -327,14 +327,14 @@ UniToupper(register wchar_t uc) /* * UniStrupr: Upper case a unicode string */ -static inline __le16 * -UniStrupr(register __le16 *upin) +static inline wchar_t * +UniStrupr(register wchar_t *upin) { - register __le16 *up; + register wchar_t *up; up = upin; while (*up) { /* For all characters */ - *up = cpu_to_le16(UniToupper(le16_to_cpu(*up))); + *up = UniToupper(*up); up++; } return upin; /* Return input pointer */ diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index f59d0d58258e..71436d1fca13 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -414,7 +414,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, int rc = 0; int len; char nt_hash[CIFS_NTHASH_SIZE]; - __le16 *user; + wchar_t *user; wchar_t *domain; wchar_t *server; @@ -439,7 +439,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, return rc; } - /* convert ses->user_name to unicode */ + /* convert ses->user_name to unicode and uppercase */ len = ses->user_name ? strlen(ses->user_name) : 0; user = kmalloc(2 + (len * 2), GFP_KERNEL); if (user == NULL) { @@ -448,7 +448,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, } if (len) { - len = cifs_strtoUTF16(user, ses->user_name, len, nls_cp); + len = cifs_strtoUTF16((__le16 *)user, ses->user_name, len, nls_cp); UniStrupr(user); } else { memset(user, '\0', 2); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 58663ee45b6e..0630710a9c3f 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -553,10 +553,11 @@ cifs_relock_file(struct cifsFileInfo *cfile) struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); int rc = 0; - down_read(&cinode->lock_sem); + /* we are going to update can_cache_brlcks here - need a write access */ + down_write(&cinode->lock_sem); if (cinode->can_cache_brlcks) { - /* can cache locks - no need to relock */ - up_read(&cinode->lock_sem); + /* can cache locks - no need to push them */ + up_write(&cinode->lock_sem); return rc; } @@ -567,7 +568,7 @@ cifs_relock_file(struct cifsFileInfo *cfile) else rc = tcon->ses->server->ops->push_mand_locks(cfile); - up_read(&cinode->lock_sem); + up_write(&cinode->lock_sem); return rc; } diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 449b6cf09b09..20efd81266c6 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -558,11 +558,6 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, fattr->cf_mode &= ~(S_IWUGO); fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks); - if (fattr->cf_nlink < 1) { - cifs_dbg(1, "replacing bogus file nlink value %u\n", - fattr->cf_nlink); - fattr->cf_nlink = 1; - } } fattr->cf_uid = cifs_sb->mnt_uid; diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index f8cde46de9cd..a5ffe2e2a462 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -576,8 +576,11 @@ static int htree_dirblock_to_tree(struct file *dir_file, if (!ext3_check_dir_entry("htree_dirblock_to_tree", dir, de, bh, (block<i_sb)) +((char *)de - bh->b_data))) { - /* silently ignore the rest of the block */ - break; + /* On error, skip the f_pos to the next block. */ + dir_file->f_pos = (dir_file->f_pos | + (dir->i_sb->s_blocksize - 1)) + 1; + brelse (bh); + return count; } ext3fs_dirhash(de->name, de->name_len, hinfo); if ((hinfo->hash < start_hash) || diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 7297d63e7e20..4b88cd4eb7d6 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -38,8 +38,8 @@ ext4_group_t ext4_get_group_number(struct super_block *sb, ext4_group_t group; if (test_opt2(sb, STD_GROUP_SIZE)) - group = (block - - le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) >> + group = (le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block) + + block) >> (EXT4_BLOCK_SIZE_BITS(sb) + EXT4_CLUSTER_BITS(sb) + 3); else ext4_get_group_no_and_offset(sb, block, &group, NULL); diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 2873db80d59a..d6ca79831273 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4665,7 +4665,7 @@ static int ext4_xattr_fiemap(struct inode *inode, error = ext4_get_inode_loc(inode, &iloc); if (error) return error; - physical = (__u64)iloc.bh->b_blocknr << blockbits; + physical = iloc.bh->b_blocknr << blockbits; offset = EXT4_GOOD_OLD_INODE_SIZE + EXT4_I(inode)->i_extra_isize; physical += offset; @@ -4673,7 +4673,7 @@ static int ext4_xattr_fiemap(struct inode *inode, flags |= FIEMAP_EXTENT_DATA_INLINE; brelse(iloc.bh); } else { /* external block */ - physical = (__u64)EXT4_I(inode)->i_file_acl << blockbits; + physical = EXT4_I(inode)->i_file_acl << blockbits; length = inode->i_sb->s_blocksize; } diff --git a/fs/ext4/file.c b/fs/ext4/file.c index b19f0a457f32..b1b4d51b5d86 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -312,7 +312,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode, blkbits = inode->i_sb->s_blocksize_bits; startoff = *offset; lastoff = startoff; - endoff = (loff_t)(map->m_lblk + map->m_len) << blkbits; + endoff = (map->m_lblk + map->m_len) << blkbits; index = startoff >> PAGE_CACHE_SHIFT; end = endoff >> PAGE_CACHE_SHIFT; @@ -457,7 +457,7 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) ret = ext4_map_blocks(NULL, inode, &map, 0); if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { if (last != start) - dataoff = (loff_t)last << blkbits; + dataoff = last << blkbits; break; } @@ -468,7 +468,7 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) ext4_es_find_delayed_extent_range(inode, last, last, &es); if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { if (last != start) - dataoff = (loff_t)last << blkbits; + dataoff = last << blkbits; break; } @@ -486,7 +486,7 @@ static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize) } last++; - dataoff = (loff_t)last << blkbits; + dataoff = last << blkbits; } while (last <= end); mutex_unlock(&inode->i_mutex); @@ -540,7 +540,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) ret = ext4_map_blocks(NULL, inode, &map, 0); if (ret > 0 && !(map.m_flags & EXT4_MAP_UNWRITTEN)) { last += ret; - holeoff = (loff_t)last << blkbits; + holeoff = last << blkbits; continue; } @@ -551,7 +551,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) ext4_es_find_delayed_extent_range(inode, last, last, &es); if (es.es_len != 0 && in_range(last, es.es_lblk, es.es_len)) { last = es.es_lblk + es.es_len; - holeoff = (loff_t)last << blkbits; + holeoff = last << blkbits; continue; } @@ -566,7 +566,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize) &map, &holeoff); if (!unwritten) { last += ret; - holeoff = (loff_t)last << blkbits; + holeoff = last << blkbits; continue; } } diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 0e0677f3cf47..32b2e358532b 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1847,7 +1847,7 @@ int ext4_inline_data_fiemap(struct inode *inode, if (error) goto out; - physical = (__u64)iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits; + physical = iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits; physical += (char *)ext4_raw_inode(&iloc) - iloc.bh->b_data; physical += offsetof(struct ext4_inode, i_block); length = i_size_read(inode); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b1d3d976d62a..ecd9604ca5dc 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1111,13 +1111,10 @@ static int ext4_write_end(struct file *file, } } - if (ext4_has_inline_data(inode)) { - ret = ext4_write_inline_data_end(inode, pos, len, - copied, page); - if (ret < 0) - goto errout; - copied = ret; - } else + if (ext4_has_inline_data(inode)) + copied = ext4_write_inline_data_end(inode, pos, len, + copied, page); + else copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); @@ -4847,7 +4844,7 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { struct inode *inode; - unsigned long long delalloc_blocks; + unsigned long delalloc_blocks; inode = dentry->d_inode; generic_fillattr(inode, stat); @@ -4865,7 +4862,7 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, delalloc_blocks = EXT4_C2B(EXT4_SB(inode->i_sb), EXT4_I(inode)->i_reserved_data_blocks); - stat->blocks += delalloc_blocks << (inode->i_sb->s_blocksize_bits-9); + stat->blocks += (delalloc_blocks << inode->i_sb->s_blocksize_bits)>>9; return 0; } diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 0dca154b5d75..f621796cb0bd 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4738,16 +4738,11 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, * blocks being freed are metadata. these blocks shouldn't * be used until this transaction is committed */ - retry: new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS); if (!new_entry) { - /* - * We use a retry loop because - * ext4_free_blocks() is not allowed to fail. - */ - cond_resched(); - congestion_wait(BLK_RW_ASYNC, HZ/50); - goto retry; + ext4_mb_unload_buddy(&e4b); + err = -ENOMEM; + goto error_return; } new_entry->efd_start_cluster = bit; new_entry->efd_group = block_group; diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f81fba16f686..788418929008 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -922,8 +922,11 @@ static int htree_dirblock_to_tree(struct file *dir_file, bh->b_data, bh->b_size, (block<i_sb)) + ((char *)de - bh->b_data))) { - /* silently ignore the rest of the block */ - break; + /* On error, skip the f_pos to the next block. */ + dir_file->f_pos = (dir_file->f_pos | + (dir->i_sb->s_blocksize - 1)) + 1; + brelse(bh); + return count; } ext4fs_dirhash(de->name, de->name_len, hinfo); if ((hinfo->hash < start_hash) || diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 2c2b64e98aa8..a846cc9b00d2 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -1656,10 +1656,12 @@ static int ext4_group_extend_no_check(struct super_block *sb, err = err2; if (!err) { + ext4_fsblk_t first_block; + first_block = ext4_group_first_block_no(sb, 0); if (test_opt(sb, DEBUG)) printk(KERN_DEBUG "EXT4-fs: extended group to %llu " "blocks\n", ext4_blocks_count(es)); - update_backups(sb, EXT4_SB(sb)->s_sbh->b_blocknr, + update_backups(sb, EXT4_SB(sb)->s_sbh->b_blocknr - first_block, (char *)es, sizeof(struct ext4_super_block), 0); } return err; diff --git a/fs/ext4/super.c b/fs/ext4/super.c index dd64865571a8..7b156c8377f1 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1688,6 +1688,12 @@ static inline void ext4_show_quota_options(struct seq_file *seq, if (sbi->s_qf_names[GRPQUOTA]) seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]); + + if (test_opt(sb, USRQUOTA)) + seq_puts(seq, ",usrquota"); + + if (test_opt(sb, GRPQUOTA)) + seq_puts(seq, ",grpquota"); #endif } @@ -3592,6 +3598,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); + /* Do we have standard group size of blocksize * 8 blocks ? */ + if (sbi->s_blocks_per_group == blocksize << 3) + set_opt2(sb, STD_GROUP_SIZE); + for (i = 0; i < 4; i++) sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); sbi->s_def_hash_version = es->s_def_hash_version; @@ -3661,10 +3671,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount; } - /* Do we have standard group size of clustersize * 8 blocks ? */ - if (sbi->s_blocks_per_group == clustersize << 3) - set_opt2(sb, STD_GROUP_SIZE); - /* * Test whether we have more sectors than will fit in sector_t, * and whether the max offset is addressable by the page cache. diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index aaa1a3f33b0e..95457576e434 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1318,7 +1318,6 @@ static int journal_reset(journal_t *journal) static void jbd2_write_superblock(journal_t *journal, int write_op) { struct buffer_head *bh = journal->j_sb_buffer; - journal_superblock_t *sb = journal->j_superblock; int ret; trace_jbd2_write_superblock(journal, write_op); @@ -1340,7 +1339,6 @@ static void jbd2_write_superblock(journal_t *journal, int write_op) clear_buffer_write_io_error(bh); set_buffer_uptodate(bh); } - jbd2_superblock_csum_set(journal, sb); get_bh(bh); bh->b_end_io = end_buffer_write_sync; ret = submit_bh(write_op, bh); @@ -1437,6 +1435,7 @@ void jbd2_journal_update_sb_errno(journal_t *journal) jbd_debug(1, "JBD2: updating superblock error (errno %d)\n", journal->j_errno); sb->s_errno = cpu_to_be32(journal->j_errno); + jbd2_superblock_csum_set(journal, sb); read_unlock(&journal->j_state_lock); jbd2_write_superblock(journal, WRITE_SYNC); diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index e0c0bc275924..10f524c59ea8 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -517,10 +517,10 @@ int jbd2__journal_restart(handle_t *handle, int nblocks, gfp_t gfp_mask) &transaction->t_outstanding_credits); if (atomic_dec_and_test(&transaction->t_updates)) wake_up(&journal->j_wait_updates); - tid = transaction->t_tid; spin_unlock(&transaction->t_handle_lock); jbd_debug(2, "restarting handle %p\n", handle); + tid = transaction->t_tid; need_to_start = !tid_geq(journal->j_commit_request, tid); read_unlock(&journal->j_state_lock); if (need_to_start) diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 5b8d94436105..2e3ea308c144 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -6499,16 +6499,6 @@ static int ocfs2_reflink_xattr_inline(struct ocfs2_xattr_reflink *args) } new_oi = OCFS2_I(args->new_inode); - /* - * Adjust extent record count to reserve space for extended attribute. - * Inline data count had been adjusted in ocfs2_duplicate_inline_data(). - */ - if (!(new_oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) && - !(ocfs2_inode_is_fast_symlink(args->new_inode))) { - struct ocfs2_extent_list *el = &new_di->id2.i_list; - le16_add_cpu(&el->l_count, -(inline_size / - sizeof(struct ocfs2_extent_rec))); - } spin_lock(&new_oi->ip_lock); new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL; new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features); diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 3a9a3a9793e9..f7caeb5ef27e 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1421,7 +1421,7 @@ static int mount_ubifs(struct ubifs_info *c) c->mounting = 0; ubifs_msg("mounted UBI, volume %d, name \"%s\"%s", c->vi.ubi_num, - c->vi.vol_id, c->vi.name, c->ro_mount ? ", R/O mode" : ""); + c->vi.vol_id, c->vi.name, c->ro_mount ? ", R/O mode" : NULL); x = (long long)c->main_lebs * c->leb_size; y = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; ubifs_msg("LEB size: %d bytes (%d KiB), min./max. I/O unit sizes: %d bytes/%d bytes", diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8852d370c720..8bda1294c035 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -646,60 +646,22 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( return cgrp->subsys[subsys_id]; } -/** - * task_css_set_check - obtain a task's css_set with extra access conditions - * @task: the task to obtain css_set for - * @__c: extra condition expression to be passed to rcu_dereference_check() - * - * A task's css_set is RCU protected, initialized and exited while holding - * task_lock(), and can only be modified while holding both cgroup_mutex - * and task_lock() while the task is alive. This macro verifies that the - * caller is inside proper critical section and returns @task's css_set. - * - * The caller can also specify additional allowed conditions via @__c, such - * as locks used during the cgroup_subsys::attach() methods. +/* + * function to get the cgroup_subsys_state which allows for extra + * rcu_dereference_check() conditions, such as locks used during the + * cgroup_subsys::attach() methods. */ #ifdef CONFIG_PROVE_RCU extern struct mutex cgroup_mutex; -#define task_css_set_check(task, __c) \ - rcu_dereference_check((task)->cgroups, \ - lockdep_is_held(&(task)->alloc_lock) || \ - lockdep_is_held(&cgroup_mutex) || (__c)) +#define task_subsys_state_check(task, subsys_id, __c) \ + rcu_dereference_check((task)->cgroups->subsys[(subsys_id)], \ + lockdep_is_held(&(task)->alloc_lock) || \ + lockdep_is_held(&cgroup_mutex) || (__c)) #else -#define task_css_set_check(task, __c) \ - rcu_dereference((task)->cgroups) -#endif - -/** - * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds - * @task: the target task - * @subsys_id: the target subsystem ID - * @__c: extra condition expression to be passed to rcu_dereference_check() - * - * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The - * synchronization rules are the same as task_css_set_check(). - */ #define task_subsys_state_check(task, subsys_id, __c) \ - task_css_set_check((task), (__c))->subsys[(subsys_id)] - -/** - * task_css_set - obtain a task's css_set - * @task: the task to obtain css_set for - * - * See task_css_set_check(). - */ -static inline struct css_set *task_css_set(struct task_struct *task) -{ - return task_css_set_check(task, false); -} + rcu_dereference((task)->cgroups->subsys[(subsys_id)]) +#endif -/** - * task_subsys_state - obtain css for (task, subsys) - * @task: the target task - * @subsys_id: the target subsystem ID - * - * See task_subsys_state_check(). - */ static inline struct cgroup_subsys_state * task_subsys_state(struct task_struct *task, int subsys_id) { diff --git a/include/linux/nbd.h b/include/linux/nbd.h index ae4981ebd18e..4871170a04a0 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -41,7 +41,6 @@ struct nbd_device { u64 bytesize; pid_t pid; /* pid of nbd-client, if attached */ int xmit_timeout; - int disconnect; /* a disconnect has been requested by user */ }; #endif diff --git a/kernel/cgroup.c b/kernel/cgroup.c index bf737d21488f..6dabba3d798b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3727,23 +3727,6 @@ static int cgroup_write_notify_on_release(struct cgroup *cgrp, return 0; } -/* - * When dput() is called asynchronously, if umount has been done and - * then deactivate_super() in cgroup_free_fn() kills the superblock, - * there's a small window that vfs will see the root dentry with non-zero - * refcnt and trigger BUG(). - * - * That's why we hold a reference before dput() and drop it right after. - */ -static void cgroup_dput(struct cgroup *cgrp) -{ - struct super_block *sb = cgrp->root->sb; - - atomic_inc(&sb->s_active); - dput(cgrp->dentry); - deactivate_super(sb); -} - /* * Unregister event and free resources. * @@ -3764,7 +3747,7 @@ static void cgroup_event_remove(struct work_struct *work) eventfd_ctx_put(event->eventfd); kfree(event); - cgroup_dput(cgrp); + dput(cgrp->dentry); } /* @@ -4052,8 +4035,12 @@ static void css_dput_fn(struct work_struct *work) { struct cgroup_subsys_state *css = container_of(work, struct cgroup_subsys_state, dput_work); + struct dentry *dentry = css->cgroup->dentry; + struct super_block *sb = dentry->d_sb; - cgroup_dput(css->cgroup); + atomic_inc(&sb->s_active); + dput(dentry); + deactivate_super(sb); } static void init_cgroup_css(struct cgroup_subsys_state *css, diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index fb8e9a2c55bf..ecfb16fc946c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -606,9 +606,9 @@ int can_request_irq(unsigned int irq, unsigned long irqflags) return 0; if (irq_settings_can_request(desc)) { - if (!desc->action || - irqflags & desc->action->flags & IRQF_SHARED) - canrequest = 1; + if (desc->action) + if (irqflags & desc->action->flags & IRQF_SHARED) + canrequest =1; } irq_put_desc_unlock(desc, flags); return canrequest; diff --git a/kernel/timer.c b/kernel/timer.c index a60765856fc5..c0663db9146d 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -155,11 +155,9 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu, /* now that we have rounded, subtract the extra skew again */ j -= cpu * 3; - /* - * Make sure j is still in the future. Otherwise return the - * unmodified value. - */ - return time_is_after_jiffies(j) ? j : original; + if (j <= jiffies) /* rounding ate our timeout entirely; */ + return original; + return j; } /** diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7304c704c4b7..4401d014a5b5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6301,6 +6301,14 @@ mem_cgroup_css_online(struct cgroup *cont) error = memcg_init_kmem(memcg, &mem_cgroup_subsys); mutex_unlock(&memcg_create_mutex); + if (error) { + /* + * We call put now because our (and parent's) refcnts + * are already in place. mem_cgroup_put() will internally + * call __mem_cgroup_free, so return directly + */ + mem_cgroup_put(memcg); + } return error; } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0518a8bdfe6a..e2f35f87688e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6447,10 +6447,6 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn) list_del(&page->lru); rmv_page_order(page); zone->free_area[order].nr_free--; -#ifdef CONFIG_HIGHMEM - if (PageHighMem(page)) - totalhigh_pages -= 1 << order; -#endif if (is_migrate_cma(get_pageblock_migratetype(page))) zone->free_area[order].nr_free_cma--; for (i = 0; i < (1 << order); i++) diff --git a/mm/slab.c b/mm/slab.c index bd88411595b9..8ccd296c6d9c 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -565,7 +565,7 @@ static void init_node_lock_keys(int q) if (slab_state < UP) return; - for (i = 1; i <= KMALLOC_SHIFT_HIGH; i++) { + for (i = 1; i < PAGE_SHIFT + MAX_ORDER; i++) { struct kmem_cache_node *n; struct kmem_cache *cache = kmalloc_caches[i];