diff options
99 files changed, 627 insertions, 309 deletions
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt index 4269a1105b3..1a45f11e645 100644 --- a/Documentation/local_ops.txt +++ b/Documentation/local_ops.txt @@ -68,6 +68,29 @@ typedef struct { atomic_long_t a; } local_t; variable can be read when reading some _other_ cpu's variables. +* Rules to follow when using local atomic operations + +- Variables touched by local ops must be per cpu variables. +- _Only_ the CPU owner of these variables must write to them. +- This CPU can use local ops from any context (process, irq, softirq, nmi, ...) + to update its local_t variables. +- Preemption (or interrupts) must be disabled when using local ops in + process context to make sure the process won't be migrated to a + different CPU between getting the per-cpu variable and doing the + actual local op. +- When using local ops in interrupt context, no special care must be + taken on a mainline kernel, since they will run on the local CPU with + preemption already disabled. I suggest, however, to explicitly + disable preemption anyway to make sure it will still work correctly on + -rt kernels. +- Reading the local cpu variable will provide the current copy of the + variable. +- Reads of these variables can be done from any CPU, because updates to + "long", aligned, variables are always atomic. Since no memory + synchronization is done by the writer CPU, an outdated copy of the + variable can be read when reading some _other_ cpu's variables. + + * How to use local atomic operations #include <linux/percpu.h> diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index a3026689bbe..37f0e3cedf4 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx @@ -8,4 +8,7 @@ 7 -> Leadtek Winfast USB II (em2800) 8 -> Kworld USB2800 (em2800) 9 -> Pinnacle Dazzle DVC 90 (em2820/em2840) [2304:0207] + 10 -> Hauppauge WinTV HVR 900 (em2880) + 11 -> Terratec Hybrid XS (em2880) 12 -> Kworld PVR TV 2800 RF (em2820/em2840) + 13 -> Terratec Prodigy XS (em2880) diff --git a/MAINTAINERS b/MAINTAINERS index 6c0e44bbf60..1c7c229a092 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2549,7 +2549,7 @@ S: Supported MISCELLANEOUS MCA-SUPPORT P: James Bottomley -M: jejb@steeleye.com +M: James.Bottomley@HansenPartnership.com L: linux-kernel@vger.kernel.org S: Maintained @@ -3301,9 +3301,11 @@ S: Maintained SCSI SUBSYSTEM P: James E.J. Bottomley -M: James.Bottomley@SteelEye.com +M: James.Bottomley@HansenPartnership.com L: linux-scsi@vger.kernel.org T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git +T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git +T: git kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-pending-2.6.git S: Maintained SCSI TAPE DRIVER @@ -528,9 +528,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments -KBUILD_CPPFLAGS += $(CPPFLAGS) -KBUILD_AFLAGS += $(AFLAGS) -KBUILD_CFLAGS += $(CFLAGS) +# But warn user when we do so +warn-assign = \ +$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)") + +ifneq ($(KCPPFLAGS),) + $(call warn-assign,CPPFLAGS) + KBUILD_CPPFLAGS += $(KCPPFLAGS) +endif +ifneq ($(KAFLAGS),) + $(call warn-assign,AFLAGS) + KBUILD_AFLAGS += $(KAFLAGS) +endif +ifneq ($(KCFLAGS),) + $(call warn-assign,CFLAGS) + KBUILD_CFLAGS += $(KCFLAGS) +endif # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index e6289ee74ec..8bf4ae1150b 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -200,11 +200,13 @@ static noinline __init void find_memory_chunks(unsigned long memsize) cc = __tprot(addr); while (cc == old_cc) { addr += CHUNK_INCR; - cc = __tprot(addr); + if (addr >= memsize) + break; #ifndef CONFIG_64BIT if (addr == ADDR2G) break; #endif + cc = __tprot(addr); } if (old_addr != addr && diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 96492cf2d49..29f7884b4ff 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -92,6 +92,7 @@ EXPORT_SYMBOL(unregister_idle_notifier); void do_monitor_call(struct pt_regs *regs, long interruption_code) { +#ifdef CONFIG_SMP struct s390_idle_data *idle; idle = &__get_cpu_var(s390_idle); @@ -99,7 +100,7 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code) idle->idle_time += get_clock() - idle->idle_enter; idle->in_idle = 0; spin_unlock(&idle->lock); - +#endif /* disable monitor call class 0 */ __ctl_clear_bit(8, 15); @@ -114,7 +115,9 @@ extern void s390_handle_mcck(void); static void default_idle(void) { int cpu, rc; +#ifdef CONFIG_SMP struct s390_idle_data *idle; +#endif /* CPU is going idle. */ cpu = smp_processor_id(); @@ -151,13 +154,14 @@ static void default_idle(void) s390_handle_mcck(); return; } - +#ifdef CONFIG_SMP idle = &__get_cpu_var(s390_idle); spin_lock(&idle->lock); idle->idle_count++; idle->in_idle = 1; idle->idle_enter = get_clock(); spin_unlock(&idle->lock); +#endif trace_hardirqs_on(); /* Wait for external, I/O or machine check interrupt. */ __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 1d97fe1c0e5..b05ae858425 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -788,14 +788,14 @@ static ssize_t show_idle_time(struct sys_device *dev, char *buf) } new_time = idle->idle_time; spin_unlock_irq(&idle->lock); - return sprintf(buf, "%llu us\n", new_time >> 12); + return sprintf(buf, "%llu\n", new_time >> 12); } -static SYSDEV_ATTR(idle_time, 0444, show_idle_time, NULL); +static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); static struct attribute *cpu_attrs[] = { &attr_capability.attr, &attr_idle_count.attr, - &attr_idle_time.attr, + &attr_idle_time_us.attr, NULL, }; diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 48dae49bc1e..a963fe81359 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -307,7 +307,7 @@ static cycle_t read_tod_clock(void) static struct clocksource clocksource_tod = { .name = "tod", - .rating = 100, + .rating = 400, .read = read_tod_clock, .mask = -1ULL, .mult = 1000, diff --git a/arch/um/Makefile b/arch/um/Makefile index 82c2ac48040..768a5d14b75 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -70,9 +70,12 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) # in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different # errnos. # These apply to kernelspace only. +# +# strip leading and trailing whitespace to make the USER_CFLAGS removal of these +# defines more robust -KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ - -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) +KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ + -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) KBUILD_CFLAGS += $(KERNEL_DEFINES) KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index e184b44b101..7e6cdde62ea 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -705,7 +705,7 @@ static int ubd_add(int n, char **error_out) ubd_dev->size = ROUND_BLOCK(ubd_dev->size); INIT_LIST_HEAD(&ubd_dev->restart); - sg_init_table(&ubd_dev->sg, MAX_SG); + sg_init_table(ubd_dev->sg, MAX_SG); err = -ENOMEM; ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S index 2e559233725..fa6bed1fac1 100644 --- a/arch/x86/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S @@ -28,17 +28,19 @@ * void protected_mode_jump(u32 entrypoint, u32 bootparams); */ protected_mode_jump: - xorl %ebx, %ebx # Flag to indicate this is a boot movl %edx, %esi # Pointer to boot_params table movl %eax, 2f # Patch ljmpl instruction - jmp 1f # Short jump to flush instruction q. -1: movw $__BOOT_DS, %cx + xorl %ebx, %ebx # Per the 3 |