From 123f0c07844258ec480557bd8eb3dcb4f4e92855 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 13 Sep 2010 14:09:33 +0200 Subject: [PATCH] --- yaml --- r: 210891 b: refs/heads/master c: b0722cb1ac84863f57471d2b254457c100319300 h: refs/heads/master i: 210889: ef6f962be972ae7f0c2487c7a49e31500d171253 210887: 8c3f10e51f025d1066cb15f2167cf1b0bb5754bf v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 4 +- trunk/Makefile | 2 +- trunk/arch/Kconfig | 4 +- trunk/arch/frv/kernel/signal.c | 51 ++++------ trunk/arch/x86/include/asm/hw_breakpoint.h | 2 +- trunk/arch/x86/kernel/hw_breakpoint.c | 40 ++++---- trunk/arch/x86/lguest/boot.c | 13 +-- trunk/arch/x86/oprofile/nmi_int.c | 4 +- trunk/drivers/block/cciss.c | 2 +- trunk/drivers/char/agp/intel-agp.c | 2 - trunk/drivers/char/agp/intel-agp.h | 2 - trunk/drivers/char/virtio_console.c | 6 +- trunk/drivers/gpu/drm/i915/i915_drv.c | 1 - trunk/drivers/gpu/drm/i915/i915_gem.c | 37 +++----- trunk/drivers/gpu/drm/i915/i915_gem_evict.c | 9 +- trunk/drivers/gpu/drm/i915/i915_suspend.c | 36 ++------ trunk/drivers/gpu/drm/i915/intel_crt.c | 4 +- trunk/drivers/gpu/drm/i915/intel_display.c | 8 -- trunk/drivers/i2c/busses/i2c-omap.c | 2 - trunk/drivers/serial/amba-pl010.c | 9 +- trunk/drivers/serial/mfd.c | 17 ++-- .../staging/batman-adv/hard-interface.c | 13 +++ trunk/drivers/staging/batman-adv/send.c | 8 +- trunk/drivers/staging/vt6655/wpactl.c | 11 +-- trunk/drivers/usb/host/ehci-pci.c | 5 - trunk/drivers/usb/musb/musb_debugfs.c | 5 +- trunk/drivers/usb/otg/twl4030-usb.c | 78 ++++++---------- trunk/drivers/usb/serial/mos7720.c | 3 - trunk/drivers/usb/serial/mos7840.c | 3 - trunk/fs/ceph/Kconfig | 1 - trunk/fs/ceph/addr.c | 7 +- trunk/fs/ceph/caps.c | 27 ++---- trunk/fs/ceph/dir.c | 10 +- trunk/fs/ceph/inode.c | 11 +-- trunk/fs/ceph/mds_client.c | 2 - trunk/fs/ceph/pagelist.c | 12 +-- trunk/fs/ceph/snap.c | 92 ++++++++++++------- trunk/fs/ceph/super.h | 5 +- trunk/include/linux/fs.h | 4 - trunk/kernel/hw_breakpoint.c | 3 +- trunk/kernel/sched.c | 8 +- trunk/kernel/sched_fair.c | 2 +- trunk/mm/memory.c | 8 +- 44 files changed, 241 insertions(+), 334 deletions(-) diff --git a/[refs] b/[refs] index bdbb96cd0fde..6353738640a7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 62f1b494d82272819570d715eb6633887a9fde20 +refs/heads/master: b0722cb1ac84863f57471d2b254457c100319300 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 50b8148448fd..411b0d04f69b 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -3942,7 +3942,7 @@ F: drivers/char/isicom.c F: include/linux/isicom.h MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER -M: Felipe Balbi +M: Felipe Balbi L: linux-usb@vger.kernel.org T: git git://gitorious.org/usb/usb.git S: Maintained @@ -4240,7 +4240,7 @@ S: Maintained F: drivers/char/hw_random/omap-rng.c OMAP USB SUPPORT -M: Felipe Balbi +M: Felipe Balbi M: David Brownell L: linux-usb@vger.kernel.org L: linux-omap@vger.kernel.org diff --git a/trunk/Makefile b/trunk/Makefile index 3133a5772eeb..92ab33f16cf0 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 36 -EXTRAVERSION = -rc5 +EXTRAVERSION = -rc4 NAME = Sheep on Meth # *DOCUMENTATION* diff --git a/trunk/arch/Kconfig b/trunk/arch/Kconfig index fe48fc7a3eba..4877a8c8ee16 100644 --- a/trunk/arch/Kconfig +++ b/trunk/arch/Kconfig @@ -32,9 +32,8 @@ config HAVE_OPROFILE config KPROBES bool "Kprobes" - depends on MODULES + depends on KALLSYMS && MODULES depends on HAVE_KPROBES - select KALLSYMS help Kprobes allows you to trap at almost any kernel address and execute a callback function. register_kprobe() establishes @@ -46,6 +45,7 @@ config OPTPROBES def_bool y depends on KPROBES && HAVE_OPTPROBES depends on !PREEMPT + select KALLSYMS_ALL config HAVE_EFFICIENT_UNALIGNED_ACCESS bool diff --git a/trunk/arch/frv/kernel/signal.c b/trunk/arch/frv/kernel/signal.c index bab01298b58e..0974c0ecc594 100644 --- a/trunk/arch/frv/kernel/signal.c +++ b/trunk/arch/frv/kernel/signal.c @@ -121,9 +121,6 @@ static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8) struct user_context *user = current->thread.user; unsigned long tbr, psr; - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; - tbr = user->i.tbr; psr = user->i.psr; if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context))) @@ -253,8 +250,6 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) struct sigframe __user *frame; int rsig; - set_fs(USER_DS); - frame = get_sigframe(ka, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) @@ -298,23 +293,22 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) (unsigned long) (frame->retcode + 2)); } - /* Set up registers for the signal handler */ + /* set up registers for signal handler */ + __frame->sp = (unsigned long) frame; + __frame->lr = (unsigned long) &frame->retcode; + __frame->gr8 = sig; + if (current->personality & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; - struct fdpic_func_descriptor desc; - if (copy_from_user(&desc, funcptr, sizeof(desc))) - goto give_sigsegv; - __frame->pc = desc.text; - __frame->gr15 = desc.GOT; + __get_user(__frame->pc, &funcptr->text); + __get_user(__frame->gr15, &funcptr->GOT); } else { __frame->pc = (unsigned long) ka->sa.sa_handler; __frame->gr15 = 0; } - __frame->sp = (unsigned long) frame; - __frame->lr = (unsigned long) &frame->retcode; - __frame->gr8 = sig; + set_fs(USER_DS); /* the tracer may want to single-step inside the handler */ if (test_thread_flag(TIF_SINGLESTEP)) @@ -329,7 +323,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set) return 0; give_sigsegv: - force_sigsegv(sig, current); + force_sig(SIGSEGV, current); return -EFAULT; } /* end setup_frame() */ @@ -344,8 +338,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, struct rt_sigframe __user *frame; int rsig; - set_fs(USER_DS); - frame = get_sigframe(ka, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) @@ -400,23 +392,22 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, } /* Set up registers for signal handler */ + __frame->sp = (unsigned long) frame; + __frame->lr = (unsigned long) &frame->retcode; + __frame->gr8 = sig; + __frame->gr9 = (unsigned long) &frame->info; + if (current->personality & FDPIC_FUNCPTRS) { struct fdpic_func_descriptor __user *funcptr = (struct fdpic_func_descriptor __user *) ka->sa.sa_handler; - struct fdpic_func_descriptor desc; - if (copy_from_user(&desc, funcptr, sizeof(desc))) - goto give_sigsegv; - __frame->pc = desc.text; - __frame->gr15 = desc.GOT; + __get_user(__frame->pc, &funcptr->text); + __get_user(__frame->gr15, &funcptr->GOT); } else { __frame->pc = (unsigned long) ka->sa.sa_handler; __frame->gr15 = 0; } - __frame->sp = (unsigned long) frame; - __frame->lr = (unsigned long) &frame->retcode; - __frame->gr8 = sig; - __frame->gr9 = (unsigned long) &frame->info; + set_fs(USER_DS); /* the tracer may want to single-step inside the handler */ if (test_thread_flag(TIF_SINGLESTEP)) @@ -431,7 +422,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, return 0; give_sigsegv: - force_sigsegv(sig, current); + force_sig(SIGSEGV, current); return -EFAULT; } /* end setup_rt_frame() */ @@ -446,7 +437,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info, int ret; /* Are we from a system call? */ - if (__frame->syscallno != -1) { + if (in_syscall(__frame)) { /* If so, check system call restarting.. */ switch (__frame->gr8) { case -ERESTART_RESTARTBLOCK: @@ -465,7 +456,6 @@ static int handle_signal(unsigned long sig, siginfo_t *info, __frame->gr8 = __frame->orig_gr8; __frame->pc -= 4; } - __frame->syscallno = -1; } /* Set up the stack frame */ @@ -548,11 +538,10 @@ static void do_signal(void) break; case -ERESTART_RESTARTBLOCK: - __frame->gr7 = __NR_restart_syscall; + __frame->gr8 = __NR_restart_syscall; __frame->pc -= 4; break; } - __frame->syscallno = -1; } /* if there's no signal to deliver, we just put the saved sigmask diff --git a/trunk/arch/x86/include/asm/hw_breakpoint.h b/trunk/arch/x86/include/asm/hw_breakpoint.h index 824ca07860d0..528a11e8d3e3 100644 --- a/trunk/arch/x86/include/asm/hw_breakpoint.h +++ b/trunk/arch/x86/include/asm/hw_breakpoint.h @@ -20,7 +20,7 @@ struct arch_hw_breakpoint { #include /* Available HW breakpoint length encodings */ -#define X86_BREAKPOINT_LEN_X 0x40 +#define X86_BREAKPOINT_LEN_X 0x00 #define X86_BREAKPOINT_LEN_1 0x40 #define X86_BREAKPOINT_LEN_2 0x44 #define X86_BREAKPOINT_LEN_4 0x4c diff --git a/trunk/arch/x86/kernel/hw_breakpoint.c b/trunk/arch/x86/kernel/hw_breakpoint.c index ff15c9dcc25d..a474ec37c32f 100644 --- a/trunk/arch/x86/kernel/hw_breakpoint.c +++ b/trunk/arch/x86/kernel/hw_breakpoint.c @@ -206,27 +206,11 @@ int arch_check_bp_in_kernelspace(struct perf_event *bp) int arch_bp_generic_fields(int x86_len, int x86_type, int *gen_len, int *gen_type) { - /* Type */ - switch (x86_type) { - case X86_BREAKPOINT_EXECUTE: - if (x86_len != X86_BREAKPOINT_LEN_X) - return -EINVAL; - - *gen_type = HW_BREAKPOINT_X; - *gen_len = sizeof(long); - return 0; - case X86_BREAKPOINT_WRITE: - *gen_type = HW_BREAKPOINT_W; - break; - case X86_BREAKPOINT_RW: - *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; - break; - default: - return -EINVAL; - } - /* Len */ switch (x86_len) { + case X86_BREAKPOINT_LEN_X: + *gen_len = sizeof(long); + break; case X86_BREAKPOINT_LEN_1: *gen_len = HW_BREAKPOINT_LEN_1; break; @@ -245,6 +229,21 @@ int arch_bp_generic_fields(int x86_len, int x86_type, return -EINVAL; } + /* Type */ + switch (x86_type) { + case X86_BREAKPOINT_EXECUTE: + *gen_type = HW_BREAKPOINT_X; + break; + case X86_BREAKPOINT_WRITE: + *gen_type = HW_BREAKPOINT_W; + break; + case X86_BREAKPOINT_RW: + *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; + break; + default: + return -EINVAL; + } + return 0; } @@ -317,6 +316,9 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) ret = -EINVAL; switch (info->len) { + case X86_BREAKPOINT_LEN_X: + align = sizeof(long) -1; + break; case X86_BREAKPOINT_LEN_1: align = 0; break; diff --git a/trunk/arch/x86/lguest/boot.c b/trunk/arch/x86/lguest/boot.c index 9d5f55848455..9257510b4836 100644 --- a/trunk/arch/x86/lguest/boot.c +++ b/trunk/arch/x86/lguest/boot.c @@ -324,8 +324,9 @@ static void lguest_load_gdt(const struct desc_ptr *desc) } /* - * For a single GDT entry which changes, we simply change our copy and - * then tell the host about it. + * For a single GDT entry which changes, we do the lazy thing: alter our GDT, + * then tell the Host to reload the entire thing. This operation is so rare + * that this naive implementation is reasonable. */ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, const void *desc, int type) @@ -337,13 +338,9 @@ static void lguest_write_gdt_entry(struct desc_struct *dt, int entrynum, } /* - * There are three "thread local storage" GDT entries which change + * OK, I lied. There are three "thread local storage" GDT entries which change * on every context switch (these three entries are how glibc implements - * __thread variables). As an optimization, we have a hypercall - * specifically for this case. - * - * Wouldn't it be nicer to have a general LOAD_GDT_ENTRIES hypercall - * which took a range of entries? + * __thread variables). So we have a hypercall specifically for this case. */ static void lguest_load_tls(struct thread_struct *t, unsigned int cpu) { diff --git a/trunk/arch/x86/oprofile/nmi_int.c b/trunk/arch/x86/oprofile/nmi_int.c index 009b819f48d0..cfe4faabb0f6 100644 --- a/trunk/arch/x86/oprofile/nmi_int.c +++ b/trunk/arch/x86/oprofile/nmi_int.c @@ -671,9 +671,7 @@ static int __init ppro_init(char **cpu_type) case 14: *cpu_type = "i386/core"; break; - case 0x0f: - case 0x16: - case 0x17: + case 15: case 23: *cpu_type = "i386/core_2"; break; case 0x1a: diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index 6124c2fd2d33..5e4fadcdece9 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -4792,7 +4792,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, clean4: kfree(h->cmd_pool_bits); /* Free up sg elements */ - for (k = 0; k < h->nr_cmds; k++) + for (k-- ; k >= 0; k--) kfree(h->scatter_list[k]); kfree(h->scatter_list); cciss_free_sg_chain_blocks(h->cmd_sg_list, h->nr_cmds); diff --git a/trunk/drivers/char/agp/intel-agp.c b/trunk/drivers/char/agp/intel-agp.c index cd18493c9527..eab58db5f91c 100644 --- a/trunk/drivers/char/agp/intel-agp.c +++ b/trunk/drivers/char/agp/intel-agp.c @@ -806,8 +806,6 @@ static const struct intel_driver_description { "G45/G43", NULL, &intel_i965_driver }, { PCI_DEVICE_ID_INTEL_B43_HB, PCI_DEVICE_ID_INTEL_B43_IG, "B43", NULL, &intel_i965_driver }, - { PCI_DEVICE_ID_INTEL_B43_1_HB, PCI_DEVICE_ID_INTEL_B43_1_IG, - "B43", NULL, &intel_i965_driver }, { PCI_DEVICE_ID_INTEL_G41_HB, PCI_DEVICE_ID_INTEL_G41_IG, "G41", NULL, &intel_i965_driver }, { PCI_DEVICE_ID_INTEL_IRONLAKE_D_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG, diff --git a/trunk/drivers/char/agp/intel-agp.h b/trunk/drivers/char/agp/intel-agp.h index d09b1ab7e8ab..ee189c74d345 100644 --- a/trunk/drivers/char/agp/intel-agp.h +++ b/trunk/drivers/char/agp/intel-agp.h @@ -186,8 +186,6 @@ #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 #define PCI_DEVICE_ID_INTEL_B43_HB 0x2E40 #define PCI_DEVICE_ID_INTEL_B43_IG 0x2E42 -#define PCI_DEVICE_ID_INTEL_B43_1_HB 0x2E90 -#define PCI_DEVICE_ID_INTEL_B43_1_IG 0x2E92 #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 #define PCI_DEVICE_ID_INTEL_EAGLELAKE_HB 0x2E00 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index c810481a5bc2..942a9826bd23 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -596,10 +596,6 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, ssize_t ret; bool nonblock; - /* Userspace could be out to fool us */ - if (!count) - return 0; - port = filp->private_data; nonblock = filp->f_flags & O_NONBLOCK; @@ -646,7 +642,7 @@ static unsigned int port_fops_poll(struct file *filp, poll_table *wait) poll_wait(filp, &port->waitqueue, wait); ret = 0; - if (!will_read_block(port)) + if (port->inbuf) ret |= POLLIN | POLLRDNORM; if (!will_write_block(port)) ret |= POLLOUT; diff --git a/trunk/drivers/gpu/drm/i915/i915_drv.c b/trunk/drivers/gpu/drm/i915/i915_drv.c index 6dbe14cc4f74..216deb579785 100644 --- a/trunk/drivers/gpu/drm/i915/i915_drv.c +++ b/trunk/drivers/gpu/drm/i915/i915_drv.c @@ -170,7 +170,6 @@ static const struct pci_device_id pciidlist[] = { /* aka */ INTEL_VGA_DEVICE(0x2e22, &intel_g45_info), /* G45_G */ INTEL_VGA_DEVICE(0x2e32, &intel_g45_info), /* G41_G */ INTEL_VGA_DEVICE(0x2e42, &intel_g45_info), /* B43_G */ - INTEL_VGA_DEVICE(0x2e92, &intel_g45_info), /* B43_G.1 */ INTEL_VGA_DEVICE(0xa001, &intel_pineview_info), INTEL_VGA_DEVICE(0xa011, &intel_pineview_info), INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), diff --git a/trunk/drivers/gpu/drm/i915/i915_gem.c b/trunk/drivers/gpu/drm/i915/i915_gem.c index cf4ffbee1c00..16fca1d1799a 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem.c @@ -2351,21 +2351,14 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) reg->obj = obj; - switch (INTEL_INFO(dev)->gen) { - case 6: + if (IS_GEN6(dev)) sandybridge_write_fence_reg(reg); - break; - case 5: - case 4: + else if (IS_I965G(dev)) i965_write_fence_reg(reg); - break; - case 3: + else if (IS_I9XX(dev)) i915_write_fence_reg(reg); - break; - case 2: + else i830_write_fence_reg(reg); - break; - } trace_i915_gem_object_get_fence(obj, obj_priv->fence_reg, obj_priv->tiling_mode); @@ -2388,26 +2381,22 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj) struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[obj_priv->fence_reg]; - uint32_t fence_reg; - switch (INTEL_INFO(dev)->gen) { - case 6: + if (IS_GEN6(dev)) { I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (obj_priv->fence_reg * 8), 0); - break; - case 5: - case 4: + } else if (IS_I965G(dev)) { I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0); - break; - case 3: - if (obj_priv->fence_reg > 8) - fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4; - else - case 2: + } else { + uint32_t fence_reg; + + if (obj_priv->fence_reg < 8) fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4; + else + fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - + 8) * 4; I915_WRITE(fence_reg, 0); - break; } reg->obj = NULL; diff --git a/trunk/drivers/gpu/drm/i915/i915_gem_evict.c b/trunk/drivers/gpu/drm/i915/i915_gem_evict.c index e85246ef691c..72cae3cccad8 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem_evict.c @@ -79,7 +79,6 @@ mark_free(struct drm_i915_gem_object *obj_priv, struct list_head *unwind) { list_add(&obj_priv->evict_list, unwind); - drm_gem_object_reference(&obj_priv->base); return drm_mm_scan_add_block(obj_priv->gtt_space); } @@ -166,7 +165,6 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen list_for_each_entry(obj_priv, &unwind_list, evict_list) { ret = drm_mm_scan_remove_block(obj_priv->gtt_space); BUG_ON(ret); - drm_gem_object_unreference(&obj_priv->base); } /* We expect the caller to unpin, evict all and try again, or give up. @@ -183,21 +181,18 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen * scanning, therefore store to be evicted objects on a * temporary list. */ list_move(&obj_priv->evict_list, &eviction_list); - } else - drm_gem_object_unreference(&obj_priv->base); + } } /* Unbinding will emit any required flushes */ list_for_each_entry_safe(obj_priv, tmp_obj_priv, &eviction_list, evict_list) { #if WATCH_LRU - DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base); + DRM_INFO("%s: evicting %p\n", __func__, obj); #endif ret = i915_gem_object_unbind(&obj_priv->base); if (ret) return ret; - - drm_gem_object_unreference(&obj_priv->base); } /* The just created free hole should be on the top of the free stack diff --git a/trunk/drivers/gpu/drm/i915/i915_suspend.c b/trunk/drivers/gpu/drm/i915/i915_suspend.c index 31f08581e93a..2c6b98f2440e 100644 --- a/trunk/drivers/gpu/drm/i915/i915_suspend.c +++ b/trunk/drivers/gpu/drm/i915/i915_suspend.c @@ -789,25 +789,16 @@ int i915_save_state(struct drm_device *dev) dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2)); /* Fences */ - switch (INTEL_INFO(dev)->gen) { - case 6: - for (i = 0; i < 16; i++) - dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8)); - break; - case 5: - case 4: + if (IS_I965G(dev)) { for (i = 0; i < 16; i++) dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8)); - break; - case 3: - if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) - for (i = 0; i < 8; i++) - dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); - case 2: + } else { for (i = 0; i < 8; i++) dev_priv->saveFENCE[i] = I915_READ(FENCE_REG_830_0 + (i * 4)); - break; + if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) + for (i = 0; i < 8; i++) + dev_priv->saveFENCE[i+8] = I915_READ(FENCE_REG_945_8 + (i * 4)); } return 0; @@ -824,24 +815,15 @@ int i915_restore_state(struct drm_device *dev) I915_WRITE(HWS_PGA, dev_priv->saveHWS); /* Fences */ - switch (INTEL_INFO(dev)->gen) { - case 6: - for (i = 0; i < 16; i++) - I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]); - break; - case 5: - case 4: + if (IS_I965G(dev)) { for (i = 0; i < 16; i++) I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]); - break; - case 3: - case 2: + } else { + for (i = 0; i < 8; i++) + I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]); if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) for (i = 0; i < 8; i++) I915_WRITE(FENCE_REG_945_8 + (i * 4), dev_priv->saveFENCE[i+8]); - for (i = 0; i < 8; i++) - I915_WRITE(FENCE_REG_830_0 + (i * 4), dev_priv->saveFENCE[i]); - break; } i915_restore_display(dev); diff --git a/trunk/drivers/gpu/drm/i915/intel_crt.c b/trunk/drivers/gpu/drm/i915/intel_crt.c index 197d4f32585a..a02a8df73727 100644 --- a/trunk/drivers/gpu/drm/i915/intel_crt.c +++ b/trunk/drivers/gpu/drm/i915/intel_crt.c @@ -188,7 +188,7 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) if (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, 1000, 1)) - DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); + DRM_ERROR("timed out waiting for FORCE_TRIGGER"); if (turn_off_dac) { I915_WRITE(PCH_ADPA, temp); @@ -245,7 +245,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) if (wait_for((I915_READ(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT) == 0, 1000, 1)) - DRM_DEBUG_KMS("timed out waiting for FORCE_DETECT to go off"); + DRM_ERROR("timed out waiting for FORCE_DETECT to go off"); } stat = I915_READ(PORT_HOTPLUG_STAT); diff --git a/trunk/drivers/gpu/drm/i915/intel_display.c b/trunk/drivers/gpu/drm/i915/intel_display.c index b5bf51a4502d..19daead5b525 100644 --- a/trunk/drivers/gpu/drm/i915/intel_display.c +++ b/trunk/drivers/gpu/drm/i915/intel_display.c @@ -2463,19 +2463,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct drm_device *dev = crtc->dev; - if (HAS_PCH_SPLIT(dev)) { /* FDI link clock is fixed at 2.7G */ if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) return false; } - - /* XXX some encoders set the crtcinfo, others don't. - * Obviously we need some form of conflict resolution here... - */ - if (adjusted_mode->crtc_htotal == 0) - drm_mode_set_crtcinfo(adjusted_mode, 0); - return true; } diff --git a/trunk/drivers/i2c/busses/i2c-omap.c b/trunk/drivers/i2c/busses/i2c-omap.c index b33c78586bfc..7674efb55378 100644 --- a/trunk/drivers/i2c/busses/i2c-omap.c +++ b/trunk/drivers/i2c/busses/i2c-omap.c @@ -680,8 +680,6 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) if (r == 0) r = num; - - omap_i2c_wait_for_bb(dev); out: omap_i2c_idle(dev); return r; diff --git a/trunk/drivers/serial/amba-pl010.c b/trunk/drivers/serial/amba-pl010.c index 2904aa044126..50441ffe8e38 100644 --- a/trunk/drivers/serial/amba-pl010.c +++ b/trunk/drivers/serial/amba-pl010.c @@ -472,9 +472,14 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, spin_unlock_irqrestore(&uap->port.lock, flags); } -static void pl010_set_ldisc(struct uart_port *port, int new) +static void pl010_set_ldisc(struct uart_port *port) { - if (new == N_PPS) { + int line = port->line; + + if (line >= port->state->port.tty->driver->num) + return; + + if (port->state->port.tty->ldisc->ops->num == N_PPS) { port->flags |= UPF_HARDPPS_CD; pl010_enable_ms(port); } else diff --git a/trunk/drivers/serial/mfd.c b/trunk/drivers/serial/mfd.c index 324c385a653d..bc9af503907f 100644 --- a/trunk/drivers/serial/mfd.c +++ b/trunk/drivers/serial/mfd.c @@ -1423,6 +1423,7 @@ static void hsu_global_init(void) } phsu = hsu; + hsu_debugfs_init(hsu); return; @@ -1434,20 +1435,18 @@ static void hsu_global_init(void) static void serial_hsu_remove(struct pci_dev *pdev) { - void *priv = pci_get_drvdata(pdev); - struct uart_hsu_port *up; + struct hsu_port *hsu; + int i; - if (!priv) + hsu = pci_get_drvdata(pdev); + if (!hsu) return; - /* For port 0/1/2, priv is the address of uart_hsu_port */ - if (pdev->device != 0x081E) { - up = priv; - uart_remove_one_port(&serial_hsu_reg, &up->port); - } + for (i = 0; i < 3; i++) + uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port); pci_set_drvdata(pdev, NULL); - free_irq(pdev->irq, priv); + free_irq(hsu->irq, hsu); pci_disable_device(pdev); } diff --git a/trunk/drivers/staging/batman-adv/hard-interface.c b/trunk/drivers/staging/batman-adv/hard-interface.c index 6e973a79aa25..baa8b05b9e8d 100644 --- a/trunk/drivers/staging/batman-adv/hard-interface.c +++ b/trunk/drivers/staging/batman-adv/hard-interface.c @@ -30,6 +30,7 @@ #include "hash.h" #include +#include #define MIN(x, y) ((x) < (y) ? (x) : (y)) @@ -430,6 +431,11 @@ static int hard_if_event(struct notifier_block *this, return NOTIFY_DONE; } +static int batman_skb_recv_finish(struct sk_buff *skb) +{ + return NF_ACCEPT; +} + /* receive a packet with the batman ethertype coming on a hard * interface */ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, @@ -450,6 +456,13 @@ int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, if (atomic_read(&module_state) != MODULE_ACTIVE) goto err_free; + /* if netfilter/ebtables wants to block incoming batman + * packets then give them a chance to do so here */ + ret = NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, dev, NULL, + batman_skb_recv_finish); + if (ret != 1) + goto err_out; + /* packet should hold at least type and version */ if (unlikely(skb_headlen(skb) < 2)) goto err_free; diff --git a/trunk/drivers/staging/batman-adv/send.c b/trunk/drivers/staging/batman-adv/send.c index da3c82e47bbd..055edee7b4e4 100644 --- a/trunk/drivers/staging/batman-adv/send.c +++ b/trunk/drivers/staging/batman-adv/send.c @@ -29,6 +29,7 @@ #include "vis.h" #include "aggregation.h" +#include static void send_outstanding_bcast_packet(struct work_struct *work); @@ -91,9 +92,12 @@ int send_skb_packet(struct sk_buff *skb, /* dev_queue_xmit() returns a negative result on error. However on * congestion and traffic shaping, it drops and returns NET_XMIT_DROP - * (which is > 0). This will not be treated as an error. */ + * (which is > 0). This will not be treated as an error. + * Also, if netfilter/ebtables wants to block outgoing batman + * packets then giving them a chance to do so here */ - return dev_queue_xmit(skb); + return NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, + dev_queue_xmit); send_skb_err: kfree_skb(skb); return NET_XMIT_DROP; diff --git a/trunk/drivers/staging/vt6655/wpactl.c b/trunk/drivers/staging/vt6655/wpactl.c index 4bdb8362de82..0142338bcafe 100644 --- a/trunk/drivers/staging/vt6655/wpactl.c +++ b/trunk/drivers/staging/vt6655/wpactl.c @@ -766,14 +766,9 @@ static int wpa_set_associate(PSDevice pDevice, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len); - if (param->u.wpa_associate.wpa_ie_len) { - if (!param->u.wpa_associate.wpa_ie) - return -EINVAL; - if (param->u.wpa_associate.wpa_ie_len > sizeof(abyWPAIE)) - return -EINVAL; - if (copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) - return -EFAULT; - } + if (param->u.wpa_associate.wpa_ie && + copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) + return -EINVAL; if (param->u.wpa_associate.mode == 1) pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; diff --git a/trunk/drivers/usb/host/ehci-pci.c b/trunk/drivers/usb/host/ehci-pci.c index a1e8d273103f..58b72d741d93 100644 --- a/trunk/drivers/usb/host/ehci-pci.c +++ b/trunk/drivers/usb/host/ehci-pci.c @@ -119,11 +119,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd) ehci->broken_periodic = 1; ehci_info(ehci, "using broken periodic workaround\n"); } - if (pdev->device == 0x0806 || pdev->device == 0x0811 - || pdev->device == 0x0829) { - ehci_info(ehci, "disable lpm for langwell/penwell\n"); - ehci->has_lpm = 0; - } break; case PCI_VENDOR_ID_TDI: if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { diff --git a/trunk/drivers/usb/musb/musb_debugfs.c b/trunk/drivers/usb/musb/musb_debugfs.c index 9e8639d4e862..c79a5e30d437 100644 --- a/trunk/drivers/usb/musb/musb_debugfs.c +++ b/trunk/drivers/usb/musb/musb_debugfs.c @@ -195,14 +195,15 @@ static const struct file_operations musb_regdump_fops = { static int musb_test_mode_open(struct inode *inode, struct file *file) { + file->private_data = inode->i_private; + return single_open(file, musb_test_mode_show, inode->i_private); } static ssize_t musb_test_mode_write(struct file *file, const char __user *ubuf, size_t count, loff_t *ppos) { - struct seq_file *s = file->private_data; - struct musb *musb = s->private; + struct musb *musb = file->private_data; u8 test = 0; char buf[18]; diff --git a/trunk/drivers/usb/otg/twl4030-usb.c b/trunk/drivers/usb/otg/twl4030-usb.c index 0bc97698af15..05aaac1c3861 100644 --- a/trunk/drivers/usb/otg/twl4030-usb.c +++ b/trunk/drivers/usb/otg/twl4030-usb.c @@ -347,20 +347,11 @@ static void twl4030_i2c_access(struct twl4030_usb *twl, int on) } } -static void __twl4030_phy_power(struct twl4030_usb *twl, int on) -{ - u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); - - if (on) - pwr &= ~PHY_PWR_PHYPWD; - else - pwr |= PHY_PWR_PHYPWD; - - WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); -} - static void twl4030_phy_power(struct twl4030_usb *twl, int on) { + u8 pwr; + + pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); if (on) { regulator_enable(twl->usb3v1); regulator_enable(twl->usb1v8); @@ -374,13 +365,15 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on) twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); regulator_enable(twl->usb1v5); - __twl4030_phy_power(twl, 1); + pwr &= ~PHY_PWR_PHYPWD; + WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); twl4030_usb_write(twl, PHY_CLK_CTRL, twl4030_usb_read(twl, PHY_CLK_CTRL) | (PHY_CLK_CTRL_CLOCKGATING_EN | PHY_CLK_CTRL_CLK32K_EN)); - } else { - __twl4030_phy_power(twl, 0); + } else { + pwr |= PHY_PWR_PHYPWD; + WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); regulator_disable(twl->usb1v5); regulator_disable(twl->usb1v8); regulator_disable(twl->usb3v1); @@ -394,25 +387,19 @@ static void twl4030_phy_suspend(struct twl4030_usb *twl, int controller_off) twl4030_phy_power(twl, 0); twl->asleep = 1; - dev_dbg(twl->dev, "%s\n", __func__); } -static void __twl4030_phy_resume(struct twl4030_usb *twl) +static void twl4030_phy_resume(struct twl4030_usb *twl) { + if (!twl->asleep) + return; + twl4030_phy_power(twl, 1); twl4030_i2c_access(twl, 1); twl4030_usb_set_mode(twl, twl->usb_mode); if (twl->usb_mode == T2_USB_MODE_ULPI) twl4030_i2c_access(twl, 0); -} - -static void twl4030_phy_resume(struct twl4030_usb *twl) -{ - if (!twl->asleep) - return; - __twl4030_phy_resume(twl); twl->asleep = 0; - dev_dbg(twl->dev, "%s\n", __func__); } static int twl4030_usb_ldo_init(struct twl4030_usb *twl) @@ -421,8 +408,8 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl) twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY); twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY); - /* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/ - /*twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/ + /* put VUSB3V1 LDO in active state */ + twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); /* input to VUSB3V1 LDO is from VBAT, not VBUS */ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); @@ -515,26 +502,6 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) return IRQ_HANDLED; } -static void twl4030_usb_phy_init(struct twl4030_usb *twl) -{ - int status; - - status = twl4030_usb_linkstat(twl); - if (status >= 0) { - if (status == USB_EVENT_NONE) { - __twl4030_phy_power(twl, 0); - twl->asleep = 1; - } else { - __twl4030_phy_resume(twl); - twl->asleep = 0; - } - - blocking_notifier_call_chain(&twl->otg.notifier, status, - twl->otg.gadget); - } - sysfs_notify(&twl->dev->kobj, NULL, "vbus"); -} - static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) { struct twl4030_usb *twl = xceiv_to_twl(x); @@ -583,6 +550,7 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) struct twl4030_usb_data *pdata = pdev->dev.platform_data; struct twl4030_usb *twl; int status, err; + u8 pwr; if (!pdata) { dev_dbg(&pdev->dev, "platform_data not available\n"); @@ -601,7 +569,10 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) twl->otg.set_peripheral = twl4030_set_peripheral; twl->otg.set_suspend = twl4030_set_suspend; twl->usb_mode = pdata->usb_mode; - twl->asleep = 1; + + pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); + + twl->asleep = (pwr & PHY_PWR_PHYPWD); /* init spinlock for workqueue */ spin_lock_init(&twl->lock); @@ -639,10 +610,15 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) return status; } - /* Power down phy or make it work according to - * current link state. + /* The IRQ handler just handles changes from the previous states + * of the ID and VBUS pins ... in probe() we must initialize that + * previous state. The easy way: fake an IRQ. + * + * REVISIT: a real IRQ might have happened already, if PREEMPT is + * enabled. Else the IRQ may not yet be configured or enabled, + * because of scheduling delays. */ - twl4030_usb_phy_init(twl); + twl4030_usb_irq(twl->irq, twl); dev_info(&pdev->dev, "Initialized TWL4030 USB module\n"); return 0; diff --git a/trunk/drivers/usb/serial/mos7720.c b/trunk/drivers/usb/serial/mos7720.c index aa665817a272..30922a7e3347 100644 --- a/trunk/drivers/usb/serial/mos7720.c +++ b/trunk/drivers/usb/serial/mos7720.c @@ -2024,9 +2024,6 @@ static int mos7720_ioctl(struct tty_struct *tty, struct file *file, case TIOCGICOUNT: cnow = mos7720_port->icount; - - memset(&icount, 0, sizeof(struct serial_icounter_struct)); - icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; diff --git a/trunk/drivers/usb/serial/mos7840.c b/trunk/drivers/usb/serial/mos7840.c index 1a42bc213799..1c9b6e9b2386 100644 --- a/trunk/drivers/usb/serial/mos7840.c +++ b/trunk/drivers/usb/serial/mos7840.c @@ -2285,9 +2285,6 @@ static int mos7840_ioctl(struct tty_struct *tty, struct file *file, case TIOCGICOUNT: cnow = mos7840_port->icount; smp_rmb(); - - memset(&icount, 0, sizeof(struct serial_icounter_struct)); - icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; diff --git a/trunk/fs/ceph/Kconfig b/trunk/fs/ceph/Kconfig index 0fcd2640c23f..bc87b9c1d27e 100644 --- a/trunk/fs/ceph/Kconfig +++ b/trunk/fs/ceph/Kconfig @@ -3,7 +3,6 @@ config CEPH_FS depends on INET && EXPERIMENTAL select LIBCRC32C select CRYPTO_AES - select CRYPTO help Choose Y or M here to include support for mounting the experimental Ceph distributed file system. Ceph is an extremely diff --git a/trunk/fs/ceph/addr.c b/trunk/fs/ceph/addr.c index efbc604001c8..4cfce1ee31fa 100644 --- a/trunk/fs/ceph/addr.c +++ b/trunk/fs/ceph/addr.c @@ -411,8 +411,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) if (i_size < page_off + len) len = i_size - page_off; - dout("writepage %p page %p index %lu on %llu~%u snapc %p\n", - inode, page, page->index, page_off, len, snapc); + dout("writepage %p page %p index %lu on %llu~%u\n", + inode, page, page->index, page_off, len); writeback_stat = atomic_long_inc_return(&client->writeback_count); if (writeback_stat > @@ -766,8 +766,7 @@ static int ceph_writepages_start(struct address_space *mapping, /* ok */ if (locked_pages == 0) { /* prepare async write request */ - offset = (unsigned long long)page->index - << PAGE_CACHE_SHIFT; + offset = page->index << PAGE_CACHE_SHIFT; len = wsize; req = ceph_osdc_new_request(&client->osdc, &ci->i_layout, diff --git a/trunk/fs/ceph/caps.c b/trunk/fs/ceph/caps.c index 73c153092f72..a2069b6680ae 100644 --- a/trunk/fs/ceph/caps.c +++ b/trunk/fs/ceph/caps.c @@ -814,7 +814,7 @@ int __ceph_caps_used(struct ceph_inode_info *ci) used |= CEPH_CAP_PIN; if (ci->i_rd_ref) used |= CEPH_CAP_FILE_RD; - if (ci->i_rdcache_ref || ci->vfs_inode.i_data.nrpages) + if (ci->i_rdcache_ref || ci->i_rdcache_gen) used |= CEPH_CAP_FILE_CACHE; if (ci->i_wr_ref) used |= CEPH_CAP_FILE_WR; @@ -1195,14 +1195,10 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, * asynchronously back to the MDS once sync writes complete and dirty * data is written out. * - * Unless @again is true, skip cap_snaps that were already sent to - * the MDS (i.e., during this session). - * * Called under i_lock. Takes s_mutex as needed. */ void __ceph_flush_snaps(struct ceph_inode_info *ci, - struct ceph_mds_session **psession, - int again) + struct ceph_mds_session **psession) __releases(ci->vfs_inode->i_lock) __acquires(ci->vfs_inode->i_lock) { @@ -1231,7 +1227,7 @@ void __ceph_flush_snaps(struct ceph_inode_info *ci, * pages to be written out. */ if (capsnap->dirty_pages || capsnap->writing) - break; + continue; /* * if cap writeback already occurred, we should have dropped @@ -1244,13 +1240,6 @@ void __ceph_flush_snaps(struct ceph_inode_info *ci, dout("no auth cap (migrating?), doing nothing\n"); goto out; } - - /* only flush each capsnap once */ - if (!again && !list_empty(&capsnap->flushing_item)) { - dout("already flushed %p, skipping\n", capsnap); - continue; - } - mds = ci->i_auth_cap->session->s_mds; mseq = ci->i_auth_cap->mseq; @@ -1287,8 +1276,8 @@ void __ceph_flush_snaps(struct ceph_inode_info *ci, &session->s_cap_snaps_flushing); spin_unlock(&inode->i_lock); - dout("flush_snaps %p cap_snap %p follows %lld tid %llu\n", - inode, capsnap, capsnap->follows, capsnap->flush_tid); + dout("flush_snaps %p cap_snap %p follows %lld size %llu\n", + inode, capsnap, next_follows, capsnap->size); send_cap_msg(session, ceph_vino(inode).ino, 0, CEPH_CAP_OP_FLUSHSNAP, capsnap->issued, 0, capsnap->dirty, 0, capsnap->flush_tid, 0, mseq, @@ -1325,7 +1314,7 @@ static void ceph_flush_snaps(struct ceph_inode_info *ci) struct inode *inode = &ci->vfs_inode; spin_lock(&inode->i_lock); - __ceph_flush_snaps(ci, NULL, 0); + __ceph_flush_snaps(ci, NULL); spin_unlock(&inode->i_lock); } @@ -1488,7 +1477,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, /* flush snaps first time around only */ if (!list_empty(&ci->i_cap_snaps)) - __ceph_flush_snaps(ci, &session, 0); + __ceph_flush_snaps(ci, &session); goto retry_locked; retry: spin_lock(&inode->i_lock); @@ -1905,7 +1894,7 @@ static void kick_flushing_capsnaps(struct ceph_mds_client *mdsc, if (cap && cap->session == session) { dout("kick_flushing_caps %p cap %p capsnap %p\n", inode, cap, capsnap); - __ceph_flush_snaps(ci, &session, 1); + __ceph_flush_snaps(ci, &session); } else { pr_err("%p auth cap %p not mds%d ???\n", inode, cap, session->s_mds); diff --git a/trunk/fs/ceph/dir.c b/trunk/fs/ceph/dir.c index a1986eb52045..6e4f43ff23ec 100644 --- a/trunk/fs/ceph/dir.c +++ b/trunk/fs/ceph/dir.c @@ -1021,15 +1021,11 @@ static int ceph_d_revalidate(struct dentry *dentry, struct nameidata *nd) static void ceph_dentry_release(struct dentry *dentry) { struct ceph_dentry_info *di = ceph_dentry(dentry); - struct inode *parent_inode = NULL; - u64 snapid = CEPH_NOSNAP; + struct inode *parent_inode = dentry->d_parent->d_inode; + u64 snapid = ceph_snap(parent_inode); - if (!IS_ROOT(dentry)) { - parent_inode = dentry->d_parent->d_inode; - if (parent_inode) - snapid = ceph_snap(parent_inode); - } dout("dentry_release %p parent %p\n", dentry, parent_inode); + if (parent_inode && snapid != CEPH_SNAPDIR) { struct ceph_inode_info *ci = ceph_inode(parent_inode); diff --git a/trunk/fs/ceph/inode.c b/trunk/fs/ceph/inode.c index 62377ec37edf..e7cca414da03 100644 --- a/trunk/fs/ceph/inode.c +++ b/trunk/fs/ceph/inode.c @@ -845,7 +845,7 @@ static void ceph_set_dentry_offset(struct dentry *dn) * the caller) if we fail. */ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, - bool *prehash, bool set_offset) + bool *prehash) { struct dentry *realdn; @@ -877,8 +877,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, } if ((!prehash || *prehash) && d_unhashed(dn)) d_rehash(dn); - if (set_offset) - ceph_set_dentry_offset(dn); + ceph_set_dentry_offset(dn); out: return dn; } @@ -1063,7 +1062,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, d_delete(dn); goto done; } - dn = splice_dentry(dn, in, &have_lease, true); + dn = splice_dentry(dn, in, &have_lease); if (IS_ERR(dn)) { err = PTR_ERR(dn); goto done; @@ -1106,7 +1105,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, goto done; } dout(" linking snapped dir %p to dn %p\n", in, dn); - dn = splice_dentry(dn, in, NULL, true); + dn = splice_dentry(dn, in, NULL); if (IS_ERR(dn)) { err = PTR_ERR(dn); goto done; @@ -1238,7 +1237,7 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, err = PTR_ERR(in); goto out; } - dn = splice_dentry(dn, in, NULL, false); + dn = splice_dentry(dn, in, NULL); if (IS_ERR(dn)) dn = NULL; } diff --git a/trunk/fs/ceph/mds_client.c b/trunk/fs/ceph/mds_client.c index fad95f8f2608..f091b1351786 100644 --- a/trunk/fs/ceph/mds_client.c +++ b/trunk/fs/ceph/mds_client.c @@ -2374,8 +2374,6 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, num_fcntl_locks, num_flock_locks); unlock_kernel(); - } else { - err = ceph_pagelist_append(pagelist, &rec, reclen); } out_free: diff --git a/trunk/fs/ceph/pagelist.c b/trunk/fs/ceph/pagelist.c index 46a368b6dce5..b6859f47d364 100644 --- a/trunk/fs/ceph/pagelist.c +++ b/trunk/fs/ceph/pagelist.c @@ -5,18 +5,10 @@ #include "pagelist.h" -static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl) -{ - struct page *page = list_entry(pl->head.prev, struct page, - lru); - kunmap(page); -} - int ceph_pagelist_release(struct ceph_pagelist *pl) { if (pl->mapped_tail) - ceph_pagelist_unmap_tail(pl); - + kunmap(pl->mapped_tail); while (!list_empty(&pl->head)) { struct page *page = list_first_entry(&pl->head, struct page, lru); @@ -34,7 +26,7 @@ static int ceph_pagelist_addpage(struct ceph_pagelist *pl) pl->room += PAGE_SIZE; list_add_tail(&page->lru, &pl->head); if (pl->mapped_tail) - ceph_pagelist_unmap_tail(pl); + kunmap(pl->mapped_tail); pl->mapped_tail = kmap(page); return 0; } diff --git a/trunk/fs/ceph/snap.c b/trunk/fs/ceph/snap.c index 190b6c4a6f2b..4868b9dcac5a 100644 --- a/trunk/fs/ceph/snap.c +++ b/trunk/fs/ceph/snap.c @@ -119,7 +119,6 @@ static struct ceph_snap_realm *ceph_create_snap_realm( INIT_LIST_HEAD(&realm->children); INIT_LIST_HEAD(&realm->child_item); INIT_LIST_HEAD(&realm->empty_item); - INIT_LIST_HEAD(&realm->dirty_item); INIT_LIST_HEAD(&realm->inodes_with_caps); spin_lock_init(&realm->inodes_with_caps_lock); __insert_snap_realm(&mdsc->snap_realms, realm); @@ -468,7 +467,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) INIT_LIST_HEAD(&capsnap->ci_item); INIT_LIST_HEAD(&capsnap->flushing_item); - capsnap->follows = snapc->seq; + capsnap->follows = snapc->seq - 1; capsnap->issued = __ceph_caps_issued(ci, NULL); capsnap->dirty = dirty; @@ -605,7 +604,6 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, struct ceph_snap_realm *realm; int invalidate = 0; int err = -ENOMEM; - LIST_HEAD(dirty_realms); dout("update_snap_trace deletion=%d\n", deletion); more: @@ -628,6 +626,24 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, } } + if (le64_to_cpu(ri->seq) > realm->seq) { + dout("update_snap_trace updating %llx %p %lld -> %lld\n", + realm->ino, realm, realm->seq, le64_to_cpu(ri->seq)); + /* + * if the realm seq has changed, queue a cap_snap for every + * inode with open caps. we do this _before_ we update + * the realm info so that we prepare for writeback under the + * _previous_ snap context. + * + * ...unless it's a snap deletion! + */ + if (!deletion) + queue_realm_cap_snaps(realm); + } else { + dout("update_snap_trace %llx %p seq %lld unchanged\n", + realm->ino, realm, realm->seq); + } + /* ensure the parent is correct */ err = adjust_snap_realm_parent(mdsc, realm, le64_to_cpu(ri->parent)); if (err < 0) @@ -635,8 +651,6 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, invalidate += err; if (le64_to_cpu(ri->seq) > realm->seq) { - dout("update_snap_trace updating %llx %p %lld -> %lld\n", - realm->ino, realm, realm->seq, le64_to_cpu(ri->seq)); /* update realm parameters, snap lists */ realm->seq = le64_to_cpu(ri->seq); realm->created = le64_to_cpu(ri->created); @@ -654,17 +668,9 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, if (err < 0) goto fail; - /* queue realm for cap_snap creation */ - list_add(&realm->dirty_item, &dirty_realms); - invalidate = 1; } else if (!realm->cached_context) { - dout("update_snap_trace %llx %p seq %lld new\n", - realm->ino, realm, realm->seq); invalidate = 1; - } else { - dout("update_snap_trace %llx %p seq %lld unchanged\n", - realm->ino, realm, realm->seq); } dout("done with %llx %p, invalidated=%d, %p %p\n", realm->ino, @@ -677,14 +683,6 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, if (invalidate) rebuild_snap_realms(realm); - /* - * queue cap snaps _after_ we've built the new snap contexts, - * so that i_head_snapc can be set appropriately. - */ - list_for_each_entry(realm, &dirty_realms, dirty_item) { - queue_realm_cap_snaps(realm); - } - __cleanup_empty_realms(mdsc); return 0; @@ -717,7 +715,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc) igrab(inode); spin_unlock(&mdsc->snap_flush_lock); spin_lock(&inode->i_lock); - __ceph_flush_snaps(ci, &session, 0); + __ceph_flush_snaps(ci, &session); spin_unlock(&inode->i_lock); iput(inode); spin_lock(&mdsc->snap_flush_lock); @@ -818,7 +816,6 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, }; struct inode *inode = ceph_find_inode(sb, vino); struct ceph_inode_info *ci; - struct ceph_snap_realm *oldrealm; if (!inode) continue; @@ -844,19 +841,18 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, dout(" will move %p to split realm %llx %p\n", inode, realm->ino, realm); /* - * Move the inode to the new realm + * Remove the inode from the realm's inode + * list, but don't add it to the new realm + * yet. We don't want the cap_snap to be + * queued (again) by ceph_update_snap_trace() + * below. Queue it _now_, under the old context. */ spin_lock(&realm->inodes_with_caps_lock); list_del_init(&ci->i_snap_realm_item); - list_add(&ci->i_snap_realm_item, - &realm->inodes_with_caps); - oldrealm = ci->i_snap_realm; - ci->i_snap_realm = realm; spin_unlock(&realm->inodes_with_caps_lock); spin_unlock(&inode->i_lock); - ceph_get_snap_realm(mdsc, realm); - ceph_put_snap_realm(mdsc, oldrealm); + ceph_queue_cap_snap(ci); iput(inode); continue; @@ -884,9 +880,43 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, ceph_update_snap_trace(mdsc, p, e, op == CEPH_SNAP_OP_DESTROY); - if (op == CEPH_SNAP_OP_SPLIT) + if (op == CEPH_SNAP_OP_SPLIT) { + /* + * ok, _now_ add the inodes into the new realm. + */ + for (i = 0; i < num_split_inos; i++) { + struct ceph_vino vino = { + .ino = le64_to_cpu(split_inos[i]), + .snap = CEPH_NOSNAP, + }; + struct inode *inode = ceph_find_inode(sb, vino); + struct ceph_inode_info *ci; + + if (!inode) + continue; + ci = ceph_inode(inode); + spin_lock(&inode->i_lock); + if (list_empty(&ci->i_snap_realm_item)) { + struct ceph_snap_realm *oldrealm = + ci->i_snap_realm; + + dout(" moving %p to split realm %llx %p\n", + inode, realm->ino, realm); + spin_lock(&realm->inodes_with_caps_lock); + list_add(&ci->i_snap_realm_item, + &realm->inodes_with_caps); + ci->i_snap_realm = realm; + spin_unlock(&realm->inodes_with_caps_lock); + ceph_get_snap_realm(mdsc, realm); + ceph_put_snap_realm(mdsc, oldrealm); + } + spin_unlock(&inode->i_lock); + iput(inode); + } + /* we took a reference when we created the realm, above */ ceph_put_snap_realm(mdsc, realm); + } __cleanup_empty_realms(mdsc); diff --git a/trunk/fs/ceph/super.h b/trunk/fs/ceph/super.h index b87638e84c4b..c33897ae5725 100644 --- a/trunk/fs/ceph/super.h +++ b/trunk/fs/ceph/super.h @@ -690,8 +690,6 @@ struct ceph_snap_realm { struct list_head empty_item; /* if i have ref==0 */ - struct list_head dirty_item; /* if realm needs new context */ - /* the current set of snaps for this realm */ struct ceph_snap_context *cached_context; @@ -828,8 +826,7 @@ extern void ceph_put_cap_refs(struct ceph_inode_info *ci, int had); extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, struct ceph_snap_context *snapc); extern void __ceph_flush_snaps(struct ceph_inode_info *ci, - struct ceph_mds_session **psession, - int again); + struct ceph_mds_session **psession); extern void ceph_check_caps(struct ceph_inode_info *ci, int flags, struct ceph_mds_session *session); extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc); diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 63d069bd80b7..76041b614758 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -1093,10 +1093,6 @@ struct file_lock { #include -/* temporary stubs for BKL removal */ -#define lock_flocks() lock_kernel() -#define unlock_flocks() unlock_kernel() - extern void send_sigio(struct fown_struct *fown, int fd, int band); #ifdef CONFIG_FILE_LOCKING diff --git a/trunk/kernel/hw_breakpoint.c b/trunk/kernel/hw_breakpoint.c index c7c2aed9e2dc..d71a987fd2bf 100644 --- a/trunk/kernel/hw_breakpoint.c +++ b/trunk/kernel/hw_breakpoint.c @@ -433,8 +433,7 @@ register_user_hw_breakpoint(struct perf_event_attr *attr, perf_overflow_handler_t triggered, struct task_struct *tsk) { - return perf_event_create_kernel_counter(attr, -1, task_pid_vnr(tsk), - triggered); + return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered); } EXPORT_SYMBOL_GPL(register_user_hw_breakpoint); diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index dc85ceb90832..ed09d4f2a69c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -3513,9 +3513,9 @@ void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st) rtime = nsecs_to_cputime(p->se.sum_exec_runtime); if (total) { - u64 temp = rtime; + u64 temp; - temp *= utime; + temp = (u64)(rtime * utime); do_div(temp, total); utime = (cputime_t)temp; } else @@ -3546,9 +3546,9 @@ void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st) rtime = nsecs_to_cputime(cputime.sum_exec_runtime); if (total) { - u64 temp = rtime; + u64 temp; - temp *= cputime.utime; + temp = (u64)(rtime * cputime.utime); do_div(temp, total); utime = (cputime_t)temp; } else diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index db3f674ca49d..a171138a9402 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -3630,7 +3630,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu) if (time_before(now, nohz.next_balance)) return 0; - if (rq->idle_at_tick) + if (!rq->nr_running) return 0; first_pick_cpu = atomic_read(&nohz.first_pick_cpu); diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 0e18b4d649ec..71b161b73bb5 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -2680,12 +2680,10 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, delayacct_clear_flag(DELAYACCT_PF_SWAPIN); /* - * Make sure try_to_free_swap or reuse_swap_page or swapoff did not - * release the swapcache from under us. The page pin, and pte_same - * test below, are not enough to exclude that. Even if it is still - * swapcache, we need to check that the page's swap has not changed. + * Make sure try_to_free_swap didn't release the swapcache + * from under us. The page pin isn't enough to prevent that. */ - if (unlikely(!PageSwapCache(page) || page_private(page) != entry.val)) + if (unlikely(!PageSwapCache(page))) goto out_page; if (ksm_might_need_to_copy(page, vma, address)) {