From 07c413696f4e2abde242a0858fd88f6e9d86445b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 15 Aug 2008 09:26:37 -0700 Subject: [PATCH] --- yaml --- r: 108508 b: refs/heads/master c: ffaa5b984a9322bbd5d9a7f0814ca2ce70feebe5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/hwmon/ibmaem | 33 +- trunk/Documentation/vm/page_migration | 9 +- trunk/MAINTAINERS | 18 +- .../alpha/include/asm}/8253pit.h | 0 .../alpha/include/asm}/Kbuild | 0 .../alpha/include/asm}/a.out-core.h | 0 .../alpha/include/asm}/a.out.h | 0 .../alpha/include/asm}/agp.h | 0 .../alpha/include/asm}/agp_backend.h | 0 .../alpha/include/asm}/atomic.h | 0 .../alpha/include/asm}/auxvec.h | 0 .../alpha/include/asm}/barrier.h | 0 .../alpha/include/asm}/bitops.h | 0 .../alpha/include/asm}/bug.h | 0 .../alpha/include/asm}/bugs.h | 0 .../alpha/include/asm}/byteorder.h | 0 .../alpha/include/asm}/cache.h | 0 .../alpha/include/asm}/cacheflush.h | 0 .../alpha/include/asm}/checksum.h | 0 .../alpha/include/asm}/compiler.h | 0 .../alpha/include/asm}/console.h | 0 .../alpha/include/asm}/core_apecs.h | 0 .../alpha/include/asm}/core_cia.h | 0 .../alpha/include/asm}/core_irongate.h | 0 .../alpha/include/asm}/core_lca.h | 0 .../alpha/include/asm}/core_marvel.h | 0 .../alpha/include/asm}/core_mcpcia.h | 0 .../alpha/include/asm}/core_polaris.h | 0 .../alpha/include/asm}/core_t2.h | 0 .../alpha/include/asm}/core_titan.h | 0 .../alpha/include/asm}/core_tsunami.h | 0 .../alpha/include/asm}/core_wildfire.h | 0 .../alpha/include/asm}/cputime.h | 0 .../alpha/include/asm}/current.h | 0 .../alpha/include/asm}/delay.h | 0 .../alpha/include/asm}/device.h | 0 .../alpha/include/asm}/div64.h | 0 .../alpha/include/asm}/dma-mapping.h | 0 .../alpha/include/asm}/dma.h | 0 .../alpha/include/asm}/elf.h | 0 .../alpha/include/asm}/emergency-restart.h | 0 .../alpha/include/asm}/err_common.h | 0 .../alpha/include/asm}/err_ev6.h | 0 .../alpha/include/asm}/err_ev7.h | 0 .../alpha/include/asm}/errno.h | 0 .../asm-alpha => arch/alpha/include/asm}/fb.h | 0 .../alpha/include/asm}/fcntl.h | 0 .../alpha/include/asm}/floppy.h | 0 .../alpha/include/asm}/fpu.h | 0 .../alpha/include/asm}/futex.h | 0 .../alpha/include/asm}/gct.h | 0 .../alpha/include/asm}/gentrap.h | 0 .../alpha/include/asm}/hardirq.h | 0 .../alpha/include/asm}/hw_irq.h | 0 .../alpha/include/asm}/hwrpb.h | 0 .../asm-alpha => arch/alpha/include/asm}/io.h | 0 .../alpha/include/asm}/io_trivial.h | 0 .../alpha/include/asm}/ioctl.h | 0 .../alpha/include/asm}/ioctls.h | 0 .../alpha/include/asm}/ipcbuf.h | 0 .../alpha/include/asm}/irq.h | 0 .../alpha/include/asm}/irq_regs.h | 0 .../alpha/include/asm}/jensen.h | 0 .../alpha/include/asm}/kdebug.h | 0 .../alpha/include/asm}/kmap_types.h | 0 .../alpha/include/asm}/linkage.h | 0 .../alpha/include/asm}/local.h | 0 .../alpha/include/asm}/machvec.h | 0 .../alpha/include/asm}/mc146818rtc.h | 0 .../asm-alpha => arch/alpha/include/asm}/md.h | 0 .../alpha/include/asm}/mman.h | 0 .../alpha/include/asm}/mmu.h | 0 .../alpha/include/asm}/mmu_context.h | 0 .../alpha/include/asm}/mmzone.h | 0 .../alpha/include/asm}/module.h | 0 .../alpha/include/asm}/msgbuf.h | 0 .../alpha/include/asm}/mutex.h | 0 .../alpha/include/asm}/page.h | 0 .../alpha/include/asm}/pal.h | 0 .../alpha/include/asm}/param.h | 0 .../alpha/include/asm}/parport.h | 0 .../alpha/include/asm}/pci.h | 0 .../alpha/include/asm}/percpu.h | 0 .../alpha/include/asm}/pgalloc.h | 0 .../alpha/include/asm}/pgtable.h | 0 .../alpha/include/asm}/poll.h | 0 .../alpha/include/asm}/posix_types.h | 0 .../alpha/include/asm}/processor.h | 0 .../alpha/include/asm}/ptrace.h | 0 .../alpha/include/asm}/reg.h | 0 .../alpha/include/asm}/regdef.h | 0 .../alpha/include/asm}/resource.h | 0 .../alpha/include/asm}/rtc.h | 0 .../alpha/include/asm}/rwsem.h | 0 .../alpha/include/asm}/scatterlist.h | 0 .../alpha/include/asm}/sections.h | 0 .../alpha/include/asm}/segment.h | 0 .../alpha/include/asm}/sembuf.h | 0 .../alpha/include/asm}/serial.h | 0 .../alpha/include/asm}/setup.h | 0 .../alpha/include/asm}/sfp-machine.h | 0 .../alpha/include/asm}/shmbuf.h | 0 .../alpha/include/asm}/shmparam.h | 0 .../alpha/include/asm}/sigcontext.h | 0 .../alpha/include/asm}/siginfo.h | 0 .../alpha/include/asm}/signal.h | 0 .../alpha/include/asm}/smp.h | 0 .../alpha/include/asm}/socket.h | 0 .../alpha/include/asm}/sockios.h | 0 .../alpha/include/asm}/spinlock.h | 0 .../alpha/include/asm}/spinlock_types.h | 0 .../alpha/include/asm}/stat.h | 0 .../alpha/include/asm}/statfs.h | 0 .../alpha/include/asm}/string.h | 0 .../alpha/include/asm}/suspend.h | 0 .../alpha/include/asm}/sysinfo.h | 0 .../alpha/include/asm}/system.h | 0 .../alpha/include/asm}/termbits.h | 0 .../alpha/include/asm}/termios.h | 0 .../alpha/include/asm}/thread_info.h | 0 .../alpha/include/asm}/timex.h | 0 .../alpha/include/asm}/tlb.h | 0 .../alpha/include/asm}/tlbflush.h | 0 .../alpha/include/asm}/topology.h | 0 .../alpha/include/asm}/types.h | 0 .../alpha/include/asm}/uaccess.h | 0 .../alpha/include/asm}/ucontext.h | 0 .../alpha/include/asm}/unaligned.h | 0 .../alpha/include/asm}/unistd.h | 0 .../alpha/include/asm}/user.h | 0 .../alpha/include/asm}/vga.h | 0 .../alpha/include/asm}/xor.h | 0 trunk/arch/arm/include/asm/kexec.h | 2 +- trunk/arch/arm/kernel/machine_kexec.c | 2 +- trunk/arch/ia64/include/asm/kexec.h | 2 +- trunk/arch/powerpc/include/asm/kexec.h | 2 +- trunk/arch/powerpc/kernel/machine_kexec_32.c | 2 +- trunk/arch/s390/include/asm/kexec.h | 2 +- trunk/arch/sh/include/asm/kexec.h | 2 +- trunk/arch/x86/kernel/machine_kexec_32.c | 20 +- trunk/arch/x86/kernel/relocate_kernel_32.S | 10 +- trunk/arch/x86/kernel/vmlinux_32.lds.S | 8 + trunk/drivers/hwmon/Kconfig | 16 + trunk/drivers/hwmon/Makefile | 1 + trunk/drivers/hwmon/abituguru3.c | 134 ++++--- trunk/drivers/hwmon/adcxx.c | 329 ++++++++++++++++++ trunk/drivers/hwmon/applesmc.c | 20 +- trunk/drivers/hwmon/coretemp.c | 5 +- trunk/drivers/hwmon/i5k_amb.c | 28 +- trunk/drivers/hwmon/ibmaem.c | 27 +- trunk/drivers/hwmon/w83791d.c | 3 +- trunk/drivers/spi/spi.c | 40 ++- trunk/drivers/video/fsl-diu-fb.c | 32 +- trunk/fs/inode.c | 1 + trunk/fs/omfs/bitmap.c | 5 +- trunk/fs/omfs/file.c | 33 +- trunk/fs/omfs/inode.c | 3 +- trunk/include/asm-mips/kexec.h | 2 +- trunk/include/asm-x86/kexec.h | 8 +- trunk/include/linux/completion.h | 46 +-- trunk/include/linux/ftrace.h | 21 ++ trunk/include/linux/kexec.h | 4 +- trunk/include/linux/reboot.h | 1 + trunk/include/linux/suspend.h | 4 +- trunk/kernel/kexec.c | 66 ++-- trunk/kernel/sched.c | 46 +++ trunk/kernel/sys.c | 2 +- trunk/mm/bootmem.c | 2 +- 169 files changed, 782 insertions(+), 211 deletions(-) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/8253pit.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/Kbuild (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/a.out-core.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/a.out.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/agp.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/agp_backend.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/atomic.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/auxvec.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/barrier.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/bitops.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/bug.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/bugs.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/byteorder.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/cache.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/cacheflush.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/checksum.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/compiler.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/console.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_apecs.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_cia.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_irongate.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_lca.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_marvel.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_mcpcia.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_polaris.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_t2.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_titan.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_tsunami.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/core_wildfire.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/cputime.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/current.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/delay.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/device.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/div64.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/dma-mapping.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/dma.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/elf.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/emergency-restart.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/err_common.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/err_ev6.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/err_ev7.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/errno.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/fb.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/fcntl.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/floppy.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/fpu.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/futex.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/gct.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/gentrap.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/hardirq.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/hw_irq.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/hwrpb.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/io.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/io_trivial.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/ioctl.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/ioctls.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/ipcbuf.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/irq.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/irq_regs.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/jensen.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/kdebug.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/kmap_types.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/linkage.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/local.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/machvec.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mc146818rtc.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/md.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mman.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mmu.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mmu_context.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mmzone.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/module.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/msgbuf.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/mutex.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/page.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/pal.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/param.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/parport.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/pci.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/percpu.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/pgalloc.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/pgtable.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/poll.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/posix_types.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/processor.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/ptrace.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/reg.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/regdef.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/resource.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/rtc.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/rwsem.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/scatterlist.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sections.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/segment.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sembuf.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/serial.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/setup.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sfp-machine.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/shmbuf.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/shmparam.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sigcontext.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/siginfo.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/signal.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/smp.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/socket.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sockios.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/spinlock.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/spinlock_types.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/stat.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/statfs.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/string.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/suspend.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/sysinfo.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/system.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/termbits.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/termios.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/thread_info.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/timex.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/tlb.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/tlbflush.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/topology.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/types.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/uaccess.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/ucontext.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/unaligned.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/unistd.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/user.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/vga.h (100%) rename trunk/{include/asm-alpha => arch/alpha/include/asm}/xor.h (100%) create mode 100644 trunk/drivers/hwmon/adcxx.c diff --git a/[refs] b/[refs] index 09f6e0f66af8..d4fde249ec60 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0f2456236459f3ddef48a8a75d10b2d6ecf1a93d +refs/heads/master: ffaa5b984a9322bbd5d9a7f0814ca2ce70feebe5 diff --git a/trunk/Documentation/hwmon/ibmaem b/trunk/Documentation/hwmon/ibmaem index 2fefaf582a43..e98bdfea3467 100644 --- a/trunk/Documentation/hwmon/ibmaem +++ b/trunk/Documentation/hwmon/ibmaem @@ -1,8 +1,11 @@ Kernel driver ibmaem ====================== +This driver talks to the IBM Systems Director Active Energy Manager, known +henceforth as AEM. + Supported systems: - * Any recent IBM System X server with Active Energy Manager support. + * Any recent IBM System X server with AEM support. This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface driver ("ipmi-si") needs to be loaded for this driver to do anything. @@ -14,24 +17,22 @@ Author: Darrick J. Wong Description ----------- -This driver implements sensor reading support for the energy and power -meters available on various IBM System X hardware through the BMC. All -sensor banks will be exported as platform devices; this driver can talk -to both v1 and v2 interfaces. This driver is completely separate from the -older ibmpex driver. +This driver implements sensor reading support for the energy and power meters +available on various IBM System X hardware through the BMC. All sensor banks +will be exported as platform devices; this driver can talk to both v1 and v2 +interfaces. This driver is completely separate from the older ibmpex driver. -The v1 AEM interface has a simple set of features to monitor energy use. -There is a register that displays an estimate of raw energy consumption -since the last BMC reset, and a power sensor that returns average power -use over a configurable interval. +The v1 AEM interface has a simple set of features to monitor energy use. There +is a register that displays an estimate of raw energy consumption since the +last BMC reset, and a power sensor that returns average power use over a +configurable interval. -The v2 AEM interface is a bit more sophisticated, being able to present -a wider range of energy and power use registers, the power cap as -set by the AEM software, and temperature sensors. +The v2 AEM interface is a bit more sophisticated, being able to present a wider +range of energy and power use registers, the power cap as set by the AEM +software, and temperature sensors. Special Features ---------------- -The "power_cap" value displays the current system power cap, as set by -the Active Energy Manager software. Setting the power cap from the host -is not currently supported. +The "power_cap" value displays the current system power cap, as set by the AEM +software. Setting the power cap from the host is not currently supported. diff --git a/trunk/Documentation/vm/page_migration b/trunk/Documentation/vm/page_migration index 99f89aa10169..d5fdfd34bbaf 100644 --- a/trunk/Documentation/vm/page_migration +++ b/trunk/Documentation/vm/page_migration @@ -18,10 +18,11 @@ migrate_pages function call takes two sets of nodes and moves pages of a process that are located on the from nodes to the destination nodes. Page migration functions are provided by the numactl package by Andi Kleen (a version later than 0.9.3 is required. Get it from -ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which -provides an interface similar to other numa functionality for page migration. -cat /proc//numa_maps allows an easy review of where the pages of -a process are located. See also the numa_maps manpage in the numactl package. +ftp://oss.sgi.com/www/projects/libnuma/download/). numactl provides libnuma +which provides an interface similar to other numa functionality for page +migration. cat /proc//numa_maps allows an easy review of where the +pages of a process are located. See also the numa_maps documentation in the +proc(5) man page. Manual migration is useful if for example the scheduler has relocated a process to a processor on a distant node. A batch scheduler or an diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 4c5e9fe0f7db..663485b004fb 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -175,12 +175,18 @@ M: bcrl@kvack.org L: linux-aio@kvack.org S: Supported -ABIT UGURU HARDWARE MONITOR DRIVER +ABIT UGURU 1,2 HARDWARE MONITOR DRIVER P: Hans de Goede M: j.w.r.degoede@hhs.nl L: lm-sensors@lm-sensors.org S: Maintained +ABIT UGURU 3 HARDWARE MONITOR DRIVER +P: Alistair John Strachan +M: alistair@devzero.co.uk +L: lm-sensors@lm-sensors.org +S: Maintained + ACENIC DRIVER P: Jes Sorensen M: jes@trained-monkey.org @@ -3748,6 +3754,16 @@ L: linux-visws-devel@lists.sf.net W: http://linux-visws.sf.net S: Maintained for 2.6. +SGI GRU DRIVER +P: Jack Steiner +M: steiner@sgi.com +S: Maintained + +SGI XP/XPC/XPNET DRIVER +P: Dean Nelson +M: dcn@sgi.com +S: Maintained + SIMTEC EB110ATX (Chalice CATS) P: Ben Dooks P: Vincent Sanders diff --git a/trunk/include/asm-alpha/8253pit.h b/trunk/arch/alpha/include/asm/8253pit.h similarity index 100% rename from trunk/include/asm-alpha/8253pit.h rename to trunk/arch/alpha/include/asm/8253pit.h diff --git a/trunk/include/asm-alpha/Kbuild b/trunk/arch/alpha/include/asm/Kbuild similarity index 100% rename from trunk/include/asm-alpha/Kbuild rename to trunk/arch/alpha/include/asm/Kbuild diff --git a/trunk/include/asm-alpha/a.out-core.h b/trunk/arch/alpha/include/asm/a.out-core.h similarity index 100% rename from trunk/include/asm-alpha/a.out-core.h rename to trunk/arch/alpha/include/asm/a.out-core.h diff --git a/trunk/include/asm-alpha/a.out.h b/trunk/arch/alpha/include/asm/a.out.h similarity index 100% rename from trunk/include/asm-alpha/a.out.h rename to trunk/arch/alpha/include/asm/a.out.h diff --git a/trunk/include/asm-alpha/agp.h b/trunk/arch/alpha/include/asm/agp.h similarity index 100% rename from trunk/include/asm-alpha/agp.h rename to trunk/arch/alpha/include/asm/agp.h diff --git a/trunk/include/asm-alpha/agp_backend.h b/trunk/arch/alpha/include/asm/agp_backend.h similarity index 100% rename from trunk/include/asm-alpha/agp_backend.h rename to trunk/arch/alpha/include/asm/agp_backend.h diff --git a/trunk/include/asm-alpha/atomic.h b/trunk/arch/alpha/include/asm/atomic.h similarity index 100% rename from trunk/include/asm-alpha/atomic.h rename to trunk/arch/alpha/include/asm/atomic.h diff --git a/trunk/include/asm-alpha/auxvec.h b/trunk/arch/alpha/include/asm/auxvec.h similarity index 100% rename from trunk/include/asm-alpha/auxvec.h rename to trunk/arch/alpha/include/asm/auxvec.h diff --git a/trunk/include/asm-alpha/barrier.h b/trunk/arch/alpha/include/asm/barrier.h similarity index 100% rename from trunk/include/asm-alpha/barrier.h rename to trunk/arch/alpha/include/asm/barrier.h diff --git a/trunk/include/asm-alpha/bitops.h b/trunk/arch/alpha/include/asm/bitops.h similarity index 100% rename from trunk/include/asm-alpha/bitops.h rename to trunk/arch/alpha/include/asm/bitops.h diff --git a/trunk/include/asm-alpha/bug.h b/trunk/arch/alpha/include/asm/bug.h similarity index 100% rename from trunk/include/asm-alpha/bug.h rename to trunk/arch/alpha/include/asm/bug.h diff --git a/trunk/include/asm-alpha/bugs.h b/trunk/arch/alpha/include/asm/bugs.h similarity index 100% rename from trunk/include/asm-alpha/bugs.h rename to trunk/arch/alpha/include/asm/bugs.h diff --git a/trunk/include/asm-alpha/byteorder.h b/trunk/arch/alpha/include/asm/byteorder.h similarity index 100% rename from trunk/include/asm-alpha/byteorder.h rename to trunk/arch/alpha/include/asm/byteorder.h diff --git a/trunk/include/asm-alpha/cache.h b/trunk/arch/alpha/include/asm/cache.h similarity index 100% rename from trunk/include/asm-alpha/cache.h rename to trunk/arch/alpha/include/asm/cache.h diff --git a/trunk/include/asm-alpha/cacheflush.h b/trunk/arch/alpha/include/asm/cacheflush.h similarity index 100% rename from trunk/include/asm-alpha/cacheflush.h rename to trunk/arch/alpha/include/asm/cacheflush.h diff --git a/trunk/include/asm-alpha/checksum.h b/trunk/arch/alpha/include/asm/checksum.h similarity index 100% rename from trunk/include/asm-alpha/checksum.h rename to trunk/arch/alpha/include/asm/checksum.h diff --git a/trunk/include/asm-alpha/compiler.h b/trunk/arch/alpha/include/asm/compiler.h similarity index 100% rename from trunk/include/asm-alpha/compiler.h rename to trunk/arch/alpha/include/asm/compiler.h diff --git a/trunk/include/asm-alpha/console.h b/trunk/arch/alpha/include/asm/console.h similarity index 100% rename from trunk/include/asm-alpha/console.h rename to trunk/arch/alpha/include/asm/console.h diff --git a/trunk/include/asm-alpha/core_apecs.h b/trunk/arch/alpha/include/asm/core_apecs.h similarity index 100% rename from trunk/include/asm-alpha/core_apecs.h rename to trunk/arch/alpha/include/asm/core_apecs.h diff --git a/trunk/include/asm-alpha/core_cia.h b/trunk/arch/alpha/include/asm/core_cia.h similarity index 100% rename from trunk/include/asm-alpha/core_cia.h rename to trunk/arch/alpha/include/asm/core_cia.h diff --git a/trunk/include/asm-alpha/core_irongate.h b/trunk/arch/alpha/include/asm/core_irongate.h similarity index 100% rename from trunk/include/asm-alpha/core_irongate.h rename to trunk/arch/alpha/include/asm/core_irongate.h diff --git a/trunk/include/asm-alpha/core_lca.h b/trunk/arch/alpha/include/asm/core_lca.h similarity index 100% rename from trunk/include/asm-alpha/core_lca.h rename to trunk/arch/alpha/include/asm/core_lca.h diff --git a/trunk/include/asm-alpha/core_marvel.h b/trunk/arch/alpha/include/asm/core_marvel.h similarity index 100% rename from trunk/include/asm-alpha/core_marvel.h rename to trunk/arch/alpha/include/asm/core_marvel.h diff --git a/trunk/include/asm-alpha/core_mcpcia.h b/trunk/arch/alpha/include/asm/core_mcpcia.h similarity index 100% rename from trunk/include/asm-alpha/core_mcpcia.h rename to trunk/arch/alpha/include/asm/core_mcpcia.h diff --git a/trunk/include/asm-alpha/core_polaris.h b/trunk/arch/alpha/include/asm/core_polaris.h similarity index 100% rename from trunk/include/asm-alpha/core_polaris.h rename to trunk/arch/alpha/include/asm/core_polaris.h diff --git a/trunk/include/asm-alpha/core_t2.h b/trunk/arch/alpha/include/asm/core_t2.h similarity index 100% rename from trunk/include/asm-alpha/core_t2.h rename to trunk/arch/alpha/include/asm/core_t2.h diff --git a/trunk/include/asm-alpha/core_titan.h b/trunk/arch/alpha/include/asm/core_titan.h similarity index 100% rename from trunk/include/asm-alpha/core_titan.h rename to trunk/arch/alpha/include/asm/core_titan.h diff --git a/trunk/include/asm-alpha/core_tsunami.h b/trunk/arch/alpha/include/asm/core_tsunami.h similarity index 100% rename from trunk/include/asm-alpha/core_tsunami.h rename to trunk/arch/alpha/include/asm/core_tsunami.h diff --git a/trunk/include/asm-alpha/core_wildfire.h b/trunk/arch/alpha/include/asm/core_wildfire.h similarity index 100% rename from trunk/include/asm-alpha/core_wildfire.h rename to trunk/arch/alpha/include/asm/core_wildfire.h diff --git a/trunk/include/asm-alpha/cputime.h b/trunk/arch/alpha/include/asm/cputime.h similarity index 100% rename from trunk/include/asm-alpha/cputime.h rename to trunk/arch/alpha/include/asm/cputime.h diff --git a/trunk/include/asm-alpha/current.h b/trunk/arch/alpha/include/asm/current.h similarity index 100% rename from trunk/include/asm-alpha/current.h rename to trunk/arch/alpha/include/asm/current.h diff --git a/trunk/include/asm-alpha/delay.h b/trunk/arch/alpha/include/asm/delay.h similarity index 100% rename from trunk/include/asm-alpha/delay.h rename to trunk/arch/alpha/include/asm/delay.h diff --git a/trunk/include/asm-alpha/device.h b/trunk/arch/alpha/include/asm/device.h similarity index 100% rename from trunk/include/asm-alpha/device.h rename to trunk/arch/alpha/include/asm/device.h diff --git a/trunk/include/asm-alpha/div64.h b/trunk/arch/alpha/include/asm/div64.h similarity index 100% rename from trunk/include/asm-alpha/div64.h rename to trunk/arch/alpha/include/asm/div64.h diff --git a/trunk/include/asm-alpha/dma-mapping.h b/trunk/arch/alpha/include/asm/dma-mapping.h similarity index 100% rename from trunk/include/asm-alpha/dma-mapping.h rename to trunk/arch/alpha/include/asm/dma-mapping.h diff --git a/trunk/include/asm-alpha/dma.h b/trunk/arch/alpha/include/asm/dma.h similarity index 100% rename from trunk/include/asm-alpha/dma.h rename to trunk/arch/alpha/include/asm/dma.h diff --git a/trunk/include/asm-alpha/elf.h b/trunk/arch/alpha/include/asm/elf.h similarity index 100% rename from trunk/include/asm-alpha/elf.h rename to trunk/arch/alpha/include/asm/elf.h diff --git a/trunk/include/asm-alpha/emergency-restart.h b/trunk/arch/alpha/include/asm/emergency-restart.h similarity index 100% rename from trunk/include/asm-alpha/emergency-restart.h rename to trunk/arch/alpha/include/asm/emergency-restart.h diff --git a/trunk/include/asm-alpha/err_common.h b/trunk/arch/alpha/include/asm/err_common.h similarity index 100% rename from trunk/include/asm-alpha/err_common.h rename to trunk/arch/alpha/include/asm/err_common.h diff --git a/trunk/include/asm-alpha/err_ev6.h b/trunk/arch/alpha/include/asm/err_ev6.h similarity index 100% rename from trunk/include/asm-alpha/err_ev6.h rename to trunk/arch/alpha/include/asm/err_ev6.h diff --git a/trunk/include/asm-alpha/err_ev7.h b/trunk/arch/alpha/include/asm/err_ev7.h similarity index 100% rename from trunk/include/asm-alpha/err_ev7.h rename to trunk/arch/alpha/include/asm/err_ev7.h diff --git a/trunk/include/asm-alpha/errno.h b/trunk/arch/alpha/include/asm/errno.h similarity index 100% rename from trunk/include/asm-alpha/errno.h rename to trunk/arch/alpha/include/asm/errno.h diff --git a/trunk/include/asm-alpha/fb.h b/trunk/arch/alpha/include/asm/fb.h similarity index 100% rename from trunk/include/asm-alpha/fb.h rename to trunk/arch/alpha/include/asm/fb.h diff --git a/trunk/include/asm-alpha/fcntl.h b/trunk/arch/alpha/include/asm/fcntl.h similarity index 100% rename from trunk/include/asm-alpha/fcntl.h rename to trunk/arch/alpha/include/asm/fcntl.h diff --git a/trunk/include/asm-alpha/floppy.h b/trunk/arch/alpha/include/asm/floppy.h similarity index 100% rename from trunk/include/asm-alpha/floppy.h rename to trunk/arch/alpha/include/asm/floppy.h diff --git a/trunk/include/asm-alpha/fpu.h b/trunk/arch/alpha/include/asm/fpu.h similarity index 100% rename from trunk/include/asm-alpha/fpu.h rename to trunk/arch/alpha/include/asm/fpu.h diff --git a/trunk/include/asm-alpha/futex.h b/trunk/arch/alpha/include/asm/futex.h similarity index 100% rename from trunk/include/asm-alpha/futex.h rename to trunk/arch/alpha/include/asm/futex.h diff --git a/trunk/include/asm-alpha/gct.h b/trunk/arch/alpha/include/asm/gct.h similarity index 100% rename from trunk/include/asm-alpha/gct.h rename to trunk/arch/alpha/include/asm/gct.h diff --git a/trunk/include/asm-alpha/gentrap.h b/trunk/arch/alpha/include/asm/gentrap.h similarity index 100% rename from trunk/include/asm-alpha/gentrap.h rename to trunk/arch/alpha/include/asm/gentrap.h diff --git a/trunk/include/asm-alpha/hardirq.h b/trunk/arch/alpha/include/asm/hardirq.h similarity index 100% rename from trunk/include/asm-alpha/hardirq.h rename to trunk/arch/alpha/include/asm/hardirq.h diff --git a/trunk/include/asm-alpha/hw_irq.h b/trunk/arch/alpha/include/asm/hw_irq.h similarity index 100% rename from trunk/include/asm-alpha/hw_irq.h rename to trunk/arch/alpha/include/asm/hw_irq.h diff --git a/trunk/include/asm-alpha/hwrpb.h b/trunk/arch/alpha/include/asm/hwrpb.h similarity index 100% rename from trunk/include/asm-alpha/hwrpb.h rename to trunk/arch/alpha/include/asm/hwrpb.h diff --git a/trunk/include/asm-alpha/io.h b/trunk/arch/alpha/include/asm/io.h similarity index 100% rename from trunk/include/asm-alpha/io.h rename to trunk/arch/alpha/include/asm/io.h diff --git a/trunk/include/asm-alpha/io_trivial.h b/trunk/arch/alpha/include/asm/io_trivial.h similarity index 100% rename from trunk/include/asm-alpha/io_trivial.h rename to trunk/arch/alpha/include/asm/io_trivial.h diff --git a/trunk/include/asm-alpha/ioctl.h b/trunk/arch/alpha/include/asm/ioctl.h similarity index 100% rename from trunk/include/asm-alpha/ioctl.h rename to trunk/arch/alpha/include/asm/ioctl.h diff --git a/trunk/include/asm-alpha/ioctls.h b/trunk/arch/alpha/include/asm/ioctls.h similarity index 100% rename from trunk/include/asm-alpha/ioctls.h rename to trunk/arch/alpha/include/asm/ioctls.h diff --git a/trunk/include/asm-alpha/ipcbuf.h b/trunk/arch/alpha/include/asm/ipcbuf.h similarity index 100% rename from trunk/include/asm-alpha/ipcbuf.h rename to trunk/arch/alpha/include/asm/ipcbuf.h diff --git a/trunk/include/asm-alpha/irq.h b/trunk/arch/alpha/include/asm/irq.h similarity index 100% rename from trunk/include/asm-alpha/irq.h rename to trunk/arch/alpha/include/asm/irq.h diff --git a/trunk/include/asm-alpha/irq_regs.h b/trunk/arch/alpha/include/asm/irq_regs.h similarity index 100% rename from trunk/include/asm-alpha/irq_regs.h rename to trunk/arch/alpha/include/asm/irq_regs.h diff --git a/trunk/include/asm-alpha/jensen.h b/trunk/arch/alpha/include/asm/jensen.h similarity index 100% rename from trunk/include/asm-alpha/jensen.h rename to trunk/arch/alpha/include/asm/jensen.h diff --git a/trunk/include/asm-alpha/kdebug.h b/trunk/arch/alpha/include/asm/kdebug.h similarity index 100% rename from trunk/include/asm-alpha/kdebug.h rename to trunk/arch/alpha/include/asm/kdebug.h diff --git a/trunk/include/asm-alpha/kmap_types.h b/trunk/arch/alpha/include/asm/kmap_types.h similarity index 100% rename from trunk/include/asm-alpha/kmap_types.h rename to trunk/arch/alpha/include/asm/kmap_types.h diff --git a/trunk/include/asm-alpha/linkage.h b/trunk/arch/alpha/include/asm/linkage.h similarity index 100% rename from trunk/include/asm-alpha/linkage.h rename to trunk/arch/alpha/include/asm/linkage.h diff --git a/trunk/include/asm-alpha/local.h b/trunk/arch/alpha/include/asm/local.h similarity index 100% rename from trunk/include/asm-alpha/local.h rename to trunk/arch/alpha/include/asm/local.h diff --git a/trunk/include/asm-alpha/machvec.h b/trunk/arch/alpha/include/asm/machvec.h similarity index 100% rename from trunk/include/asm-alpha/machvec.h rename to trunk/arch/alpha/include/asm/machvec.h diff --git a/trunk/include/asm-alpha/mc146818rtc.h b/trunk/arch/alpha/include/asm/mc146818rtc.h similarity index 100% rename from trunk/include/asm-alpha/mc146818rtc.h rename to trunk/arch/alpha/include/asm/mc146818rtc.h diff --git a/trunk/include/asm-alpha/md.h b/trunk/arch/alpha/include/asm/md.h similarity index 100% rename from trunk/include/asm-alpha/md.h rename to trunk/arch/alpha/include/asm/md.h diff --git a/trunk/include/asm-alpha/mman.h b/trunk/arch/alpha/include/asm/mman.h similarity index 100% rename from trunk/include/asm-alpha/mman.h rename to trunk/arch/alpha/include/asm/mman.h diff --git a/trunk/include/asm-alpha/mmu.h b/trunk/arch/alpha/include/asm/mmu.h similarity index 100% rename from trunk/include/asm-alpha/mmu.h rename to trunk/arch/alpha/include/asm/mmu.h diff --git a/trunk/include/asm-alpha/mmu_context.h b/trunk/arch/alpha/include/asm/mmu_context.h similarity index 100% rename from trunk/include/asm-alpha/mmu_context.h rename to trunk/arch/alpha/include/asm/mmu_context.h diff --git a/trunk/include/asm-alpha/mmzone.h b/trunk/arch/alpha/include/asm/mmzone.h similarity index 100% rename from trunk/include/asm-alpha/mmzone.h rename to trunk/arch/alpha/include/asm/mmzone.h diff --git a/trunk/include/asm-alpha/module.h b/trunk/arch/alpha/include/asm/module.h similarity index 100% rename from trunk/include/asm-alpha/module.h rename to trunk/arch/alpha/include/asm/module.h diff --git a/trunk/include/asm-alpha/msgbuf.h b/trunk/arch/alpha/include/asm/msgbuf.h similarity index 100% rename from trunk/include/asm-alpha/msgbuf.h rename to trunk/arch/alpha/include/asm/msgbuf.h diff --git a/trunk/include/asm-alpha/mutex.h b/trunk/arch/alpha/include/asm/mutex.h similarity index 100% rename from trunk/include/asm-alpha/mutex.h rename to trunk/arch/alpha/include/asm/mutex.h diff --git a/trunk/include/asm-alpha/page.h b/trunk/arch/alpha/include/asm/page.h similarity index 100% rename from trunk/include/asm-alpha/page.h rename to trunk/arch/alpha/include/asm/page.h diff --git a/trunk/include/asm-alpha/pal.h b/trunk/arch/alpha/include/asm/pal.h similarity index 100% rename from trunk/include/asm-alpha/pal.h rename to trunk/arch/alpha/include/asm/pal.h diff --git a/trunk/include/asm-alpha/param.h b/trunk/arch/alpha/include/asm/param.h similarity index 100% rename from trunk/include/asm-alpha/param.h rename to trunk/arch/alpha/include/asm/param.h diff --git a/trunk/include/asm-alpha/parport.h b/trunk/arch/alpha/include/asm/parport.h similarity index 100% rename from trunk/include/asm-alpha/parport.h rename to trunk/arch/alpha/include/asm/parport.h diff --git a/trunk/include/asm-alpha/pci.h b/trunk/arch/alpha/include/asm/pci.h similarity index 100% rename from trunk/include/asm-alpha/pci.h rename to trunk/arch/alpha/include/asm/pci.h diff --git a/trunk/include/asm-alpha/percpu.h b/trunk/arch/alpha/include/asm/percpu.h similarity index 100% rename from trunk/include/asm-alpha/percpu.h rename to trunk/arch/alpha/include/asm/percpu.h diff --git a/trunk/include/asm-alpha/pgalloc.h b/trunk/arch/alpha/include/asm/pgalloc.h similarity index 100% rename from trunk/include/asm-alpha/pgalloc.h rename to trunk/arch/alpha/include/asm/pgalloc.h diff --git a/trunk/include/asm-alpha/pgtable.h b/trunk/arch/alpha/include/asm/pgtable.h similarity index 100% rename from trunk/include/asm-alpha/pgtable.h rename to trunk/arch/alpha/include/asm/pgtable.h diff --git a/trunk/include/asm-alpha/poll.h b/trunk/arch/alpha/include/asm/poll.h similarity index 100% rename from trunk/include/asm-alpha/poll.h rename to trunk/arch/alpha/include/asm/poll.h diff --git a/trunk/include/asm-alpha/posix_types.h b/trunk/arch/alpha/include/asm/posix_types.h similarity index 100% rename from trunk/include/asm-alpha/posix_types.h rename to trunk/arch/alpha/include/asm/posix_types.h diff --git a/trunk/include/asm-alpha/processor.h b/trunk/arch/alpha/include/asm/processor.h similarity index 100% rename from trunk/include/asm-alpha/processor.h rename to trunk/arch/alpha/include/asm/processor.h diff --git a/trunk/include/asm-alpha/ptrace.h b/trunk/arch/alpha/include/asm/ptrace.h similarity index 100% rename from trunk/include/asm-alpha/ptrace.h rename to trunk/arch/alpha/include/asm/ptrace.h diff --git a/trunk/include/asm-alpha/reg.h b/trunk/arch/alpha/include/asm/reg.h similarity index 100% rename from trunk/include/asm-alpha/reg.h rename to trunk/arch/alpha/include/asm/reg.h diff --git a/trunk/include/asm-alpha/regdef.h b/trunk/arch/alpha/include/asm/regdef.h similarity index 100% rename from trunk/include/asm-alpha/regdef.h rename to trunk/arch/alpha/include/asm/regdef.h diff --git a/trunk/include/asm-alpha/resource.h b/trunk/arch/alpha/include/asm/resource.h similarity index 100% rename from trunk/include/asm-alpha/resource.h rename to trunk/arch/alpha/include/asm/resource.h diff --git a/trunk/include/asm-alpha/rtc.h b/trunk/arch/alpha/include/asm/rtc.h similarity index 100% rename from trunk/include/asm-alpha/rtc.h rename to trunk/arch/alpha/include/asm/rtc.h diff --git a/trunk/include/asm-alpha/rwsem.h b/trunk/arch/alpha/include/asm/rwsem.h similarity index 100% rename from trunk/include/asm-alpha/rwsem.h rename to trunk/arch/alpha/include/asm/rwsem.h diff --git a/trunk/include/asm-alpha/scatterlist.h b/trunk/arch/alpha/include/asm/scatterlist.h similarity index 100% rename from trunk/include/asm-alpha/scatterlist.h rename to trunk/arch/alpha/include/asm/scatterlist.h diff --git a/trunk/include/asm-alpha/sections.h b/trunk/arch/alpha/include/asm/sections.h similarity index 100% rename from trunk/include/asm-alpha/sections.h rename to trunk/arch/alpha/include/asm/sections.h diff --git a/trunk/include/asm-alpha/segment.h b/trunk/arch/alpha/include/asm/segment.h similarity index 100% rename from trunk/include/asm-alpha/segment.h rename to trunk/arch/alpha/include/asm/segment.h diff --git a/trunk/include/asm-alpha/sembuf.h b/trunk/arch/alpha/include/asm/sembuf.h similarity index 100% rename from trunk/include/asm-alpha/sembuf.h rename to trunk/arch/alpha/include/asm/sembuf.h diff --git a/trunk/include/asm-alpha/serial.h b/trunk/arch/alpha/include/asm/serial.h similarity index 100% rename from trunk/include/asm-alpha/serial.h rename to trunk/arch/alpha/include/asm/serial.h diff --git a/trunk/include/asm-alpha/setup.h b/trunk/arch/alpha/include/asm/setup.h similarity index 100% rename from trunk/include/asm-alpha/setup.h rename to trunk/arch/alpha/include/asm/setup.h diff --git a/trunk/include/asm-alpha/sfp-machine.h b/trunk/arch/alpha/include/asm/sfp-machine.h similarity index 100% rename from trunk/include/asm-alpha/sfp-machine.h rename to trunk/arch/alpha/include/asm/sfp-machine.h diff --git a/trunk/include/asm-alpha/shmbuf.h b/trunk/arch/alpha/include/asm/shmbuf.h similarity index 100% rename from trunk/include/asm-alpha/shmbuf.h rename to trunk/arch/alpha/include/asm/shmbuf.h diff --git a/trunk/include/asm-alpha/shmparam.h b/trunk/arch/alpha/include/asm/shmparam.h similarity index 100% rename from trunk/include/asm-alpha/shmparam.h rename to trunk/arch/alpha/include/asm/shmparam.h diff --git a/trunk/include/asm-alpha/sigcontext.h b/trunk/arch/alpha/include/asm/sigcontext.h similarity index 100% rename from trunk/include/asm-alpha/sigcontext.h rename to trunk/arch/alpha/include/asm/sigcontext.h diff --git a/trunk/include/asm-alpha/siginfo.h b/trunk/arch/alpha/include/asm/siginfo.h similarity index 100% rename from trunk/include/asm-alpha/siginfo.h rename to trunk/arch/alpha/include/asm/siginfo.h diff --git a/trunk/include/asm-alpha/signal.h b/trunk/arch/alpha/include/asm/signal.h similarity index 100% rename from trunk/include/asm-alpha/signal.h rename to trunk/arch/alpha/include/asm/signal.h diff --git a/trunk/include/asm-alpha/smp.h b/trunk/arch/alpha/include/asm/smp.h similarity index 100% rename from trunk/include/asm-alpha/smp.h rename to trunk/arch/alpha/include/asm/smp.h diff --git a/trunk/include/asm-alpha/socket.h b/trunk/arch/alpha/include/asm/socket.h similarity index 100% rename from trunk/include/asm-alpha/socket.h rename to trunk/arch/alpha/include/asm/socket.h diff --git a/trunk/include/asm-alpha/sockios.h b/trunk/arch/alpha/include/asm/sockios.h similarity index 100% rename from trunk/include/asm-alpha/sockios.h rename to trunk/arch/alpha/include/asm/sockios.h diff --git a/trunk/include/asm-alpha/spinlock.h b/trunk/arch/alpha/include/asm/spinlock.h similarity index 100% rename from trunk/include/asm-alpha/spinlock.h rename to trunk/arch/alpha/include/asm/spinlock.h diff --git a/trunk/include/asm-alpha/spinlock_types.h b/trunk/arch/alpha/include/asm/spinlock_types.h similarity index 100% rename from trunk/include/asm-alpha/spinlock_types.h rename to trunk/arch/alpha/include/asm/spinlock_types.h diff --git a/trunk/include/asm-alpha/stat.h b/trunk/arch/alpha/include/asm/stat.h similarity index 100% rename from trunk/include/asm-alpha/stat.h rename to trunk/arch/alpha/include/asm/stat.h diff --git a/trunk/include/asm-alpha/statfs.h b/trunk/arch/alpha/include/asm/statfs.h similarity index 100% rename from trunk/include/asm-alpha/statfs.h rename to trunk/arch/alpha/include/asm/statfs.h diff --git a/trunk/include/asm-alpha/string.h b/trunk/arch/alpha/include/asm/string.h similarity index 100% rename from trunk/include/asm-alpha/string.h rename to trunk/arch/alpha/include/asm/string.h diff --git a/trunk/include/asm-alpha/suspend.h b/trunk/arch/alpha/include/asm/suspend.h similarity index 100% rename from trunk/include/asm-alpha/suspend.h rename to trunk/arch/alpha/include/asm/suspend.h diff --git a/trunk/include/asm-alpha/sysinfo.h b/trunk/arch/alpha/include/asm/sysinfo.h similarity index 100% rename from trunk/include/asm-alpha/sysinfo.h rename to trunk/arch/alpha/include/asm/sysinfo.h diff --git a/trunk/include/asm-alpha/system.h b/trunk/arch/alpha/include/asm/system.h similarity index 100% rename from trunk/include/asm-alpha/system.h rename to trunk/arch/alpha/include/asm/system.h diff --git a/trunk/include/asm-alpha/termbits.h b/trunk/arch/alpha/include/asm/termbits.h similarity index 100% rename from trunk/include/asm-alpha/termbits.h rename to trunk/arch/alpha/include/asm/termbits.h diff --git a/trunk/include/asm-alpha/termios.h b/trunk/arch/alpha/include/asm/termios.h similarity index 100% rename from trunk/include/asm-alpha/termios.h rename to trunk/arch/alpha/include/asm/termios.h diff --git a/trunk/include/asm-alpha/thread_info.h b/trunk/arch/alpha/include/asm/thread_info.h similarity index 100% rename from trunk/include/asm-alpha/thread_info.h rename to trunk/arch/alpha/include/asm/thread_info.h diff --git a/trunk/include/asm-alpha/timex.h b/trunk/arch/alpha/include/asm/timex.h similarity index 100% rename from trunk/include/asm-alpha/timex.h rename to trunk/arch/alpha/include/asm/timex.h diff --git a/trunk/include/asm-alpha/tlb.h b/trunk/arch/alpha/include/asm/tlb.h similarity index 100% rename from trunk/include/asm-alpha/tlb.h rename to trunk/arch/alpha/include/asm/tlb.h diff --git a/trunk/include/asm-alpha/tlbflush.h b/trunk/arch/alpha/include/asm/tlbflush.h similarity index 100% rename from trunk/include/asm-alpha/tlbflush.h rename to trunk/arch/alpha/include/asm/tlbflush.h diff --git a/trunk/include/asm-alpha/topology.h b/trunk/arch/alpha/include/asm/topology.h similarity index 100% rename from trunk/include/asm-alpha/topology.h rename to trunk/arch/alpha/include/asm/topology.h diff --git a/trunk/include/asm-alpha/types.h b/trunk/arch/alpha/include/asm/types.h similarity index 100% rename from trunk/include/asm-alpha/types.h rename to trunk/arch/alpha/include/asm/types.h diff --git a/trunk/include/asm-alpha/uaccess.h b/trunk/arch/alpha/include/asm/uaccess.h similarity index 100% rename from trunk/include/asm-alpha/uaccess.h rename to trunk/arch/alpha/include/asm/uaccess.h diff --git a/trunk/include/asm-alpha/ucontext.h b/trunk/arch/alpha/include/asm/ucontext.h similarity index 100% rename from trunk/include/asm-alpha/ucontext.h rename to trunk/arch/alpha/include/asm/ucontext.h diff --git a/trunk/include/asm-alpha/unaligned.h b/trunk/arch/alpha/include/asm/unaligned.h similarity index 100% rename from trunk/include/asm-alpha/unaligned.h rename to trunk/arch/alpha/include/asm/unaligned.h diff --git a/trunk/include/asm-alpha/unistd.h b/trunk/arch/alpha/include/asm/unistd.h similarity index 100% rename from trunk/include/asm-alpha/unistd.h rename to trunk/arch/alpha/include/asm/unistd.h diff --git a/trunk/include/asm-alpha/user.h b/trunk/arch/alpha/include/asm/user.h similarity index 100% rename from trunk/include/asm-alpha/user.h rename to trunk/arch/alpha/include/asm/user.h diff --git a/trunk/include/asm-alpha/vga.h b/trunk/arch/alpha/include/asm/vga.h similarity index 100% rename from trunk/include/asm-alpha/vga.h rename to trunk/arch/alpha/include/asm/vga.h diff --git a/trunk/include/asm-alpha/xor.h b/trunk/arch/alpha/include/asm/xor.h similarity index 100% rename from trunk/include/asm-alpha/xor.h rename to trunk/arch/alpha/include/asm/xor.h diff --git a/trunk/arch/arm/include/asm/kexec.h b/trunk/arch/arm/include/asm/kexec.h index c8986bb99ed5..df15a0dc228e 100644 --- a/trunk/arch/arm/include/asm/kexec.h +++ b/trunk/arch/arm/include/asm/kexec.h @@ -10,7 +10,7 @@ /* Maximum address we can use for the control code buffer */ #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL) -#define KEXEC_CONTROL_CODE_SIZE 4096 +#define KEXEC_CONTROL_PAGE_SIZE 4096 #define KEXEC_ARCH KEXEC_ARCH_ARM diff --git a/trunk/arch/arm/kernel/machine_kexec.c b/trunk/arch/arm/kernel/machine_kexec.c index db8f54a3451f..fae5beb3c3d6 100644 --- a/trunk/arch/arm/kernel/machine_kexec.c +++ b/trunk/arch/arm/kernel/machine_kexec.c @@ -71,7 +71,7 @@ void machine_kexec(struct kimage *image) flush_icache_range((unsigned long) reboot_code_buffer, - (unsigned long) reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE); + (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); printk(KERN_INFO "Bye!\n"); cpu_proc_fin(); diff --git a/trunk/arch/ia64/include/asm/kexec.h b/trunk/arch/ia64/include/asm/kexec.h index 541be835fc5a..e1d58f819d78 100644 --- a/trunk/arch/ia64/include/asm/kexec.h +++ b/trunk/arch/ia64/include/asm/kexec.h @@ -9,7 +9,7 @@ /* Maximum address we can use for the control code buffer */ #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE -#define KEXEC_CONTROL_CODE_SIZE (8192 + 8192 + 4096) +#define KEXEC_CONTROL_PAGE_SIZE (8192 + 8192 + 4096) /* The native architecture */ #define KEXEC_ARCH KEXEC_ARCH_IA_64 diff --git a/trunk/arch/powerpc/include/asm/kexec.h b/trunk/arch/powerpc/include/asm/kexec.h index acdcdc66f1b6..3736d9b33289 100644 --- a/trunk/arch/powerpc/include/asm/kexec.h +++ b/trunk/arch/powerpc/include/asm/kexec.h @@ -22,7 +22,7 @@ #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE #endif -#define KEXEC_CONTROL_CODE_SIZE 4096 +#define KEXEC_CONTROL_PAGE_SIZE 4096 /* The native architecture */ #ifdef __powerpc64__ diff --git a/trunk/arch/powerpc/kernel/machine_kexec_32.c b/trunk/arch/powerpc/kernel/machine_kexec_32.c index cbaa34196797..ae63a964b858 100644 --- a/trunk/arch/powerpc/kernel/machine_kexec_32.c +++ b/trunk/arch/powerpc/kernel/machine_kexec_32.c @@ -51,7 +51,7 @@ void default_machine_kexec(struct kimage *image) relocate_new_kernel_size); flush_icache_range(reboot_code_buffer, - reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE); + reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); printk(KERN_INFO "Bye!\n"); /* now call it */ diff --git a/trunk/arch/s390/include/asm/kexec.h b/trunk/arch/s390/include/asm/kexec.h index f219c6411e0b..bb729b84a21e 100644 --- a/trunk/arch/s390/include/asm/kexec.h +++ b/trunk/arch/s390/include/asm/kexec.h @@ -31,7 +31,7 @@ #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31) /* Allocate one page for the pdp and the second for the code */ -#define KEXEC_CONTROL_CODE_SIZE 4096 +#define KEXEC_CONTROL_PAGE_SIZE 4096 /* The native architecture */ #define KEXEC_ARCH KEXEC_ARCH_S390 diff --git a/trunk/arch/sh/include/asm/kexec.h b/trunk/arch/sh/include/asm/kexec.h index 00f4260ef09b..765a5e1660fc 100644 --- a/trunk/arch/sh/include/asm/kexec.h +++ b/trunk/arch/sh/include/asm/kexec.h @@ -21,7 +21,7 @@ /* Maximum address we can use for the control code buffer */ #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE -#define KEXEC_CONTROL_CODE_SIZE 4096 +#define KEXEC_CONTROL_PAGE_SIZE 4096 /* The native architecture */ #define KEXEC_ARCH KEXEC_ARCH_SH diff --git a/trunk/arch/x86/kernel/machine_kexec_32.c b/trunk/arch/x86/kernel/machine_kexec_32.c index 9fe478d98406..0732adba05ca 100644 --- a/trunk/arch/x86/kernel/machine_kexec_32.c +++ b/trunk/arch/x86/kernel/machine_kexec_32.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -78,7 +79,7 @@ static void load_segments(void) /* * A architecture hook called to validate the * proposed image and prepare the control pages - * as needed. The pages for KEXEC_CONTROL_CODE_SIZE + * as needed. The pages for KEXEC_CONTROL_PAGE_SIZE * have been allocated, but the segments have yet * been copied into the kernel. * @@ -113,6 +114,7 @@ void machine_kexec(struct kimage *image) { unsigned long page_list[PAGES_NR]; void *control_page; + int save_ftrace_enabled; asmlinkage unsigned long (*relocate_kernel_ptr)(unsigned long indirection_page, unsigned long control_page, @@ -120,7 +122,12 @@ void machine_kexec(struct kimage *image) unsigned int has_pae, unsigned int preserve_context); - tracer_disable(); +#ifdef CONFIG_KEXEC_JUMP + if (kexec_image->preserve_context) + save_processor_state(); +#endif + + save_ftrace_enabled = __ftrace_enabled_save(); /* Interrupts aren't acceptable while we reboot */ local_irq_disable(); @@ -138,7 +145,7 @@ void machine_kexec(struct kimage *image) } control_page = page_address(image->control_code_page); - memcpy(control_page, relocate_kernel, PAGE_SIZE/2); + memcpy(control_page, relocate_kernel, KEXEC_CONTROL_CODE_MAX_SIZE); relocate_kernel_ptr = control_page; page_list[PA_CONTROL_PAGE] = __pa(control_page); @@ -178,6 +185,13 @@ void machine_kexec(struct kimage *image) (unsigned long)page_list, image->start, cpu_has_pae, image->preserve_context); + +#ifdef CONFIG_KEXEC_JUMP + if (kexec_image->preserve_context) + restore_processor_state(); +#endif + + __ftrace_enabled_restore(save_ftrace_enabled); } void arch_crash_save_vmcoreinfo(void) diff --git a/trunk/arch/x86/kernel/relocate_kernel_32.S b/trunk/arch/x86/kernel/relocate_kernel_32.S index 703310a99023..6f50664b2ba5 100644 --- a/trunk/arch/x86/kernel/relocate_kernel_32.S +++ b/trunk/arch/x86/kernel/relocate_kernel_32.S @@ -20,10 +20,11 @@ #define PAGE_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) #define PAE_PGD_ATTR (_PAGE_PRESENT) -/* control_page + PAGE_SIZE/2 ~ control_page + PAGE_SIZE * 3/4 are - * used to save some data for jumping back +/* control_page + KEXEC_CONTROL_CODE_MAX_SIZE + * ~ control_page + PAGE_SIZE are used as data storage and stack for + * jumping back */ -#define DATA(offset) (PAGE_SIZE/2+(offset)) +#define DATA(offset) (KEXEC_CONTROL_CODE_MAX_SIZE+(offset)) /* Minimal CPU state */ #define ESP DATA(0x0) @@ -376,3 +377,6 @@ swap_pages: popl %ebx popl %ebp ret + + .globl kexec_control_code_size +.set kexec_control_code_size, . - relocate_kernel diff --git a/trunk/arch/x86/kernel/vmlinux_32.lds.S b/trunk/arch/x86/kernel/vmlinux_32.lds.S index cdb2363697d2..af5bdad84604 100644 --- a/trunk/arch/x86/kernel/vmlinux_32.lds.S +++ b/trunk/arch/x86/kernel/vmlinux_32.lds.S @@ -209,3 +209,11 @@ SECTIONS DWARF_DEBUG } + +#ifdef CONFIG_KEXEC +/* Link time checks */ +#include + +ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, + "kexec control code size is too big") +#endif diff --git a/trunk/drivers/hwmon/Kconfig b/trunk/drivers/hwmon/Kconfig index bf4ebfb86fa5..d402e8d813ce 100644 --- a/trunk/drivers/hwmon/Kconfig +++ b/trunk/drivers/hwmon/Kconfig @@ -77,6 +77,22 @@ config SENSORS_AD7418 This driver can also be built as a module. If so, the module will be called ad7418. +config SENSORS_ADCXX + tristate "National Semiconductor ADCxxxSxxx" + depends on SPI_MASTER && EXPERIMENTAL + help + If you say yes here you get support for the National Semiconductor + ADCS chip family, where + * bb is the resolution in number of bits (8, 10, 12) + * c is the number of channels (1, 2, 4, 8) + * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 + kSPS and 101 for 1 MSPS) + + Examples : ADC081S101, ADC124S501, ... + + This driver can also be built as a module. If so, the module + will be called adcxx. + config SENSORS_ADM1021 tristate "Analog Devices ADM1021 and compatibles" depends on I2C diff --git a/trunk/drivers/hwmon/Makefile b/trunk/drivers/hwmon/Makefile index 7943e5cefb06..950134ab8426 100644 --- a/trunk/drivers/hwmon/Makefile +++ b/trunk/drivers/hwmon/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_SENSORS_ABITUGURU) += abituguru.o obj-$(CONFIG_SENSORS_ABITUGURU3)+= abituguru3.o obj-$(CONFIG_SENSORS_AD7414) += ad7414.o obj-$(CONFIG_SENSORS_AD7418) += ad7418.o +obj-$(CONFIG_SENSORS_ADCXX) += adcxx.o obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o diff --git a/trunk/drivers/hwmon/abituguru3.c b/trunk/drivers/hwmon/abituguru3.c index f00f497b9ca9..d568c65c1370 100644 --- a/trunk/drivers/hwmon/abituguru3.c +++ b/trunk/drivers/hwmon/abituguru3.c @@ -1,5 +1,8 @@ /* - abituguru3.c Copyright (c) 2006 Hans de Goede + abituguru3.c + + Copyright (c) 2006-2008 Hans de Goede + Copyright (c) 2008 Alistair John Strachan 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 @@ -116,7 +119,7 @@ struct abituguru3_sensor_info { struct abituguru3_motherboard_info { u16 id; - const char *name; + const char *dmi_name; /* + 1 -> end of sensors indicated by a sensor with name == NULL */ struct abituguru3_sensor_info sensors[ABIT_UGURU3_MAX_NO_SENSORS + 1]; }; @@ -161,7 +164,7 @@ struct abituguru3_data { /* Constants */ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { - { 0x000C, "unknown", { + { 0x000C, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -183,7 +186,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX1 Fan", 35, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x000D, "Abit AW8", { + { 0x000D, NULL /* Abit AW8, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -212,7 +215,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX5 Fan", 39, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x000E, "AL-8", { + { 0x000E, NULL /* AL-8, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -233,7 +236,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "SYS Fan", 34, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x000F, "unknown", { + { 0x000F, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -254,7 +257,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "SYS Fan", 34, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0010, "Abit NI8 SLI GR", { + { 0x0010, NULL /* Abit NI8 SLI GR, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -276,7 +279,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "OTES1 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0011, "Abit AT8 32X", { + { 0x0011, NULL /* Abit AT8 32X, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 20, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -302,7 +305,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX2 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0012, "Abit AN8 32X", { + { 0x0012, NULL /* Abit AN8 32X, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 20, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -324,7 +327,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX1 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0013, "Abit AW8D", { + { 0x0013, NULL /* Abit AW8D, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -353,7 +356,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX5 Fan", 39, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0014, "Abit AB9 Pro", { + { 0x0014, NULL /* Abit AB9 Pro, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 10, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -374,7 +377,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "SYS Fan", 34, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0015, "unknown", { + { 0x0015, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR", 1, 0, 20, 1, 0 }, { "DDR VTT", 2, 0, 10, 1, 0 }, @@ -398,7 +401,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0016, "AW9D-MAX", { + { 0x0016, NULL /* AW9D-MAX, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -426,7 +429,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "OTES1 Fan", 38, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0017, "unknown", { + { 0x0017, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -451,7 +454,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 FAN", 37, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0018, "unknown", { + { 0x0018, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -478,7 +481,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x0019, "unknown", { + { 0x0019, NULL /* Unknown, need DMI string */, { { "CPU Core", 7, 0, 10, 1, 0 }, { "DDR2", 13, 0, 20, 1, 0 }, { "DDR2 VTT", 14, 0, 10, 1, 0 }, @@ -505,7 +508,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 FAN", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x001A, "Abit IP35 Pro", { + { 0x001A, "IP35 Pro(Intel P35-ICH9R)", { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -533,7 +536,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX4 Fan", 37, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x001B, "unknown", { + { 0x001B, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR3", 1, 0, 20, 1, 0 }, { "DDR3 VTT", 2, 0, 10, 1, 0 }, @@ -560,7 +563,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = { { "AUX3 Fan", 36, 2, 60, 1, 0 }, { NULL, 0, 0, 0, 0, 0 } } }, - { 0x001C, "unknown", { + { 0x001C, NULL /* Unknown, need DMI string */, { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -935,9 +938,18 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) goto abituguru3_probe_error; } data->sensors = abituguru3_motherboards[i].sensors; + printk(KERN_INFO ABIT_UGURU3_NAME ": found Abit uGuru3, motherboard " - "ID: %04X (%s)\n", (unsigned int)id, - abituguru3_motherboards[i].name); + "ID: %04X\n", (unsigned int)id); + +#ifdef CONFIG_DMI + if (!abituguru3_motherboards[i].dmi_name) { + printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " + "not detected using DMI. Please send the output of " + "\"dmidecode\" to the abituguru3 maintainer" + "(see MAINTAINERS)\n"); + } +#endif /* Fill the sysfs attr array */ sysfs_attr_i = 0; @@ -1109,6 +1121,46 @@ static struct platform_driver abituguru3_driver = { .resume = abituguru3_resume }; +#ifdef CONFIG_DMI + +static int __init abituguru3_dmi_detect(void) +{ + const char *board_vendor, *board_name; + int i, err = (force) ? 1 : -ENODEV; + + board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); + if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/")) + return err; + + board_name = dmi_get_system_info(DMI_BOARD_NAME); + if (!board_name) + return err; + + for (i = 0; abituguru3_motherboards[i].id; i++) { + const char *dmi_name = abituguru3_motherboards[i].dmi_name; + if (dmi_name && !strcmp(dmi_name, board_name)) + break; + } + + if (!abituguru3_motherboards[i].id) + return 1; + + return 0; +} + +#else /* !CONFIG_DMI */ + +static inline int abituguru3_dmi_detect(void) +{ + return -ENODEV; +} + +#endif /* CONFIG_DMI */ + +/* FIXME: Manual detection should die eventually; we need to collect stable + * DMI model names first before we can rely entirely on CONFIG_DMI. + */ + static int __init abituguru3_detect(void) { /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or @@ -1119,7 +1171,7 @@ static int __init abituguru3_detect(void) if (((data_val == 0x00) || (data_val == 0x08)) && ((cmd_val == 0xAC) || (cmd_val == 0x05) || (cmd_val == 0x55))) - return ABIT_UGURU3_BASE; + return 0; ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = " "0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val); @@ -1127,7 +1179,7 @@ static int __init abituguru3_detect(void) if (force) { printk(KERN_INFO ABIT_UGURU3_NAME ": Assuming Abit uGuru3 is " "present because of \"force\" parameter\n"); - return ABIT_UGURU3_BASE; + return 0; } /* No uGuru3 found */ @@ -1138,27 +1190,29 @@ static struct platform_device *abituguru3_pdev; static int __init abituguru3_init(void) { - int address, err; struct resource res = { .flags = IORESOURCE_IO }; - -#ifdef CONFIG_DMI - const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); - - /* safety check, refuse to load on non Abit motherboards */ - if (!force && (!board_vendor || - strcmp(board_vendor, "http://www.abit.com.tw/"))) - return -ENODEV; -#endif - - address = abituguru3_detect(); - if (address < 0) - return address; + int err; + + /* Attempt DMI detection first */ + err = abituguru3_dmi_detect(); + if (err < 0) + return err; + + /* Fall back to manual detection if there was no exact + * board name match, or force was specified. + */ + if (err > 0) { + err = abituguru3_detect(); + if (err) + return err; + } err = platform_driver_register(&abituguru3_driver); if (err) goto exit; - abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME, address); + abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME, + ABIT_UGURU3_BASE); if (!abituguru3_pdev) { printk(KERN_ERR ABIT_UGURU3_NAME ": Device allocation failed\n"); @@ -1166,8 +1220,8 @@ static int __init abituguru3_init(void) goto exit_driver_unregister; } - res.start = address; - res.end = address + ABIT_UGURU3_REGION_LENGTH - 1; + res.start = ABIT_UGURU3_BASE; + res.end = ABIT_UGURU3_BASE + ABIT_UGURU3_REGION_LENGTH - 1; res.name = ABIT_UGURU3_NAME; err = platform_device_add_resources(abituguru3_pdev, &res, 1); diff --git a/trunk/drivers/hwmon/adcxx.c b/trunk/drivers/hwmon/adcxx.c new file mode 100644 index 000000000000..242294db3db6 --- /dev/null +++ b/trunk/drivers/hwmon/adcxx.c @@ -0,0 +1,329 @@ +/* + * adcxx.c + * + * The adcxx4s is an AD converter family from National Semiconductor (NS). + * + * Copyright (c) 2008 Marc Pignat + * + * The adcxx4s communicates with a host processor via an SPI/Microwire Bus + * interface. This driver supports the whole family of devices with name + * ADCS, where + * * bb is the resolution in number of bits (8, 10, 12) + * * c is the number of channels (1, 2, 4, 8) + * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS + * and 101 for 1 MSPS) + * + * Complete datasheets are available at National's website here: + * http://www.national.com/ds/DC/ADCS.pdf + * + * Handling of 8, 10 and 12 bits converters are the same, the + * unavailable bits are 0 :) + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "adcxx" + +struct adcxx { + struct device *hwmon_dev; + struct mutex lock; + u32 channels; + u32 reference; /* in millivolts */ +}; + +/* sysfs hook function */ +static ssize_t adcxx_read(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct spi_device *spi = to_spi_device(dev); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct adcxx *adc = dev_get_drvdata(&spi->dev); + u8 tx_buf[2] = { attr->index << 3 }; /* other bits are don't care */ + u8 rx_buf[2]; + int status; + int value; + + if (mutex_lock_interruptible(&adc->lock)) + return -ERESTARTSYS; + + status = spi_write_then_read(spi, tx_buf, sizeof(tx_buf), + rx_buf, sizeof(rx_buf)); + if (status < 0) { + dev_warn(dev, "spi_write_then_read failed with status %d\n", + status); + goto out; + } + + value = (rx_buf[0] << 8) + rx_buf[1]; + dev_dbg(dev, "raw value = 0x%x\n", value); + + value = value * adc->reference >> 12; + status = sprintf(buf, "%d\n", value); +out: + mutex_unlock(&adc->lock); + return status; +} + +static ssize_t adcxx_show_min(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + /* The minimum reference is 0 for this chip family */ + return sprintf(buf, "0\n"); +} + +static ssize_t adcxx_show_max(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct spi_device *spi = to_spi_device(dev); + struct adcxx *adc = dev_get_drvdata(&spi->dev); + u32 reference; + + if (mutex_lock_interruptible(&adc->lock)) + return -ERESTARTSYS; + + reference = adc->reference; + + mutex_unlock(&adc->lock); + + return sprintf(buf, "%d\n", reference); +} + +static ssize_t adcxx_set_max(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct spi_device *spi = to_spi_device(dev); + struct adcxx *adc = dev_get_drvdata(&spi->dev); + unsigned long value; + + if (strict_strtoul(buf, 10, &value)) + return -EINVAL; + + if (mutex_lock_interruptible(&adc->lock)) + return -ERESTARTSYS; + + adc->reference = value; + + mutex_unlock(&adc->lock); + + return count; +} + +static ssize_t adcxx_show_name(struct device *dev, struct device_attribute + *devattr, char *buf) +{ + struct spi_device *spi = to_spi_device(dev); + struct adcxx *adc = dev_get_drvdata(&spi->dev); + + return sprintf(buf, "adcxx%ds\n", adc->channels); +} + +static struct sensor_device_attribute ad_input[] = { + SENSOR_ATTR(name, S_IRUGO, adcxx_show_name, NULL, 0), + SENSOR_ATTR(in_min, S_IRUGO, adcxx_show_min, NULL, 0), + SENSOR_ATTR(in_max, S_IWUSR | S_IRUGO, adcxx_show_max, + adcxx_set_max, 0), + SENSOR_ATTR(in0_input, S_IRUGO, adcxx_read, NULL, 0), + SENSOR_ATTR(in1_input, S_IRUGO, adcxx_read, NULL, 1), + SENSOR_ATTR(in2_input, S_IRUGO, adcxx_read, NULL, 2), + SENSOR_ATTR(in3_input, S_IRUGO, adcxx_read, NULL, 3), + SENSOR_ATTR(in4_input, S_IRUGO, adcxx_read, NULL, 4), + SENSOR_ATTR(in5_input, S_IRUGO, adcxx_read, NULL, 5), + SENSOR_ATTR(in6_input, S_IRUGO, adcxx_read, NULL, 6), + SENSOR_ATTR(in7_input, S_IRUGO, adcxx_read, NULL, 7), +}; + +/*----------------------------------------------------------------------*/ + +static int __devinit adcxx_probe(struct spi_device *spi, int channels) +{ + struct adcxx *adc; + int status; + int i; + + adc = kzalloc(sizeof *adc, GFP_KERNEL); + if (!adc) + return -ENOMEM; + + /* set a default value for the reference */ + adc->reference = 3300; + adc->channels = channels; + mutex_init(&adc->lock); + + mutex_lock(&adc->lock); + + dev_set_drvdata(&spi->dev, adc); + + for (i = 0; i < 3 + adc->channels; i++) { + status = device_create_file(&spi->dev, &ad_input[i].dev_attr); + if (status) { + dev_err(&spi->dev, "device_create_file failed.\n"); + goto out_err; + } + } + + adc->hwmon_dev = hwmon_device_register(&spi->dev); + if (IS_ERR(adc->hwmon_dev)) { + dev_err(&spi->dev, "hwmon_device_register failed.\n"); + status = PTR_ERR(adc->hwmon_dev); + goto out_err; + } + + mutex_unlock(&adc->lock); + return 0; + +out_err: + for (i--; i >= 0; i--) + device_remove_file(&spi->dev, &ad_input[i].dev_attr); + + dev_set_drvdata(&spi->dev, NULL); + mutex_unlock(&adc->lock); + kfree(adc); + return status; +} + +static int __devinit adcxx1s_probe(struct spi_device *spi) +{ + return adcxx_probe(spi, 1); +} + +static int __devinit adcxx2s_probe(struct spi_device *spi) +{ + return adcxx_probe(spi, 2); +} + +static int __devinit adcxx4s_probe(struct spi_device *spi) +{ + return adcxx_probe(spi, 4); +} + +static int __devinit adcxx8s_probe(struct spi_device *spi) +{ + return adcxx_probe(spi, 8); +} + +static int __devexit adcxx_remove(struct spi_device *spi) +{ + struct adcxx *adc = dev_get_drvdata(&spi->dev); + int i; + + mutex_lock(&adc->lock); + hwmon_device_unregister(adc->hwmon_dev); + for (i = 0; i < 3 + adc->channels; i++) + device_remove_file(&spi->dev, &ad_input[i].dev_attr); + + dev_set_drvdata(&spi->dev, NULL); + mutex_unlock(&adc->lock); + kfree(adc); + + return 0; +} + +static struct spi_driver adcxx1s_driver = { + .driver = { + .name = "adcxx1s", + .owner = THIS_MODULE, + }, + .probe = adcxx1s_probe, + .remove = __devexit_p(adcxx_remove), +}; + +static struct spi_driver adcxx2s_driver = { + .driver = { + .name = "adcxx2s", + .owner = THIS_MODULE, + }, + .probe = adcxx2s_probe, + .remove = __devexit_p(adcxx_remove), +}; + +static struct spi_driver adcxx4s_driver = { + .driver = { + .name = "adcxx4s", + .owner = THIS_MODULE, + }, + .probe = adcxx4s_probe, + .remove = __devexit_p(adcxx_remove), +}; + +static struct spi_driver adcxx8s_driver = { + .driver = { + .name = "adcxx8s", + .owner = THIS_MODULE, + }, + .probe = adcxx8s_probe, + .remove = __devexit_p(adcxx_remove), +}; + +static int __init init_adcxx(void) +{ + int status; + status = spi_register_driver(&adcxx1s_driver); + if (status) + goto reg_1_failed; + + status = spi_register_driver(&adcxx2s_driver); + if (status) + goto reg_2_failed; + + status = spi_register_driver(&adcxx4s_driver); + if (status) + goto reg_4_failed; + + status = spi_register_driver(&adcxx8s_driver); + if (status) + goto reg_8_failed; + + return status; + +reg_8_failed: + spi_unregister_driver(&adcxx4s_driver); +reg_4_failed: + spi_unregister_driver(&adcxx2s_driver); +reg_2_failed: + spi_unregister_driver(&adcxx1s_driver); +reg_1_failed: + return status; +} + +static void __exit exit_adcxx(void) +{ + spi_unregister_driver(&adcxx1s_driver); + spi_unregister_driver(&adcxx2s_driver); + spi_unregister_driver(&adcxx4s_driver); + spi_unregister_driver(&adcxx8s_driver); +} + +module_init(init_adcxx); +module_exit(exit_adcxx); + +MODULE_AUTHOR("Marc Pignat"); +MODULE_DESCRIPTION("National Semiconductor adcxx8sxxx Linux driver"); +MODULE_LICENSE("GPL"); + +MODULE_ALIAS("adcxx1s"); +MODULE_ALIAS("adcxx2s"); +MODULE_ALIAS("adcxx4s"); +MODULE_ALIAS("adcxx8s"); diff --git a/trunk/drivers/hwmon/applesmc.c b/trunk/drivers/hwmon/applesmc.c index aacc0c4b809c..b06b8e090a27 100644 --- a/trunk/drivers/hwmon/applesmc.c +++ b/trunk/drivers/hwmon/applesmc.c @@ -98,6 +98,12 @@ static const char* temperature_sensors_sets[][36] = { "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", NULL }, +/* Set 5: iMac */ + { "TC0D", "TA0P", "TG0P", "TG0D", "TG0H", "TH0P", "Tm0P", "TO0P", + "Tp0C", NULL }, +/* Set 6: Macbook3 set */ + { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TTF0", "TW0P", "Th0H", + "Th0S", "Th1H", NULL }, }; /* List of keys used to read/write fan speeds */ @@ -1223,6 +1229,10 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { { .accelerometer = 0, .light = 0, .temperature_set = 3 }, /* MacPro: temperature set 4 */ { .accelerometer = 0, .light = 0, .temperature_set = 4 }, +/* iMac: temperature set 5 */ + { .accelerometer = 0, .light = 0, .temperature_set = 5 }, +/* MacBook3: accelerometer and temperature set 6 */ + { .accelerometer = 1, .light = 0, .temperature_set = 6 }, }; /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". @@ -1232,10 +1242,14 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") }, (void*)&applesmc_dmi_data[0]}, - { applesmc_dmi_match, "Apple MacBook", { + { applesmc_dmi_match, "Apple MacBook (v2)", { DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), DMI_MATCH(DMI_PRODUCT_NAME,"MacBook2") }, (void*)&applesmc_dmi_data[1]}, + { applesmc_dmi_match, "Apple MacBook (v3)", { + DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), + DMI_MATCH(DMI_PRODUCT_NAME,"MacBook3") }, + (void*)&applesmc_dmi_data[6]}, { applesmc_dmi_match, "Apple MacBook", { DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") }, @@ -1248,6 +1262,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, (void*)&applesmc_dmi_data[4]}, + { applesmc_dmi_match, "Apple iMac", { + DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), + DMI_MATCH(DMI_PRODUCT_NAME,"iMac") }, + (void*)&applesmc_dmi_data[5]}, { .ident = NULL } }; diff --git a/trunk/drivers/hwmon/coretemp.c b/trunk/drivers/hwmon/coretemp.c index 70239acecc8e..93c17223b527 100644 --- a/trunk/drivers/hwmon/coretemp.c +++ b/trunk/drivers/hwmon/coretemp.c @@ -413,10 +413,11 @@ static int __init coretemp_init(void) for_each_online_cpu(i) { struct cpuinfo_x86 *c = &cpu_data(i); - /* check if family 6, models 0xe, 0xf, 0x16, 0x17 */ + /* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A */ if ((c->cpuid_level < 0) || (c->x86 != 0x6) || !((c->x86_model == 0xe) || (c->x86_model == 0xf) || - (c->x86_model == 0x16) || (c->x86_model == 0x17))) { + (c->x86_model == 0x16) || (c->x86_model == 0x17) || + (c->x86_model == 0x1A))) { /* supported CPU not found, but report the unknown family 6 CPU */ diff --git a/trunk/drivers/hwmon/i5k_amb.c b/trunk/drivers/hwmon/i5k_amb.c index f9e2ed621f7b..2ede9388096b 100644 --- a/trunk/drivers/hwmon/i5k_amb.c +++ b/trunk/drivers/hwmon/i5k_amb.c @@ -81,6 +81,8 @@ static unsigned long amb_reg_temp(unsigned int amb) #define MAX_AMBS_PER_CHANNEL 16 #define MAX_AMBS (MAX_MEM_CHANNELS * \ MAX_AMBS_PER_CHANNEL) +#define CHANNEL_SHIFT 4 +#define DIMM_MASK 0xF /* * Ugly hack: For some reason the highest bit is set if there * are _any_ DIMMs in the channel. Attempting to read from @@ -89,7 +91,7 @@ static unsigned long amb_reg_temp(unsigned int amb) * might prevent us from seeing the 16th DIMM in the channel. */ #define REAL_MAX_AMBS_PER_CHANNEL 15 -#define KNOBS_PER_AMB 5 +#define KNOBS_PER_AMB 6 static unsigned long amb_num_from_reg(unsigned int byte_num, unsigned int bit) { @@ -238,6 +240,16 @@ static ssize_t show_amb_temp(struct device *dev, 500 * amb_read_byte(data, amb_reg_temp(attr->index))); } +static ssize_t show_label(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + return sprintf(buf, "Ch. %d DIMM %d\n", attr->index >> CHANNEL_SHIFT, + attr->index & DIMM_MASK); +} + static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) { int i, j, k, d = 0; @@ -268,6 +280,20 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) continue; d++; + /* sysfs label */ + iattr = data->attrs + data->num_attrs; + snprintf(iattr->name, AMB_SYSFS_NAME_LEN, + "temp%d_label", d); + iattr->s_attr.dev_attr.attr.name = iattr->name; + iattr->s_attr.dev_attr.attr.mode = S_IRUGO; + iattr->s_attr.dev_attr.show = show_label; + iattr->s_attr.index = k; + res = device_create_file(&pdev->dev, + &iattr->s_attr.dev_attr); + if (res) + goto exit_remove; + data->num_attrs++; + /* Temperature sysfs knob */ iattr = data->attrs + data->num_attrs; snprintf(iattr->name, AMB_SYSFS_NAME_LEN, diff --git a/trunk/drivers/hwmon/ibmaem.c b/trunk/drivers/hwmon/ibmaem.c index c9416e657487..0f70dc204105 100644 --- a/trunk/drivers/hwmon/ibmaem.c +++ b/trunk/drivers/hwmon/ibmaem.c @@ -1,6 +1,6 @@ /* - * A hwmon driver for the IBM Active Energy Manager temperature/power sensors - * and capping functionality. + * A hwmon driver for the IBM System Director Active Energy Manager (AEM) + * temperature/power/energy sensors and capping functionality. * Copyright (C) 2008 IBM * * Author: Darrick J. Wong @@ -463,12 +463,18 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg, } /* Update AEM energy registers */ +static void update_aem_energy_one(struct aem_data *data, int which) +{ + aem_read_sensor(data, AEM_ENERGY_ELEMENT, which, + &data->energy[which], 8); +} + static void update_aem_energy(struct aem_data *data) { - aem_read_sensor(data, AEM_ENERGY_ELEMENT, 0, &data->energy[0], 8); + update_aem_energy_one(data, 0); if (data->ver_major < 2) return; - aem_read_sensor(data, AEM_ENERGY_ELEMENT, 1, &data->energy[1], 8); + update_aem_energy_one(data, 1); } /* Update all AEM1 sensors */ @@ -676,7 +682,8 @@ static int aem_find_aem2(struct aem_ipmi_data *data, return -ETIMEDOUT; if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) || - memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id))) + memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)) || + fi_resp->num_instances <= instance_num) return -ENOENT; return 0; @@ -849,7 +856,7 @@ static ssize_t aem_show_power(struct device *dev, struct timespec b, a; mutex_lock(&data->lock); - update_aem_energy(data); + update_aem_energy_one(data, attr->index); getnstimeofday(&b); before = data->energy[attr->index]; @@ -861,7 +868,7 @@ static ssize_t aem_show_power(struct device *dev, return 0; } - update_aem_energy(data); + update_aem_energy_one(data, attr->index); getnstimeofday(&a); after = data->energy[attr->index]; mutex_unlock(&data->lock); @@ -880,7 +887,9 @@ static ssize_t aem_show_energy(struct device *dev, { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct aem_data *a = dev_get_drvdata(dev); - a->update(a); + mutex_lock(&a->lock); + update_aem_energy_one(a, attr->index); + mutex_unlock(&a->lock); return sprintf(buf, "%llu\n", (unsigned long long)a->energy[attr->index] * 1000); @@ -1104,7 +1113,7 @@ static void __exit aem_exit(void) } MODULE_AUTHOR("Darrick J. Wong "); -MODULE_DESCRIPTION("IBM Active Energy Manager power/temp sensor driver"); +MODULE_DESCRIPTION("IBM AEM power/temp/energy sensor driver"); MODULE_LICENSE("GPL"); module_init(aem_init); diff --git a/trunk/drivers/hwmon/w83791d.c b/trunk/drivers/hwmon/w83791d.c index daa7d121483b..de21142d106c 100644 --- a/trunk/drivers/hwmon/w83791d.c +++ b/trunk/drivers/hwmon/w83791d.c @@ -1055,9 +1055,10 @@ static int w83791d_probe(struct i2c_client *client, { struct w83791d_data *data; struct device *dev = &client->dev; - int i, val1, err; + int i, err; #ifdef DEBUG + int val1; val1 = w83791d_read(client, W83791D_REG_DID_VID4); dev_dbg(dev, "Device ID version: %d.%d (0x%02x)\n", (val1 >> 5) & 0x07, (val1 >> 1) & 0x0f, val1); diff --git a/trunk/drivers/spi/spi.c b/trunk/drivers/spi/spi.c index 964124b60db2..75e86865234c 100644 --- a/trunk/drivers/spi/spi.c +++ b/trunk/drivers/spi/spi.c @@ -226,10 +226,11 @@ EXPORT_SYMBOL_GPL(spi_alloc_device); * Companion function to spi_alloc_device. Devices allocated with * spi_alloc_device can be added onto the spi bus with this function. * - * Returns 0 on success; non-zero on failure + * Returns 0 on success; negative errno on failure */ int spi_add_device(struct spi_device *spi) { + static DEFINE_MUTEX(spi_add_lock); struct device *dev = spi->master->dev.parent; int status; @@ -246,26 +247,43 @@ int spi_add_device(struct spi_device *spi) "%s.%u", spi->master->dev.bus_id, spi->chip_select); - /* drivers may modify this initial i/o setup */ + + /* We need to make sure there's no other device with this + * chipselect **BEFORE** we call setup(), else we'll trash + * its configuration. Lock against concurrent add() calls. + */ + mutex_lock(&spi_add_lock); + + if (bus_find_device_by_name(&spi_bus_type, NULL, spi->dev.bus_id) + != NULL) { + dev_err(dev, "chipselect %d already in use\n", + spi->chip_select); + status = -EBUSY; + goto done; + } + + /* Drivers may modify this initial i/o setup, but will + * normally rely on the device being setup. Devices + * using SPI_CS_HIGH can't coexist well otherwise... + */ status = spi->master->setup(spi); if (status < 0) { dev_err(dev, "can't %s %s, status %d\n", "setup", spi->dev.bus_id, status); - return status; + goto done; } - /* driver core catches callers that misbehave by defining - * devices that already exist. - */ + /* Device may be bound to an active driver when this returns */ status = device_add(&spi->dev); - if (status < 0) { + if (status < 0) dev_err(dev, "can't %s %s, status %d\n", "add", spi->dev.bus_id, status); - return status; - } + else + dev_dbg(dev, "registered child %s\n", spi->dev.bus_id); - dev_dbg(dev, "registered child %s\n", spi->dev.bus_id); - return 0; +done: + mutex_unlock(&spi_add_lock); + return status; } EXPORT_SYMBOL_GPL(spi_add_device); diff --git a/trunk/drivers/video/fsl-diu-fb.c b/trunk/drivers/video/fsl-diu-fb.c index bd320a2bfb7c..fb51197d1c98 100644 --- a/trunk/drivers/video/fsl-diu-fb.c +++ b/trunk/drivers/video/fsl-diu-fb.c @@ -479,6 +479,10 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var, base_plane_width = machine_data->fsl_diu_info[0]->var.xres; base_plane_height = machine_data->fsl_diu_info[0]->var.yres; + if (mfbi->x_aoi_d < 0) + mfbi->x_aoi_d = 0; + if (mfbi->y_aoi_d < 0) + mfbi->y_aoi_d = 0; switch (index) { case 0: if (mfbi->x_aoi_d != 0) @@ -777,6 +781,22 @@ static void unmap_video_memory(struct fb_info *info) info->fix.smem_len = 0; } +/* + * Using the fb_var_screeninfo in fb_info we set the aoi of this + * particular framebuffer. It is a light version of fsl_diu_set_par. + */ +static int fsl_diu_set_aoi(struct fb_info *info) +{ + struct fb_var_screeninfo *var = &info->var; + struct mfb_info *mfbi = info->par; + struct diu_ad *ad = mfbi->ad; + + /* AOI should not be greater than display size */ + ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset); + ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d); + return 0; +} + /* * Using the fb_var_screeninfo in fb_info we set the resolution of this * particular framebuffer. This function alters the fb_fix_screeninfo stored @@ -817,11 +837,11 @@ static int fsl_diu_set_par(struct fb_info *info) diu_ops.get_pixel_format(var->bits_per_pixel, machine_data->monitor_port); ad->addr = cpu_to_le32(info->fix.smem_start); - ad->src_size_g_alpha = cpu_to_le32((var->yres << 12) | - var->xres) | mfbi->g_alpha; - /* fix me. AOI should not be greater than display size */ + ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) | + var->xres_virtual) | mfbi->g_alpha; + /* AOI should not be greater than display size */ ad->aoi_size = cpu_to_le32((var->yres << 16) | var->xres); - ad->offset_xyi = 0; + ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset); ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d); /* Disable chroma keying function */ @@ -921,6 +941,8 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var, else info->var.vmode &= ~FB_VMODE_YWRAP; + fsl_diu_set_aoi(info); + return 0; } @@ -989,7 +1011,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd, pr_debug("set AOI display offset of index %d to (%d,%d)\n", mfbi->index, aoi_d.x_aoi_d, aoi_d.y_aoi_d); fsl_diu_check_var(&info->var, info); - fsl_diu_set_par(info); + fsl_diu_set_aoi(info); break; case MFB_GET_AOID: aoi_d.x_aoi_d = mfbi->x_aoi_d; diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index b6726f644530..0487ddba1397 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -166,6 +166,7 @@ static struct inode *alloc_inode(struct super_block *sb) mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE); mapping->assoc_mapping = NULL; mapping->backing_dev_info = &default_backing_dev_info; + mapping->writeback_index = 0; /* * If the block_device provides a backing_dev_info for client diff --git a/trunk/fs/omfs/bitmap.c b/trunk/fs/omfs/bitmap.c index 697663b01bae..e1c0ec0ae989 100644 --- a/trunk/fs/omfs/bitmap.c +++ b/trunk/fs/omfs/bitmap.c @@ -92,7 +92,7 @@ int omfs_allocate_block(struct super_block *sb, u64 block) struct buffer_head *bh; struct omfs_sb_info *sbi = OMFS_SB(sb); int bits_per_entry = 8 * sb->s_blocksize; - int map, bit; + unsigned int map, bit; int ret = 0; u64 tmp; @@ -176,7 +176,8 @@ int omfs_clear_range(struct super_block *sb, u64 block, int count) struct omfs_sb_info *sbi = OMFS_SB(sb); int bits_per_entry = 8 * sb->s_blocksize; u64 tmp; - int map, bit, ret; + unsigned int map, bit; + int ret; tmp = block; bit = do_div(tmp, bits_per_entry); diff --git a/trunk/fs/omfs/file.c b/trunk/fs/omfs/file.c index 7e2499053e4d..834b2331f6b3 100644 --- a/trunk/fs/omfs/file.c +++ b/trunk/fs/omfs/file.c @@ -26,6 +26,13 @@ static int omfs_sync_file(struct file *file, struct dentry *dentry, return err ? -EIO : 0; } +static u32 omfs_max_extents(struct omfs_sb_info *sbi, int offset) +{ + return (sbi->s_sys_blocksize - offset - + sizeof(struct omfs_extent)) / + sizeof(struct omfs_extent_entry) + 1; +} + void omfs_make_empty_table(struct buffer_head *bh, int offset) { struct omfs_extent *oe = (struct omfs_extent *) &bh->b_data[offset]; @@ -45,6 +52,7 @@ int omfs_shrink_inode(struct inode *inode) struct buffer_head *bh; u64 next, last; u32 extent_count; + u32 max_extents; int ret; /* traverse extent table, freeing each entry that is greater @@ -62,15 +70,18 @@ int omfs_shrink_inode(struct inode *inode) goto out; oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]); + max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START); for (;;) { - if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next)) { - brelse(bh); - goto out; - } + if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next)) + goto out_brelse; extent_count = be32_to_cpu(oe->e_extent_count); + + if (extent_count > max_extents) + goto out_brelse; + last = next; next = be64_to_cpu(oe->e_next); entry = &oe->e_entry; @@ -98,10 +109,14 @@ int omfs_shrink_inode(struct inode *inode) if (!bh) goto out; oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]); + max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT); } ret = 0; out: return ret; +out_brelse: + brelse(bh); + return ret; } static void omfs_truncate(struct inode *inode) @@ -154,9 +169,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe, goto out; } } - max_count = (sbi->s_sys_blocksize - OMFS_EXTENT_START - - sizeof(struct omfs_extent)) / - sizeof(struct omfs_extent_entry) + 1; + max_count = omfs_max_extents(sbi, OMFS_EXTENT_START); /* TODO: add a continuation block here */ if (be32_to_cpu(oe->e_extent_count) > max_count-1) @@ -225,6 +238,7 @@ static int omfs_get_block(struct inode *inode, sector_t block, sector_t next, offset; int ret; u64 new_block; + u32 max_extents; int extent_count; struct omfs_extent *oe; struct omfs_extent_entry *entry; @@ -238,6 +252,7 @@ static int omfs_get_block(struct inode *inode, sector_t block, goto out; oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]); + max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START); next = inode->i_ino; for (;;) { @@ -249,6 +264,9 @@ static int omfs_get_block(struct inode *inode, sector_t block, next = be64_to_cpu(oe->e_next); entry = &oe->e_entry; + if (extent_count > max_extents) + goto out_brelse; + offset = find_block(inode, entry, block, extent_count, &remain); if (offset > 0) { ret = 0; @@ -266,6 +284,7 @@ static int omfs_get_block(struct inode *inode, sector_t block, if (!bh) goto out; oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]); + max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT); } if (create) { ret = omfs_grow_extent(inode, oe, &new_block); diff --git a/trunk/fs/omfs/inode.c b/trunk/fs/omfs/inode.c index a95fe5984f4b..d29047b1b9b0 100644 --- a/trunk/fs/omfs/inode.c +++ b/trunk/fs/omfs/inode.c @@ -232,8 +232,7 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino) inode->i_mode = S_IFDIR | (S_IRWXUGO & ~sbi->s_dmask); inode->i_op = &omfs_dir_inops; inode->i_fop = &omfs_dir_operations; - inode->i_size = be32_to_cpu(oi->i_head.h_body_size) + - sizeof(struct omfs_header); + inode->i_size = sbi->s_sys_blocksize; inc_nlink(inode); break; case OMFS_FILE: diff --git a/trunk/include/asm-mips/kexec.h b/trunk/include/asm-mips/kexec.h index cdbab43b7d3a..4314892aaebb 100644 --- a/trunk/include/asm-mips/kexec.h +++ b/trunk/include/asm-mips/kexec.h @@ -16,7 +16,7 @@ /* Maximum address we can use for the control code buffer */ #define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000) -#define KEXEC_CONTROL_CODE_SIZE 4096 +#define KEXEC_CONTROL_PAGE_SIZE 4096 /* The native architecture */ #define KEXEC_ARCH KEXEC_ARCH_MIPS diff --git a/trunk/include/asm-x86/kexec.h b/trunk/include/asm-x86/kexec.h index c0e52a14fd4d..4246ab7dc988 100644 --- a/trunk/include/asm-x86/kexec.h +++ b/trunk/include/asm-x86/kexec.h @@ -41,6 +41,10 @@ # define PAGES_NR 17 #endif +#ifdef CONFIG_X86_32 +# define KEXEC_CONTROL_CODE_MAX_SIZE 2048 +#endif + #ifndef __ASSEMBLY__ #include @@ -63,7 +67,7 @@ /* Maximum address we can use for the control code buffer */ # define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE -# define KEXEC_CONTROL_CODE_SIZE 4096 +# define KEXEC_CONTROL_PAGE_SIZE 4096 /* The native architecture */ # define KEXEC_ARCH KEXEC_ARCH_386 @@ -79,7 +83,7 @@ # define KEXEC_CONTROL_MEMORY_LIMIT (0xFFFFFFFFFFUL) /* Allocate one page for the pdp and the second for the code */ -# define KEXEC_CONTROL_CODE_SIZE (4096UL + 4096UL) +# define KEXEC_CONTROL_PAGE_SIZE (4096UL + 4096UL) /* The native architecture */ # define KEXEC_ARCH KEXEC_ARCH_X86_64 diff --git a/trunk/include/linux/completion.h b/trunk/include/linux/completion.h index 57faa60de9bd..02ef8835999c 100644 --- a/trunk/include/linux/completion.h +++ b/trunk/include/linux/completion.h @@ -49,6 +49,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); extern unsigned long wait_for_completion_interruptible_timeout( struct completion *x, unsigned long timeout); +extern bool try_wait_for_completion(struct completion *x); +extern bool completion_done(struct completion *x); extern void complete(struct completion *); extern void complete_all(struct completion *); @@ -56,48 +58,4 @@ extern void complete_all(struct completion *); #define INIT_COMPLETION(x) ((x).done = 0) -/** - * try_wait_for_completion - try to decrement a completion without blocking - * @x: completion structure - * - * Returns: 0 if a decrement cannot be done without blocking - * 1 if a decrement succeeded. - * - * If a completion is being used as a counting completion, - * attempt to decrement the counter without blocking. This - * enables us to avoid waiting if the resource the completion - * is protecting is not available. - */ -static inline bool try_wait_for_completion(struct completion *x) -{ - int ret = 1; - - spin_lock_irq(&x->wait.lock); - if (!x->done) - ret = 0; - else - x->done--; - spin_unlock_irq(&x->wait.lock); - return ret; -} - -/** - * completion_done - Test to see if a completion has any waiters - * @x: completion structure - * - * Returns: 0 if there are waiters (wait_for_completion() in progress) - * 1 if there are no waiters. - * - */ -static inline bool completion_done(struct completion *x) -{ - int ret = 1; - - spin_lock_irq(&x->wait.lock); - if (!x->done) - ret = 0; - spin_unlock_irq(&x->wait.lock); - return ret; -} - #endif diff --git a/trunk/include/linux/ftrace.h b/trunk/include/linux/ftrace.h index f368d041e02d..bb384068272e 100644 --- a/trunk/include/linux/ftrace.h +++ b/trunk/include/linux/ftrace.h @@ -98,6 +98,27 @@ static inline void tracer_disable(void) #endif } +/* Ftrace disable/restore without lock. Some synchronization mechanism + * must be used to prevent ftrace_enabled to be changed between + * disable/restore. */ +static inline int __ftrace_enabled_save(void) +{ +#ifdef CONFIG_FTRACE + int saved_ftrace_enabled = ftrace_enabled; + ftrace_enabled = 0; + return saved_ftrace_enabled; +#else + return 0; +#endif +} + +static inline void __ftrace_enabled_restore(int enabled) +{ +#ifdef CONFIG_FTRACE + ftrace_enabled = enabled; +#endif +} + #ifdef CONFIG_FRAME_POINTER /* TODO: need to fix this for ARM */ # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) diff --git a/trunk/include/linux/kexec.h b/trunk/include/linux/kexec.h index 32110cede64f..17f76fc05173 100644 --- a/trunk/include/linux/kexec.h +++ b/trunk/include/linux/kexec.h @@ -25,8 +25,8 @@ #error KEXEC_CONTROL_MEMORY_LIMIT not defined #endif -#ifndef KEXEC_CONTROL_CODE_SIZE -#error KEXEC_CONTROL_CODE_SIZE not defined +#ifndef KEXEC_CONTROL_PAGE_SIZE +#error KEXEC_CONTROL_PAGE_SIZE not defined #endif #ifndef KEXEC_ARCH diff --git a/trunk/include/linux/reboot.h b/trunk/include/linux/reboot.h index b93b541cf111..988e55fe649b 100644 --- a/trunk/include/linux/reboot.h +++ b/trunk/include/linux/reboot.h @@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *); * Architecture independent implemenations of sys_reboot commands. */ +extern void kernel_restart_prepare(char *cmd); extern void kernel_restart(char *cmd); extern void kernel_halt(void); extern void kernel_power_off(void); diff --git a/trunk/include/linux/suspend.h b/trunk/include/linux/suspend.h index c63435095970..2ce8207686e2 100644 --- a/trunk/include/linux/suspend.h +++ b/trunk/include/linux/suspend.h @@ -217,11 +217,11 @@ struct platform_hibernation_ops { #ifdef CONFIG_HIBERNATION /* kernel/power/snapshot.c */ extern void __register_nosave_region(unsigned long b, unsigned long e, int km); -static inline void register_nosave_region(unsigned long b, unsigned long e) +static inline void __init register_nosave_region(unsigned long b, unsigned long e) { __register_nosave_region(b, e, 0); } -static inline void register_nosave_region_late(unsigned long b, unsigned long e) +static inline void __init register_nosave_region_late(unsigned long b, unsigned long e) { __register_nosave_region(b, e, 1); } diff --git a/trunk/kernel/kexec.c b/trunk/kernel/kexec.c index c8a4370e2a34..59f3f0df35d4 100644 --- a/trunk/kernel/kexec.c +++ b/trunk/kernel/kexec.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -77,7 +77,7 @@ int kexec_should_crash(struct task_struct *p) * * The code for the transition from the current kernel to the * the new kernel is placed in the control_code_buffer, whose size - * is given by KEXEC_CONTROL_CODE_SIZE. In the best case only a single + * is given by KEXEC_CONTROL_PAGE_SIZE. In the best case only a single * page of memory is necessary, but some architectures require more. * Because this memory must be identity mapped in the transition from * virtual to physical addresses it must live in the range @@ -242,7 +242,7 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry, */ result = -ENOMEM; image->control_code_page = kimage_alloc_control_pages(image, - get_order(KEXEC_CONTROL_CODE_SIZE)); + get_order(KEXEC_CONTROL_PAGE_SIZE)); if (!image->control_code_page) { printk(KERN_ERR "Could not allocate control_code_buffer\n"); goto out; @@ -317,7 +317,7 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry, */ result = -ENOMEM; image->control_code_page = kimage_alloc_control_pages(image, - get_order(KEXEC_CONTROL_CODE_SIZE)); + get_order(KEXEC_CONTROL_PAGE_SIZE)); if (!image->control_code_page) { printk(KERN_ERR "Could not allocate control_code_buffer\n"); goto out; @@ -924,19 +924,14 @@ static int kimage_load_segment(struct kimage *image, */ struct kimage *kexec_image; struct kimage *kexec_crash_image; -/* - * A home grown binary mutex. - * Nothing can wait so this mutex is safe to use - * in interrupt context :) - */ -static int kexec_lock; + +static DEFINE_MUTEX(kexec_mutex); asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, struct kexec_segment __user *segments, unsigned long flags) { struct kimage **dest_image, *image; - int locked; int result; /* We only trust the superuser with rebooting the system. */ @@ -972,8 +967,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, * * KISS: always take the mutex. */ - locked = xchg(&kexec_lock, 1); - if (locked) + if (!mutex_trylock(&kexec_mutex)) return -EBUSY; dest_image = &kexec_image; @@ -1015,8 +1009,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, image = xchg(dest_image, image); out: - locked = xchg(&kexec_lock, 0); /* Release the mutex */ - BUG_ON(!locked); + mutex_unlock(&kexec_mutex); kimage_free(image); return result; @@ -1063,10 +1056,7 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, void crash_kexec(struct pt_regs *regs) { - int locked; - - - /* Take the kexec_lock here to prevent sys_kexec_load + /* Take the kexec_mutex here to prevent sys_kexec_load * running on one cpu from replacing the crash kernel * we are using after a panic on a different cpu. * @@ -1074,8 +1064,7 @@ void crash_kexec(struct pt_regs *regs) * of memory the xchg(&kexec_crash_image) would be * sufficient. But since I reuse the memory... */ - locked = xchg(&kexec_lock, 1); - if (!locked) { + if (mutex_trylock(&kexec_mutex)) { if (kexec_crash_image) { struct pt_regs fixed_regs; crash_setup_regs(&fixed_regs, regs); @@ -1083,8 +1072,7 @@ void crash_kexec(struct pt_regs *regs) machine_crash_shutdown(&fixed_regs); machine_kexec(kexec_crash_image); } - locked = xchg(&kexec_lock, 0); - BUG_ON(!locked); + mutex_unlock(&kexec_mutex); } } @@ -1426,25 +1414,23 @@ static int __init crash_save_vmcoreinfo_init(void) module_init(crash_save_vmcoreinfo_init) -/** - * kernel_kexec - reboot the system - * - * Move into place and start executing a preloaded standalone - * executable. If nothing was preloaded return an error. +/* + * Move into place and start executing a preloaded standalone + * executable. If nothing was preloaded return an error. */ int kernel_kexec(void) { int error = 0; - if (xchg(&kexec_lock, 1)) + if (!mutex_trylock(&kexec_mutex)) return -EBUSY; if (!kexec_image) { error = -EINVAL; goto Unlock; } - if (kexec_image->preserve_context) { #ifdef CONFIG_KEXEC_JUMP + if (kexec_image->preserve_context) { mutex_lock(&pm_mutex); pm_prepare_console(); error = freeze_processes(); @@ -1459,6 +1445,7 @@ int kernel_kexec(void) error = disable_nonboot_cpus(); if (error) goto Resume_devices; + device_pm_lock(); local_irq_disable(); /* At this point, device_suspend() has been called, * but *not* device_power_down(). We *must* @@ -1470,26 +1457,22 @@ int kernel_kexec(void) error = device_power_down(PMSG_FREEZE); if (error) goto Enable_irqs; - save_processor_state(); + } else #endif - } else { - blocking_notifier_call_chain(&reboot_notifier_list, - SYS_RESTART, NULL); - system_state = SYSTEM_RESTART; - device_shutdown(); - sysdev_shutdown(); + { + kernel_restart_prepare(NULL); printk(KERN_EMERG "Starting new kernel\n"); machine_shutdown(); } machine_kexec(kexec_image); - if (kexec_image->preserve_context) { #ifdef CONFIG_KEXEC_JUMP - restore_processor_state(); + if (kexec_image->preserve_context) { device_power_up(PMSG_RESTORE); Enable_irqs: local_irq_enable(); + device_pm_unlock(); enable_nonboot_cpus(); Resume_devices: device_resume(PMSG_RESTORE); @@ -1499,11 +1482,10 @@ int kernel_kexec(void) Restore_console: pm_restore_console(); mutex_unlock(&pm_mutex); -#endif } +#endif Unlock: - xchg(&kexec_lock, 0); - + mutex_unlock(&kexec_mutex); return error; } diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index d601fb0406ca..95e6ad3c231d 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -4669,6 +4669,52 @@ int __sched wait_for_completion_killable(struct completion *x) } EXPORT_SYMBOL(wait_for_completion_killable); +/** + * try_wait_for_completion - try to decrement a completion without blocking + * @x: completion structure + * + * Returns: 0 if a decrement cannot be done without blocking + * 1 if a decrement succeeded. + * + * If a completion is being used as a counting completion, + * attempt to decrement the counter without blocking. This + * enables us to avoid waiting if the resource the completion + * is protecting is not available. + */ +bool try_wait_for_completion(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + else + x->done--; + spin_unlock_irq(&x->wait.lock); + return ret; +} +EXPORT_SYMBOL(try_wait_for_completion); + +/** + * completion_done - Test to see if a completion has any waiters + * @x: completion structure + * + * Returns: 0 if there are waiters (wait_for_completion() in progress) + * 1 if there are no waiters. + * + */ +bool completion_done(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + spin_unlock_irq(&x->wait.lock); + return ret; +} +EXPORT_SYMBOL(completion_done); + static long __sched sleep_on_common(wait_queue_head_t *q, int state, long timeout) { diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index c01858090a98..3dacb00a7f76 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -274,7 +274,7 @@ void emergency_restart(void) } EXPORT_SYMBOL_GPL(emergency_restart); -static void kernel_restart_prepare(char *cmd) +void kernel_restart_prepare(char *cmd) { blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); system_state = SYSTEM_RESTART; diff --git a/trunk/mm/bootmem.c b/trunk/mm/bootmem.c index 4af15d0340ad..e023c68b0255 100644 --- a/trunk/mm/bootmem.c +++ b/trunk/mm/bootmem.c @@ -473,7 +473,7 @@ static void * __init alloc_bootmem_core(struct bootmem_data *bdata, goto find_block; } - if (bdata->last_end_off && + if (bdata->last_end_off & (PAGE_SIZE - 1) && PFN_DOWN(bdata->last_end_off) + 1 == sidx) start_off = ALIGN(bdata->last_end_off, align); else