]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge git://oss.sgi.com:8090/xfs/linux-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Aug 2008 22:17:49 +0000 (15:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Aug 2008 22:17:49 +0000 (15:17 -0700)
* git://oss.sgi.com:8090/xfs/linux-2.6: (45 commits)
  [XFS] Fix use after free in xfs_log_done().
  [XFS] Make xfs_bmap_*_count_leaves void.
  [XFS] Use KM_NOFS for debug trace buffers
  [XFS] use KM_MAYFAIL in xfs_mountfs
  [XFS] refactor xfs_mount_free
  [XFS] don't call xfs_freesb from xfs_unmountfs
  [XFS] xfs_unmountfs should return void
  [XFS] cleanup xfs_mountfs
  [XFS] move root inode IRELE into xfs_unmountfs
  [XFS] stop using file_update_time
  [XFS] optimize xfs_ichgtime
  [XFS] update timestamp in xfs_ialloc manually
  [XFS] remove the sema_t from XFS.
  [XFS] replace dquot flush semaphore with a completion
  [XFS] replace inode flush semaphore with a completion
  [XFS] extend completions to provide XFS object flush requirements
  [XFS] replace the XFS buf iodone semaphore with a completion
  [XFS] clean up stale references to semaphores
  [XFS] use get_unaligned_* helpers
  [XFS] Fix compile failure in xfs_buf_trace()
  ...

246 files changed:
Documentation/DocBook/Makefile
Documentation/DocBook/procfs_example.c
Documentation/Makefile [new file with mode: 0644]
Documentation/accounting/Makefile [new file with mode: 0644]
Documentation/accounting/getdelays.c
Documentation/auxdisplay/Makefile [new file with mode: 0644]
Documentation/connector/Makefile [new file with mode: 0644]
Documentation/cpu-hotplug.txt
Documentation/feature-removal-schedule.txt
Documentation/filesystems/configfs/Makefile [new file with mode: 0644]
Documentation/filesystems/quota.txt
Documentation/ia64/Makefile [new file with mode: 0644]
Documentation/lguest/lguest.c
Documentation/networking/Makefile [new file with mode: 0644]
Documentation/networking/ifenslave.c
Documentation/pcmcia/Makefile [new file with mode: 0644]
Documentation/pcmcia/crc32hash.c
Documentation/spi/Makefile [new file with mode: 0644]
Documentation/video4linux/Makefile [new file with mode: 0644]
Documentation/vm/Makefile [new file with mode: 0644]
Documentation/watchdog/src/Makefile [new file with mode: 0644]
MAINTAINERS
Makefile
arch/h8300/include/asm/Kbuild [moved from include/asm-h8300/Kbuild with 100% similarity]
arch/h8300/include/asm/a.out.h [moved from include/asm-h8300/a.out.h with 100% similarity]
arch/h8300/include/asm/atomic.h [moved from include/asm-h8300/atomic.h with 100% similarity]
arch/h8300/include/asm/auxvec.h [moved from include/asm-h8300/auxvec.h with 100% similarity]
arch/h8300/include/asm/bitops.h [moved from include/asm-h8300/bitops.h with 100% similarity]
arch/h8300/include/asm/bootinfo.h [moved from include/asm-h8300/bootinfo.h with 100% similarity]
arch/h8300/include/asm/bug.h [moved from include/asm-h8300/bug.h with 100% similarity]
arch/h8300/include/asm/bugs.h [moved from include/asm-h8300/bugs.h with 100% similarity]
arch/h8300/include/asm/byteorder.h [moved from include/asm-h8300/byteorder.h with 100% similarity]
arch/h8300/include/asm/cache.h [moved from include/asm-h8300/cache.h with 100% similarity]
arch/h8300/include/asm/cachectl.h [moved from include/asm-h8300/cachectl.h with 100% similarity]
arch/h8300/include/asm/cacheflush.h [moved from include/asm-h8300/cacheflush.h with 100% similarity]
arch/h8300/include/asm/checksum.h [moved from include/asm-h8300/checksum.h with 100% similarity]
arch/h8300/include/asm/cputime.h [moved from include/asm-h8300/cputime.h with 100% similarity]
arch/h8300/include/asm/current.h [moved from include/asm-h8300/current.h with 100% similarity]
arch/h8300/include/asm/dbg.h [moved from include/asm-h8300/dbg.h with 100% similarity]
arch/h8300/include/asm/delay.h [moved from include/asm-h8300/delay.h with 100% similarity]
arch/h8300/include/asm/device.h [moved from include/asm-h8300/device.h with 100% similarity]
arch/h8300/include/asm/div64.h [moved from include/asm-h8300/div64.h with 100% similarity]
arch/h8300/include/asm/dma.h [moved from include/asm-h8300/dma.h with 100% similarity]
arch/h8300/include/asm/elf.h [moved from include/asm-h8300/elf.h with 100% similarity]
arch/h8300/include/asm/emergency-restart.h [moved from include/asm-h8300/emergency-restart.h with 100% similarity]
arch/h8300/include/asm/errno.h [moved from include/asm-h8300/errno.h with 100% similarity]
arch/h8300/include/asm/fb.h [moved from include/asm-h8300/fb.h with 100% similarity]
arch/h8300/include/asm/fcntl.h [moved from include/asm-h8300/fcntl.h with 100% similarity]
arch/h8300/include/asm/flat.h [moved from include/asm-h8300/flat.h with 100% similarity]
arch/h8300/include/asm/fpu.h [moved from include/asm-h8300/fpu.h with 100% similarity]
arch/h8300/include/asm/futex.h [moved from include/asm-h8300/futex.h with 100% similarity]
arch/h8300/include/asm/gpio.h [moved from include/asm-h8300/gpio.h with 100% similarity]
arch/h8300/include/asm/hardirq.h [moved from include/asm-h8300/hardirq.h with 100% similarity]
arch/h8300/include/asm/hw_irq.h [moved from include/asm-h8300/hw_irq.h with 100% similarity]
arch/h8300/include/asm/io.h [moved from include/asm-h8300/io.h with 100% similarity]
arch/h8300/include/asm/ioctl.h [moved from include/asm-h8300/ioctl.h with 100% similarity]
arch/h8300/include/asm/ioctls.h [moved from include/asm-h8300/ioctls.h with 100% similarity]
arch/h8300/include/asm/ipcbuf.h [moved from include/asm-h8300/ipcbuf.h with 100% similarity]
arch/h8300/include/asm/irq.h [moved from include/asm-h8300/irq.h with 100% similarity]
arch/h8300/include/asm/irq_regs.h [moved from include/asm-h8300/irq_regs.h with 100% similarity]
arch/h8300/include/asm/kdebug.h [moved from include/asm-h8300/kdebug.h with 100% similarity]
arch/h8300/include/asm/kmap_types.h [moved from include/asm-h8300/kmap_types.h with 100% similarity]
arch/h8300/include/asm/linkage.h [moved from include/asm-h8300/linkage.h with 100% similarity]
arch/h8300/include/asm/local.h [moved from include/asm-h8300/local.h with 100% similarity]
arch/h8300/include/asm/mc146818rtc.h [moved from include/asm-h8300/mc146818rtc.h with 100% similarity]
arch/h8300/include/asm/md.h [moved from include/asm-h8300/md.h with 100% similarity]
arch/h8300/include/asm/mman.h [moved from include/asm-h8300/mman.h with 100% similarity]
arch/h8300/include/asm/mmu.h [moved from include/asm-h8300/mmu.h with 100% similarity]
arch/h8300/include/asm/mmu_context.h [moved from include/asm-h8300/mmu_context.h with 100% similarity]
arch/h8300/include/asm/module.h [moved from include/asm-h8300/module.h with 100% similarity]
arch/h8300/include/asm/msgbuf.h [moved from include/asm-h8300/msgbuf.h with 100% similarity]
arch/h8300/include/asm/mutex.h [moved from include/asm-h8300/mutex.h with 100% similarity]
arch/h8300/include/asm/page.h [moved from include/asm-h8300/page.h with 100% similarity]
arch/h8300/include/asm/page_offset.h [moved from include/asm-h8300/page_offset.h with 100% similarity]
arch/h8300/include/asm/param.h [moved from include/asm-h8300/param.h with 100% similarity]
arch/h8300/include/asm/pci.h [moved from include/asm-h8300/pci.h with 100% similarity]
arch/h8300/include/asm/percpu.h [moved from include/asm-h8300/percpu.h with 100% similarity]
arch/h8300/include/asm/pgalloc.h [moved from include/asm-h8300/pgalloc.h with 100% similarity]
arch/h8300/include/asm/pgtable.h [moved from include/asm-h8300/pgtable.h with 100% similarity]
arch/h8300/include/asm/poll.h [moved from include/asm-h8300/poll.h with 100% similarity]
arch/h8300/include/asm/posix_types.h [moved from include/asm-h8300/posix_types.h with 100% similarity]
arch/h8300/include/asm/processor.h [moved from include/asm-h8300/processor.h with 100% similarity]
arch/h8300/include/asm/ptrace.h [moved from include/asm-h8300/ptrace.h with 100% similarity]
arch/h8300/include/asm/regs267x.h [moved from include/asm-h8300/regs267x.h with 100% similarity]
arch/h8300/include/asm/regs306x.h [moved from include/asm-h8300/regs306x.h with 100% similarity]
arch/h8300/include/asm/resource.h [moved from include/asm-h8300/resource.h with 100% similarity]
arch/h8300/include/asm/scatterlist.h [moved from include/asm-h8300/scatterlist.h with 100% similarity]
arch/h8300/include/asm/sections.h [moved from include/asm-h8300/sections.h with 100% similarity]
arch/h8300/include/asm/segment.h [moved from include/asm-h8300/segment.h with 100% similarity]
arch/h8300/include/asm/sembuf.h [moved from include/asm-h8300/sembuf.h with 100% similarity]
arch/h8300/include/asm/setup.h [moved from include/asm-h8300/setup.h with 100% similarity]
arch/h8300/include/asm/sh_bios.h [moved from include/asm-h8300/sh_bios.h with 100% similarity]
arch/h8300/include/asm/shm.h [moved from include/asm-h8300/shm.h with 100% similarity]
arch/h8300/include/asm/shmbuf.h [moved from include/asm-h8300/shmbuf.h with 100% similarity]
arch/h8300/include/asm/shmparam.h [moved from include/asm-h8300/shmparam.h with 100% similarity]
arch/h8300/include/asm/sigcontext.h [moved from include/asm-h8300/sigcontext.h with 100% similarity]
arch/h8300/include/asm/siginfo.h [moved from include/asm-h8300/siginfo.h with 100% similarity]
arch/h8300/include/asm/signal.h [moved from include/asm-h8300/signal.h with 100% similarity]
arch/h8300/include/asm/smp.h [moved from include/asm-h8300/smp.h with 100% similarity]
arch/h8300/include/asm/socket.h [moved from include/asm-h8300/socket.h with 100% similarity]
arch/h8300/include/asm/sockios.h [moved from include/asm-h8300/sockios.h with 100% similarity]
arch/h8300/include/asm/spinlock.h [moved from include/asm-h8300/spinlock.h with 100% similarity]
arch/h8300/include/asm/stat.h [moved from include/asm-h8300/stat.h with 100% similarity]
arch/h8300/include/asm/statfs.h [moved from include/asm-h8300/statfs.h with 100% similarity]
arch/h8300/include/asm/string.h [moved from include/asm-h8300/string.h with 100% similarity]
arch/h8300/include/asm/system.h [moved from include/asm-h8300/system.h with 100% similarity]
arch/h8300/include/asm/target_time.h [moved from include/asm-h8300/target_time.h with 100% similarity]
arch/h8300/include/asm/termbits.h [moved from include/asm-h8300/termbits.h with 100% similarity]
arch/h8300/include/asm/termios.h [moved from include/asm-h8300/termios.h with 100% similarity]
arch/h8300/include/asm/thread_info.h [moved from include/asm-h8300/thread_info.h with 100% similarity]
arch/h8300/include/asm/timex.h [moved from include/asm-h8300/timex.h with 100% similarity]
arch/h8300/include/asm/tlb.h [moved from include/asm-h8300/tlb.h with 100% similarity]
arch/h8300/include/asm/tlbflush.h [moved from include/asm-h8300/tlbflush.h with 100% similarity]
arch/h8300/include/asm/topology.h [moved from include/asm-h8300/topology.h with 100% similarity]
arch/h8300/include/asm/traps.h [moved from include/asm-h8300/traps.h with 100% similarity]
arch/h8300/include/asm/types.h [moved from include/asm-h8300/types.h with 100% similarity]
arch/h8300/include/asm/uaccess.h [moved from include/asm-h8300/uaccess.h with 100% similarity]
arch/h8300/include/asm/ucontext.h [moved from include/asm-h8300/ucontext.h with 100% similarity]
arch/h8300/include/asm/unaligned.h [moved from include/asm-h8300/unaligned.h with 100% similarity]
arch/h8300/include/asm/unistd.h [moved from include/asm-h8300/unistd.h with 100% similarity]
arch/h8300/include/asm/user.h [moved from include/asm-h8300/user.h with 100% similarity]
arch/h8300/include/asm/virtconvert.h [moved from include/asm-h8300/virtconvert.h with 100% similarity]
arch/h8300/mm/init.c
arch/ia64/include/asm/sal.h
arch/ia64/kernel/head.S
arch/ia64/kernel/setup.c
arch/ia64/kernel/smpboot.c
arch/ia64/kernel/vmlinux.lds.S
arch/ia64/mm/contig.c
arch/ia64/mm/discontig.c
arch/powerpc/Kconfig
arch/x86/Kconfig
arch/x86/kernel/apic_32.c
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/io_apic_32.c
arch/x86/kernel/io_apic_64.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/pci-calgary_64.c
arch/x86/kernel/setup.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/vmi_32.c
arch/x86/mm/Makefile
arch/x86/mm/pgtable.c
drivers/char/agp/agp.h
drivers/char/agp/ali-agp.c
drivers/char/agp/amd-k7-agp.c
drivers/char/agp/amd64-agp.c
drivers/char/agp/ati-agp.c
drivers/char/agp/backend.c
drivers/char/agp/generic.c
drivers/char/agp/intel-agp.c
drivers/char/agp/isoch.c
drivers/char/agp/sis-agp.c
drivers/char/agp/sworks-agp.c
drivers/char/agp/uninorth-agp.c
drivers/char/hvc_console.c
drivers/char/rtc.c
drivers/cpuidle/sysfs.c
drivers/firmware/memmap.c
drivers/infiniband/hw/ehca/ehca_classes.h
drivers/infiniband/hw/ehca/ehca_qes.h
drivers/infiniband/hw/ehca/ehca_qp.c
drivers/infiniband/hw/ehca/ehca_reqs.c
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/lguest/page_tables.c
drivers/misc/sgi-gru/grutables.h
drivers/rtc/rtc-dev.c
drivers/rtc/rtc-isl1208.c
drivers/scsi/device_handler/scsi_dh_alua.c
drivers/scsi/device_handler/scsi_dh_emc.c
drivers/scsi/device_handler/scsi_dh_hp_sw.c
drivers/scsi/device_handler/scsi_dh_rdac.c
drivers/usb/misc/isight_firmware.c
drivers/video/atmel_lcdfb.c
drivers/video/aty/radeon_accel.c
drivers/video/console/fbcon.c
drivers/video/matrox/i2c-matroxfb.c
drivers/video/matrox/matroxfb_maven.c
drivers/watchdog/Kconfig
fs/dlm/config.c
fs/dlm/user.c
fs/eventpoll.c
fs/jbd/transaction.c
fs/jbd2/transaction.c
fs/lockd/svc4proc.c
fs/lockd/svcproc.c
fs/nfsd/export.c
fs/reiserfs/super.c
fs/seq_file.c
include/asm-generic/ioctl.h
include/asm-x86/efi.h
include/asm-x86/hw_irq.h
include/asm-x86/irq_vectors.h
include/linux/Kbuild
include/linux/agp_backend.h
include/linux/bitmap.h
include/linux/bootmem.h
include/linux/byteorder.h [new file with mode: 0644]
include/linux/firmware-map.h
include/linux/i2c-id.h
include/linux/init.h
include/linux/kernel.h
include/linux/lockdep.h
include/linux/mm.h
include/linux/rcuclassic.h
include/linux/sched.h
include/linux/seq_file.h
include/linux/spinlock.h
include/linux/spinlock_api_smp.h
include/linux/swab.h [new file with mode: 0644]
include/video/atmel_lcdc.h
include/video/radeon.h
init/main.c
kernel/Kconfig.hz
kernel/cpu.c
kernel/irq/proc.c
kernel/lockdep.c
kernel/lockdep_internals.h
kernel/lockdep_proc.c
kernel/module.c
kernel/posix-timers.c
kernel/sched.c
kernel/sched_clock.c
kernel/sched_fair.c
kernel/sched_rt.c
kernel/signal.c
kernel/smp.c
kernel/spinlock.c
kernel/stop_machine.c
kernel/time/tick-sched.c
kernel/workqueue.c
lib/Kconfig.debug
lib/bitmap.c
lib/debug_locks.c
lib/vsprintf.c
mm/Kconfig
mm/hugetlb.c
mm/memcontrol.c
mm/mempolicy.c
mm/mmap.c
mm/page_alloc.c
mm/sparse.c
mm/util.c
sound/pci/hda/hda_intel.c
sound/soc/codecs/wm8750.c
sound/soc/pxa/spitz.c

index 1d1b34500b69278e5f217c6b521d729a1c78b4f9..1615350b7b53b4b681ed187e176e896ca0b0845e 100644 (file)
@@ -102,6 +102,13 @@ C-procfs-example = procfs_example.xml
 C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
 $(obj)/procfs-guide.xml: $(C-procfs-example2)
 
+# List of programs to build
+##oops, this is a kernel module::hostprogs-y := procfs_example
+obj-m += procfs_example.o
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
 notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \
                   exit 1
 db2xtemplate = db2TYPE -o $(dir $@) $<
index 7064084c1c5e4ce6b10f64971a5d7cd2d009f5d1..2f3de0fb83651779e3c849c8ec2c9706c13a2ac4 100644 (file)
@@ -189,8 +189,6 @@ static int __init init_procfs_example(void)
        return 0;
 
 no_symlink:
-       remove_proc_entry("tty", example_dir);
-no_tty:
        remove_proc_entry("bar", example_dir);
 no_bar:
        remove_proc_entry("foo", example_dir);
@@ -206,7 +204,6 @@ out:
 static void __exit cleanup_procfs_example(void)
 {
        remove_proc_entry("jiffies_too", example_dir);
-       remove_proc_entry("tty", example_dir);
        remove_proc_entry("bar", example_dir);
        remove_proc_entry("foo", example_dir);
        remove_proc_entry("jiffies", example_dir);
@@ -222,3 +219,4 @@ module_exit(cleanup_procfs_example);
 
 MODULE_AUTHOR("Erik Mouw");
 MODULE_DESCRIPTION("procfs examples");
+MODULE_LICENSE("GPL");
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644 (file)
index 0000000..94b9457
--- /dev/null
@@ -0,0 +1,3 @@
+obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
+       filesystems/configfs/ ia64/ networking/ \
+       pcmcia/ spi/ video4linux/ vm/ watchdog/src/
diff --git a/Documentation/accounting/Makefile b/Documentation/accounting/Makefile
new file mode 100644 (file)
index 0000000..31929eb
--- /dev/null
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := getdelays
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include
index 3f7755f3963f11fd31ba598a8f6199371c87202f..cc49400b4af899abf34b30cf955b52d378617948 100644 (file)
@@ -201,13 +201,19 @@ void print_delayacct(struct taskstats *t)
               "RECLAIM  %12s%15s\n"
               "      %15llu%15llu\n",
               "count", "real total", "virtual total", "delay total",
-              t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
-              t->cpu_delay_total,
+              (unsigned long long)t->cpu_count,
+              (unsigned long long)t->cpu_run_real_total,
+              (unsigned long long)t->cpu_run_virtual_total,
+              (unsigned long long)t->cpu_delay_total,
               "count", "delay total",
-              t->blkio_count, t->blkio_delay_total,
-              "count", "delay total", t->swapin_count, t->swapin_delay_total,
+              (unsigned long long)t->blkio_count,
+              (unsigned long long)t->blkio_delay_total,
               "count", "delay total",
-              t->freepages_count, t->freepages_delay_total);
+              (unsigned long long)t->swapin_count,
+              (unsigned long long)t->swapin_delay_total,
+              "count", "delay total",
+              (unsigned long long)t->freepages_count,
+              (unsigned long long)t->freepages_delay_total);
 }
 
 void task_context_switch_counts(struct taskstats *t)
@@ -215,14 +221,17 @@ void task_context_switch_counts(struct taskstats *t)
        printf("\n\nTask   %15s%15s\n"
               "       %15llu%15llu\n",
               "voluntary", "nonvoluntary",
-              t->nvcsw, t->nivcsw);
+              (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
 }
 
 void print_cgroupstats(struct cgroupstats *c)
 {
        printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
-               "uninterruptible %llu\n", c->nr_sleeping, c->nr_io_wait,
-               c->nr_running, c->nr_stopped, c->nr_uninterruptible);
+               "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
+               (unsigned long long)c->nr_io_wait,
+               (unsigned long long)c->nr_running,
+               (unsigned long long)c->nr_stopped,
+               (unsigned long long)c->nr_uninterruptible);
 }
 
 
diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay/Makefile
new file mode 100644 (file)
index 0000000..51fe233
--- /dev/null
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := cfag12864b-example
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include
diff --git a/Documentation/connector/Makefile b/Documentation/connector/Makefile
new file mode 100644 (file)
index 0000000..8df1a72
--- /dev/null
@@ -0,0 +1,11 @@
+ifneq ($(CONFIG_CONNECTOR),)
+obj-m += cn_test.o
+endif
+
+# List of programs to build
+hostprogs-y := ucon
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
index ba0aacde94fba2472d33ba9da5764a2b8cc5f63e..94bbc27ddd4fbf50ff361177450c5f524210f1cb 100644 (file)
@@ -59,15 +59,10 @@ apicid values in those tables for disabled apics. In the event BIOS doesn't
 mark such hot-pluggable cpus as disabled entries, one could use this
 parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.
 
-s390 uses the number of cpus it detects at IPL time to also the number of bits
-in cpu_possible_map. If it is desired to add additional cpus at a later time
-the number should be specified using this option or the possible_cpus option.
-
 possible_cpus=n                [s390 only] use this to set hotpluggable cpus.
                        This option sets possible_cpus bits in
                        cpu_possible_map. Thus keeping the numbers of bits set
                        constant even if the machine gets rebooted.
-                       This option overrides additional_cpus.
 
 CPU maps and such
 -----------------
index 17cab3c74e8b60506d0136f812745f4258bc2ca4..eb1a47b974278270242c2da772420f6a984ff706 100644 (file)
@@ -19,15 +19,6 @@ Who: Pavel Machek <pavel@suse.cz>
 
 ---------------------------
 
-What:  old NCR53C9x driver
-When:  October 2007
-Why:   Replaced by the much better esp_scsi driver.  Actual low-level
-       driver can be ported over almost trivially.
-Who:   David Miller <davem@davemloft.net>
-       Christoph Hellwig <hch@lst.de>
-
----------------------------
-
 What:  Video4Linux API 1 ioctls and video_decoder.h from Video devices.
 When:  December 2008
 Files: include/linux/video_decoder.h include/linux/videodev.h
diff --git a/Documentation/filesystems/configfs/Makefile b/Documentation/filesystems/configfs/Makefile
new file mode 100644 (file)
index 0000000..be7ec5e
--- /dev/null
@@ -0,0 +1,3 @@
+ifneq ($(CONFIG_CONFIGFS_FS),)
+obj-m += configfs_example_explicit.o configfs_example_macros.o
+endif
index a590c4093eff87470baebc430a1cb0034f8f93db..5e8de25bf0f1ec86aac76ad6a102d557b883603f 100644 (file)
@@ -3,14 +3,14 @@ Quota subsystem
 ===============
 
 Quota subsystem allows system administrator to set limits on used space and
-number of used inodes (inode is a filesystem structure which is associated
-with each file or directory) for users and/or groups. For both used space and
-number of used inodes there are actually two limits. The first one is called
-softlimit and the second one hardlimit.  An user can never exceed a hardlimit
-for any resource. User is allowed to exceed softlimit but only for limited
-period of time. This period is called "grace period" or "grace time". When
-grace time is over, user is not able to allocate more space/inodes until he
-frees enough of them to get below softlimit.
+number of used inodes (inode is a filesystem structure which is associated with
+each file or directory) for users and/or groups. For both used space and number
+of used inodes there are actually two limits. The first one is called softlimit
+and the second one hardlimit.  An user can never exceed a hardlimit for any
+resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed
+softlimit but only for limited period of time. This period is called "grace
+period" or "grace time". When grace time is over, user is not able to allocate
+more space/inodes until he frees enough of them to get below softlimit.
 
 Quota limits (and amount of grace time) are set independently for each
 filesystem.
@@ -53,6 +53,12 @@ in parentheses):
                QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded
                  longer than given grace period.
                QUOTA_NL_BSOFTWARN - space (block) softlimit
+         - four warnings are also defined for the event when user stops
+           exceeding some limit:
+               QUOTA_NL_IHARDBELOW - inode hardlimit
+               QUOTA_NL_ISOFTBELOW - inode softlimit
+               QUOTA_NL_BHARDBELOW - space (block) hardlimit
+               QUOTA_NL_BSOFTBELOW - space (block) softlimit
         QUOTA_NL_A_DEV_MAJOR (u32)
          - major number of a device with the affected filesystem
         QUOTA_NL_A_DEV_MINOR (u32)
diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile
new file mode 100644 (file)
index 0000000..b75db69
--- /dev/null
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := aliasing-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
index b88b0ea54e90c597896aac6eb478e1b56bab8bd0..655414821edc361fae2382104a068bb2c895f0de 100644 (file)
@@ -1447,21 +1447,6 @@ static void configure_device(int fd, const char *tapif, u32 ipaddr)
                err(1, "Bringing interface %s up", tapif);
 }
 
-static void get_mac(int fd, const char *tapif, unsigned char hwaddr[6])
-{
-       struct ifreq ifr;
-
-       memset(&ifr, 0, sizeof(ifr));
-       strcpy(ifr.ifr_name, tapif);
-
-       /* SIOC stands for Socket I/O Control.  G means Get (vs S for Set
-        * above).  IF means Interface, and HWADDR is hardware address.
-        * Simple! */
-       if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0)
-               err(1, "getting hw address for %s", tapif);
-       memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6);
-}
-
 static int get_tun_device(char tapif[IFNAMSIZ])
 {
        struct ifreq ifr;
@@ -1531,11 +1516,8 @@ static void setup_tun_net(char *arg)
        p = strchr(arg, ':');
        if (p) {
                str2mac(p+1, conf.mac);
+               add_feature(dev, VIRTIO_NET_F_MAC);
                *p = '\0';
-       } else {
-               p = arg + strlen(arg);
-               /* None supplied; query the randomly assigned mac. */
-               get_mac(ipfd, tapif, conf.mac);
        }
 
        /* arg is now either an IP address or a bridge name */
@@ -1547,13 +1529,10 @@ static void setup_tun_net(char *arg)
        /* Set up the tun device. */
        configure_device(ipfd, tapif, ip);
 
-       /* Tell Guest what MAC address to use. */
-       add_feature(dev, VIRTIO_NET_F_MAC);
        add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
        /* Expect Guest to handle everything except UFO */
        add_feature(dev, VIRTIO_NET_F_CSUM);
        add_feature(dev, VIRTIO_NET_F_GUEST_CSUM);
-       add_feature(dev, VIRTIO_NET_F_MAC);
        add_feature(dev, VIRTIO_NET_F_GUEST_TSO4);
        add_feature(dev, VIRTIO_NET_F_GUEST_TSO6);
        add_feature(dev, VIRTIO_NET_F_GUEST_ECN);
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile
new file mode 100644 (file)
index 0000000..6d8af1a
--- /dev/null
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := ifenslave
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
index a12059886755c7d2b5ff346eaaf495f9376a589a..1b96ccda3836507b18e14a60744b7bfa16de1c83 100644 (file)
@@ -1081,7 +1081,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname)
 
                }
 
-               ipaddr = ifr.ifr_addr.sa_data;
+               ipaddr = (unsigned char *)ifr.ifr_addr.sa_data;
                v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n",
                        slave_ifname, ifra[i].desc,
                        ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
diff --git a/Documentation/pcmcia/Makefile b/Documentation/pcmcia/Makefile
new file mode 100644 (file)
index 0000000..accde87
--- /dev/null
@@ -0,0 +1,10 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := crc32hash
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include
index cbc36d299af808016fd0d018ed27a3cbfe57615e..4210e5abab8a8b86de57770420ac0cfff96a4b38 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char **argv) {
                printf("no string passed as argument\n");
                return -1;
        }
-       result = crc32(argv[1], strlen(argv[1]));
+       result = crc32((unsigned char const *)argv[1], strlen(argv[1]));
        printf("0x%x\n", result);
        return 0;
 }
diff --git a/Documentation/spi/Makefile b/Documentation/spi/Makefile
new file mode 100644 (file)
index 0000000..a5b03c8
--- /dev/null
@@ -0,0 +1,11 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := spidev_test spidev_fdx
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
+
+HOSTCFLAGS_spidev_test.o += -I$(objtree)/usr/include
+HOSTCFLAGS_spidev_fdx.o += -I$(objtree)/usr/include
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile
new file mode 100644 (file)
index 0000000..1ed0e98
--- /dev/null
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := v4lgrab
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
new file mode 100644 (file)
index 0000000..6f562f7
--- /dev/null
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := slabinfo
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile
new file mode 100644 (file)
index 0000000..40e5f46
--- /dev/null
@@ -0,0 +1,8 @@
+# kbuild trick to avoid linker error. Can be omitted if a module is built.
+obj- := dummy.o
+
+# List of programs to build
+hostprogs-y := watchdog-simple watchdog-test
+
+# Tell kbuild to always build the programs
+always := $(hostprogs-y)
index b343814a1ace0dbb9f38e73bd130042ff9f64c01..af6aa4e4b39264313d8b2fa0dc59820877ab2600 100644 (file)
@@ -2462,7 +2462,7 @@ L:        kernel-janitors@vger.kernel.org
 W:     http://www.kerneljanitors.org/
 S:     Maintained
 
-KERNEL NFSD
+KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
 P:     J. Bruce Fields
 M:     bfields@fieldses.org
 P:     Neil Brown
@@ -3078,7 +3078,7 @@ M:        ja@ssi.bg
 L:     netdev@vger.kernel.org
 S:     Maintained
 
-NFS CLIENT
+NFS, SUNRPC, AND LOCKD CLIENTS
 P:     Trond Myklebust
 M:     Trond.Myklebust@netapp.com
 L:     linux-nfs@vger.kernel.org
index f3e206509ee1fc740e4b17357c39d64e97c0939a..53bf6ec1af9d29fac6682fb6cd4c2e5dbcb84490 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 27
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc3
 NAME = Rotary Wombat
 
 # *DOCUMENTATION*
@@ -821,6 +821,9 @@ ifdef CONFIG_HEADERS_CHECK
 endif
 ifdef CONFIG_SAMPLES
        $(Q)$(MAKE) $(build)=samples
+endif
+ifdef CONFIG_BUILD_DOCSRC
+       $(Q)$(MAKE) $(build)=Documentation
 endif
        $(call vmlinux-modpost)
        $(call if_changed_rule,vmlinux__)
@@ -1166,7 +1169,7 @@ MRPROPER_FILES += .config .config.old include/asm .version .old_version \
 #
 clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
-clean-dirs      := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
+clean-dirs      := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs) Documentation)
 
 PHONY += $(clean-dirs) clean archclean
 $(clean-dirs):
index a1d228f5e4e6b4282ac10558ad6fc801a209e4cf..9942f24aff9e19067a5b74ae05bb3ae26dfdb119 100644 (file)
@@ -40,9 +40,6 @@
 
 #undef DEBUG
 
-extern void die_if_kernel(char *,struct pt_regs *,long);
-extern void free_initmem(void);
-
 /*
  * BAD_PAGE is the page that is used for page faults when linux
  * is out-of-memory. Older versions of linux just did a
@@ -73,7 +70,7 @@ extern unsigned long memory_end;
  * The parameters are pointers to where to stick the starting and ending
  * addresses of available kernel virtual memory.
  */
-void paging_init(void)
+void __init paging_init(void)
 {
        /*
         * Make sure start_mem is page aligned,  otherwise bootmem and
@@ -122,7 +119,7 @@ void paging_init(void)
        }
 }
 
-void mem_init(void)
+void __init mem_init(void)
 {
        int codek = 0, datak = 0, initk = 0;
        /* DAVIDM look at setup memory map generically with reserved area */
@@ -178,7 +175,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 #endif
 
 void
-free_initmem()
+free_initmem(void)
 {
 #ifdef CONFIG_RAMKERNEL
        unsigned long addr;
index 89594b442f835e3ff162cc60bd8fdb55f099e641..ea310c0812aa2d8b2f32d6e60996f63e962a31cd 100644 (file)
@@ -236,7 +236,7 @@ extern struct ia64_sal_desc_ptc *ia64_ptc_domain_info;
 
 extern unsigned short sal_revision;    /* supported SAL spec revision */
 extern unsigned short sal_version;     /* SAL version; OEM dependent */
-#define SAL_VERSION_CODE(major, minor) ((BIN2BCD(major) << 8) | BIN2BCD(minor))
+#define SAL_VERSION_CODE(major, minor) ((bin2bcd(major) << 8) | bin2bcd(minor))
 
 extern const char *ia64_sal_strerror (long status);
 extern void ia64_sal_init (struct ia64_sal_systab *sal_systab);
index 41c712917ff706b595ee1683b3e6fdbcf0b46efe..8bdea8eb62e366abc0350bd53261146d445ab41a 100644 (file)
@@ -359,7 +359,31 @@ start_ap:
        mov ar.rsc=0            // place RSE in enforced lazy mode
        ;;
        loadrs                  // clear the dirty partition
-       mov IA64_KR(PER_CPU_DATA)=r0    // clear physical per-CPU base
+       movl r19=__phys_per_cpu_start
+       mov r18=PERCPU_PAGE_SIZE
+       ;;
+#ifndef CONFIG_SMP
+       add r19=r19,r18
+       ;;
+#else
+(isAP) br.few 2f
+       mov r20=r19
+       sub r19=r19,r18
+       ;;
+       shr.u r18=r18,3
+1:
+       ld8 r21=[r20],8;;
+       st8[r19]=r21,8
+       adds r18=-1,r18;;
+       cmp4.lt p7,p6=0,r18
+(p7)   br.cond.dptk.few 1b
+2:
+#endif
+       tpa r19=r19
+       ;;
+       .pred.rel.mutex isBP,isAP
+(isBP) mov IA64_KR(PER_CPU_DATA)=r19   // per-CPU base for cpu0
+(isAP) mov IA64_KR(PER_CPU_DATA)=r0    // clear physical per-CPU base
        ;;
        mov ar.bspstore=r2      // establish the new RSE stack
        ;;
index 593279f33e96e71fae02c6c335f20d2b699e23c6..c27d5b2c182b4c7edd4de5609ce2a2c856a55ddb 100644 (file)
@@ -927,17 +927,19 @@ cpu_init (void)
        if (smp_processor_id() == 0) {
                cpu_set(0, per_cpu(cpu_sibling_map, 0));
                cpu_set(0, cpu_core_map[0]);
+       } else {
+               /*
+                * Set ar.k3 so that assembly code in MCA handler can compute
+                * physical addresses of per cpu variables with a simple:
+                *   phys = ar.k3 + &per_cpu_var
+                * and the alt-dtlb-miss handler can set per-cpu mapping into
+                * the TLB when needed. head.S already did this for cpu0.
+                */
+               ia64_set_kr(IA64_KR_PER_CPU_DATA,
+                           ia64_tpa(cpu_data) - (long) __per_cpu_start);
        }
 #endif
 
-       /*
-        * We set ar.k3 so that assembly code in MCA handler can compute
-        * physical addresses of per cpu variables with a simple:
-        *   phys = ar.k3 + &per_cpu_var
-        */
-       ia64_set_kr(IA64_KR_PER_CPU_DATA,
-                   ia64_tpa(cpu_data) - (long) __per_cpu_start);
-
        get_max_cacheline_size();
 
        /*
index 03f1a9908afc6a3bb547674362cdda704b2ebcc0..b39853a292d5bf27caecb43b5651eff2688b4ae5 100644 (file)
@@ -467,7 +467,9 @@ start_secondary (void *unused)
 {
        /* Early console may use I/O ports */
        ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase));
+#ifndef CONFIG_PRINTK_TIME
        Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id());
+#endif
        efi_map_pal_code();
        cpu_init();
        preempt_disable();
index 5a77206c2492e0c000140a18a179d7d461ab3dee..de71da811cd68de596ed1c88b0cdcb6b2a714c29 100644 (file)
@@ -215,6 +215,9 @@ SECTIONS
   /* Per-cpu data: */
   percpu : { } :percpu
   . = ALIGN(PERCPU_PAGE_SIZE);
+#ifdef CONFIG_SMP
+  . = . + PERCPU_PAGE_SIZE;    /* cpu0 per-cpu space */
+#endif
   __phys_per_cpu_start = .;
   .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET)
        {
index 798bf9835a519f9ab20c748b6d5056ec69489a66..e566ff43884afcd97b17ff8bb71ebd95deda9ee6 100644 (file)
@@ -163,8 +163,14 @@ per_cpu_init (void)
         * get_zeroed_page().
         */
        if (first_time) {
+               void *cpu0_data = __phys_per_cpu_start - PERCPU_PAGE_SIZE;
+
                first_time=0;
-               for (cpu = 0; cpu < NR_CPUS; cpu++) {
+
+               __per_cpu_offset[0] = (char *) cpu0_data - __per_cpu_start;
+               per_cpu(local_per_cpu_offset, 0) = __per_cpu_offset[0];
+
+               for (cpu = 1; cpu < NR_CPUS; cpu++) {
                        memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
                        __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start;
                        cpu_data += PERCPU_PAGE_SIZE;
@@ -177,7 +183,7 @@ per_cpu_init (void)
 static inline void
 alloc_per_cpu_data(void)
 {
-       cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
+       cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS-1,
                                   PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
 }
 #else
index d83125e1ed27b33a1e7ef04794324380dc97f862..78026aabaa7f03671d8b62d304d28d02c3817746 100644 (file)
@@ -143,7 +143,11 @@ static void *per_cpu_node_setup(void *cpu_data, int node)
        int cpu;
 
        for_each_possible_early_cpu(cpu) {
-               if (node == node_cpuid[cpu].nid) {
+               if (cpu == 0) {
+                       void *cpu0_data = __phys_per_cpu_start - PERCPU_PAGE_SIZE;
+                       __per_cpu_offset[cpu] = (char*)cpu0_data -
+                               __per_cpu_start;
+               } else if (node == node_cpuid[cpu].nid) {
                        memcpy(__va(cpu_data), __phys_per_cpu_start,
                               __per_cpu_end - __per_cpu_start);
                        __per_cpu_offset[cpu] = (char*)__va(cpu_data) -
index 63c9cafda9c4e34bce6d096db4bcf83b68b7cd51..587da5e0990f9504979f9357b2783305e6a23d02 100644 (file)
@@ -42,9 +42,6 @@ config GENERIC_HARDIRQS
        bool
        default y
 
-config HAVE_GET_USER_PAGES_FAST
-       def_bool PPC64
-
 config HAVE_SETUP_PER_CPU_AREA
        def_bool PPC64
 
index 3d0f2b6a5a16e6edd6f349b4b19756a5d2cecff7..ac2fb0641a041e4a28055867140f458613673dc2 100644 (file)
@@ -22,7 +22,6 @@ config X86
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_IOREMAP_PROT
-       select HAVE_GET_USER_PAGES_FAST
        select HAVE_KPROBES
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select HAVE_KRETPROBES
index d6c8983583713d747790587861318a5fb58eb342..039a8d4aaf62db88eeb36040ad15ff64be9ed852 100644 (file)
@@ -1720,15 +1720,19 @@ static int __init parse_lapic_timer_c2_ok(char *arg)
 }
 early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok);
 
-static int __init apic_set_verbosity(char *str)
+static int __init apic_set_verbosity(char *arg)
 {
-       if (strcmp("debug", str) == 0)
+       if (!arg)
+               return -EINVAL;
+
+       if (strcmp(arg, "debug") == 0)
                apic_verbosity = APIC_DEBUG;
-       else if (strcmp("verbose", str) == 0)
+       else if (strcmp(arg, "verbose") == 0)
                apic_verbosity = APIC_VERBOSE;
-       return 1;
+
+       return 0;
 }
-__setup("apic=", apic_set_verbosity);
+early_param("apic", apic_set_verbosity);
 
 static int __init lapic_insert_resource(void)
 {
index c9b58a806e852d3d4a2ff96e0f48c0e737cff80f..c8e315f1aa837d95bc20f4e48655b8b90844fe9f 100644 (file)
@@ -50,6 +50,8 @@ static double __initdata y = 3145727.0;
  */
 static void __init check_fpu(void)
 {
+       s32 fdiv_bug;
+
        if (!boot_cpu_data.hard_math) {
 #ifndef CONFIG_MATH_EMULATION
                printk(KERN_EMERG "No coprocessor found and no math emulation present.\n");
@@ -74,8 +76,10 @@ static void __init check_fpu(void)
                "fistpl %0\n\t"
                "fwait\n\t"
                "fninit"
-               : "=m" (*&boot_cpu_data.fdiv_bug)
+               : "=m" (*&fdiv_bug)
                : "m" (*&x), "m" (*&y));
+
+       boot_cpu_data.fdiv_bug = fdiv_bug;
        if (boot_cpu_data.fdiv_bug)
                printk("Hmm, FPU with FDIV bug.\n");
 }
index de9aa0e3a9c51e10df0e85403529e3aa285ad395..09cddb57bec45e9ddd60ba376b3a70aca647ad8d 100644 (file)
@@ -57,7 +57,7 @@ atomic_t irq_mis_count;
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
-static DEFINE_SPINLOCK(vector_lock);
+DEFINE_SPINLOCK(vector_lock);
 
 int timer_through_8259 __initdata;
 
@@ -1209,10 +1209,6 @@ static int assign_irq_vector(int irq)
        return vector;
 }
 
-void setup_vector_irq(int cpu)
-{
-}
-
 static struct irq_chip ioapic_chip;
 
 #define IOAPIC_AUTO    -1
index 8269434d170765a6466eb7039e2b849d8b0b5b18..61a83b70c18fcc65ce60b965ee3a6e0456622dc4 100644 (file)
@@ -101,7 +101,7 @@ int timer_through_8259 __initdata;
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
-DEFINE_SPINLOCK(vector_lock);
+static DEFINE_SPINLOCK(vector_lock);
 
 /*
  * # of IRQ routing registers
@@ -697,6 +697,19 @@ static int pin_2_irq(int idx, int apic, int pin)
        return irq;
 }
 
+void lock_vector_lock(void)
+{
+       /* Used to the online set of cpus does not change
+        * during assign_irq_vector.
+        */
+       spin_lock(&vector_lock);
+}
+
+void unlock_vector_lock(void)
+{
+       spin_unlock(&vector_lock);
+}
+
 static int __assign_irq_vector(int irq, cpumask_t mask)
 {
        /*
@@ -802,7 +815,7 @@ static void __clear_irq_vector(int irq)
        cpus_clear(cfg->domain);
 }
 
-static void __setup_vector_irq(int cpu)
+void __setup_vector_irq(int cpu)
 {
        /* Initialize vector_irq on a new cpu */
        /* This function must be called with vector_lock held */
@@ -825,14 +838,6 @@ static void __setup_vector_irq(int cpu)
        }
 }
 
-void setup_vector_irq(int cpu)
-{
-       spin_lock(&vector_lock);
-       __setup_vector_irq(smp_processor_id());
-       spin_unlock(&vector_lock);
-}
-
-
 static struct irq_chip ioapic_chip;
 
 static void ioapic_register_intr(int irq, unsigned long trigger)
index 6ae005ccaed83bc46a6666f1d65b80baf7737f8d..678090508a6240996aee5eedbdd5774cc86ab629 100644 (file)
@@ -83,7 +83,7 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
        if (x86_quirks->mpc_oem_bus_info)
                x86_quirks->mpc_oem_bus_info(m, str);
        else
-               printk(KERN_INFO "Bus #%d is %s\n", m->mpc_busid, str);
+               apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->mpc_busid, str);
 
 #if MAX_MP_BUSSES < 256
        if (m->mpc_busid >= MAX_MP_BUSSES) {
@@ -154,7 +154,7 @@ static void __init MP_ioapic_info(struct mpc_config_ioapic *m)
 
 static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
 {
-       printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
+       apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC INT %02x\n",
                m->mpc_irqtype, m->mpc_irqflag & 3,
                (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
@@ -163,7 +163,7 @@ static void print_MP_intsrc_info(struct mpc_config_intsrc *m)
 
 static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
 {
-       printk(KERN_CONT "Int: type %d, pol %d, trig %d, bus %02x,"
+       apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC INT %02x\n",
                mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3,
                (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus,
@@ -235,7 +235,7 @@ static void __init MP_intsrc_info(struct mpc_config_intsrc *m)
 
 static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m)
 {
-       printk(KERN_INFO "Lint: type %d, pol %d, trig %d, bus %02x,"
+       apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x,"
                " IRQ %02x, APIC ID %x, APIC LINT %02x\n",
                m->mpc_irqtype, m->mpc_irqflag & 3,
                (m->mpc_irqflag >> 2) & 3, m->mpc_srcbusid,
@@ -695,7 +695,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
        unsigned int *bp = phys_to_virt(base);
        struct intel_mp_floating *mpf;
 
-       printk(KERN_DEBUG "Scan SMP from %p for %ld bytes.\n", bp, length);
+       apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
+                       bp, length);
        BUILD_BUG_ON(sizeof(*mpf) != 16);
 
        while (length > 0) {
index b67a4b1d4eaefd1399ae3996932b061a12357fc7..02d19328525db264c3deac9793254274d4f0891d 100644 (file)
@@ -1350,7 +1350,7 @@ static void calgary_init_bitmap_from_tce_table(struct iommu_table *tbl)
  * Function for kdump case. Get the tce tables from first kernel
  * by reading the contents of the base adress register of calgary iommu
  */
-static void get_tce_space_from_tar()
+static void get_tce_space_from_tar(void)
 {
        int bus;
        void __iomem *target;
index 2d888586385d2599dce70e99e1b4603714155e9f..68b48e3fbcbd92b7115ac90cb59cd9c1d3bc4054 100644 (file)
@@ -604,6 +604,14 @@ void __init setup_arch(char **cmdline_p)
        early_cpu_init();
        early_ioremap_init();
 
+#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
+       /*
+        * Must be before kernel pagetables are setup
+        * or fixmap area is touched.
+        */
+       vmi_init();
+#endif
+
        ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
        screen_info = boot_params.screen_info;
        edid_info = boot_params.edid_info;
@@ -817,14 +825,6 @@ void __init setup_arch(char **cmdline_p)
        kvmclock_init();
 #endif
 
-#if defined(CONFIG_VMI) && defined(CONFIG_X86_32)
-       /*
-        * Must be after max_low_pfn is determined, and before kernel
-        * pagetables are setup.
-        */
-       vmi_init();
-#endif
-
        paravirt_pagetable_setup_start(swapper_pg_dir);
        paging_init();
        paravirt_pagetable_setup_done(swapper_pg_dir);
@@ -861,12 +861,6 @@ void __init setup_arch(char **cmdline_p)
        init_apic_mappings();
        ioapic_init_mappings();
 
-#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
-       if (def_to_bigsmp)
-               printk(KERN_WARNING "More than 8 CPUs detected and "
-                       "CONFIG_X86_PC cannot handle it.\nUse "
-                       "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
-#endif
        kvm_guest_init();
 
        e820_reserve_resources();
index 332512767f4f0600d15ed473391528b20c4a5a72..91055d7fc1b0444d3e1446181216a06db2ce6978 100644 (file)
@@ -326,12 +326,16 @@ static void __cpuinit start_secondary(void *unused)
         * for which cpus receive the IPI. Holding this
         * lock helps us to not include this cpu in a currently in progress
         * smp_call_function().
+        *
+        * We need to hold vector_lock so there the set of online cpus
+        * does not change while we are assigning vectors to cpus.  Holding
+        * this lock ensures we don't half assign or remove an irq from a cpu.
         */
        ipi_call_lock_irq();
-#ifdef CONFIG_X86_IO_APIC
-       setup_vector_irq(smp_processor_id());
-#endif
+       lock_vector_lock();
+       __setup_vector_irq(smp_processor_id());
        cpu_set(smp_processor_id(), cpu_online_map);
+       unlock_vector_lock();
        ipi_call_unlock_irq();
        per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
 
@@ -990,7 +994,17 @@ int __cpuinit native_cpu_up(unsigned int cpu)
        flush_tlb_all();
        low_mappings = 1;
 
+#ifdef CONFIG_X86_PC
+       if (def_to_bigsmp && apicid > 8) {
+               printk(KERN_WARNING
+                       "More than 8 CPUs detected - skipping them.\n"
+                       "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+               err = -1;
+       } else
+               err = do_boot_cpu(apicid, cpu);
+#else
        err = do_boot_cpu(apicid, cpu);
+#endif
 
        zap_low_mappings();
        low_mappings = 0;
@@ -1336,7 +1350,9 @@ int __cpu_disable(void)
        remove_siblinginfo(cpu);
 
        /* It's now safe to remove this processor from the online map */
+       lock_vector_lock();
        remove_cpu_from_maps(cpu);
+       unlock_vector_lock();
        fixup_irqs(cpu_online_map);
        return 0;
 }
index 0a1b1a9d922df7f4380a40d4b210330dbc8db17a..6ca515d6db543b9a7739b9f2f9ab39d181ed3f9b 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/timer.h>
 #include <asm/vmi_time.h>
 #include <asm/kmap_types.h>
+#include <asm/setup.h>
 
 /* Convenient for calling VMI functions indirectly in the ROM */
 typedef u32 __attribute__((regparm(1))) (VROMFUNC)(void);
@@ -683,7 +684,7 @@ void vmi_bringup(void)
 {
        /* We must establish the lowmem mapping for MMU ops to work */
        if (vmi_ops.set_linear_mapping)
-               vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, max_low_pfn, 0);
+               vmi_ops.set_linear_mapping(0, (void *)__PAGE_OFFSET, MAXMEM_PFN, 0);
 }
 
 /*
index 2977ea37791f3ca3ec53efb8a2984fc17d866d30..dfb932dcf136c5055dd555d6e5680e4821bacf59 100644 (file)
@@ -1,7 +1,6 @@
 obj-y  :=  init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
-           pat.o pgtable.o
+           pat.o pgtable.o gup.o
 
-obj-$(CONFIG_HAVE_GET_USER_PAGES_FAST) += gup.o
 obj-$(CONFIG_X86_32)           += pgtable_32.o
 
 obj-$(CONFIG_HUGETLB_PAGE)     += hugetlbpage.o
index 557b2abceef86f83058ff447be17a1da56942d44..d50302774fe2cf7d9796d9856b9c8515e69b5f54 100644 (file)
@@ -207,6 +207,9 @@ static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[])
        unsigned long addr;
        int i;
 
+       if (PREALLOCATED_PMDS == 0) /* Work around gcc-3.4.x bug */
+               return;
+
        pud = pud_offset(pgd, 0);
 
        for (addr = i = 0; i < PREALLOCATED_PMDS;
index 81e14bea54bdb8779e7b6f0cc4f468e7bb51b3a2..4bada0e8b8128ad548771b170b71f91579fb2dca 100644 (file)
@@ -148,6 +148,9 @@ struct agp_bridge_data {
        char minor_version;
        struct list_head list;
        u32 apbase_config;
+       /* list of agp_memory mapped to the aperture */
+       struct list_head mapped_list;
+       spinlock_t mapped_lock;
 };
 
 #define KB(x)  ((x) * 1024)
index 1ffb381130c3188c4e89e501e454aeee58c70b40..31dcd9142d54416f623f5a53e587c2c0ed33fafc 100644 (file)
@@ -110,7 +110,8 @@ static int ali_configure(void)
 
                nlvm_addr+= agp_bridge->gart_bus_addr;
                nlvm_addr|=(agp_bridge->gart_bus_addr>>12);
-               printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr);
+               dev_info(&agp_bridge->dev->dev, "nlvm top &base = %8x\n",
+                        nlvm_addr);
        }
 #endif
 
@@ -315,8 +316,8 @@ static int __devinit agp_ali_probe(struct pci_dev *pdev,
                        goto found;
        }
 
-       printk(KERN_ERR PFX "Unsupported ALi chipset (device id: %04x)\n",
-            pdev->device);
+       dev_err(&pdev->dev, "unsupported ALi chipset [%04x/%04x])\n",
+               pdev->vendor, pdev->device);
        return -ENODEV;
 
 
@@ -361,8 +362,7 @@ found:
                bridge->driver = &ali_generic_bridge;
        }
 
-       printk(KERN_INFO PFX "Detected ALi %s chipset\n",
-                       devs[j].chipset_name);
+       dev_info(&pdev->dev, "ALi %s chipset\n", devs[j].chipset_name);
 
        /* Fill in the mode register */
        pci_read_config_dword(pdev,
index 39a0718bc61642b96247da80ec8237049ee0af8e..e280531843be490e0613ec70da67c9f8054ff48f 100644 (file)
@@ -419,8 +419,8 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
                return -ENODEV;
 
        j = ent - agp_amdk7_pci_table;
-       printk(KERN_INFO PFX "Detected AMD %s chipset\n",
-              amd_agp_device_ids[j].chipset_name);
+       dev_info(&pdev->dev, "AMD %s chipset\n",
+                amd_agp_device_ids[j].chipset_name);
 
        bridge = agp_alloc_bridge();
        if (!bridge)
@@ -442,7 +442,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
                while (!cap_ptr) {
                        gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard);
                        if (!gfxcard) {
-                               printk (KERN_INFO PFX "Couldn't find an AGP VGA controller.\n");
+                               dev_info(&pdev->dev, "no AGP VGA controller\n");
                                return -ENODEV;
                        }
                        cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP);
@@ -453,7 +453,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
                   (if necessary at all). */
                if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) {
                        agp_bridge->flags |= AGP_ERRATA_1X;
-                       printk (KERN_INFO PFX "AMD 751 chipset with NVidia GeForce detected. Forcing to 1X due to errata.\n");
+                       dev_info(&pdev->dev, "AMD 751 chipset with NVidia GeForce; forcing 1X due to errata\n");
                }
                pci_dev_put(gfxcard);
        }
@@ -469,7 +469,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
                        agp_bridge->flags = AGP_ERRATA_FASTWRITES;
                        agp_bridge->flags |= AGP_ERRATA_SBA;
                        agp_bridge->flags |= AGP_ERRATA_1X;
-                       printk (KERN_INFO PFX "AMD 761 chipset with errata detected - disabling AGP fast writes & SBA and forcing to 1X.\n");
+                       dev_info(&pdev->dev, "AMD 761 chipset with errata; disabling AGP fast writes & SBA and forcing to 1X\n");
                }
        }
 
index 481ffe87c716472548d99c7d79bde85872bb0c0e..7495c522d8e477ac3aa0431c95fead255e7879ac 100644 (file)
@@ -34,6 +34,7 @@
 
 static struct resource *aperture_resource;
 static int __initdata agp_try_unsupported = 1;
+static int agp_bridges_found;
 
 static void amd64_tlbflush(struct agp_memory *temp)
 {
@@ -293,12 +294,13 @@ static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
         * so let double check that order, and lets trust the AMD NB settings
         */
        if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) {
-               printk(KERN_INFO "Aperture size %u MB is not right, using settings from NB\n",
-                                 32 << order);
+               dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n",
+                        32 << order);
                order = nb_order;
        }
 
-       printk(KERN_INFO PFX "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order);
+       dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n",
+                aper, 32 << order);
        if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order))
                return -1;
 
@@ -319,10 +321,10 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
        for (i = 0; i < num_k8_northbridges; i++) {
                struct pci_dev *dev = k8_northbridges[i];
                if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
-                       printk(KERN_ERR PFX "No usable aperture found.\n");
+                       dev_err(&dev->dev, "no usable aperture found\n");
 #ifdef __x86_64__
                        /* should port this to i386 */
-                       printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
+                       dev_err(&dev->dev, "consider rebooting with iommu=memaper=2 to get a good aperture\n");
 #endif
                        return -1;
                }
@@ -345,14 +347,14 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data
        default:   revstring="??"; break;
        }
 
-       printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring);
+       dev_info(&pdev->dev, "AMD 8151 AGP Bridge rev %s\n", revstring);
 
        /*
         * Work around errata.
         * Chips before B2 stepping incorrectly reporting v3.5
         */
        if (pdev->revision < 0x13) {
-               printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n");
+               dev_info(&pdev->dev, "correcting AGP revision (reports 3.5, is really 3.0)\n");
                bridge->major_version = 3;
                bridge->minor_version = 0;
        }
@@ -375,11 +377,11 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
        struct pci_dev *dev1;
        int i;
        unsigned size = amd64_fetch_size();
-       printk(KERN_INFO "Setting up ULi AGP.\n");
+
+       dev_info(&pdev->dev, "setting up ULi AGP\n");
        dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0));
        if (dev1 == NULL) {
-               printk(KERN_INFO PFX "Detected a ULi chipset, "
-                       "but could not fine the secondary device.\n");
+               dev_info(&pdev->dev, "can't find ULi secondary device\n");
                return -ENODEV;
        }
 
@@ -388,7 +390,7 @@ static int __devinit uli_agp_init(struct pci_dev *pdev)
                        break;
 
        if (i == ARRAY_SIZE(uli_sizes)) {
-               printk(KERN_INFO PFX "No ULi size found for %d\n", size);
+               dev_info(&pdev->dev, "no ULi size found for %d\n", size);
                return -ENODEV;
        }
 
@@ -433,13 +435,11 @@ static int nforce3_agp_init(struct pci_dev *pdev)
        int i;
        unsigned size = amd64_fetch_size();
 
-       printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n");
+       dev_info(&pdev->dev, "setting up Nforce3 AGP\n");
 
        dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0));
        if (dev1 == NULL) {
-               printk(KERN_INFO PFX "agpgart: Detected an NVIDIA "
-                       "nForce3 chipset, but could not find "
-                       "the secondary device.\n");
+               dev_info(&pdev->dev, "can't find Nforce3 secondary device\n");
                return -ENODEV;
        }
 
@@ -448,7 +448,7 @@ static int nforce3_agp_init(struct pci_dev *pdev)
                        break;
 
        if (i == ARRAY_SIZE(nforce3_sizes)) {
-               printk(KERN_INFO PFX "No NForce3 size found for %d\n", size);
+               dev_info(&pdev->dev, "no NForce3 size found for %d\n", size);
                return -ENODEV;
        }
 
@@ -462,7 +462,7 @@ static int nforce3_agp_init(struct pci_dev *pdev)
 
        /* if x86-64 aperture base is beyond 4G, exit here */
        if ( (apbase & 0x7fff) >> (32 - 25) ) {
-               printk(KERN_INFO PFX "aperture base > 4G\n");
+               dev_info(&pdev->dev, "aperture base > 4G\n");
                return -ENODEV;
        }
 
@@ -489,6 +489,7 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
 {
        struct agp_bridge_data *bridge;
        u8 cap_ptr;
+       int err;
 
        cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
        if (!cap_ptr)
@@ -504,7 +505,8 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
            pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
                amd8151_init(pdev, bridge);
        } else {
-               printk(KERN_INFO PFX "Detected AGP bridge %x\n", pdev->devfn);
+               dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n",
+                        pdev->vendor, pdev->device);
        }
 
        bridge->driver = &amd_8151_driver;
@@ -536,7 +538,12 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
        }
 
        pci_set_drvdata(pdev, bridge);
-       return agp_add_bridge(bridge);
+       err = agp_add_bridge(bridge);
+       if (err < 0)
+               return err;
+
+       agp_bridges_found++;
+       return 0;
 }
 
 static void __devexit agp_amd64_remove(struct pci_dev *pdev)
@@ -713,7 +720,11 @@ int __init agp_amd64_init(void)
 
        if (agp_off)
                return -EINVAL;
-       if (pci_register_driver(&agp_amd64_pci_driver) < 0) {
+       err = pci_register_driver(&agp_amd64_pci_driver);
+       if (err < 0)
+               return err;
+
+       if (agp_bridges_found == 0) {
                struct pci_dev *dev;
                if (!agp_try_unsupported && !agp_try_unsupported_boot) {
                        printk(KERN_INFO PFX "No supported AGP bridge found.\n");
index 3a4566c0d84faef4cc5f15de4f50bfdec942e6cf..6ecbcafb34b1978dfe62b1eca7a2d0cf849285ed 100644 (file)
@@ -486,8 +486,8 @@ static int __devinit agp_ati_probe(struct pci_dev *pdev,
                        goto found;
        }
 
-       printk(KERN_ERR PFX
-            "Unsupported Ati chipset (device id: %04x)\n", pdev->device);
+       dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n",
+               pdev->vendor, pdev->device);
        return -ENODEV;
 
 found:
@@ -500,8 +500,7 @@ found:
 
        bridge->driver = &ati_generic_bridge;
 
-       printk(KERN_INFO PFX "Detected Ati %s chipset\n",
-                       devs[j].chipset_name);
+       dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name);
 
        /* Fill in the mode register */
        pci_read_config_dword(pdev,
index 1ec87104e68cf56f32bfc2d065b3d70a1325ceab..3a3cc03d401ce3d3d1484f681bfaae6ba6d88e28 100644 (file)
@@ -144,7 +144,8 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
                void *addr = bridge->driver->agp_alloc_page(bridge);
 
                if (!addr) {
-                       printk(KERN_ERR PFX "unable to get memory for scratch page.\n");
+                       dev_err(&bridge->dev->dev,
+                               "can't get memory for scratch page\n");
                        return -ENOMEM;
                }
 
@@ -155,13 +156,13 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
 
        size_value = bridge->driver->fetch_size();
        if (size_value == 0) {
-               printk(KERN_ERR PFX "unable to determine aperture size.\n");
+               dev_err(&bridge->dev->dev, "can't determine aperture size\n");
                rc = -EINVAL;
                goto err_out;
        }
        if (bridge->driver->create_gatt_table(bridge)) {
-               printk(KERN_ERR PFX
-                   "unable to get memory for graphics translation table.\n");
+               dev_err(&bridge->dev->dev,
+                       "can't get memory for graphics translation table\n");
                rc = -ENOMEM;
                goto err_out;
        }
@@ -169,7 +170,8 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
 
        bridge->key_list = vmalloc(PAGE_SIZE * 4);
        if (bridge->key_list == NULL) {
-               printk(KERN_ERR PFX "error allocating memory for key lists.\n");
+               dev_err(&bridge->dev->dev,
+                       "can't allocate memory for key lists\n");
                rc = -ENOMEM;
                goto err_out;
        }
@@ -179,10 +181,12 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
        memset(bridge->key_list, 0, PAGE_SIZE * 4);
 
        if (bridge->driver->configure()) {
-               printk(KERN_ERR PFX "error configuring host chipset.\n");
+               dev_err(&bridge->dev->dev, "error configuring host chipset\n");
                rc = -EINVAL;
                goto err_out;
        }
+       INIT_LIST_HEAD(&bridge->mapped_list);
+       spin_lock_init(&bridge->mapped_lock);
 
        return 0;
 
@@ -269,25 +273,27 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
 
        /* Grab reference on the chipset driver. */
        if (!try_module_get(bridge->driver->owner)) {
-               printk (KERN_INFO PFX "Couldn't lock chipset driver.\n");
+               dev_info(&bridge->dev->dev, "can't lock chipset driver\n");
                return -EINVAL;
        }
 
        error = agp_backend_initialize(bridge);
        if (error) {
-               printk (KERN_INFO PFX "agp_backend_initialize() failed.\n");
+               dev_info(&bridge->dev->dev,
+                        "agp_backend_initialize() failed\n");
                goto err_out;
        }
 
        if (list_empty(&agp_bridges)) {
                error = agp_frontend_initialize();
                if (error) {
-                       printk (KERN_INFO PFX "agp_frontend_initialize() failed.\n");
+                       dev_info(&bridge->dev->dev,
+                                "agp_frontend_initialize() failed\n");
                        goto frontend_err;
                }
 
-               printk(KERN_INFO PFX "AGP aperture is %dM @ 0x%lx\n",
-                       bridge->driver->fetch_size(), bridge->gart_bus_addr);
+               dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n",
+                        bridge->driver->fetch_size(), bridge->gart_bus_addr);
 
        }
 
index eaa1a355bb326a483b270689347fc49a80cbe05a..118dbde25dc71ac53ca2afa24f784d2a0dfbce17 100644 (file)
@@ -429,6 +429,10 @@ int agp_bind_memory(struct agp_memory *curr, off_t pg_start)
 
        curr->is_bound = true;
        curr->pg_start = pg_start;
+       spin_lock(&agp_bridge->mapped_lock);
+       list_add(&curr->mapped_list, &agp_bridge->mapped_list);
+       spin_unlock(&agp_bridge->mapped_lock);
+
        return 0;
 }
 EXPORT_SYMBOL(agp_bind_memory);
@@ -461,10 +465,34 @@ int agp_unbind_memory(struct agp_memory *curr)
 
        curr->is_bound = false;
        curr->pg_start = 0;
+       spin_lock(&curr->bridge->mapped_lock);
+       list_del(&curr->mapped_list);
+       spin_unlock(&curr->bridge->mapped_lock);
        return 0;
 }
 EXPORT_SYMBOL(agp_unbind_memory);
 
+/**
+ *     agp_rebind_emmory  -  Rewrite the entire GATT, useful on resume
+ */
+int agp_rebind_memory(void)
+{
+       struct agp_memory *curr;
+       int ret_val = 0;
+
+       spin_lock(&agp_bridge->mapped_lock);
+       list_for_each_entry(curr, &agp_bridge->mapped_list, mapped_list) {
+               ret_val = curr->bridge->driver->insert_memory(curr,
+                                                             curr->pg_start,
+                                                             curr->type);
+               if (ret_val != 0)
+                       break;
+       }
+       spin_unlock(&agp_bridge->mapped_lock);
+       return ret_val;
+}
+EXPORT_SYMBOL(agp_rebind_memory);
+
 /* End - Routines for handling swapping of agp_memory into the GATT */
 
 
@@ -771,8 +799,8 @@ void agp_device_command(u32 bridge_agpstat, bool agp_v3)
                if (!agp)
                        continue;
 
-               printk(KERN_INFO PFX "Putting AGP V%d device at %s into %dx mode\n",
-                               agp_v3 ? 3 : 2, pci_name(device), mode);
+               dev_info(&device->dev, "putting AGP V%d device into %dx mode\n",
+                        agp_v3 ? 3 : 2, mode);
                pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat);
        }
 }
@@ -800,10 +828,8 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
 
        get_agp_version(agp_bridge);
 
-       printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
-                               agp_bridge->major_version,
-                               agp_bridge->minor_version,
-                               pci_name(agp_bridge->dev));
+       dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
+                agp_bridge->major_version, agp_bridge->minor_version);
 
        pci_read_config_dword(agp_bridge->dev,
                      agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat);
@@ -832,8 +858,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
                    pci_write_config_dword(bridge->dev,
                                        bridge->capndx+AGPCTRL, temp);
 
-                   printk(KERN_INFO PFX "Device is in legacy mode,"
-                               " falling back to 2.x\n");
+                   dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n");
                }
        }
 
index df702642ab8fb49334ae46c0f0125df4a735376c..016fdf0623a4ce7b5f849efc8ab099a2c5026497 100644 (file)
@@ -32,8 +32,8 @@
 #define PCI_DEVICE_ID_INTEL_Q35_IG          0x29B2
 #define PCI_DEVICE_ID_INTEL_Q33_HB          0x29D0
 #define PCI_DEVICE_ID_INTEL_Q33_IG          0x29D2
-#define PCI_DEVICE_ID_INTEL_IGD_HB          0x2A40
-#define PCI_DEVICE_ID_INTEL_IGD_IG          0x2A42
+#define PCI_DEVICE_ID_INTEL_GM45_HB         0x2A40
+#define PCI_DEVICE_ID_INTEL_GM45_IG         0x2A42
 #define PCI_DEVICE_ID_INTEL_IGD_E_HB        0x2E00
 #define PCI_DEVICE_ID_INTEL_IGD_E_IG        0x2E02
 #define PCI_DEVICE_ID_INTEL_Q45_HB          0x2E10
@@ -55,7 +55,7 @@
                 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \
                 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB || \
                 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GME_HB || \
-                agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_HB)
+                agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB)
 
 #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \
                agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \
@@ -161,7 +161,7 @@ static int intel_i810_fetch_size(void)
        values = A_SIZE_FIX(agp_bridge->driver->aperture_sizes);
 
        if ((smram_miscc & I810_GMS) == I810_GMS_DISABLE) {
-               printk(KERN_WARNING PFX "i810 is disabled\n");
+               dev_warn(&agp_bridge->dev->dev, "i810 is disabled\n");
                return 0;
        }
        if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) {
@@ -193,7 +193,8 @@ static int intel_i810_configure(void)
 
                intel_private.registers = ioremap(temp, 128 * 4096);
                if (!intel_private.registers) {
-                       printk(KERN_ERR PFX "Unable to remap memory.\n");
+                       dev_err(&intel_private.pcidev->dev,
+                               "can't remap memory\n");
                        return -ENOMEM;
                }
        }
@@ -201,7 +202,8 @@ static int intel_i810_configure(void)
        if ((readl(intel_private.registers+I810_DRAM_CTL)
                & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) {
                /* This will need to be dynamically assigned */
-               printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n");
+               dev_info(&intel_private.pcidev->dev,
+                        "detected 4MB dedicated video ram\n");
                intel_private.num_dcache_entries = 1024;
        }
        pci_read_config_dword(intel_private.pcidev, I810_GMADDR, &temp);
@@ -500,8 +502,8 @@ static void intel_i830_init_gtt_entries(void)
                        size = 1024 + 512;
                        break;
                default:
-                       printk(KERN_INFO PFX "Unknown page table size, "
-                              "assuming 512KB\n");
+                       dev_info(&intel_private.pcidev->dev,
+                                "unknown page table size, assuming 512KB\n");
                        size = 512;
                }
                size += 4; /* add in BIOS popup space */
@@ -515,8 +517,8 @@ static void intel_i830_init_gtt_entries(void)
                        size = 2048;
                        break;
                default:
-                       printk(KERN_INFO PFX "Unknown page table size 0x%x, "
-                               "assuming 512KB\n",
+                       dev_info(&agp_bridge->dev->dev,
+                                "unknown page table size 0x%x, assuming 512KB\n",
                                (gmch_ctrl & G33_PGETBL_SIZE_MASK));
                        size = 512;
                }
@@ -627,11 +629,11 @@ static void intel_i830_init_gtt_entries(void)
                }
        }
        if (gtt_entries > 0)
-               printk(KERN_INFO PFX "Detected %dK %s memory.\n",
+               dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n",
                       gtt_entries / KB(1), local ? "local" : "stolen");
        else
-               printk(KERN_INFO PFX
-                      "No pre-allocated video memory detected.\n");
+               dev_info(&agp_bridge->dev->dev,
+                      "no pre-allocated video memory detected\n");
        gtt_entries /= KB(4);
 
        intel_private.gtt_entries = gtt_entries;
@@ -801,10 +803,12 @@ static int intel_i830_insert_entries(struct agp_memory *mem, off_t pg_start,
        num_entries = A_SIZE_FIX(temp)->num_entries;
 
        if (pg_start < intel_private.gtt_entries) {
-               printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n",
-                               pg_start, intel_private.gtt_entries);
+               dev_printk(KERN_DEBUG, &intel_private.pcidev->dev,
+                          "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n",
+                          pg_start, intel_private.gtt_entries);
 
-               printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n");
+               dev_info(&intel_private.pcidev->dev,
+                        "trying to insert into local/stolen memory\n");
                goto out_err;
        }
 
@@ -851,7 +855,8 @@ static int intel_i830_remove_entries(struct agp_memory *mem, off_t pg_start,
                return 0;
 
        if (pg_start < intel_private.gtt_entries) {
-               printk(KERN_INFO PFX "Trying to disable local/stolen memory\n");
+               dev_info(&intel_private.pcidev->dev,
+                        "trying to disable local/stolen memory\n");
                return -EINVAL;
        }
 
@@ -957,7 +962,7 @@ static void intel_i9xx_setup_flush(void)
        if (intel_private.ifp_resource.start) {
                intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE);
                if (!intel_private.i9xx_flush_page)
-                       printk(KERN_INFO "unable to ioremap flush  page - no chipset flushing");
+                       dev_info(&intel_private.pcidev->dev, "can't ioremap flush page - no chipset flushing");
        }
 }
 
@@ -1028,10 +1033,12 @@ static int intel_i915_insert_entries(struct agp_memory *mem, off_t pg_start,
        num_entries = A_SIZE_FIX(temp)->num_entries;
 
        if (pg_start < intel_private.gtt_entries) {
-               printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n",
-                               pg_start, intel_private.gtt_entries);
+               dev_printk(KERN_DEBUG, &intel_private.pcidev->dev,
+                          "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n",
+                          pg_start, intel_private.gtt_entries);
 
-               printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n");
+               dev_info(&intel_private.pcidev->dev,
+                        "trying to insert into local/stolen memory\n");
                goto out_err;
        }
 
@@ -1078,7 +1085,8 @@ static int intel_i915_remove_entries(struct agp_memory *mem, off_t pg_start,
                return 0;
 
        if (pg_start < intel_private.gtt_entries) {
-               printk(KERN_INFO PFX "Trying to disable local/stolen memory\n");
+               dev_info(&intel_private.pcidev->dev,
+                        "trying to disable local/stolen memory\n");
                return -EINVAL;
        }
 
@@ -1182,7 +1190,7 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge,
 static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
 {
        switch (agp_bridge->dev->device) {
-       case PCI_DEVICE_ID_INTEL_IGD_HB:
+       case PCI_DEVICE_ID_INTEL_GM45_HB:
        case PCI_DEVICE_ID_INTEL_IGD_E_HB:
        case PCI_DEVICE_ID_INTEL_Q45_HB:
        case PCI_DEVICE_ID_INTEL_G45_HB:
@@ -1379,7 +1387,7 @@ static int intel_815_configure(void)
        /* the Intel 815 chipset spec. says that bits 29-31 in the
        * ATTBASE register are reserved -> try not to write them */
        if (agp_bridge->gatt_bus_addr & INTEL_815_ATTBASE_MASK) {
-               printk(KERN_EMERG PFX "gatt bus addr too high");
+               dev_emerg(&agp_bridge->dev->dev, "gatt bus addr too high");
                return -EINVAL;
        }
 
@@ -2117,8 +2125,8 @@ static const struct intel_driver_description {
                NULL, &intel_g33_driver },
        { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33",
                NULL, &intel_g33_driver },
-       { PCI_DEVICE_ID_INTEL_IGD_HB, PCI_DEVICE_ID_INTEL_IGD_IG, 0,
-           "Intel Integrated Graphics Device", NULL, &intel_i965_driver },
+       { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0,
+           "Mobile Intel? GM45 Express", NULL, &intel_i965_driver },
        { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0,
            "Intel Integrated Graphics Device", NULL, &intel_i965_driver },
        { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0,
@@ -2163,8 +2171,8 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 
        if (intel_agp_chipsets[i].name == NULL) {
                if (cap_ptr)
-                       printk(KERN_WARNING PFX "Unsupported Intel chipset"
-                              "(device id: %04x)\n", pdev->device);
+                       dev_warn(&pdev->dev, "unsupported Intel chipset [%04x/%04x]\n",
+                                pdev->vendor, pdev->device);
                agp_put_bridge(bridge);
                return -ENODEV;
        }
@@ -2172,9 +2180,8 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
        if (bridge->driver == NULL) {
                /* bridge has no AGP and no IGD detected */
                if (cap_ptr)
-                       printk(KERN_WARNING PFX "Failed to find bridge device "
-                               "(chip_id: %04x)\n",
-                               intel_agp_chipsets[i].gmch_chip_id);
+                       dev_warn(&pdev->dev, "can't find bridge device (chip_id: %04x)\n",
+                                intel_agp_chipsets[i].gmch_chip_id);
                agp_put_bridge(bridge);
                return -ENODEV;
        }
@@ -2183,8 +2190,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
        bridge->capndx = cap_ptr;
        bridge->dev_private_data = &intel_private;
 
-       printk(KERN_INFO PFX "Detected an Intel %s Chipset.\n",
-               intel_agp_chipsets[i].name);
+       dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name);
 
        /*
        * The following fixes the case where the BIOS has "forgotten" to
@@ -2194,7 +2200,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
        r = &pdev->resource[0];
        if (!r->start && r->end) {
                if (pci_assign_resource(pdev, 0)) {
-                       printk(KERN_ERR PFX "could not assign resource 0\n");
+                       dev_err(&pdev->dev, "can't assign resource 0\n");
                        agp_put_bridge(bridge);
                        return -ENODEV;
                }
@@ -2206,7 +2212,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
        * 20030610 - hamish@zot.org
        */
        if (pci_enable_device(pdev)) {
-               printk(KERN_ERR PFX "Unable to Enable PCI device\n");
+               dev_err(&pdev->dev, "can't enable PCI device\n");
                agp_put_bridge(bridge);
                return -ENODEV;
        }
@@ -2238,6 +2244,7 @@ static void __devexit agp_intel_remove(struct pci_dev *pdev)
 static int agp_intel_resume(struct pci_dev *pdev)
 {
        struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
+       int ret_val;
 
        pci_restore_state(pdev);
 
@@ -2265,6 +2272,10 @@ static int agp_intel_resume(struct pci_dev *pdev)
        else if (bridge->driver == &intel_i965_driver)
                intel_i915_configure();
 
+       ret_val = agp_rebind_memory();
+       if (ret_val != 0)
+               return ret_val;
+
        return 0;
 }
 #endif
@@ -2315,7 +2326,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
        ID(PCI_DEVICE_ID_INTEL_G33_HB),
        ID(PCI_DEVICE_ID_INTEL_Q35_HB),
        ID(PCI_DEVICE_ID_INTEL_Q33_HB),
-       ID(PCI_DEVICE_ID_INTEL_IGD_HB),
+       ID(PCI_DEVICE_ID_INTEL_GM45_HB),
        ID(PCI_DEVICE_ID_INTEL_IGD_E_HB),
        ID(PCI_DEVICE_ID_INTEL_Q45_HB),
        ID(PCI_DEVICE_ID_INTEL_G45_HB),
index 3f9ccde62377d1c47d9d2858caadaac3c1c06f9d..c73385cc4b8a4f907161eca5258294bea2a9b159 100644 (file)
@@ -153,7 +153,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge,
 
        /* Check if this configuration has any chance of working */
        if (tot_bw > target.maxbw) {
-               printk(KERN_ERR PFX "isochronous bandwidth required "
+               dev_err(&td->dev, "isochronous bandwidth required "
                        "by AGP 3.0 devices exceeds that which is supported by "
                        "the AGP 3.0 bridge!\n");
                ret = -ENODEV;
@@ -188,7 +188,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge,
        /* Exit if the minimal ISOCH_N allocation among the masters is more
         * than the target can handle. */
        if (tot_n > target.n) {
-               printk(KERN_ERR PFX "number of isochronous "
+               dev_err(&td->dev, "number of isochronous "
                        "transactions per period required by AGP 3.0 devices "
                        "exceeds that which is supported by the AGP 3.0 "
                        "bridge!\n");
@@ -229,7 +229,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge,
        /* Exit if the minimal RQ needs of the masters exceeds what the target
         * can provide. */
        if (tot_rq > rq_isoch) {
-               printk(KERN_ERR PFX "number of request queue slots "
+               dev_err(&td->dev, "number of request queue slots "
                        "required by the isochronous bandwidth requested by "
                        "AGP 3.0 devices exceeds the number provided by the "
                        "AGP 3.0 bridge!\n");
@@ -359,8 +359,9 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
                        case 0x0001:    /* Unclassified device */
                                /* Don't know what this is, but log it for investigation. */
                                if (mcapndx != 0) {
-                                       printk (KERN_INFO PFX "Wacky, found unclassified AGP device. %x:%x\n",
-                                               dev->vendor, dev->device);
+                                       dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x/%04x]\n",
+                                                pci_name(dev),
+                                                dev->vendor, dev->device);
                                }
                                continue;
 
@@ -407,17 +408,18 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
                }
 
                if (mcapndx == 0) {
-                       printk(KERN_ERR PFX "woah!  Non-AGP device "
-                               "found on the secondary bus of an AGP 3.5 bridge!\n");
+                       dev_err(&td->dev, "woah!  Non-AGP device %s on "
+                               "secondary bus of AGP 3.5 bridge!\n",
+                               pci_name(dev));
                        ret = -ENODEV;
                        goto free_and_exit;
                }
 
                mmajor = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf;
                if (mmajor < 3) {
-                       printk(KERN_ERR PFX "woah!  AGP 2.0 device "
-                               "found on the secondary bus of an AGP 3.5 "
-                               "bridge operating with AGP 3.0 electricals!\n");
+                       dev_err(&td->dev, "woah!  AGP 2.0 device %s on "
+                               "secondary bus of AGP 3.5 bridge operating "
+                               "with AGP 3.0 electricals!\n", pci_name(dev));
                        ret = -ENODEV;
                        goto free_and_exit;
                }
@@ -427,10 +429,10 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
                pci_read_config_dword(dev, cur->capndx+AGPSTAT, &mstatus);
 
                if (((mstatus >> 3) & 0x1) == 0) {
-                       printk(KERN_ERR PFX "woah!  AGP 3.x device "
-                               "not operating in AGP 3.x mode found on the "
-                               "secondary bus of an AGP 3.5 bridge operating "
-                               "with AGP 3.0 electricals!\n");
+                       dev_err(&td->dev, "woah!  AGP 3.x device %s not "
+                               "operating in AGP 3.x mode on secondary bus "
+                               "of AGP 3.5 bridge operating with AGP 3.0 "
+                               "electricals!\n", pci_name(dev));
                        ret = -ENODEV;
                        goto free_and_exit;
                }
@@ -444,9 +446,9 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
        if (isoch) {
                ret = agp_3_5_isochronous_node_enable(bridge, dev_list, ndevs);
                if (ret) {
-                       printk(KERN_INFO PFX "Something bad happened setting "
-                              "up isochronous xfers.  Falling back to "
-                              "non-isochronous xfer mode.\n");
+                       dev_info(&td->dev, "something bad happened setting "
+                                "up isochronous xfers; falling back to "
+                                "non-isochronous xfer mode\n");
                } else {
                        goto free_and_exit;
                }
@@ -466,4 +468,3 @@ free_and_exit:
 get_out:
        return ret;
 }
-
index b6791846809fc7cda691146ff625befac1342bec..2587ef96a9603afdd965ce016be1806eab000a70 100644 (file)
@@ -79,10 +79,8 @@ static void sis_delayed_enable(struct agp_bridge_data *bridge, u32 mode)
        u32 command;
        int rate;
 
-       printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
-               agp_bridge->major_version,
-               agp_bridge->minor_version,
-               pci_name(agp_bridge->dev));
+       dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
+                agp_bridge->major_version, agp_bridge->minor_version);
 
        pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command);
        command = agp_collect_device_status(bridge, mode, command);
@@ -94,8 +92,8 @@ static void sis_delayed_enable(struct agp_bridge_data *bridge, u32 mode)
                if (!agp)
                        continue;
 
-               printk(KERN_INFO PFX "Putting AGP V3 device at %s into %dx mode\n",
-                       pci_name(device), rate);
+               dev_info(&agp_bridge->dev->dev, "putting AGP V3 device at %s into %dx mode\n",
+                        pci_name(device), rate);
 
                pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command);
 
@@ -105,7 +103,7 @@ static void sis_delayed_enable(struct agp_bridge_data *bridge, u32 mode)
                 * cannot be configured
                 */
                if (device->device == bridge->dev->device) {
-                       printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n");
+                       dev_info(&agp_bridge->dev->dev, "SiS delay workaround: giving bridge time to recover\n");
                        msleep(10);
                }
        }
@@ -190,7 +188,8 @@ static int __devinit agp_sis_probe(struct pci_dev *pdev,
                return -ENODEV;
 
 
-       printk(KERN_INFO PFX "Detected SiS chipset - id:%i\n", pdev->device);
+       dev_info(&pdev->dev, "SiS chipset [%04x/%04x]\n",
+                pdev->vendor, pdev->device);
        bridge = agp_alloc_bridge();
        if (!bridge)
                return -ENOMEM;
@@ -242,7 +241,7 @@ static struct pci_device_id agp_sis_pci_table[] = {
                .class          = (PCI_CLASS_BRIDGE_HOST << 8),
                .class_mask     = ~0,
                .vendor         = PCI_VENDOR_ID_SI,
-               .device         = PCI_DEVICE_ID_SI_5591_AGP,
+               .device         = PCI_DEVICE_ID_SI_5591,
                .subvendor      = PCI_ANY_ID,
                .subdevice      = PCI_ANY_ID,
        },
index 0e054c1344908db74790c5f374ca5ca96c66d243..2fb27fe4c10c186d4003c314c4f53b456f87e799 100644 (file)
@@ -241,7 +241,8 @@ static void serverworks_tlbflush(struct agp_memory *temp)
        while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) {
                cpu_relax();
                if (time_after(jiffies, timeout)) {
-                       printk(KERN_ERR PFX "TLB post flush took more than 3 seconds\n");
+                       dev_err(&serverworks_private.svrwrks_dev->dev,
+                               "TLB post flush took more than 3 seconds\n");
                        break;
                }
        }
@@ -251,7 +252,8 @@ static void serverworks_tlbflush(struct agp_memory *temp)
        while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) {
                cpu_relax();
                if (time_after(jiffies, timeout)) {
-                       printk(KERN_ERR PFX "TLB Dir flush took more than 3 seconds\n");
+                       dev_err(&serverworks_private.svrwrks_dev->dev,
+                               "TLB Dir flush took more than 3 seconds\n");
                        break;
                }
        }
@@ -271,7 +273,7 @@ static int serverworks_configure(void)
        temp = (temp & PCI_BASE_ADDRESS_MEM_MASK);
        serverworks_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096);
        if (!serverworks_private.registers) {
-               printk (KERN_ERR PFX "Unable to ioremap() memory.\n");
+               dev_err(&agp_bridge->dev->dev, "can't ioremap(%#x)\n", temp);
                return -ENOMEM;
        }
 
@@ -451,7 +453,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 
        switch (pdev->device) {
        case 0x0006:
-               printk (KERN_ERR PFX "ServerWorks CNB20HE is unsupported due to lack of documentation.\n");
+               dev_err(&pdev->dev, "ServerWorks CNB20HE is unsupported due to lack of documentation\n");
                return -ENODEV;
 
        case PCI_DEVICE_ID_SERVERWORKS_HE:
@@ -461,8 +463,8 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 
        default:
                if (cap_ptr)
-                       printk(KERN_ERR PFX "Unsupported Serverworks chipset "
-                                       "(device id: %04x)\n", pdev->device);
+                       dev_err(&pdev->dev, "unsupported Serverworks chipset "
+                               "[%04x/%04x]\n", pdev->vendor, pdev->device);
                return -ENODEV;
        }
 
@@ -470,8 +472,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
        bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
                        PCI_DEVFN(0, 1));
        if (!bridge_dev) {
-               printk(KERN_INFO PFX "Detected a Serverworks chipset "
-                      "but could not find the secondary device.\n");
+               dev_info(&pdev->dev, "can't find secondary device\n");
                return -ENODEV;
        }
 
@@ -482,8 +483,8 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
        if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
                pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2);
                if (temp2 != 0) {
-                       printk(KERN_INFO PFX "Detected 64 bit aperture address, "
-                              "but top bits are not zero.  Disabling agp\n");
+                       dev_info(&pdev->dev, "64 bit aperture address, "
+                                "but top bits are not zero; disabling AGP\n");
                        return -ENODEV;
                }
                serverworks_private.mm_addr_ofs = 0x18;
@@ -495,8 +496,8 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
                pci_read_config_dword(pdev,
                                serverworks_private.mm_addr_ofs + 4, &temp2);
                if (temp2 != 0) {
-                       printk(KERN_INFO PFX "Detected 64 bit MMIO address, "
-                              "but top bits are not zero.  Disabling agp\n");
+                       dev_info(&pdev->dev, "64 bit MMIO address, but top "
+                                "bits are not zero; disabling AGP\n");
                        return -ENODEV;
                }
        }
index d2fa3cfca02a2ccf1b033e852a078320c64577a9..eef72709ec5331902291c26f37eb9301daba48af 100644 (file)
@@ -46,8 +46,8 @@ static int uninorth_fetch_size(void)
                                break;
 
                if (i == agp_bridge->driver->num_aperture_sizes) {
-                       printk(KERN_ERR PFX "Invalid aperture size, using"
-                              " default\n");
+                       dev_err(&agp_bridge->dev->dev, "invalid aperture size, "
+                               "using default\n");
                        size = 0;
                        aperture = NULL;
                }
@@ -108,8 +108,8 @@ static int uninorth_configure(void)
 
        current_size = A_SIZE_32(agp_bridge->current_size);
 
-       printk(KERN_INFO PFX "configuring for size idx: %d\n",
-              current_size->size_value);
+       dev_info(&agp_bridge->dev->dev, "configuring for size idx: %d\n",
+                current_size->size_value);
 
        /* aperture size and gatt addr */
        pci_write_config_dword(agp_bridge->dev,
@@ -197,8 +197,9 @@ static int u3_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
        gp = (u32 *) &agp_bridge->gatt_table[pg_start];
        for (i = 0; i < mem->page_count; ++i) {
                if (gp[i]) {
-                       printk("u3_insert_memory: entry 0x%x occupied (%x)\n",
-                              i, gp[i]);
+                       dev_info(&agp_bridge->dev->dev,
+                                "u3_insert_memory: entry 0x%x occupied (%x)\n",
+                                i, gp[i]);
                        return -EBUSY;
                }
        }
@@ -276,8 +277,8 @@ static void uninorth_agp_enable(struct agp_bridge_data *bridge, u32 mode)
                                       &scratch);
        } while ((scratch & PCI_AGP_COMMAND_AGP) == 0 && ++timeout < 1000);
        if ((scratch & PCI_AGP_COMMAND_AGP) == 0)
-               printk(KERN_ERR PFX "failed to write UniNorth AGP"
-                      command register\n");
+               dev_err(&bridge->dev->dev, "can't write UniNorth AGP "
+                       "command register\n");
 
        if (uninorth_rev >= 0x30) {
                /* This is an AGP V3 */
@@ -330,8 +331,8 @@ static int agp_uninorth_suspend(struct pci_dev *pdev)
                pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd);
                if (!(cmd & PCI_AGP_COMMAND_AGP))
                        continue;
-               printk("uninorth-agp: disabling AGP on device %s\n",
-                               pci_name(device));
+               dev_info(&pdev->dev, "disabling AGP on device %s\n",
+                        pci_name(device));
                cmd &= ~PCI_AGP_COMMAND_AGP;
                pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd);
        }
@@ -341,8 +342,7 @@ static int agp_uninorth_suspend(struct pci_dev *pdev)
        pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd);
        bridge->dev_private_data = (void *)(long)cmd;
        if (cmd & PCI_AGP_COMMAND_AGP) {
-               printk("uninorth-agp: disabling AGP on bridge %s\n",
-                               pci_name(pdev));
+               dev_info(&pdev->dev, "disabling AGP on bridge\n");
                cmd &= ~PCI_AGP_COMMAND_AGP;
                pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd);
        }
@@ -591,14 +591,14 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
        /* probe for known chipsets */
        for (j = 0; devs[j].chipset_name != NULL; ++j) {
                if (pdev->device == devs[j].device_id) {
-                       printk(KERN_INFO PFX "Detected Apple %s chipset\n",
-                              devs[j].chipset_name);
+                       dev_info(&pdev->dev, "Apple %s chipset\n",
+                                devs[j].chipset_name);
                        goto found;
                }
        }
 
-       printk(KERN_ERR PFX "Unsupported Apple chipset (device id: %04x).\n",
-               pdev->device);
+       dev_err(&pdev->dev, "unsupported Apple chipset [%04x/%04x]\n",
+               pdev->vendor, pdev->device);
        return -ENODEV;
 
  found:
index 02aac104842d91033077da4488926fccfc7daa3d..fd64137b1ab915fb9384fa674ad54be65c5f0074 100644 (file)
@@ -322,11 +322,10 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
 
        hp->tty = tty;
 
-       if (hp->ops->notifier_add)
-               rc = hp->ops->notifier_add(hp, hp->data);
-
        spin_unlock_irqrestore(&hp->lock, flags);
 
+       if (hp->ops->notifier_add)
+               rc = hp->ops->notifier_add(hp, hp->data);
 
        /*
         * If the notifier fails we return an error.  The tty layer
index d9799e2bcfbfb128dfc583866fbc40cfcc0d1184..f53d4d00faf01ba76e46d8f99f94048230bd142d 100644 (file)
@@ -78,7 +78,6 @@
 #include <linux/wait.h>
 #include <linux/bcd.h>
 #include <linux/delay.h>
-#include <linux/smp_lock.h>
 #include <linux/uaccess.h>
 
 #include <asm/current.h>
index 31a0e0b455b6e3c61ffef1ef004351fac0085dcd..97b003839fb6ab0df4249fd29424f4ba05f0ec3b 100644 (file)
@@ -21,8 +21,8 @@ static int __init cpuidle_sysfs_setup(char *unused)
 }
 __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);
 
-static ssize_t show_available_governors(struct sys_device *dev,
-               struct sysdev_attribute *attr, char *buf)
+static ssize_t show_available_governors(struct sysdev_class *class,
+                                       char *buf)
 {
        ssize_t i = 0;
        struct cpuidle_governor *tmp;
@@ -40,8 +40,8 @@ out:
        return i;
 }
 
-static ssize_t show_current_driver(struct sys_device *dev,
-               struct sysdev_attribute *attr, char *buf)
+static ssize_t show_current_driver(struct sysdev_class *class,
+                                  char *buf)
 {
        ssize_t ret;
 
@@ -55,8 +55,8 @@ static ssize_t show_current_driver(struct sys_device *dev,
        return ret;
 }
 
-static ssize_t show_current_governor(struct sys_device *dev,
-                       struct sysdev_attribute *attr, char *buf)
+static ssize_t show_current_governor(struct sysdev_class *class,
+                                    char *buf)
 {
        ssize_t ret;
 
@@ -70,9 +70,8 @@ static ssize_t show_current_governor(struct sys_device *dev,
        return ret;
 }
 
-static ssize_t store_current_governor(struct sys_device *dev,
-       struct sysdev_attribute *attr,
-       const char *buf, size_t count)
+static ssize_t store_current_governor(struct sysdev_class *class,
+                                     const char *buf, size_t count)
 {
        char gov_name[CPUIDLE_NAME_LEN];
        int ret = -EINVAL;
@@ -104,8 +103,9 @@ static ssize_t store_current_governor(struct sys_device *dev,
                return count;
 }
 
-static SYSDEV_ATTR(current_driver, 0444, show_current_driver, NULL);
-static SYSDEV_ATTR(current_governor_ro, 0444, show_current_governor, NULL);
+static SYSDEV_CLASS_ATTR(current_driver, 0444, show_current_driver, NULL);
+static SYSDEV_CLASS_ATTR(current_governor_ro, 0444, show_current_governor,
+                        NULL);
 
 static struct attribute *cpuclass_default_attrs[] = {
        &attr_current_driver.attr,
@@ -113,9 +113,10 @@ static struct attribute *cpuclass_default_attrs[] = {
        NULL
 };
 
-static SYSDEV_ATTR(available_governors, 0444, show_available_governors, NULL);
-static SYSDEV_ATTR(current_governor, 0644, show_current_governor,
-       store_current_governor);
+static SYSDEV_CLASS_ATTR(available_governors, 0444, show_available_governors,
+                        NULL);
+static SYSDEV_CLASS_ATTR(current_governor, 0644, show_current_governor,
+                        store_current_governor);
 
 static struct attribute *cpuclass_switch_attrs[] = {
        &attr_available_governors.attr,
index 001622eb86f962d28f6b6842981817ddf7f14132..3bf8ee120d42d9e64cb64246157e46ed0b430c6f 100644 (file)
@@ -84,20 +84,23 @@ static struct kobj_type memmap_ktype = {
  */
 
 /*
- * Firmware memory map entries
+ * Firmware memory map entries. No locking is needed because the
+ * firmware_map_add() and firmware_map_add_early() functions are called
+ * in firmware initialisation code in one single thread of execution.
  */
 static LIST_HEAD(map_entries);
 
 /**
- * Common implementation of firmware_map_add() and firmware_map_add_early()
- * which expects a pre-allocated struct firmware_map_entry.
- *
+ * firmware_map_add_entry() - Does the real work to add a firmware memmap entry.
  * @start: Start of the memory range.
  * @end:   End of the memory range (inclusive).
  * @type:  Type of the memory range.
  * @entry: Pre-allocated (either kmalloc() or bootmem allocator), uninitialised
  *         entry.
- */
+ *
+ * Common implementation of firmware_map_add() and firmware_map_add_early()
+ * which expects a pre-allocated struct firmware_map_entry.
+ **/
 static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
                                  const char *type,
                                  struct firmware_map_entry *entry)
@@ -115,33 +118,52 @@ static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
        return 0;
 }
 
-/*
- * See <linux/firmware-map.h> for documentation.
- */
+/**
+ * firmware_map_add() - Adds a firmware mapping entry.
+ * @start: Start of the memory range.
+ * @end:   End of the memory range (inclusive).
+ * @type:  Type of the memory range.
+ *
+ * This function uses kmalloc() for memory
+ * allocation. Use firmware_map_add_early() if you want to use the bootmem
+ * allocator.
+ *
+ * That function must be called before late_initcall.
+ *
+ * Returns 0 on success, or -ENOMEM if no memory could be allocated.
+ **/
 int firmware_map_add(resource_size_t start, resource_size_t end,
                     const char *type)
 {
        struct firmware_map_entry *entry;
 
        entry = kmalloc(sizeof(struct firmware_map_entry), GFP_ATOMIC);
-       WARN_ON(!entry);
        if (!entry)
                return -ENOMEM;
 
        return firmware_map_add_entry(start, end, type, entry);
 }
 
-/*
- * See <linux/firmware-map.h> for documentation.
- */
+/**
+ * firmware_map_add_early() - Adds a firmware mapping entry.
+ * @start: Start of the memory range.
+ * @end:   End of the memory range (inclusive).
+ * @type:  Type of the memory range.
+ *
+ * Adds a firmware mapping entry. This function uses the bootmem allocator
+ * for memory allocation. Use firmware_map_add() if you want to use kmalloc().
+ *
+ * That function must be called before late_initcall.
+ *
+ * Returns 0 on success, or -ENOMEM if no memory could be allocated.
+ **/
 int __init firmware_map_add_early(resource_size_t start, resource_size_t end,
                                  const char *type)
 {
        struct firmware_map_entry *entry;
 
        entry = alloc_bootmem_low(sizeof(struct firmware_map_entry));
-       WARN_ON(!entry);
-       if (!entry)
+       if (WARN_ON(!entry))
                return -ENOMEM;
 
        return firmware_map_add_entry(start, end, type, entry);
@@ -183,7 +205,10 @@ static ssize_t memmap_attr_show(struct kobject *kobj,
 /*
  * Initialises stuff and adds the entries in the map_entries list to
  * sysfs. Important is that firmware_map_add() and firmware_map_add_early()
- * must be called before late_initcall.
+ * must be called before late_initcall. That's just because that function
+ * is called as late_initcall() function, which means that if you call
+ * firmware_map_add() or firmware_map_add_early() afterwards, the entries
+ * are not added to sysfs.
  */
 static int __init memmap_init(void)
 {
@@ -192,13 +217,13 @@ static int __init memmap_init(void)
        struct kset *memmap_kset;
 
        memmap_kset = kset_create_and_add("memmap", NULL, firmware_kobj);
-       WARN_ON(!memmap_kset);
-       if (!memmap_kset)
+       if (WARN_ON(!memmap_kset))
                return -ENOMEM;
 
        list_for_each_entry(entry, &map_entries, list) {
                entry->kobj.kset = memmap_kset;
-               kobject_add(&entry->kobj, NULL, "%d", i++);
+               if (kobject_add(&entry->kobj, NULL, "%d", i++))
+                       kobject_put(&entry->kobj);
        }
 
        return 0;
index 0b0618edd64528b363fe7acb85fd2388adf8f812..1ab919f836a8c516c797619e565cc091e5ee04d9 100644 (file)
@@ -156,6 +156,14 @@ struct ehca_mod_qp_parm {
 
 #define EHCA_MOD_QP_PARM_MAX 4
 
+#define QMAP_IDX_MASK 0xFFFFULL
+
+/* struct for tracking if cqes have been reported to the application */
+struct ehca_qmap_entry {
+       u16 app_wr_id;
+       u16 reported;
+};
+
 struct ehca_qp {
        union {
                struct ib_qp ib_qp;
@@ -165,6 +173,7 @@ struct ehca_qp {
        enum ehca_ext_qp_type ext_type;
        enum ib_qp_state state;
        struct ipz_queue ipz_squeue;
+       struct ehca_qmap_entry *sq_map;
        struct ipz_queue ipz_rqueue;
        struct h_galpas galpas;
        u32 qkey;
index 818803057ebf0bc37b8ef9a45bb49c79aad01122..5d28e3e98a20a9ca9bb5036d3dbc88262561e7a4 100644 (file)
@@ -213,6 +213,7 @@ struct ehca_wqe {
 #define WC_STATUS_ERROR_BIT 0x80000000
 #define WC_STATUS_REMOTE_ERROR_FLAGS 0x0000F800
 #define WC_STATUS_PURGE_BIT 0x10
+#define WC_SEND_RECEIVE_BIT 0x80
 
 struct ehca_cqe {
        u64 work_request_id;
index ea13efddf175b818747af7db1f024da9e2384639..b6bcee036734ff6ee0ff063196463a9b90cb7c40 100644 (file)
@@ -412,6 +412,7 @@ static struct ehca_qp *internal_create_qp(
        struct ehca_shca *shca = container_of(pd->device, struct ehca_shca,
                                              ib_device);
        struct ib_ucontext *context = NULL;
+       u32 nr_qes;
        u64 h_ret;
        int is_llqp = 0, has_srq = 0;
        int qp_type, max_send_sge, max_recv_sge, ret;
@@ -715,6 +716,15 @@ static struct ehca_qp *internal_create_qp(
                                 "and pages ret=%i", ret);
                        goto create_qp_exit2;
                }
+               nr_qes = my_qp->ipz_squeue.queue_length /
+                        my_qp->ipz_squeue.qe_size;
+               my_qp->sq_map = vmalloc(nr_qes *
+                                       sizeof(struct ehca_qmap_entry));
+               if (!my_qp->sq_map) {
+                       ehca_err(pd->device, "Couldn't allocate squeue "
+                                "map ret=%i", ret);
+                       goto create_qp_exit3;
+               }
        }
 
        if (HAS_RQ(my_qp)) {
@@ -724,7 +734,7 @@ static struct ehca_qp *internal_create_qp(
                if (ret) {
                        ehca_err(pd->device, "Couldn't initialize rqueue "
                                 "and pages ret=%i", ret);
-                       goto create_qp_exit3;
+                       goto create_qp_exit4;
                }
        }
 
@@ -770,7 +780,7 @@ static struct ehca_qp *internal_create_qp(
                        if (!my_qp->mod_qp_parm) {
                                ehca_err(pd->device,
                                         "Could not alloc mod_qp_parm");
-                               goto create_qp_exit4;
+                               goto create_qp_exit5;
                        }
                }
        }
@@ -780,7 +790,7 @@ static struct ehca_qp *internal_create_qp(
                h_ret = ehca_define_sqp(shca, my_qp, init_attr);
                if (h_ret != H_SUCCESS) {
                        ret = ehca2ib_return_code(h_ret);
-                       goto create_qp_exit5;
+                       goto create_qp_exit6;
                }
        }
 
@@ -789,7 +799,7 @@ static struct ehca_qp *internal_create_qp(
                if (ret) {
                        ehca_err(pd->device,
                                 "Couldn't assign qp to send_cq ret=%i", ret);
-                       goto create_qp_exit5;
+                       goto create_qp_exit6;
                }
        }
 
@@ -815,22 +825,26 @@ static struct ehca_qp *internal_create_qp(
                if (ib_copy_to_udata(udata, &resp, sizeof resp)) {
                        ehca_err(pd->device, "Copy to udata failed");
                        ret = -EINVAL;
-                       goto create_qp_exit6;
+                       goto create_qp_exit7;
                }
        }
 
        return my_qp;
 
-create_qp_exit6:
+create_qp_exit7:
        ehca_cq_unassign_qp(my_qp->send_cq, my_qp->real_qp_num);
 
-create_qp_exit5:
+create_qp_exit6:
        kfree(my_qp->mod_qp_parm);
 
-create_qp_exit4:
+create_qp_exit5:
        if (HAS_RQ(my_qp))
                ipz_queue_dtor(my_pd, &my_qp->ipz_rqueue);
 
+create_qp_exit4:
+       if (HAS_SQ(my_qp))
+               vfree(my_qp->sq_map);
+
 create_qp_exit3:
        if (HAS_SQ(my_qp))
                ipz_queue_dtor(my_pd, &my_qp->ipz_squeue);
@@ -1534,8 +1548,6 @@ static int internal_modify_qp(struct ib_qp *ibqp,
        if (attr_mask & IB_QP_QKEY)
                my_qp->qkey = attr->qkey;
 
-       my_qp->state = qp_new_state;
-
 modify_qp_exit2:
        if (squeue_locked) { /* this means: sqe -> rts */
                spin_unlock_irqrestore(&my_qp->spinlock_s, flags);
@@ -1551,6 +1563,8 @@ modify_qp_exit1:
 int ehca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
                   struct ib_udata *udata)
 {
+       int ret = 0;
+
        struct ehca_shca *shca = container_of(ibqp->device, struct ehca_shca,
                                              ib_device);
        struct ehca_qp *my_qp = container_of(ibqp, struct ehca_qp, ib_qp);
@@ -1597,12 +1611,18 @@ int ehca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
                                 attr->qp_state, my_qp->init_attr.port_num,
                                 ibqp->qp_type);
                        spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
-                       return 0;
+                       goto out;
                }
                spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
        }
 
-       return internal_modify_qp(ibqp, attr, attr_mask, 0);
+       ret = internal_modify_qp(ibqp, attr, attr_mask, 0);
+
+out:
+       if ((ret == 0) && (attr_mask & IB_QP_STATE))
+               my_qp->state = attr->qp_state;
+
+       return ret;
 }
 
 void ehca_recover_sqp(struct ib_qp *sqp)
@@ -1973,8 +1993,10 @@ static int internal_destroy_qp(struct ib_device *dev, struct ehca_qp *my_qp,
 
        if (HAS_RQ(my_qp))
                ipz_queue_dtor(my_pd, &my_qp->ipz_rqueue);
-       if (HAS_SQ(my_qp))
+       if (HAS_SQ(my_qp)) {
                ipz_queue_dtor(my_pd, &my_qp->ipz_squeue);
+               vfree(my_qp->sq_map);
+       }
        kmem_cache_free(qp_cache, my_qp);
        atomic_dec(&shca->num_qps);
        return 0;
index 898c8b5c38dd9a604194ed2903364add33fbb93d..4426d82fe7988c32a2da9b471d2e86a5ead90c68 100644 (file)
@@ -139,6 +139,7 @@ static void trace_send_wr_ud(const struct ib_send_wr *send_wr)
 static inline int ehca_write_swqe(struct ehca_qp *qp,
                                  struct ehca_wqe *wqe_p,
                                  const struct ib_send_wr *send_wr,
+                                 u32 sq_map_idx,
                                  int hidden)
 {
        u32 idx;
@@ -157,7 +158,11 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
        /* clear wqe header until sglist */
        memset(wqe_p, 0, offsetof(struct ehca_wqe, u.ud_av.sg_list));
 
-       wqe_p->work_request_id = send_wr->wr_id;
+       wqe_p->work_request_id = send_wr->wr_id & ~QMAP_IDX_MASK;
+       wqe_p->work_request_id |= sq_map_idx & QMAP_IDX_MASK;
+
+       qp->sq_map[sq_map_idx].app_wr_id = send_wr->wr_id & QMAP_IDX_MASK;
+       qp->sq_map[sq_map_idx].reported = 0;
 
        switch (send_wr->opcode) {
        case IB_WR_SEND:
@@ -381,6 +386,7 @@ static inline int post_one_send(struct ehca_qp *my_qp,
 {
        struct ehca_wqe *wqe_p;
        int ret;
+       u32 sq_map_idx;
        u64 start_offset = my_qp->ipz_squeue.current_q_offset;
 
        /* get pointer next to free WQE */
@@ -393,8 +399,15 @@ static inline int post_one_send(struct ehca_qp *my_qp,
                         "qp_num=%x", my_qp->ib_qp.qp_num);
                return -ENOMEM;
        }
+
+       /*
+        * Get the index of the WQE in the send queue. The same index is used
+        * for writing into the sq_map.
+        */
+       sq_map_idx = start_offset / my_qp->ipz_squeue.qe_size;
+
        /* write a SEND WQE into the QUEUE */
-       ret = ehca_write_swqe(my_qp, wqe_p, cur_send_wr, hidden);
+       ret = ehca_write_swqe(my_qp, wqe_p, cur_send_wr, sq_map_idx, hidden);
        /*
         * if something failed,
         * reset the free entry pointer to the start value
@@ -589,7 +602,7 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc)
        struct ehca_qp *my_qp;
        int cqe_count = 0, is_error;
 
-poll_cq_one_read_cqe:
+repoll:
        cqe = (struct ehca_cqe *)
                ipz_qeit_get_inc_valid(&my_cq->ipz_queue);
        if (!cqe) {
@@ -617,7 +630,7 @@ poll_cq_one_read_cqe:
                        ehca_dmp(cqe, 64, "cq_num=%x qp_num=%x",
                                 my_cq->cq_number, cqe->local_qp_number);
                        /* ignore this purged cqe */
-                       goto poll_cq_one_read_cqe;
+                       goto repoll;
                }
                spin_lock_irqsave(&qp->spinlock_s, flags);
                purgeflag = qp->sqerr_purgeflag;
@@ -636,7 +649,7 @@ poll_cq_one_read_cqe:
                         * that caused sqe and turn off purge flag
                         */
                        qp->sqerr_purgeflag = 0;
-                       goto poll_cq_one_read_cqe;
+                       goto repoll;
                }
        }
 
@@ -654,8 +667,34 @@ poll_cq_one_read_cqe:
                         my_cq, my_cq->cq_number);
        }
 
-       /* we got a completion! */
-       wc->wr_id = cqe->work_request_id;
+       read_lock(&ehca_qp_idr_lock);
+       my_qp = idr_find(&ehca_qp_idr, cqe->qp_token);
+       read_unlock(&ehca_qp_idr_lock);
+       if (!my_qp)
+               goto repoll;
+       wc->qp = &my_qp->ib_qp;
+
+       if (!(cqe->w_completion_flags & WC_SEND_RECEIVE_BIT)) {
+               struct ehca_qmap_entry *qmap_entry;
+               /*
+                * We got a send completion and need to restore the original
+                * wr_id.
+                */
+               qmap_entry = &my_qp->sq_map[cqe->work_request_id &
+                                           QMAP_IDX_MASK];
+
+               if (qmap_entry->reported) {
+                       ehca_warn(cq->device, "Double cqe on qp_num=%#x",
+                                 my_qp->real_qp_num);
+                       /* found a double cqe, discard it and read next one */
+                       goto repoll;
+               }
+               wc->wr_id = cqe->work_request_id & ~QMAP_IDX_MASK;
+               wc->wr_id |= qmap_entry->app_wr_id;
+               qmap_entry->reported = 1;
+       } else
+               /* We got a receive completion. */
+               wc->wr_id = cqe->work_request_id;
 
        /* eval ib_wc_opcode */
        wc->opcode = ib_wc_opcode[cqe->optype]-1;
@@ -667,7 +706,7 @@ poll_cq_one_read_cqe:
                ehca_dmp(cqe, 64, "ehca_cq=%p cq_num=%x",
                         my_cq, my_cq->cq_number);
                /* update also queue adder to throw away this entry!!! */
-               goto poll_cq_one_exit0;
+               goto repoll;
        }
 
        /* eval ib_wc_status */
@@ -678,11 +717,6 @@ poll_cq_one_read_cqe:
        } else
                wc->status = IB_WC_SUCCESS;
 
-       read_lock(&ehca_qp_idr_lock);
-       my_qp = idr_find(&ehca_qp_idr, cqe->qp_token);
-       wc->qp = &my_qp->ib_qp;
-       read_unlock(&ehca_qp_idr_lock);
-
        wc->byte_len = cqe->nr_bytes_transferred;
        wc->pkey_index = cqe->pkey_index;
        wc->slid = cqe->rlid;
index 7ebc400a4b3d33d7ea6440a7676a999b168c267e..341ffedafed6704a9cb9995f49582e66c88c4505 100644 (file)
@@ -202,7 +202,7 @@ static void ipoib_cm_free_rx_ring(struct net_device *dev,
                        dev_kfree_skb_any(rx_ring[i].skb);
                }
 
-       kfree(rx_ring);
+       vfree(rx_ring);
 }
 
 static void ipoib_cm_start_rx_drain(struct ipoib_dev_priv *priv)
@@ -352,9 +352,14 @@ static int ipoib_cm_nonsrq_init_rx(struct net_device *dev, struct ib_cm_id *cm_i
        int ret;
        int i;
 
-       rx->rx_ring = kcalloc(ipoib_recvq_size, sizeof *rx->rx_ring, GFP_KERNEL);
-       if (!rx->rx_ring)
+       rx->rx_ring = vmalloc(ipoib_recvq_size * sizeof *rx->rx_ring);
+       if (!rx->rx_ring) {
+               printk(KERN_WARNING "%s: failed to allocate CM non-SRQ ring (%d entries)\n",
+                      priv->ca->name, ipoib_recvq_size);
                return -ENOMEM;
+       }
+
+       memset(rx->rx_ring, 0, ipoib_recvq_size * sizeof *rx->rx_ring);
 
        t = kmalloc(sizeof *t, GFP_KERNEL);
        if (!t) {
@@ -1494,14 +1499,16 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
                return;
        }
 
-       priv->cm.srq_ring = kzalloc(ipoib_recvq_size * sizeof *priv->cm.srq_ring,
-                                   GFP_KERNEL);
+       priv->cm.srq_ring = vmalloc(ipoib_recvq_size * sizeof *priv->cm.srq_ring);
        if (!priv->cm.srq_ring) {
                printk(KERN_WARNING "%s: failed to allocate CM SRQ ring (%d entries)\n",
                       priv->ca->name, ipoib_recvq_size);
                ib_destroy_srq(priv->cm.srq);
                priv->cm.srq = NULL;
+               return;
        }
+
+       memset(priv->cm.srq_ring, 0, ipoib_recvq_size * sizeof *priv->cm.srq_ring);
 }
 
 int ipoib_cm_dev_init(struct net_device *dev)
index d93500f24fbb22e26ecd0316ed12289ed8b4b686..81d0c60534472de6e6ce9744820476058f4a5fe3 100644 (file)
@@ -108,9 +108,8 @@ static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr)
 }
 /*:*/
 
-/*M:014 get_pfn is slow; it takes the mmap sem and calls get_user_pages.  We
- * could probably try to grab batches of pages here as an optimization
- * (ie. pre-faulting). :*/
+/*M:014 get_pfn is slow: we could probably try to grab batches of pages here as
+ * an optimization (ie. pre-faulting). :*/
 
 /*H:350 This routine takes a page number given by the Guest and converts it to
  * an actual, physical page number.  It can fail for several reasons: the
@@ -123,19 +122,13 @@ static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr)
 static unsigned long get_pfn(unsigned long virtpfn, int write)
 {
        struct page *page;
-       /* This value indicates failure. */
-       unsigned long ret = -1UL;
 
-       /* get_user_pages() is a complex interface: it gets the "struct
-        * vm_area_struct" and "struct page" assocated with a range of pages.
-        * It also needs the task's mmap_sem held, and is not very quick.
-        * It returns the number of pages it got. */
-       down_read(&current->mm->mmap_sem);
-       if (get_user_pages(current, current->mm, virtpfn << PAGE_SHIFT,
-                          1, write, 1, &page, NULL) == 1)
-               ret = page_to_pfn(page);
-       up_read(&current->mm->mmap_sem);
-       return ret;
+       /* gup me one page at this address please! */
+       if (get_user_pages_fast(virtpfn << PAGE_SHIFT, 1, write, &page) == 1)
+               return page_to_pfn(page);
+
+       /* This value indicates failure. */
+       return -1UL;
 }
 
 /*H:340 Converting a Guest page table entry to a shadow (ie. real) page table
@@ -174,7 +167,7 @@ static pte_t gpte_to_spte(struct lg_cpu *cpu, pte_t gpte, int write)
 /*H:460 And to complete the chain, release_pte() looks like this: */
 static void release_pte(pte_t pte)
 {
-       /* Remember that get_user_pages() took a reference to the page, in
+       /* Remember that get_user_pages_fast() took a reference to the page, in
         * get_pfn()?  We have to put it back now. */
        if (pte_flags(pte) & _PAGE_PRESENT)
                put_page(pfn_to_page(pte_pfn(pte)));
index 4251018f70ff0e63f1cc98650a32bef2c101318d..a78f70deeb59d47a9554b99ed0ec5803c6ea26ee 100644 (file)
@@ -279,7 +279,7 @@ struct gru_stats_s {
 #if defined CONFIG_IA64
 #define VADDR_HI_BIT           64
 #define GRUREGION(addr)                ((addr) >> (VADDR_HI_BIT - 3) & 3)
-#elif defined __x86_64
+#elif defined CONFIG_X86_64
 #define VADDR_HI_BIT           48
 #define GRUREGION(addr)                (0)             /* ZZZ could do better */
 #else
index 856cc1af40df85efe53805822c62886af0754143..35dcc06eb3e2dab77b16e27881f2b6bd6250c372 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <linux/module.h>
 #include <linux/rtc.h>
-#include <linux/smp_lock.h>
 #include "rtc-core.h"
 
 static dev_t rtc_devt;
@@ -27,11 +26,8 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
                                        struct rtc_device, char_dev);
        const struct rtc_class_ops *ops = rtc->ops;
 
-       lock_kernel();
-       if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) {
-               err = -EBUSY;
-               goto out;
-       }
+       if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags))
+               return -EBUSY;
 
        file->private_data = rtc;
 
@@ -41,13 +37,11 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
                rtc->irq_data = 0;
                spin_unlock_irq(&rtc->irq_lock);
 
-               goto out;
+               return 0;
        }
 
        /* something has gone wrong */
        clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
-out:
-       unlock_kernel();
        return err;
 }
 
index fbb90b1e40981f6fadfd4542e468ad35a3d70f4d..a81adab6e515849306d9fb9e245eebc0e8532784 100644 (file)
@@ -482,7 +482,7 @@ isl1208_sysfs_register(struct device *dev)
 static int
 isl1208_sysfs_unregister(struct device *dev)
 {
-       device_remove_file(dev, &dev_attr_atrim);
+       device_remove_file(dev, &dev_attr_dtrim);
        device_remove_file(dev, &dev_attr_atrim);
        device_remove_file(dev, &dev_attr_usr);
 
index fcdd73f256256ccddc5a5d3887d8220a34d0107b..994da56fffed4e7c513345d86f93b3a9acd40238 100644 (file)
@@ -680,7 +680,7 @@ static int alua_prep_fn(struct scsi_device *sdev, struct request *req)
 
 }
 
-const struct scsi_dh_devlist alua_dev_list[] = {
+static const struct scsi_dh_devlist alua_dev_list[] = {
        {"HP", "MSA VOLUME" },
        {"HP", "HSV101" },
        {"HP", "HSV111" },
index aa46b131b20eb44eef41c17c3a086ed6935d24ed..b9d23e9e9a44dff3ba612bd90f3fbcb3db4a1392 100644 (file)
@@ -562,7 +562,7 @@ done:
        return result;
 }
 
-const struct scsi_dh_devlist clariion_dev_list[] = {
+static const struct scsi_dh_devlist clariion_dev_list[] = {
        {"DGC", "RAID"},
        {"DGC", "DISK"},
        {"DGC", "VRAID"},
index 9c7a1f8ebb722df09e88c67b49235448ef006a60..a6a4ef3ad51c01e83421d22a11bafbc0f9eb87aa 100644 (file)
@@ -282,7 +282,7 @@ static int hp_sw_activate(struct scsi_device *sdev)
        return ret;
 }
 
-const struct scsi_dh_devlist hp_sw_dh_data_list[] = {
+static const struct scsi_dh_devlist hp_sw_dh_data_list[] = {
        {"COMPAQ", "MSA1000 VOLUME"},
        {"COMPAQ", "HSV110"},
        {"HP", "HSV100"},
index b093a501f8ae673b980ca896d6d73d4ed407a78e..e7c7b4ebc1fe3c3cebbcce6c1342a2e54145e7f2 100644 (file)
@@ -574,7 +574,7 @@ static int rdac_check_sense(struct scsi_device *sdev,
        return SCSI_RETURN_NOT_HANDLED;
 }
 
-const struct scsi_dh_devlist rdac_dev_list[] = {
+static const struct scsi_dh_devlist rdac_dev_list[] = {
        {"IBM", "1722"},
        {"IBM", "1724"},
        {"IBM", "1726"},
index d94aa7387608fde3db0e3690eea050980bc0b5df..b897f6554ecdd0e282fd4d5b0dfed072f041f3b7 100644 (file)
@@ -48,7 +48,8 @@ static int isight_firmware_load(struct usb_interface *intf,
 
        if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) {
                printk(KERN_ERR "Unable to load isight firmware\n");
-               return -ENODEV;
+               ret = -ENODEV;
+               goto out;
        }
 
        ptr = firmware->data;
@@ -91,7 +92,6 @@ static int isight_firmware_load(struct usb_interface *intf,
                             buf, llen, 300) != llen) {
                                printk(KERN_ERR
                                       "Failed to load isight firmware\n");
-                               kfree(buf);
                                ret = -ENODEV;
                                goto out;
                        }
index e7018a2f56afd29e2e7d9b40aa082d79defe827d..9c5925927ece04d4f39961ddaa0e596288c5a780 100644 (file)
@@ -39,7 +39,9 @@
 #endif
 
 #if defined(CONFIG_ARCH_AT91)
-#define        ATMEL_LCDFB_FBINFO_DEFAULT      FBINFO_DEFAULT
+#define        ATMEL_LCDFB_FBINFO_DEFAULT      (FBINFO_DEFAULT \
+                                        | FBINFO_PARTIAL_PAN_OK \
+                                        | FBINFO_HWACCEL_YPAN)
 
 static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
                                        struct fb_var_screeninfo *var)
@@ -177,7 +179,7 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
        .type           = FB_TYPE_PACKED_PIXELS,
        .visual         = FB_VISUAL_TRUECOLOR,
        .xpanstep       = 0,
-       .ypanstep       = 0,
+       .ypanstep       = 1,
        .ywrapstep      = 0,
        .accel          = FB_ACCEL_NONE,
 };
@@ -240,9 +242,11 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
 {
        struct fb_info *info = sinfo->info;
        struct fb_var_screeninfo *var = &info->var;
+       unsigned int smem_len;
 
-       info->fix.smem_len = (var->xres_virtual * var->yres_virtual
-                           * ((var->bits_per_pixel + 7) / 8));
+       smem_len = (var->xres_virtual * var->yres_virtual
+                   * ((var->bits_per_pixel + 7) / 8));
+       info->fix.smem_len = max(smem_len, sinfo->smem_len);
 
        info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len,
                                        (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL);
@@ -794,6 +798,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
                sinfo->default_monspecs = pdata_sinfo->default_monspecs;
                sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control;
                sinfo->guard_time = pdata_sinfo->guard_time;
+               sinfo->smem_len = pdata_sinfo->smem_len;
                sinfo->lcdcon_is_backlight = pdata_sinfo->lcdcon_is_backlight;
                sinfo->lcd_wiring_mode = pdata_sinfo->lcd_wiring_mode;
        } else {
index 4d13f68436e6efa1d9942563d9d70250d28b5b30..aa95f835024282ca4e88142d9f957d393271c4ee 100644 (file)
@@ -55,6 +55,10 @@ static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo,
        OUTREG(DP_WRITE_MSK, 0xffffffff);
        OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
 
+       radeon_fifo_wait(2);
+       OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
+       OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
+
        radeon_fifo_wait(2);  
        OUTREG(DST_Y_X, (region->dy << 16) | region->dx);
        OUTREG(DST_WIDTH_HEIGHT, (region->width << 16) | region->height);
@@ -116,6 +120,10 @@ static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo,
        OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
                        | (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
 
+       radeon_fifo_wait(2);
+       OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
+       OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
+
        radeon_fifo_wait(3);
        OUTREG(SRC_Y_X, (sy << 16) | sx);
        OUTREG(DST_Y_X, (dy << 16) | dx);
index 33859934a8e465b1654bf08e454633253685fd98..c6299e8a041de55fb205142792aa5c1d287500c9 100644 (file)
@@ -2518,7 +2518,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
                        c = vc->vc_video_erase_char;
                        vc->vc_video_erase_char =
                            ((c & 0xfe00) >> 1) | (c & 0xff);
-                       c = vc->vc_def_color;
+                       c = vc->vc_scrl_erase_char;
                        vc->vc_scrl_erase_char =
                            ((c & 0xFE00) >> 1) | (c & 0xFF);
                        vc->vc_attr >>= 1;
@@ -2551,7 +2551,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
                        if (vc->vc_can_do_color) {
                                vc->vc_video_erase_char =
                                    ((c & 0xff00) << 1) | (c & 0xff);
-                               c = vc->vc_def_color;
+                               c = vc->vc_scrl_erase_char;
                                vc->vc_scrl_erase_char =
                                    ((c & 0xFF00) << 1) | (c & 0xFF);
                                vc->vc_attr <<= 1;
index 75ee5a12e549ec703a0974c984975c1cdf2ac29a..c14e3e2212b395f911909b0d72b3342f83364bd6 100644 (file)
@@ -87,13 +87,7 @@ static int matroxfb_gpio_getscl(void* data) {
        return (matroxfb_read_gpio(b->minfo) & b->mask.clock) ? 1 : 0;
 }
 
-static struct i2c_adapter matrox_i2c_adapter_template =
-{
-       .owner =        THIS_MODULE,
-       .id =           I2C_HW_B_G400,
-};
-
-static struct i2c_algo_bit_data matrox_i2c_algo_template =
+static const struct i2c_algo_bit_data matrox_i2c_algo_template =
 {
        .setsda         = matroxfb_gpio_setsda,
        .setscl         = matroxfb_gpio_setscl,
@@ -112,7 +106,7 @@ static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo,
        b->minfo = minfo;
        b->mask.data = data;
        b->mask.clock = clock;
-       b->adapter = matrox_i2c_adapter_template;
+       b->adapter.owner = THIS_MODULE;
        snprintf(b->adapter.name, sizeof(b->adapter.name), name,
                minfo->fbcon.node);
        i2c_set_adapdata(&b->adapter, b);
@@ -187,6 +181,17 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
                                  MAT_DATA, MAT_CLK, "MAVEN:fb%u", 0);
                if (err)
                        printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n");
+               else {
+                       struct i2c_board_info maven_info = {
+                               I2C_BOARD_INFO("maven", 0x1b),
+                       };
+                       unsigned short const addr_list[2] = {
+                               0x1b, I2C_CLIENT_END
+                       };
+
+                       i2c_new_probed_device(&m2info->maven.adapter,
+                                             &maven_info, addr_list);
+               }
        }
        return m2info;
 fail_ddc1:;
index 89da27bd5c498147d5308e3258af4f2a96349c7d..042408a8c631d32d36e73ff806176f6eb01c3177 100644 (file)
@@ -19,8 +19,6 @@
 #include <linux/matroxfb.h>
 #include <asm/div64.h>
 
-#define MAVEN_I2CID    (0x1B)
-
 #define MGATVO_B       1
 #define MGATVO_C       2
 
@@ -128,7 +126,7 @@ static int get_ctrl_id(__u32 v4l2_id) {
 
 struct maven_data {
        struct matrox_fb_info*          primary_head;
-       struct i2c_client               client;
+       struct i2c_client               *client;
        int                             version;
 };
 
@@ -974,7 +972,7 @@ static inline int maven_compute_timming(struct maven_data* md,
 
 static int maven_program_timming(struct maven_data* md,
                const struct mavenregs* m) {
-       struct i2c_client* c = &md->client;
+       struct i2c_client *c = md->client;
 
        if (m->mode == MATROXFB_OUTPUT_MODE_MONITOR) {
                LR(0x80);
@@ -1011,7 +1009,7 @@ static int maven_program_timming(struct maven_data* md,
 }
 
 static inline int maven_resync(struct maven_data* md) {
-       struct i2c_client* c = &md->client;
+       struct i2c_client *c = md->client;
        maven_set_reg(c, 0x95, 0x20);   /* start whole thing */
        return 0;
 }
@@ -1069,48 +1067,48 @@ static int maven_set_control (struct maven_data* md,
                  maven_compute_bwlevel(md, &blacklevel, &whitelevel);
                  blacklevel = (blacklevel >> 2) | ((blacklevel & 3) << 8);
                  whitelevel = (whitelevel >> 2) | ((whitelevel & 3) << 8);
-                 maven_set_reg_pair(&md->client, 0x0e, blacklevel);
-                 maven_set_reg_pair(&md->client, 0x1e, whitelevel);
+                 maven_set_reg_pair(md->client, 0x0e, blacklevel);
+                 maven_set_reg_pair(md->client, 0x1e, whitelevel);
                }
                break;
                case V4L2_CID_SATURATION:
                {
-                 maven_set_reg(&md->client, 0x20, p->value);
-                 maven_set_reg(&md->client, 0x22, p->value);
+                 maven_set_reg(md->client, 0x20, p->value);
+                 maven_set_reg(md->client, 0x22, p->value);
                }
                break;
                case V4L2_CID_HUE:
                {
-                 maven_set_reg(&md->client, 0x25, p->value);
+                 maven_set_reg(md->client, 0x25, p->value);
                }
                break;
                case V4L2_CID_GAMMA:
                {
                  const struct maven_gamma* g;
                  g = maven_compute_gamma(md);
-                 maven_set_reg(&md->client, 0x83, g->reg83);
-                 maven_set_reg(&md->client, 0x84, g->reg84);
-                 maven_set_reg(&md->client, 0x85, g->reg85);
-                 maven_set_reg(&md->client, 0x86, g->reg86);
-                 maven_set_reg(&md->client, 0x87, g->reg87);
-                 maven_set_reg(&md->client, 0x88, g->reg88);
-                 maven_set_reg(&md->client, 0x89, g->reg89);
-                 maven_set_reg(&md->client, 0x8a, g->reg8a);
-                 maven_set_reg(&md->client, 0x8b, g->reg8b);
+                 maven_set_reg(md->client, 0x83, g->reg83);
+                 maven_set_reg(md->client, 0x84, g->reg84);
+                 maven_set_reg(md->client, 0x85, g->reg85);
+                 maven_set_reg(md->client, 0x86, g->reg86);
+                 maven_set_reg(md->client, 0x87, g->reg87);
+                 maven_set_reg(md->client, 0x88, g->reg88);
+                 maven_set_reg(md->client, 0x89, g->reg89);
+                 maven_set_reg(md->client, 0x8a, g->reg8a);
+                 maven_set_reg(md->client, 0x8b, g->reg8b);
                }
                break;
                case MATROXFB_CID_TESTOUT:
                {
                        unsigned char val 
-                         = maven_get_reg(&md->client,0x8d);
+                         = maven_get_reg(md->client, 0x8d);
                        if (p->value) val |= 0x10;
                        else          val &= ~0x10;
-                       maven_set_reg(&md->client, 0x8d, val);
+                       maven_set_reg(md->client, 0x8d, val);
                }
                break;
                case MATROXFB_CID_DEFLICKER:
                {
-                 maven_set_reg(&md->client, 0x93, maven_compute_deflicker(md));
+                 maven_set_reg(md->client, 0x93, maven_compute_deflicker(md));
                }
                break;
        }
@@ -1189,6 +1187,7 @@ static int maven_init_client(struct i2c_client* clnt) {
        MINFO_FROM(container_of(clnt->adapter, struct i2c_bit_adapter, adapter)->minfo);
 
        md->primary_head = MINFO;
+       md->client = clnt;
        down_write(&ACCESS_FBINFO(altout.lock));
        ACCESS_FBINFO(outputs[1]).output = &maven_altout;
        ACCESS_FBINFO(outputs[1]).src = ACCESS_FBINFO(outputs[1]).default_src;
@@ -1232,14 +1231,11 @@ static int maven_shutdown_client(struct i2c_client* clnt) {
        return 0;
 }
 
-static const unsigned short normal_i2c[] = { MAVEN_I2CID, I2C_CLIENT_END };
-I2C_CLIENT_INSMOD;
-
-static struct i2c_driver maven_driver;
-
-static int maven_detect_client(struct i2c_adapter* adapter, int address, int kind) {
-       int err = 0;
-       struct i2c_client* new_client;
+static int maven_probe(struct i2c_client *client,
+                      const struct i2c_device_id *id)
+{
+       struct i2c_adapter *adapter = client->adapter;
+       int err = -ENODEV;
        struct maven_data* data;
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_WORD_DATA |
@@ -1250,50 +1246,37 @@ static int maven_detect_client(struct i2c_adapter* adapter, int address, int kin
                err = -ENOMEM;
                goto ERROR0;
        }
-       new_client = &data->client;
-       i2c_set_clientdata(new_client, data);
-       new_client->addr = address;
-       new_client->adapter = adapter;
-       new_client->driver = &maven_driver;
-       new_client->flags = 0;
-       strlcpy(new_client->name, "maven", I2C_NAME_SIZE);
-       if ((err = i2c_attach_client(new_client)))
-               goto ERROR3;
-       err = maven_init_client(new_client);
+       i2c_set_clientdata(client, data);
+       err = maven_init_client(client);
        if (err)
                goto ERROR4;
        return 0;
 ERROR4:;
-       i2c_detach_client(new_client);
-ERROR3:;
-       kfree(new_client);
+       kfree(data);
 ERROR0:;
        return err;
 }
 
-static int maven_attach_adapter(struct i2c_adapter* adapter) {
-       if (adapter->id == I2C_HW_B_G400)
-               return i2c_probe(adapter, &addr_data, &maven_detect_client);
-       return 0;
-}
-
-static int maven_detach_client(struct i2c_client* client) {
-       int err;
-
-       if ((err = i2c_detach_client(client)))
-               return err;
+static int maven_remove(struct i2c_client *client)
+{
        maven_shutdown_client(client);
        kfree(i2c_get_clientdata(client));
        return 0;
 }
 
+static const struct i2c_device_id maven_id[] = {
+       { "maven", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, maven_id);
+
 static struct i2c_driver maven_driver={
        .driver = {
                .name   = "maven",
        },
-       .id             = I2C_DRIVERID_MGATVO,
-       .attach_adapter = maven_attach_adapter,
-       .detach_client  = maven_detach_client,
+       .probe          = maven_probe,
+       .remove         = maven_remove,
+       .id_table       = maven_id,
 };
 
 static int __init matroxfb_maven_init(void)
index 32b9fe1536413c28e52526a1d3949214a923100d..db20542796bff39c0361e8985ce5284524390d4f 100644 (file)
@@ -285,10 +285,11 @@ config ALIM1535_WDT
 
 config ALIM7101_WDT
        tristate "ALi M7101 PMU Computer Watchdog"
-       depends on X86 && PCI
+       depends on PCI
        help
          This is the driver for the hardware watchdog on the ALi M7101 PMU
-         as used in the x86 Cobalt servers.
+         as used in the x86 Cobalt servers and also found in some
+         SPARC Netra servers too.
 
          To compile this driver as a module, choose M here: the
          module will be called alim7101_wdt.
index c4e7d721bd8dcffaedcbdf3fcac2b2ea5ac26c31..89d2fb7b991ae13f1ada96176a5dca785b9dd646 100644 (file)
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
 
 static struct config_group *space_list;
 static struct config_group *comm_list;
-static struct comm *local_comm;
+static struct dlm_comm *local_comm;
 
-struct clusters;
-struct cluster;
-struct spaces;
-struct space;
-struct comms;
-struct comm;
-struct nodes;
-struct node;
+struct dlm_clusters;
+struct dlm_cluster;
+struct dlm_spaces;
+struct dlm_space;
+struct dlm_comms;
+struct dlm_comm;
+struct dlm_nodes;
+struct dlm_node;
 
 static struct config_group *make_cluster(struct config_group *, const char *);
 static void drop_cluster(struct config_group *, struct config_item *);
@@ -68,17 +68,22 @@ static ssize_t show_node(struct config_item *i, struct configfs_attribute *a,
 static ssize_t store_node(struct config_item *i, struct configfs_attribute *a,
                          const char *buf, size_t len);
 
-static ssize_t comm_nodeid_read(struct comm *cm, char *buf);
-static ssize_t comm_nodeid_write(struct comm *cm, const char *buf, size_t len);
-static ssize_t comm_local_read(struct comm *cm, char *buf);
-static ssize_t comm_local_write(struct comm *cm, const char *buf, size_t len);
-static ssize_t comm_addr_write(struct comm *cm, const char *buf, size_t len);
-static ssize_t node_nodeid_read(struct node *nd, char *buf);
-static ssize_t node_nodeid_write(struct node *nd, const char *buf, size_t len);
-static ssize_t node_weight_read(struct node *nd, char *buf);
-static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len);
-
-struct cluster {
+static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf);
+static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf,
+                               size_t len);
+static ssize_t comm_local_read(struct dlm_comm *cm, char *buf);
+static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf,
+                               size_t len);
+static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf,
+                               size_t len);
+static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf);
+static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
+                               size_t len);
+static ssize_t node_weight_read(struct dlm_node *nd, char *buf);
+static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
+                               size_t len);
+
+struct dlm_cluster {
        struct config_group group;
        unsigned int cl_tcp_port;
        unsigned int cl_buffer_size;
@@ -109,11 +114,11 @@ enum {
 
 struct cluster_attribute {
        struct configfs_attribute attr;
-       ssize_t (*show)(struct cluster *, char *);
-       ssize_t (*store)(struct cluster *, const char *, size_t);
+       ssize_t (*show)(struct dlm_cluster *, char *);
+       ssize_t (*store)(struct dlm_cluster *, const char *, size_t);
 };
 
-static ssize_t cluster_set(struct cluster *cl, unsigned int *cl_field,
+static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field,
                           int *info_field, int check_zero,
                           const char *buf, size_t len)
 {
@@ -134,12 +139,12 @@ static ssize_t cluster_set(struct cluster *cl, unsigned int *cl_field,
 }
 
 #define CLUSTER_ATTR(name, check_zero)                                        \
-static ssize_t name##_write(struct cluster *cl, const char *buf, size_t len)  \
+static ssize_t name##_write(struct dlm_cluster *cl, const char *buf, size_t len) \
 {                                                                             \
        return cluster_set(cl, &cl->cl_##name, &dlm_config.ci_##name,         \
                           check_zero, buf, len);                             \
 }                                                                             \
-static ssize_t name##_read(struct cluster *cl, char *buf)                     \
+static ssize_t name##_read(struct dlm_cluster *cl, char *buf)                 \
 {                                                                             \
        return snprintf(buf, PAGE_SIZE, "%u\n", cl->cl_##name);               \
 }                                                                             \
@@ -181,8 +186,8 @@ enum {
 
 struct comm_attribute {
        struct configfs_attribute attr;
-       ssize_t (*show)(struct comm *, char *);
-       ssize_t (*store)(struct comm *, const char *, size_t);
+       ssize_t (*show)(struct dlm_comm *, char *);
+       ssize_t (*store)(struct dlm_comm *, const char *, size_t);
 };
 
 static struct comm_attribute comm_attr_nodeid = {
@@ -222,8 +227,8 @@ enum {
 
 struct node_attribute {
        struct configfs_attribute attr;
-       ssize_t (*show)(struct node *, char *);
-       ssize_t (*store)(struct node *, const char *, size_t);
+       ssize_t (*show)(struct dlm_node *, char *);
+       ssize_t (*store)(struct dlm_node *, const char *, size_t);
 };
 
 static struct node_attribute node_attr_nodeid = {
@@ -248,26 +253,26 @@ static struct configfs_attribute *node_attrs[] = {
        NULL,
 };
 
-struct clusters {
+struct dlm_clusters {
        struct configfs_subsystem subsys;
 };
 
-struct spaces {
+struct dlm_spaces {
        struct config_group ss_group;
 };
 
-struct space {
+struct dlm_space {
        struct config_group group;
        struct list_head members;
        struct mutex members_lock;
        int members_count;
 };
 
-struct comms {
+struct dlm_comms {
        struct config_group cs_group;
 };
 
-struct comm {
+struct dlm_comm {
        struct config_item item;
        int nodeid;
        int local;
@@ -275,11 +280,11 @@ struct comm {
        struct sockaddr_storage *addr[DLM_MAX_ADDR_COUNT];
 };
 
-struct nodes {
+struct dlm_nodes {
        struct config_group ns_group;
 };
 
-struct node {
+struct dlm_node {
        struct config_item item;
        struct list_head list; /* space->members */
        int nodeid;
@@ -372,38 +377,40 @@ static struct config_item_type node_type = {
        .ct_owner = THIS_MODULE,
 };
 
-static struct cluster *to_cluster(struct config_item *i)
+static struct dlm_cluster *to_cluster(struct config_item *i)
 {
-       return i ? container_of(to_config_group(i), struct cluster, group):NULL;
+       return i ? container_of(to_config_group(i), struct dlm_cluster, group) :
+                  NULL;
 }
 
-static struct space *to_space(struct config_item *i)
+static struct dlm_space *to_space(struct config_item *i)
 {
-       return i ? container_of(to_config_group(i), struct space, group) : NULL;
+       return i ? container_of(to_config_group(i), struct dlm_space, group) :
+                  NULL;
 }
 
-static struct comm *to_comm(struct config_item *i)
+static struct dlm_comm *to_comm(struct config_item *i)
 {
-       return i ? container_of(i, struct comm, item) : NULL;
+       return i ? container_of(i, struct dlm_comm, item) : NULL;
 }
 
-static struct node *to_node(struct config_item *i)
+static struct dlm_node *to_node(struct config_item *i)
 {
-       return i ? container_of(i, struct node, item) : NULL;
+       return i ? container_of(i, struct dlm_node, item) : NULL;
 }
 
 static struct config_group *make_cluster(struct config_group *g,
                                         const char *name)
 {
-       struct cluster *cl = NULL;
-       struct spaces *sps = NULL;
-       struct comms *cms = NULL;
+       struct dlm_cluster *cl = NULL;
+       struct dlm_spaces *sps = NULL;
+       struct dlm_comms *cms = NULL;
        void *gps = NULL;
 
-       cl = kzalloc(sizeof(struct cluster), GFP_KERNEL);
+       cl = kzalloc(sizeof(struct dlm_cluster), GFP_KERNEL);
        gps = kcalloc(3, sizeof(struct config_group *), GFP_KERNEL);
-       sps = kzalloc(sizeof(struct spaces), GFP_KERNEL);
-       cms = kzalloc(sizeof(struct comms), GFP_KERNEL);
+       sps = kzalloc(sizeof(struct dlm_spaces), GFP_KERNEL);
+       cms = kzalloc(sizeof(struct dlm_comms), GFP_KERNEL);
 
        if (!cl || !gps || !sps || !cms)
                goto fail;
@@ -443,7 +450,7 @@ static struct config_group *make_cluster(struct config_group *g,
 
 static void drop_cluster(struct config_group *g, struct config_item *i)
 {
-       struct cluster *cl = to_cluster(i);
+       struct dlm_cluster *cl = to_cluster(i);
        struct config_item *tmp;
        int j;
 
@@ -461,20 +468,20 @@ static void drop_cluster(struct config_group *g, struct config_item *i)
 
 static void release_cluster(struct config_item *i)
 {
-       struct cluster *cl = to_cluster(i);
+       struct dlm_cluster *cl = to_cluster(i);
        kfree(cl->group.default_groups);
        kfree(cl);
 }
 
 static struct config_group *make_space(struct config_group *g, const char *name)
 {
-       struct space *sp = NULL;
-       struct nodes *nds = NULL;
+       struct dlm_space *sp = NULL;
+       struct dlm_nodes *nds = NULL;
        void *gps = NULL;
 
-       sp = kzalloc(sizeof(struct space), GFP_KERNEL);
+       sp = kzalloc(sizeof(struct dlm_space), GFP_KERNEL);
        gps = kcalloc(2, sizeof(struct config_group *), GFP_KERNEL);
-       nds = kzalloc(sizeof(struct nodes), GFP_KERNEL);
+       nds = kzalloc(sizeof(struct dlm_nodes), GFP_KERNEL);
 
        if (!sp || !gps || !nds)
                goto fail;
@@ -500,7 +507,7 @@ static struct config_group *make_space(struct config_group *g, const char *name)
 
 static void drop_space(struct config_group *g, struct config_item *i)
 {
-       struct space *sp = to_space(i);
+       struct dlm_space *sp = to_space(i);
        struct config_item *tmp;
        int j;
 
@@ -517,16 +524,16 @@ static void drop_space(struct config_group *g, struct config_item *i)
 
 static void release_space(struct config_item *i)
 {
-       struct space *sp = to_space(i);
+       struct dlm_space *sp = to_space(i);
        kfree(sp->group.default_groups);
        kfree(sp);
 }
 
 static struct config_item *make_comm(struct config_group *g, const char *name)
 {
-       struct comm *cm;
+       struct dlm_comm *cm;
 
-       cm = kzalloc(sizeof(struct comm), GFP_KERNEL);
+       cm = kzalloc(sizeof(struct dlm_comm), GFP_KERNEL);
        if (!cm)
                return ERR_PTR(-ENOMEM);
 
@@ -539,7 +546,7 @@ static struct config_item *make_comm(struct config_group *g, const char *name)
 
 static void drop_comm(struct config_group *g, struct config_item *i)
 {
-       struct comm *cm = to_comm(i);
+       struct dlm_comm *cm = to_comm(i);
        if (local_comm == cm)
                local_comm = NULL;
        dlm_lowcomms_close(cm->nodeid);
@@ -550,16 +557,16 @@ static void drop_comm(struct config_group *g, struct config_item *i)
 
 static void release_comm(struct config_item *i)
 {
-       struct comm *cm = to_comm(i);
+       struct dlm_comm *cm = to_comm(i);
        kfree(cm);
 }
 
 static struct config_item *make_node(struct config_group *g, const char *name)
 {
-       struct space *sp = to_space(g->cg_item.ci_parent);
-       struct node *nd;
+       struct dlm_space *sp = to_space(g->cg_item.ci_parent);
+       struct dlm_node *nd;
 
-       nd = kzalloc(sizeof(struct node), GFP_KERNEL);
+       nd = kzalloc(sizeof(struct dlm_node), GFP_KERNEL);
        if (!nd)
                return ERR_PTR(-ENOMEM);
 
@@ -578,8 +585,8 @@ static struct config_item *make_node(struct config_group *g, const char *name)
 
 static void drop_node(struct config_group *g, struct config_item *i)
 {
-       struct space *sp = to_space(g->cg_item.ci_parent);
-       struct node *nd = to_node(i);
+       struct dlm_space *sp = to_space(g->cg_item.ci_parent);
+       struct dlm_node *nd = to_node(i);
 
        mutex_lock(&sp->members_lock);
        list_del(&nd->list);
@@ -591,11 +598,11 @@ static void drop_node(struct config_group *g, struct config_item *i)
 
 static void release_node(struct config_item *i)
 {
-       struct node *nd = to_node(i);
+       struct dlm_node *nd = to_node(i);
        kfree(nd);
 }
 
-static struct clusters clusters_root = {
+static struct dlm_clusters clusters_root = {
        .subsys = {
                .su_group = {
                        .cg_item = {
@@ -625,7 +632,7 @@ void dlm_config_exit(void)
 static ssize_t show_cluster(struct config_item *i, struct configfs_attribute *a,
                            char *buf)
 {
-       struct cluster *cl = to_cluster(i);
+       struct dlm_cluster *cl = to_cluster(i);
        struct cluster_attribute *cla =
                        container_of(a, struct cluster_attribute, attr);
        return cla->show ? cla->show(cl, buf) : 0;
@@ -635,7 +642,7 @@ static ssize_t store_cluster(struct config_item *i,
                             struct configfs_attribute *a,
                             const char *buf, size_t len)
 {
-       struct cluster *cl = to_cluster(i);
+       struct dlm_cluster *cl = to_cluster(i);
        struct cluster_attribute *cla =
                container_of(a, struct cluster_attribute, attr);
        return cla->store ? cla->store(cl, buf, len) : -EINVAL;
@@ -644,7 +651,7 @@ static ssize_t store_cluster(struct config_item *i,
 static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a,
                         char *buf)
 {
-       struct comm *cm = to_comm(i);
+       struct dlm_comm *cm = to_comm(i);
        struct comm_attribute *cma =
                        container_of(a, struct comm_attribute, attr);
        return cma->show ? cma->show(cm, buf) : 0;
@@ -653,29 +660,31 @@ static ssize_t show_comm(struct config_item *i, struct configfs_attribute *a,
 static ssize_t store_comm(struct config_item *i, struct configfs_attribute *a,
                          const char *buf, size_t len)
 {
-       struct comm *cm = to_comm(i);
+       struct dlm_comm *cm = to_comm(i);
        struct comm_attribute *cma =
                container_of(a, struct comm_attribute, attr);
        return cma->store ? cma->store(cm, buf, len) : -EINVAL;
 }
 
-static ssize_t comm_nodeid_read(struct comm *cm, char *buf)
+static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf)
 {
        return sprintf(buf, "%d\n", cm->nodeid);
 }
 
-static ssize_t comm_nodeid_write(struct comm *cm, const char *buf, size_t len)
+static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf,
+                                size_t len)
 {
        cm->nodeid = simple_strtol(buf, NULL, 0);
        return len;
 }
 
-static ssize_t comm_local_read(struct comm *cm, char *buf)
+static ssize_t comm_local_read(struct dlm_comm *cm, char *buf)
 {
        return sprintf(buf, "%d\n", cm->local);
 }
 
-static ssize_t comm_local_write(struct comm *cm, const char *buf, size_t len)
+static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf,
+                               size_t len)
 {
        cm->local= simple_strtol(buf, NULL, 0);
        if (cm->local && !local_comm)
@@ -683,7 +692,7 @@ static ssize_t comm_local_write(struct comm *cm, const char *buf, size_t len)
        return len;
 }
 
-static ssize_t comm_addr_write(struct comm *cm, const char *buf, size_t len)
+static ssize_t comm_addr_write(struct dlm_comm *cm, const char *buf, size_t len)
 {
        struct sockaddr_storage *addr;
 
@@ -705,7 +714,7 @@ static ssize_t comm_addr_write(struct comm *cm, const char *buf, size_t len)
 static ssize_t show_node(struct config_item *i, struct configfs_attribute *a,
                         char *buf)
 {
-       struct node *nd = to_node(i);
+       struct dlm_node *nd = to_node(i);
        struct node_attribute *nda =
                        container_of(a, struct node_attribute, attr);
        return nda->show ? nda->show(nd, buf) : 0;
@@ -714,29 +723,31 @@ static ssize_t show_node(struct config_item *i, struct configfs_attribute *a,
 static ssize_t store_node(struct config_item *i, struct configfs_attribute *a,
                          const char *buf, size_t len)
 {
-       struct node *nd = to_node(i);
+       struct dlm_node *nd = to_node(i);
        struct node_attribute *nda =
                container_of(a, struct node_attribute, attr);
        return nda->store ? nda->store(nd, buf, len) : -EINVAL;
 }
 
-static ssize_t node_nodeid_read(struct node *nd, char *buf)
+static ssize_t node_nodeid_read(struct dlm_node *nd, char *buf)
 {
        return sprintf(buf, "%d\n", nd->nodeid);
 }
 
-static ssize_t node_nodeid_write(struct node *nd, const char *buf, size_t len)
+static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
+                                size_t len)
 {
        nd->nodeid = simple_strtol(buf, NULL, 0);
        return len;
 }
 
-static ssize_t node_weight_read(struct node *nd, char *buf)
+static ssize_t node_weight_read(struct dlm_node *nd, char *buf)
 {
        return sprintf(buf, "%d\n", nd->weight);
 }
 
-static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len)
+static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
+                                size_t len)
 {
        nd->weight = simple_strtol(buf, NULL, 0);
        return len;
@@ -746,7 +757,7 @@ static ssize_t node_weight_write(struct node *nd, const char *buf, size_t len)
  * Functions for the dlm to get the info that's been configured
  */
 
-static struct space *get_space(char *name)
+static struct dlm_space *get_space(char *name)
 {
        struct config_item *i;
 
@@ -760,15 +771,15 @@ static struct space *get_space(char *name)
        return to_space(i);
 }
 
-static void put_space(struct space *sp)
+static void put_space(struct dlm_space *sp)
 {
        config_item_put(&sp->group.cg_item);
 }
 
-static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr)
+static struct dlm_comm *get_comm(int nodeid, struct sockaddr_storage *addr)
 {
        struct config_item *i;
-       struct comm *cm = NULL;
+       struct dlm_comm *cm = NULL;
        int found = 0;
 
        if (!comm_list)
@@ -801,7 +812,7 @@ static struct comm *get_comm(int nodeid, struct sockaddr_storage *addr)
        return cm;
 }
 
-static void put_comm(struct comm *cm)
+static void put_comm(struct dlm_comm *cm)
 {
        config_item_put(&cm->item);
 }
@@ -810,8 +821,8 @@ static void put_comm(struct comm *cm)
 int dlm_nodeid_list(char *lsname, int **ids_out, int *ids_count_out,
                    int **new_out, int *new_count_out)
 {
-       struct space *sp;
-       struct node *nd;
+       struct dlm_space *sp;
+       struct dlm_node *nd;
        int i = 0, rv = 0, ids_count = 0, new_count = 0;
        int *ids, *new;
 
@@ -874,8 +885,8 @@ int dlm_nodeid_list(char *lsname, int **ids_out, int *ids_count_out,
 
 int dlm_node_weight(char *lsname, int nodeid)
 {
-       struct space *sp;
-       struct node *nd;
+       struct dlm_space *sp;
+       struct dlm_node *nd;
        int w = -EEXIST;
 
        sp = get_space(lsname);
@@ -897,7 +908,7 @@ int dlm_node_weight(char *lsname, int nodeid)
 
 int dlm_nodeid_to_addr(int nodeid, struct sockaddr_storage *addr)
 {
-       struct comm *cm = get_comm(nodeid, NULL);
+       struct dlm_comm *cm = get_comm(nodeid, NULL);
        if (!cm)
                return -EEXIST;
        if (!cm->addr_count)
@@ -909,7 +920,7 @@ int dlm_nodeid_to_addr(int nodeid, struct sockaddr_storage *addr)
 
 int dlm_addr_to_nodeid(struct sockaddr_storage *addr, int *nodeid)
 {
-       struct comm *cm = get_comm(0, addr);
+       struct dlm_comm *cm = get_comm(0, addr);
        if (!cm)
                return -EEXIST;
        *nodeid = cm->nodeid;
index 929e48ae7591199cc0e6e4c80eb4516c939bfd60..34f14a14fb4e41e0e8b5b8a0ed207f7f37976703 100644 (file)
@@ -527,8 +527,10 @@ static ssize_t device_write(struct file *file, const char __user *buf,
                k32buf = (struct dlm_write_request32 *)kbuf;
                kbuf = kmalloc(count + 1 + (sizeof(struct dlm_write_request) -
                               sizeof(struct dlm_write_request32)), GFP_KERNEL);
-               if (!kbuf)
+               if (!kbuf) {
+                       kfree(k32buf);
                        return -ENOMEM;
+               }
 
                if (proc)
                        set_bit(DLM_PROC_FLAGS_COMPAT, &proc->flags);
@@ -539,8 +541,10 @@ static ssize_t device_write(struct file *file, const char __user *buf,
 
        /* do we really need this? can a write happen after a close? */
        if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) &&
-           (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)))
-               return -EINVAL;
+           (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) {
+               error = -EINVAL;
+               goto out_free;
+       }
 
        sigfillset(&allsigs);
        sigprocmask(SIG_BLOCK, &allsigs, &tmpsig);
index 0c87474f7917776d92fb1427c93f118535ef624f..7cc0eb756b55e99e5f876eaa43c6c4e466b27b05 100644 (file)
@@ -1041,10 +1041,7 @@ retry:
 }
 
 /*
- * It opens an eventpoll file descriptor. The "size" parameter is there
- * for historical reasons, when epoll was using an hash instead of an
- * RB tree. With the current implementation, the "size" parameter is ignored
- * (besides sanity checks).
+ * Open an eventpoll file descriptor.
  */
 asmlinkage long sys_epoll_create1(int flags)
 {
index 8dee32007500e3200451b9334b849f2362611cc7..0540ca27a4464060e9c230095f664cd9937b21a1 100644 (file)
@@ -291,7 +291,7 @@ handle_t *journal_start(journal_t *journal, int nblocks)
                goto out;
        }
 
-       lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+       lock_map_acquire(&handle->h_lockdep_map);
 
 out:
        return handle;
@@ -1448,7 +1448,7 @@ int journal_stop(handle_t *handle)
                spin_unlock(&journal->j_state_lock);
        }
 
-       lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);
+       lock_map_release(&handle->h_lockdep_map);
 
        jbd_free_handle(handle);
        return err;
index 4f7cadbb19faa4396edeb4ff0be6840fc7a313af..e5d540588fa9609296f446c232278202bd1f2d6b 100644 (file)
@@ -301,7 +301,7 @@ handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
                goto out;
        }
 
-       lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+       lock_map_acquire(&handle->h_lockdep_map);
 out:
        return handle;
 }
@@ -1279,7 +1279,7 @@ int jbd2_journal_stop(handle_t *handle)
                spin_unlock(&journal->j_state_lock);
        }
 
-       lock_release(&handle->h_lockdep_map, 1, _THIS_IP_);
+       lock_map_release(&handle->h_lockdep_map);
 
        jbd2_free_handle(handle);
        return err;
index 399444639337d1ac096cbb368cd319c284626551..4a714f64515b06557704b38cf02f8ba7f36f7ea0 100644 (file)
@@ -83,7 +83,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
 {
        struct nlm_host *host;
        struct nlm_file *file;
-       int rc = rpc_success;
+       __be32 rc = rpc_success;
 
        dprintk("lockd: TEST4        called\n");
        resp->cookie = argp->cookie;
@@ -116,7 +116,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 {
        struct nlm_host *host;
        struct nlm_file *file;
-       int rc = rpc_success;
+       __be32 rc = rpc_success;
 
        dprintk("lockd: LOCK          called\n");
 
index 76019d2ff72def49828cf78ad6dba73b728fc8de..76262c1986f2d36d1f6765da9acf506736b3b30b 100644 (file)
@@ -112,7 +112,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
 {
        struct nlm_host *host;
        struct nlm_file *file;
-       int rc = rpc_success;
+       __be32 rc = rpc_success;
 
        dprintk("lockd: TEST          called\n");
        resp->cookie = argp->cookie;
@@ -146,7 +146,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp, struct nlm_args *argp,
 {
        struct nlm_host *host;
        struct nlm_file *file;
-       int rc = rpc_success;
+       __be32 rc = rpc_success;
 
        dprintk("lockd: LOCK          called\n");
 
index 33bfcf09db46faaffa13472d1ffd351c7dad28fb..9dc036f1835614e3c2505abad50496071cf8b0b2 100644 (file)
@@ -1023,7 +1023,7 @@ exp_export(struct nfsctl_export *nxp)
        /* Look up the dentry */
        err = path_lookup(nxp->ex_path, 0, &nd);
        if (err)
-               goto out_unlock;
+               goto out_put_clp;
        err = -EINVAL;
 
        exp = exp_get_by_name(clp, nd.path.mnt, nd.path.dentry, NULL);
@@ -1090,9 +1090,9 @@ finish:
                exp_put(exp);
        if (fsid_key && !IS_ERR(fsid_key))
                cache_put(&fsid_key->h, &svc_expkey_cache);
-       if (clp)
-               auth_domain_put(clp);
        path_put(&nd.path);
+out_put_clp:
+       auth_domain_put(clp);
 out_unlock:
        exp_writeunlock();
 out:
index 282a13596c702ac126e7697e97bd239fc4e905a4..d318c7e663faff15eb08ced95d11a123f6297866 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/mnt_namespace.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
-#include <linux/quotaops.h>
 
 struct file_system_type reiserfs_fs_type;
 
index 3f54dbd6c49b0c28506505bc41f99f20472fba8f..5d54205e486b6d9351840f768829a3e94d28bf23 100644 (file)
@@ -443,6 +443,20 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc)
        return -1;
 }
 
+int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits)
+{
+       size_t len = bitmap_scnprintf_len(nr_bits);
+
+       if (m->count + len < m->size) {
+               bitmap_scnprintf(m->buf + m->count, m->size - m->count,
+                                bits, nr_bits);
+               m->count += len;
+               return 0;
+       }
+       m->count = m->size;
+       return -1;
+}
+
 static void *single_start(struct seq_file *p, loff_t *pos)
 {
        return NULL + (*pos == 0);
index 864181385579891496f396bee440d8b3b0884117..15828b2d663c6aebfbb4df4d34186a3cdcafacbb 100644 (file)
         ((nr)   << _IOC_NRSHIFT) | \
         ((size) << _IOC_SIZESHIFT))
 
+#ifdef __KERNEL__
 /* provoke compile error for invalid uses of size argument */
 extern unsigned int __invalid_size_argument_for_IOC;
 #define _IOC_TYPECHECK(t) \
        ((sizeof(t) == sizeof(t[1]) && \
          sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
          sizeof(t) : __invalid_size_argument_for_IOC)
+#else
+#define _IOC_TYPECHECK(t) (sizeof(t))
+#endif
 
 /* used to create numbers */
 #define _IO(type,nr)           _IOC(_IOC_NONE,(type),(nr),0)
index 7ed2bd7a7f51c3621b26acde91bdaa65f36d9f96..d4f2b0abe9294eefce100885a7c342bea885d0c5 100644 (file)
@@ -86,7 +86,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3,
        efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
                  (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
 
-extern void *efi_ioremap(unsigned long addr, unsigned long size);
+extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size);
 
 #endif /* CONFIG_X86_32 */
 
index 77ba51df56680fcd9e28b4529eb647c0eea07292..edd0b95f14d0df6dd9b4f4cfb01d02548d485c9b 100644 (file)
@@ -98,9 +98,17 @@ extern void (*const interrupt[NR_IRQS])(void);
 #else
 typedef int vector_irq_t[NR_VECTORS];
 DECLARE_PER_CPU(vector_irq_t, vector_irq);
-extern spinlock_t vector_lock;
 #endif
-extern void setup_vector_irq(int cpu);
+
+#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_X86_64)
+extern void lock_vector_lock(void);
+extern void unlock_vector_lock(void);
+extern void __setup_vector_irq(int cpu);
+#else
+static inline void lock_vector_lock(void) {}
+static inline void unlock_vector_lock(void) {}
+static inline void __setup_vector_irq(int cpu) {}
+#endif
 
 #endif /* !ASSEMBLY_ */
 
index 90b1d1f12f08d652d39fef01e241ed321f38c415..b95d167b7fb26d8697a1d1a56b2000648b042e8b 100644 (file)
 #define LAST_VM86_IRQ          15
 #define invalid_vm86_irq(irq)  ((irq) < 3 || (irq) > 15)
 
-#if !defined(CONFIG_X86_VOYAGER)
+#ifdef CONFIG_X86_64
+# if NR_CPUS < MAX_IO_APICS
+#  define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
+# else
+#  define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
+# endif
+# define NR_IRQ_VECTORS NR_IRQS
+
+#elif !defined(CONFIG_X86_VOYAGER)
 
 # if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS)
 
index a26f565e8189978b490e9b7f4e6265b1f9993811..327f60658d947d905b3b1d0d2ff2cc6254ecc8ae 100644 (file)
@@ -356,6 +356,7 @@ unifdef-y += virtio_balloon.h
 unifdef-y += virtio_console.h
 unifdef-y += virtio_pci.h
 unifdef-y += virtio_ring.h
+unifdef-y += virtio_rng.h
 unifdef-y += vt.h
 unifdef-y += wait.h
 unifdef-y += wanrouter.h
index 972b12bcfb36a1ca8ea6bd9ce8fdac0b61ecbf7f..2b8df8b420fd0ebb2dc648d46d4aec3e148967f9 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef _AGP_BACKEND_H
 #define _AGP_BACKEND_H 1
 
+#include <linux/list.h>
+
 enum chipset_type {
        NOT_SUPPORTED,
        SUPPORTED,
@@ -78,6 +80,8 @@ struct agp_memory {
        bool is_bound;
        bool is_flushed;
         bool vmalloc_flag;
+       /* list of agp_memory mapped to the aperture */
+       struct list_head mapped_list;
 };
 
 #define AGP_NORMAL_MEMORY 0
@@ -96,6 +100,7 @@ extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t,
 extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);
 extern int agp_bind_memory(struct agp_memory *, off_t);
 extern int agp_unbind_memory(struct agp_memory *);
+extern int agp_rebind_memory(void);
 extern void agp_enable(struct agp_bridge_data *, u32);
 extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
 extern void agp_backend_release(struct agp_bridge_data *);
index 1abfe664c4446a9a64ea182ce680e6c08d1a3086..89781fd48859bb957bbaafabce4c87ad0affd2a0 100644 (file)
@@ -110,6 +110,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);
 
 extern int bitmap_scnprintf(char *buf, unsigned int len,
                        const unsigned long *src, int nbits);
+extern int bitmap_scnprintf_len(unsigned int nr_bits);
 extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
                        unsigned long *dst, int nbits);
 extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,
index 652470b687c9533f09fc8829d829f3d8fa768b6b..95837bfb52561dded74d03982bb252bdae4776f5 100644 (file)
@@ -97,10 +97,14 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
 #define alloc_bootmem(x) \
        __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+       __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
        __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
        __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+       __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
        __alloc_bootmem_low(x, PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x) \
diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h
new file mode 100644 (file)
index 0000000..29f002d
--- /dev/null
@@ -0,0 +1,372 @@
+#ifndef _LINUX_BYTEORDER_H
+#define _LINUX_BYTEORDER_H
+
+#include <linux/types.h>
+#include <linux/swab.h>
+
+#if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
+# error Fix asm/byteorder.h to define one endianness
+#endif
+
+#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
+# error Fix asm/byteorder.h to define arch endianness
+#endif
+
+#ifdef __LITTLE_ENDIAN
+# undef __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN 1234
+#endif
+
+#ifdef __BIG_ENDIAN
+# undef __BIG_ENDIAN
+# define __BIG_ENDIAN 4321
+#endif
+
+#if defined(__LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN_BITFIELD)
+# define __LITTLE_ENDIAN_BITFIELD
+#endif
+
+#if defined(__BIG_ENDIAN) && !defined(__BIG_ENDIAN_BITFIELD)
+# define __BIG_ENDIAN_BITFIELD
+#endif
+
+#ifdef __LITTLE_ENDIAN
+# define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
+# define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
+# define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
+# define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
+# define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
+# define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
+
+# define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
+# define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
+# define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
+# define __cpu_to_be16(x) ((__force __be16)__swab16(x))
+# define __cpu_to_be32(x) ((__force __be32)__swab32(x))
+# define __cpu_to_be64(x) ((__force __be64)__swab64(x))
+#endif
+
+#ifdef __BIG_ENDIAN
+# define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
+# define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
+# define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
+# define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
+# define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
+# define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
+
+# define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
+# define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
+# define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
+# define __cpu_to_le16(x) ((__force __le16)__swab16(x))
+# define __cpu_to_le32(x) ((__force __le32)__swab32(x))
+# define __cpu_to_le64(x) ((__force __le64)__swab64(x))
+#endif
+
+/*
+ * These helpers could be phased out over time as the base version
+ * handles constant folding.
+ */
+#define __constant_htonl(x) __cpu_to_be32(x)
+#define __constant_ntohl(x) __be32_to_cpu(x)
+#define __constant_htons(x) __cpu_to_be16(x)
+#define __constant_ntohs(x) __be16_to_cpu(x)
+
+#define __constant_le16_to_cpu(x) __le16_to_cpu(x)
+#define __constant_le32_to_cpu(x) __le32_to_cpu(x)
+#define __constant_le64_to_cpu(x) __le64_to_cpu(x)
+#define __constant_be16_to_cpu(x) __be16_to_cpu(x)
+#define __constant_be32_to_cpu(x) __be32_to_cpu(x)
+#define __constant_be64_to_cpu(x) __be64_to_cpu(x)
+
+#define __constant_cpu_to_le16(x) __cpu_to_le16(x)
+#define __constant_cpu_to_le32(x) __cpu_to_le32(x)
+#define __constant_cpu_to_le64(x) __cpu_to_le64(x)
+#define __constant_cpu_to_be16(x) __cpu_to_be16(x)
+#define __constant_cpu_to_be32(x) __cpu_to_be32(x)
+#define __constant_cpu_to_be64(x) __cpu_to_be64(x)
+
+static inline void __le16_to_cpus(__u16 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab16s(p);
+#endif
+}
+
+static inline void __cpu_to_le16s(__u16 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab16s(p);
+#endif
+}
+
+static inline void __le32_to_cpus(__u32 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab32s(p);
+#endif
+}
+
+static inline void __cpu_to_le32s(__u32 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab32s(p);
+#endif
+}
+
+static inline void __le64_to_cpus(__u64 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab64s(p);
+#endif
+}
+
+static inline void __cpu_to_le64s(__u64 *p)
+{
+#ifdef __BIG_ENDIAN
+       __swab64s(p);
+#endif
+}
+
+static inline void __be16_to_cpus(__u16 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab16s(p);
+#endif
+}
+
+static inline void __cpu_to_be16s(__u16 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab16s(p);
+#endif
+}
+
+static inline void __be32_to_cpus(__u32 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab32s(p);
+#endif
+}
+
+static inline void __cpu_to_be32s(__u32 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab32s(p);
+#endif
+}
+
+static inline void __be64_to_cpus(__u64 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab64s(p);
+#endif
+}
+
+static inline void __cpu_to_be64s(__u64 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       __swab64s(p);
+#endif
+}
+
+static inline __u16 __le16_to_cpup(const __le16 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __u16)*p;
+#else
+       return __swab16p((__force __u16 *)p);
+#endif
+}
+
+static inline __u32 __le32_to_cpup(const __le32 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __u32)*p;
+#else
+       return __swab32p((__force __u32 *)p);
+#endif
+}
+
+static inline __u64 __le64_to_cpup(const __le64 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __u64)*p;
+#else
+       return __swab64p((__force __u64 *)p);
+#endif
+}
+
+static inline __le16 __cpu_to_le16p(const __u16 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __le16)*p;
+#else
+       return (__force __le16)__swab16p(p);
+#endif
+}
+
+static inline __le32 __cpu_to_le32p(const __u32 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __le32)*p;
+#else
+       return (__force __le32)__swab32p(p);
+#endif
+}
+
+static inline __le64 __cpu_to_le64p(const __u64 *p)
+{
+#ifdef __LITTLE_ENDIAN
+       return (__force __le64)*p;
+#else
+       return (__force __le64)__swab64p(p);
+#endif
+}
+
+static inline __u16 __be16_to_cpup(const __be16 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __u16)*p;
+#else
+       return __swab16p((__force __u16 *)p);
+#endif
+}
+
+static inline __u32 __be32_to_cpup(const __be32 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __u32)*p;
+#else
+       return __swab32p((__force __u32 *)p);
+#endif
+}
+
+static inline __u64 __be64_to_cpup(const __be64 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __u64)*p;
+#else
+       return __swab64p((__force __u64 *)p);
+#endif
+}
+
+static inline __be16 __cpu_to_be16p(const __u16 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __be16)*p;
+#else
+       return (__force __be16)__swab16p(p);
+#endif
+}
+
+static inline __be32 __cpu_to_be32p(const __u32 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __be32)*p;
+#else
+       return (__force __be32)__swab32p(p);
+#endif
+}
+
+static inline __be64 __cpu_to_be64p(const __u64 *p)
+{
+#ifdef __BIG_ENDIAN
+       return (__force __be64)*p;
+#else
+       return (__force __be64)__swab64p(p);
+#endif
+}
+
+#ifdef __KERNEL__
+
+# define le16_to_cpu __le16_to_cpu
+# define le32_to_cpu __le32_to_cpu
+# define le64_to_cpu __le64_to_cpu
+# define be16_to_cpu __be16_to_cpu
+# define be32_to_cpu __be32_to_cpu
+# define be64_to_cpu __be64_to_cpu
+# define cpu_to_le16 __cpu_to_le16
+# define cpu_to_le32 __cpu_to_le32
+# define cpu_to_le64 __cpu_to_le64
+# define cpu_to_be16 __cpu_to_be16
+# define cpu_to_be32 __cpu_to_be32
+# define cpu_to_be64 __cpu_to_be64
+
+# define le16_to_cpup __le16_to_cpup
+# define le32_to_cpup __le32_to_cpup
+# define le64_to_cpup __le64_to_cpup
+# define be16_to_cpup __be16_to_cpup
+# define be32_to_cpup __be32_to_cpup
+# define be64_to_cpup __be64_to_cpup
+# define cpu_to_le16p __cpu_to_le16p
+# define cpu_to_le32p __cpu_to_le32p
+# define cpu_to_le64p __cpu_to_le64p
+# define cpu_to_be16p __cpu_to_be16p
+# define cpu_to_be32p __cpu_to_be32p
+# define cpu_to_be64p __cpu_to_be64p
+
+# define le16_to_cpus __le16_to_cpus
+# define le32_to_cpus __le32_to_cpus
+# define le64_to_cpus __le64_to_cpus
+# define be16_to_cpus __be16_to_cpus
+# define be32_to_cpus __be32_to_cpus
+# define be64_to_cpus __be64_to_cpus
+# define cpu_to_le16s __cpu_to_le16s
+# define cpu_to_le32s __cpu_to_le32s
+# define cpu_to_le64s __cpu_to_le64s
+# define cpu_to_be16s __cpu_to_be16s
+# define cpu_to_be32s __cpu_to_be32s
+# define cpu_to_be64s __cpu_to_be64s
+
+/*
+ * They have to be macros in order to do the constant folding
+ * correctly - if the argument passed into a inline function
+ * it is no longer constant according to gcc..
+ */
+# undef ntohl
+# undef ntohs
+# undef htonl
+# undef htons
+
+# define ___htonl(x) __cpu_to_be32(x)
+# define ___htons(x) __cpu_to_be16(x)
+# define ___ntohl(x) __be32_to_cpu(x)
+# define ___ntohs(x) __be16_to_cpu(x)
+
+# define htonl(x) ___htonl(x)
+# define ntohl(x) ___ntohl(x)
+# define htons(x) ___htons(x)
+# define ntohs(x) ___ntohs(x)
+
+static inline void le16_add_cpu(__le16 *var, u16 val)
+{
+       *var = cpu_to_le16(le16_to_cpup(var) + val);
+}
+
+static inline void le32_add_cpu(__le32 *var, u32 val)
+{
+       *var = cpu_to_le32(le32_to_cpup(var) + val);
+}
+
+static inline void le64_add_cpu(__le64 *var, u64 val)
+{
+       *var = cpu_to_le64(le64_to_cpup(var) + val);
+}
+
+static inline void be16_add_cpu(__be16 *var, u16 val)
+{
+       *var = cpu_to_be16(be16_to_cpup(var) + val);
+}
+
+static inline void be32_add_cpu(__be32 *var, u32 val)
+{
+       *var = cpu_to_be32(be32_to_cpup(var) + val);
+}
+
+static inline void be64_add_cpu(__be64 *var, u64 val)
+{
+       *var = cpu_to_be64(be64_to_cpup(var) + val);
+}
+
+#endif /* __KERNEL__ */
+#endif /* _LINUX_BYTEORDER_H */
index acbdbcc160518ab81fb7c7197d661a37b5303aab..6e199c8dfacc4f3c40307076535d41da914afeb8 100644 (file)
  */
 #ifdef CONFIG_FIRMWARE_MEMMAP
 
-/**
- * Adds a firmware mapping entry. This function uses kmalloc() for memory
- * allocation. Use firmware_map_add_early() if you want to use the bootmem
- * allocator.
- *
- * That function must be called before late_initcall.
- *
- * @start: Start of the memory range.
- * @end:   End of the memory range (inclusive).
- * @type:  Type of the memory range.
- *
- * Returns 0 on success, or -ENOMEM if no memory could be allocated.
- */
 int firmware_map_add(resource_size_t start, resource_size_t end,
                     const char *type);
-
-/**
- * Adds a firmware mapping entry. This function uses the bootmem allocator
- * for memory allocation. Use firmware_map_add() if you want to use kmalloc().
- *
- * That function must be called before late_initcall.
- *
- * @start: Start of the memory range.
- * @end:   End of the memory range (inclusive).
- * @type:  Type of the memory range.
- *
- * Returns 0 on success, or -ENOMEM if no memory could be allocated.
- */
 int firmware_map_add_early(resource_size_t start, resource_size_t end,
                           const char *type);
 
index 4862398e05bf033e3ee7721715fe9b398cd9a98d..bf34c5f4c0511abc17c664655559918e2da01ef5 100644 (file)
@@ -39,7 +39,6 @@
 #define I2C_DRIVERID_SAA7111A   8      /* video input processor        */
 #define I2C_DRIVERID_SAA7185B  13      /* video encoder                */
 #define I2C_DRIVERID_SAA7110   22      /* video decoder                */
-#define I2C_DRIVERID_MGATVO    23      /* Matrox TVOut                 */
 #define I2C_DRIVERID_SAA5249   24      /* SAA5249 and compatibles      */
 #define I2C_DRIVERID_PCF8583   25      /* real time clock              */
 #define I2C_DRIVERID_SAB3036   26      /* SAB3036 tuner                */
@@ -95,7 +94,6 @@
 #define I2C_HW_B_BT848         0x010005 /* BT848 video boards */
 #define I2C_HW_B_VIA           0x010007 /* Via vt82c586b */
 #define I2C_HW_B_HYDRA         0x010008 /* Apple Hydra Mac I/O */
-#define I2C_HW_B_G400          0x010009 /* Matrox G400 */
 #define I2C_HW_B_I810          0x01000a /* Intel I810 */
 #define I2C_HW_B_VOO           0x01000b /* 3dfx Voodoo 3 / Banshee */
 #define I2C_HW_B_SCX200                0x01000e /* Nat'l Semi SCx200 I2C */
index 11b84e1060532ecf62f73e3151b9f6eaed043c8b..93538b696e3d99f2bb30d96b83d3516c66442233 100644 (file)
@@ -139,6 +139,7 @@ extern initcall_t __con_initcall_start[], __con_initcall_end[];
 extern initcall_t __security_initcall_start[], __security_initcall_end[];
 
 /* Defined in init/main.c */
+extern int do_one_initcall(initcall_t fn);
 extern char __initdata boot_command_line[];
 extern char *saved_command_line;
 extern unsigned int reset_devices;
index aaa998f65c7af93e8a0e715e5bef0ca5ef067ece..2651f805ba6d771b9ec1f26078609aebdb198853 100644 (file)
@@ -108,6 +108,13 @@ struct completion;
 struct pt_regs;
 struct user;
 
+#ifdef CONFIG_PREEMPT_VOLUNTARY
+extern int _cond_resched(void);
+# define might_resched() _cond_resched()
+#else
+# define might_resched() do { } while (0)
+#endif
+
 /**
  * might_sleep - annotation for functions that can sleep
  *
@@ -118,13 +125,6 @@ struct user;
  * be bitten later when the calling function happens to sleep when it is not
  * supposed to.
  */
-#ifdef CONFIG_PREEMPT_VOLUNTARY
-extern int _cond_resched(void);
-# define might_resched() _cond_resched()
-#else
-# define might_resched() do { } while (0)
-#endif
-
 #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
   void __might_sleep(char *file, int line);
 # define might_sleep() \
index 2486eb4edbf146b77effbfe27c14689ea70db1de..331e5f1c2d8ec4439bc69294337dc1b00345f3d8 100644 (file)
@@ -89,6 +89,7 @@ struct lock_class {
 
        struct lockdep_subclass_key     *key;
        unsigned int                    subclass;
+       unsigned int                    dep_gen_id;
 
        /*
         * IRQ/softirq usage tracking bits:
@@ -189,6 +190,14 @@ struct lock_chain {
        u64                             chain_key;
 };
 
+#define MAX_LOCKDEP_KEYS_BITS          13
+/*
+ * Subtract one because we offset hlock->class_idx by 1 in order
+ * to make 0 mean no class. This avoids overflowing the class_idx
+ * bitfield and hitting the BUG in hlock_class().
+ */
+#define MAX_LOCKDEP_KEYS               ((1UL << MAX_LOCKDEP_KEYS_BITS) - 1)
+
 struct held_lock {
        /*
         * One-way hash of the dependency chain up to this point. We
@@ -205,14 +214,14 @@ struct held_lock {
         * with zero), here we store the previous hash value:
         */
        u64                             prev_chain_key;
-       struct lock_class               *class;
        unsigned long                   acquire_ip;
        struct lockdep_map              *instance;
-
+       struct lockdep_map              *nest_lock;
 #ifdef CONFIG_LOCK_STAT
        u64                             waittime_stamp;
        u64                             holdtime_stamp;
 #endif
+       unsigned int                    class_idx:MAX_LOCKDEP_KEYS_BITS;
        /*
         * The lock-stack is unified in that the lock chains of interrupt
         * contexts nest ontop of process context chains, but we 'separate'
@@ -226,11 +235,11 @@ struct held_lock {
         * The following field is used to detect when we cross into an
         * interrupt context:
         */
-       int                             irq_context;
-       int                             trylock;
-       int                             read;
-       int                             check;
-       int                             hardirqs_off;
+       unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */
+       unsigned int trylock:1;
+       unsigned int read:2;        /* see lock_acquire() comment */
+       unsigned int check:2;       /* see lock_acquire() comment */
+       unsigned int hardirqs_off:1;
 };
 
 /*
@@ -294,11 +303,15 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
  *   2: full validation
  */
 extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
-                        int trylock, int read, int check, unsigned long ip);
+                        int trylock, int read, int check,
+                        struct lockdep_map *nest_lock, unsigned long ip);
 
 extern void lock_release(struct lockdep_map *lock, int nested,
                         unsigned long ip);
 
+extern void lock_set_subclass(struct lockdep_map *lock, unsigned int subclass,
+                             unsigned long ip);
+
 # define INIT_LOCKDEP                          .lockdep_recursion = 0,
 
 #define lockdep_depth(tsk)     (debug_locks ? (tsk)->lockdep_depth : 0)
@@ -313,8 +326,9 @@ static inline void lockdep_on(void)
 {
 }
 
-# define lock_acquire(l, s, t, r, c, i)                do { } while (0)
+# define lock_acquire(l, s, t, r, c, n, i)     do { } while (0)
 # define lock_release(l, n, i)                 do { } while (0)
+# define lock_set_subclass(l, s, i)            do { } while (0)
 # define lockdep_init()                                do { } while (0)
 # define lockdep_info()                                do { } while (0)
 # define lockdep_init_map(lock, name, key, sub)        do { (void)(key); } while (0)
@@ -400,9 +414,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # ifdef CONFIG_PROVE_LOCKING
-#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 2, i)
+#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 2, NULL, i)
+#  define spin_acquire_nest(l, s, t, n, i)     lock_acquire(l, s, t, 0, 2, n, i)
 # else
-#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 1, i)
+#  define spin_acquire(l, s, t, i)             lock_acquire(l, s, t, 0, 1, NULL, i)
+#  define spin_acquire_nest(l, s, t, n, i)     lock_acquire(l, s, t, 0, 1, NULL, i)
 # endif
 # define spin_release(l, n, i)                 lock_release(l, n, i)
 #else
@@ -412,11 +428,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # ifdef CONFIG_PROVE_LOCKING
-#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 2, i)
-#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 2, i)
+#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 2, NULL, i)
+#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 2, NULL, i)
 # else
-#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 1, i)
-#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 1, i)
+#  define rwlock_acquire(l, s, t, i)           lock_acquire(l, s, t, 0, 1, NULL, i)
+#  define rwlock_acquire_read(l, s, t, i)      lock_acquire(l, s, t, 2, 1, NULL, i)
 # endif
 # define rwlock_release(l, n, i)               lock_release(l, n, i)
 #else
@@ -427,9 +443,9 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # ifdef CONFIG_PROVE_LOCKING
-#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, i)
+#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, NULL, i)
 # else
-#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, i)
+#  define mutex_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, NULL, i)
 # endif
 # define mutex_release(l, n, i)                        lock_release(l, n, i)
 #else
@@ -439,11 +455,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # ifdef CONFIG_PROVE_LOCKING
-#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, i)
-#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 2, i)
+#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 2, NULL, i)
+#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 2, NULL, i)
 # else
-#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, i)
-#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 1, i)
+#  define rwsem_acquire(l, s, t, i)            lock_acquire(l, s, t, 0, 1, NULL, i)
+#  define rwsem_acquire_read(l, s, t, i)       lock_acquire(l, s, t, 1, 1, NULL, i)
 # endif
 # define rwsem_release(l, n, i)                        lock_release(l, n, i)
 #else
@@ -452,4 +468,16 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 # define rwsem_release(l, n, i)                        do { } while (0)
 #endif
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# ifdef CONFIG_PROVE_LOCKING
+#  define lock_map_acquire(l)          lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
+# else
+#  define lock_map_acquire(l)          lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
+# endif
+# define lock_map_release(l)                   lock_release(l, 1, _THIS_IP_)
+#else
+# define lock_map_acquire(l)                   do { } while (0)
+# define lock_map_release(l)                   do { } while (0)
+#endif
+
 #endif /* __LINUX_LOCKDEP_H */
index 335288bff1b741bd25dce72d3a84773c5ef70aee..fa651609b65dbc928a1a3d20035c29b42a1a8947 100644 (file)
@@ -834,7 +834,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma,
                          struct vm_area_struct **pprev, unsigned long start,
                          unsigned long end, unsigned long newflags);
 
-#ifdef CONFIG_HAVE_GET_USER_PAGES_FAST
 /*
  * get_user_pages_fast provides equivalent functionality to get_user_pages,
  * operating on current and current->mm (force=0 and doesn't return any vmas).
@@ -848,25 +847,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma,
 int get_user_pages_fast(unsigned long start, int nr_pages, int write,
                        struct page **pages);
 
-#else
-/*
- * Should probably be moved to asm-generic, and architectures can include it if
- * they don't implement their own get_user_pages_fast.
- */
-#define get_user_pages_fast(start, nr_pages, write, pages)     \
-({                                                             \
-       struct mm_struct *mm = current->mm;                     \
-       int ret;                                                \
-                                                               \
-       down_read(&mm->mmap_sem);                               \
-       ret = get_user_pages(current, mm, start, nr_pages,      \
-                                       write, 0, pages, NULL); \
-       up_read(&mm->mmap_sem);                                 \
-                                                               \
-       ret;                                                    \
-})
-#endif
-
 /*
  * A callback you can register to apply pressure to ageable caches.
  *
index 8c774905dcfec6c5a98d500d396b5dfdee97837e..4ab8436227276322042c5b7374e6d0c561e80486 100644 (file)
@@ -117,7 +117,7 @@ extern int rcu_needs_cpu(int cpu);
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 extern struct lockdep_map rcu_lock_map;
 # define rcu_read_acquire()    \
-                       lock_acquire(&rcu_lock_map, 0, 0, 2, 1, _THIS_IP_)
+                       lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
 # define rcu_read_release()    lock_release(&rcu_lock_map, 1, _THIS_IP_)
 #else
 # define rcu_read_acquire()    do { } while (0)
index 5270d449ff9deb9036f0b4d7852c4877dc561262..5850bfb968a87079d767387169a0847e8530f217 100644 (file)
@@ -1551,16 +1551,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
 
 extern unsigned long long sched_clock(void);
 
-#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
-static inline void sched_clock_init(void)
-{
-}
-
-static inline u64 sched_clock_cpu(int cpu)
-{
-       return sched_clock();
-}
+extern void sched_clock_init(void);
+extern u64 sched_clock_cpu(int cpu);
 
+#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
 static inline void sched_clock_tick(void)
 {
 }
@@ -1572,28 +1566,11 @@ static inline void sched_clock_idle_sleep_event(void)
 static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
 {
 }
-
-#ifdef CONFIG_NO_HZ
-static inline void sched_clock_tick_stop(int cpu)
-{
-}
-
-static inline void sched_clock_tick_start(int cpu)
-{
-}
-#endif
-
-#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
-extern void sched_clock_init(void);
-extern u64 sched_clock_cpu(int cpu);
+#else
 extern void sched_clock_tick(void);
 extern void sched_clock_idle_sleep_event(void);
 extern void sched_clock_idle_wakeup_event(u64 delta_ns);
-#ifdef CONFIG_NO_HZ
-extern void sched_clock_tick_stop(int cpu);
-extern void sched_clock_tick_start(int cpu);
 #endif
-#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
 
 /*
  * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
index a66304a09955b0d36e7b7f67193657a444355e77..a1783b229ef4c219081fc7200fcdc5dd63c267e4 100644 (file)
@@ -4,6 +4,8 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/mutex.h>
+#include <linux/cpumask.h>
+#include <linux/nodemask.h>
 
 struct seq_operations;
 struct file;
@@ -47,6 +49,16 @@ int seq_path(struct seq_file *, struct path *, char *);
 int seq_dentry(struct seq_file *, struct dentry *, char *);
 int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
                  char *esc);
+int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits);
+static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask)
+{
+       return seq_bitmap(m, mask->bits, NR_CPUS);
+}
+
+static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask)
+{
+       return seq_bitmap(m, mask->bits, MAX_NUMNODES);
+}
 
 int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
 int single_release(struct inode *, struct file *);
index 61e5610ad165592c0605eb68330ff50d9e0b77f8..e0c0fccced46c4b09d654121423f76357407bc95 100644 (file)
@@ -183,8 +183,14 @@ do {                                                               \
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass)
+# define spin_lock_nest_lock(lock, nest_lock)                          \
+        do {                                                           \
+                typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\
+                _spin_lock_nest_lock(lock, &(nest_lock)->dep_map);     \
+        } while (0)
 #else
 # define spin_lock_nested(lock, subclass) _spin_lock(lock)
+# define spin_lock_nest_lock(lock, nest_lock) _spin_lock(lock)
 #endif
 
 #define write_lock(lock)               _write_lock(lock)
index 8a2307ce729687f25a954969ae14df0b31748915..d79845d034b530372ff0049655179525a45dffc0 100644 (file)
@@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr);
 void __lockfunc _spin_lock(spinlock_t *lock)           __acquires(lock);
 void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
                                                        __acquires(lock);
+void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map)
+                                                       __acquires(lock);
 void __lockfunc _read_lock(rwlock_t *lock)             __acquires(lock);
 void __lockfunc _write_lock(rwlock_t *lock)            __acquires(lock);
 void __lockfunc _spin_lock_bh(spinlock_t *lock)                __acquires(lock);
diff --git a/include/linux/swab.h b/include/linux/swab.h
new file mode 100644 (file)
index 0000000..270d5c2
--- /dev/null
@@ -0,0 +1,309 @@
+#ifndef _LINUX_SWAB_H
+#define _LINUX_SWAB_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <asm/byteorder.h>
+
+/*
+ * casts are necessary for constants, because we never know how for sure
+ * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
+ */
+#define __const_swab16(x) ((__u16)(                            \
+       (((__u16)(x) & (__u16)0x00ffU) << 8) |                  \
+       (((__u16)(x) & (__u16)0xff00U) >> 8)))
+
+#define __const_swab32(x) ((__u32)(                            \
+       (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
+       (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
+       (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
+       (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
+
+#define __const_swab64(x) ((__u64)(                            \
+       (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) |   \
+       (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) |   \
+       (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) |   \
+       (((__u64)(x) & (__u64)0x00000000ff000000ULL) <<  8) |   \
+       (((__u64)(x) & (__u64)0x000000ff00000000ULL) >>  8) |   \
+       (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) |   \
+       (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) |   \
+       (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
+
+#define __const_swahw32(x) ((__u32)(                           \
+       (((__u32)(x) & (__u32)0x0000ffffUL) << 16) |            \
+       (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
+
+#define __const_swahb32(x) ((__u32)(                           \
+       (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) |             \
+       (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
+
+/*
+ * Implement the following as inlines, but define the interface using
+ * macros to allow constant folding when possible:
+ * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
+ */
+
+static inline __attribute_const__ __u16 ___swab16(__u16 val)
+{
+#ifdef __arch_swab16
+       return __arch_swab16(val);
+#elif defined(__arch_swab16p)
+       return __arch_swab16p(&val);
+#else
+       return __const_swab16(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 ___swab32(__u32 val)
+{
+#ifdef __arch_swab32
+       return __arch_swab32(val);
+#elif defined(__arch_swab32p)
+       return __arch_swab32p(&val);
+#else
+       return __const_swab32(val);
+#endif
+}
+
+static inline __attribute_const__ __u64 ___swab64(__u64 val)
+{
+#ifdef __arch_swab64
+       return __arch_swab64(val);
+#elif defined(__arch_swab64p)
+       return __arch_swab64p(&val);
+#elif defined(__SWAB_64_THRU_32__)
+       __u32 h = val >> 32;
+       __u32 l = val & ((1ULL << 32) - 1);
+       return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h)));
+#else
+       return __const_swab64(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 ___swahw32(__u32 val)
+{
+#ifdef __arch_swahw32
+       return __arch_swahw32(val);
+#elif defined(__arch_swahw32p)
+       return __arch_swahw32p(&val);
+#else
+       return __const_swahw32(val);
+#endif
+}
+
+static inline __attribute_const__ __u32 ___swahb32(__u32 val)
+{
+#ifdef __arch_swahb32
+       return __arch_swahb32(val);
+#elif defined(__arch_swahb32p)
+       return __arch_swahb32p(&val);
+#else
+       return __const_swahb32(val);
+#endif
+}
+
+/**
+ * __swab16 - return a byteswapped 16-bit value
+ * @x: value to byteswap
+ */
+#define __swab16(x)                            \
+       (__builtin_constant_p((__u16)(x)) ?     \
+       __const_swab16((x)) :                   \
+       ___swab16((x)))
+
+/**
+ * __swab32 - return a byteswapped 32-bit value
+ * @x: value to byteswap
+ */
+#define __swab32(x)                            \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       __const_swab32((x)) :                   \
+       ___swab32((x)))
+
+/**
+ * __swab64 - return a byteswapped 64-bit value
+ * @x: value to byteswap
+ */
+#define __swab64(x)                            \
+       (__builtin_constant_p((__u64)(x)) ?     \
+       __const_swab64((x)) :                   \
+       ___swab64((x)))
+
+/**
+ * __swahw32 - return a word-swapped 32-bit value
+ * @x: value to wordswap
+ *
+ * __swahw32(0x12340000) is 0x00001234
+ */
+#define __swahw32(x)                           \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       __const_swahw32((x)) :                  \
+       ___swahw32((x)))
+
+/**
+ * __swahb32 - return a high and low byte-swapped 32-bit value
+ * @x: value to byteswap
+ *
+ * __swahb32(0x12345678) is 0x34127856
+ */
+#define __swahb32(x)                           \
+       (__builtin_constant_p((__u32)(x)) ?     \
+       __const_swahb32((x)) :                  \
+       ___swahb32((x)))
+
+/**
+ * __swab16p - return a byteswapped 16-bit value from a pointer
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static inline __u16 __swab16p(const __u16 *p)
+{
+#ifdef __arch_swab16p
+       return __arch_swab16p(p);
+#else
+       return __swab16(*p);
+#endif
+}
+
+/**
+ * __swab32p - return a byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static inline __u32 __swab32p(const __u32 *p)
+{
+#ifdef __arch_swab32p
+       return __arch_swab32p(p);
+#else
+       return __swab32(*p);
+#endif
+}
+
+/**
+ * __swab64p - return a byteswapped 64-bit value from a pointer
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static inline __u64 __swab64p(const __u64 *p)
+{
+#ifdef __arch_swab64p
+       return __arch_swab64p(p);
+#else
+       return __swab64(*p);
+#endif
+}
+
+/**
+ * __swahw32p - return a wordswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping.
+ */
+static inline __u32 __swahw32p(const __u32 *p)
+{
+#ifdef __arch_swahw32p
+       return __arch_swahw32p(p);
+#else
+       return __swahw32(*p);
+#endif
+}
+
+/**
+ * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high/low byteswapping.
+ */
+static inline __u32 __swahb32p(const __u32 *p)
+{
+#ifdef __arch_swahb32p
+       return __arch_swahb32p(p);
+#else
+       return __swahb32(*p);
+#endif
+}
+
+/**
+ * __swab16s - byteswap a 16-bit value in-place
+ * @p: pointer to a naturally-aligned 16-bit value
+ */
+static inline void __swab16s(__u16 *p)
+{
+#ifdef __arch_swab16s
+       __arch_swab16s(p);
+#else
+       *p = __swab16p(p);
+#endif
+}
+/**
+ * __swab32s - byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ */
+static inline void __swab32s(__u32 *p)
+{
+#ifdef __arch_swab32s
+       __arch_swab32s(p);
+#else
+       *p = __swab32p(p);
+#endif
+}
+
+/**
+ * __swab64s - byteswap a 64-bit value in-place
+ * @p: pointer to a naturally-aligned 64-bit value
+ */
+static inline void __swab64s(__u64 *p)
+{
+#ifdef __arch_swab64s
+       __arch_swab64s(p);
+#else
+       *p = __swab64p(p);
+#endif
+}
+
+/**
+ * __swahw32s - wordswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahw32() for details of wordswapping
+ */
+static inline void __swahw32s(__u32 *p)
+{
+#ifdef __arch_swahw32s
+       __arch_swahw32s(p);
+#else
+       *p = __swahw32p(p);
+#endif
+}
+
+/**
+ * __swahb32s - high and low byteswap a 32-bit value in-place
+ * @p: pointer to a naturally-aligned 32-bit value
+ *
+ * See __swahb32() for details of high and low byte swapping
+ */
+static inline void __swahb32s(__u32 *p)
+{
+#ifdef __arch_swahb32s
+       __arch_swahb32s(p);
+#else
+       *p = __swahb32p(p);
+#endif
+}
+
+#ifdef __KERNEL__
+# define swab16 __swab16
+# define swab32 __swab32
+# define swab64 __swab64
+# define swahw32 __swahw32
+# define swahb32 __swahb32
+# define swab16p __swab16p
+# define swab32p __swab32p
+# define swab64p __swab64p
+# define swahw32p __swahw32p
+# define swahb32p __swahb32p
+# define swab16s __swab16s
+# define swab32s __swab32s
+# define swab64s __swab64s
+# define swahw32s __swahw32s
+# define swahb32s __swahb32s
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_SWAB_H */
index 613173b5db6991040484908e1c0940c00f247d04..920c4e9cb93dce0fb9929603121b4079ffc8ffeb 100644 (file)
@@ -41,6 +41,7 @@ struct atmel_lcdfb_info {
        struct work_struct      task;
 
        unsigned int            guard_time;
+       unsigned int            smem_len;
        struct platform_device  *pdev;
        struct clk              *bus_clk;
        struct clk              *lcdc_clk;
index 95a1f2038b1db145f07b76813cd55c4908fb1859..099ffa5e5bee9b75195850977b5b6e4ef2240014 100644 (file)
 #define SOFT_RESET_RB                             (1 <<  6)
 #define SOFT_RESET_HDP                            (1 <<  7)
 
+/* WAIT_UNTIL bit constants */
+#define WAIT_DMA_GUI_IDLE                         (1 << 9)
+#define WAIT_2D_IDLECLEAN                         (1 << 16)
+
 /* SURFACE_CNTL bit consants */
 #define SURF_TRANSLATION_DIS                      (1 << 8)
 #define NONSURF_AP0_SWP_16BPP                     (1 << 20)
index 0bc7e167bf4556c63dde64eb249a1880b6675548..f6f7042331dc3ef9dbf156a807398936e0824b1a 100644 (file)
@@ -691,7 +691,7 @@ asmlinkage void __init start_kernel(void)
        rest_init();
 }
 
-static int __initdata initcall_debug;
+static int initcall_debug;
 
 static int __init initcall_debug_setup(char *str)
 {
@@ -700,7 +700,7 @@ static int __init initcall_debug_setup(char *str)
 }
 __setup("initcall_debug", initcall_debug_setup);
 
-static void __init do_one_initcall(initcall_t fn)
+int do_one_initcall(initcall_t fn)
 {
        int count = preempt_count();
        ktime_t t0, t1, delta;
@@ -740,6 +740,8 @@ static void __init do_one_initcall(initcall_t fn)
                print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn);
                printk(" returned with %s\n", msgbuf);
        }
+
+       return result;
 }
 
 
index 382dd5a8b2d7f5dd97359895358610f2f4866595..94fabd534b03d9347dc117b653204fa838283def 100644 (file)
@@ -55,4 +55,4 @@ config HZ
        default 1000 if HZ_1000
 
 config SCHED_HRTICK
-       def_bool HIGH_RES_TIMERS && USE_GENERIC_SMP_HELPERS
+       def_bool HIGH_RES_TIMERS && (!SMP || USE_GENERIC_SMP_HELPERS)
index e202a68d1cc180cf62ade78b025ec2329c8aabcd..f17e9854c24612e1e3f83b389f48224eb2d7b807 100644 (file)
@@ -349,6 +349,8 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
                goto out_notify;
        BUG_ON(!cpu_online(cpu));
 
+       cpu_set(cpu, cpu_active_map);
+
        /* Now call notifier in preparation. */
        raw_notifier_call_chain(&cpu_chain, CPU_ONLINE | mod, hcpu);
 
@@ -367,7 +369,7 @@ int __cpuinit cpu_up(unsigned int cpu)
        if (!cpu_isset(cpu, cpu_possible_map)) {
                printk(KERN_ERR "can't online cpu %d because it is not "
                        "configured as may-hotadd at boot time\n", cpu);
-#if defined(CONFIG_IA64) || defined(CONFIG_X86_64) || defined(CONFIG_S390)
+#if defined(CONFIG_IA64) || defined(CONFIG_X86_64)
                printk(KERN_ERR "please check additional_cpus= boot "
                                "parameter\n");
 #endif
@@ -383,9 +385,6 @@ int __cpuinit cpu_up(unsigned int cpu)
 
        err = _cpu_up(cpu, 0);
 
-       if (cpu_online(cpu))
-               cpu_set(cpu, cpu_active_map);
-
 out:
        cpu_maps_update_done();
        return err;
index 6c6d35d68ee9c9628d5e5b67f2e32fdd91553f52..a09dd29c2fd748dea1dd83fd00b73751aa649316 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/irq.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/interrupt.h>
 
 #include "internals.h"
@@ -16,23 +17,18 @@ static struct proc_dir_entry *root_irq_dir;
 
 #ifdef CONFIG_SMP
 
-static int irq_affinity_read_proc(char *page, char **start, off_t off,
-                                 int count, int *eof, void *data)
+static int irq_affinity_proc_show(struct seq_file *m, void *v)
 {
-       struct irq_desc *desc = irq_desc + (long)data;
+       struct irq_desc *desc = irq_desc + (long)m->private;
        cpumask_t *mask = &desc->affinity;
-       int len;
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
        if (desc->status & IRQ_MOVE_PENDING)
                mask = &desc->pending_mask;
 #endif
-       len = cpumask_scnprintf(page, count, *mask);
-
-       if (count - len < 2)
-               return -EINVAL;
-       len += sprintf(page + len, "\n");
-       return len;
+       seq_cpumask(m, mask);
+       seq_putc(m, '\n');
+       return 0;
 }
 
 #ifndef is_affinity_mask_valid
@@ -40,11 +36,12 @@ static int irq_affinity_read_proc(char *page, char **start, off_t off,
 #endif
 
 int no_irq_affinity;
-static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
-                                  unsigned long count, void *data)
+static ssize_t irq_affinity_proc_write(struct file *file,
+               const char __user *buffer, size_t count, loff_t *pos)
 {
-       unsigned int irq = (int)(long)data, full_count = count, err;
+       unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data;
        cpumask_t new_value;
+       int err;
 
        if (!irq_desc[irq].chip->set_affinity || no_irq_affinity ||
            irq_balancing_disabled(irq))
@@ -65,28 +62,38 @@ static int irq_affinity_write_proc(struct file *file, const char __user *buffer,
        if (!cpus_intersects(new_value, cpu_online_map))
                /* Special case for empty set - allow the architecture
                   code to set default SMP affinity. */
-               return irq_select_affinity(irq) ? -EINVAL : full_count;
+               return irq_select_affinity(irq) ? -EINVAL : count;
 
        irq_set_affinity(irq, new_value);
 
-       return full_count;
+       return count;
 }
 
-static int default_affinity_read(char *page, char **start, off_t off,
-                                 int count, int *eof, void *data)
+static int irq_affinity_proc_open(struct inode *inode, struct file *file)
 {
-       int len = cpumask_scnprintf(page, count, irq_default_affinity);
-       if (count - len < 2)
-               return -EINVAL;
-       len += sprintf(page + len, "\n");
-       return len;
+       return single_open(file, irq_affinity_proc_show, PDE(inode)->data);
 }
 
-static int default_affinity_write(struct file *file, const char __user *buffer,
-                                  unsigned long count, void *data)
+static const struct file_operations irq_affinity_proc_fops = {
+       .open           = irq_affinity_proc_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+       .write          = irq_affinity_proc_write,
+};
+
+static int default_affinity_show(struct seq_file *m, void *v)
+{
+       seq_cpumask(m, &irq_default_affinity);
+       seq_putc(m, '\n');
+       return 0;
+}
+
+static ssize_t default_affinity_write(struct file *file,
+               const char __user *buffer, size_t count, loff_t *ppos)
 {
-       unsigned int full_count = count, err;
        cpumask_t new_value;
+       int err;
 
        err = cpumask_parse_user(buffer, count, new_value);
        if (err)
@@ -105,8 +112,21 @@ static int default_affinity_write(struct file *file, const char __user *buffer,
 
        irq_default_affinity = new_value;
 
-       return full_count;
+       return count;
 }
+
+static int default_affinity_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, default_affinity_show, NULL);
+}
+
+static const struct file_operations default_affinity_proc_fops = {
+       .open           = default_affinity_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+       .write          = default_affinity_write,
+};
 #endif
 
 static int irq_spurious_read(char *page, char **start, off_t off,
@@ -178,16 +198,9 @@ void register_irq_proc(unsigned int irq)
        irq_desc[irq].dir = proc_mkdir(name, root_irq_dir);
 
 #ifdef CONFIG_SMP
-       {
-               /* create /proc/irq/<irq>/smp_affinity */
-               entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir);
-
-               if (entry) {
-                       entry->data = (void *)(long)irq;
-                       entry->read_proc = irq_affinity_read_proc;
-                       entry->write_proc = irq_affinity_write_proc;
-               }
-       }
+       /* create /proc/irq/<irq>/smp_affinity */
+       proc_create_data("smp_affinity", 0600, irq_desc[irq].dir,
+                        &irq_affinity_proc_fops, (void *)(long)irq);
 #endif
 
        entry = create_proc_entry("spurious", 0444, irq_desc[irq].dir);
@@ -208,15 +221,8 @@ void unregister_handler_proc(unsigned int irq, struct irqaction *action)
 void register_default_affinity_proc(void)
 {
 #ifdef CONFIG_SMP
-       struct proc_dir_entry *entry;
-
-       /* create /proc/irq/default_smp_affinity */
-       entry = create_proc_entry("default_smp_affinity", 0600, root_irq_dir);
-       if (entry) {
-               entry->data = NULL;
-               entry->read_proc  = default_affinity_read;
-               entry->write_proc = default_affinity_write;
-       }
+       proc_create("irq/default_smp_affinity", 0600, NULL,
+                   &default_affinity_proc_fops);
 #endif
 }
 
index d38a643629735b533c2e0ddff300a9881e1bf674..1aa91fd6b06ec341897646f2322e35920640f448 100644 (file)
@@ -124,6 +124,15 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
 unsigned long nr_lock_classes;
 static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
 
+static inline struct lock_class *hlock_class(struct held_lock *hlock)
+{
+       if (!hlock->class_idx) {
+               DEBUG_LOCKS_WARN_ON(1);
+               return NULL;
+       }
+       return lock_classes + hlock->class_idx - 1;
+}
+
 #ifdef CONFIG_LOCK_STAT
 static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats);
 
@@ -222,7 +231,7 @@ static void lock_release_holdtime(struct held_lock *hlock)
 
        holdtime = sched_clock() - hlock->holdtime_stamp;
 
-       stats = get_lock_stats(hlock->class);
+       stats = get_lock_stats(hlock_class(hlock));
        if (hlock->read)
                lock_time_inc(&stats->read_holdtime, holdtime);
        else
@@ -372,6 +381,19 @@ unsigned int nr_process_chains;
 unsigned int max_lockdep_depth;
 unsigned int max_recursion_depth;
 
+static unsigned int lockdep_dependency_gen_id;
+
+static bool lockdep_dependency_visit(struct lock_class *source,
+                                    unsigned int depth)
+{
+       if (!depth)
+               lockdep_dependency_gen_id++;
+       if (source->dep_gen_id == lockdep_dependency_gen_id)
+               return true;
+       source->dep_gen_id = lockdep_dependency_gen_id;
+       return false;
+}
+
 #ifdef CONFIG_DEBUG_LOCKDEP
 /*
  * We cannot printk in early bootup code. Not even early_printk()
@@ -505,7 +527,7 @@ static void print_lockdep_cache(struct lockdep_map *lock)
 
 static void print_lock(struct held_lock *hlock)
 {
-       print_lock_name(hlock->class);
+       print_lock_name(hlock_class(hlock));
        printk(", at: ");
        print_ip_sym(hlock->acquire_ip);
 }
@@ -558,6 +580,9 @@ static void print_lock_dependencies(struct lock_class *class, int depth)
 {
        struct lock_list *entry;
 
+       if (lockdep_dependency_visit(class, depth))
+               return;
+
        if (DEBUG_LOCKS_WARN_ON(depth >= 20))
                return;
 
@@ -932,7 +957,7 @@ static noinline int print_circular_bug_tail(void)
        if (debug_locks_silent)
                return 0;
 
-       this.class = check_source->class;
+       this.class = hlock_class(check_source);
        if (!save_trace(&this.trace))
                return 0;
 
@@ -959,6 +984,67 @@ static int noinline print_infinite_recursion_bug(void)
        return 0;
 }
 
+unsigned long __lockdep_count_forward_deps(struct lock_class *class,
+                                          unsigned int depth)
+{
+       struct lock_list *entry;
+       unsigned long ret = 1;
+
+       if (lockdep_dependency_visit(class, depth))
+               return 0;
+
+       /*
+        * Recurse this class's dependency list:
+        */
+       list_for_each_entry(entry, &class->locks_after, entry)
+               ret += __lockdep_count_forward_deps(entry->class, depth + 1);
+
+       return ret;
+}
+
+unsigned long lockdep_count_forward_deps(struct lock_class *class)
+{
+       unsigned long ret, flags;
+
+       local_irq_save(flags);
+       __raw_spin_lock(&lockdep_lock);
+       ret = __lockdep_count_forward_deps(class, 0);
+       __raw_spin_unlock(&lockdep_lock);
+       local_irq_restore(flags);
+
+       return ret;
+}
+
+unsigned long __lockdep_count_backward_deps(struct lock_class *class,
+                                           unsigned int depth)
+{
+       struct lock_list *entry;
+       unsigned long ret = 1;
+
+       if (lockdep_dependency_visit(class, depth))
+               return 0;
+       /*
+        * Recurse this class's dependency list:
+        */
+       list_for_each_entry(entry, &class->locks_before, entry)
+               ret += __lockdep_count_backward_deps(entry->class, depth + 1);
+
+       return ret;
+}
+
+unsigned long lockdep_count_backward_deps(struct lock_class *class)
+{
+       unsigned long ret, flags;
+
+       local_irq_save(flags);
+       __raw_spin_lock(&lockdep_lock);
+       ret = __lockdep_count_backward_deps(class, 0);
+       __raw_spin_unlock(&lockdep_lock);
+       local_irq_restore(flags);
+
+       return ret;
+}
+
 /*
  * Prove that the dependency graph starting at <entry> can not
  * lead to <target>. Print an error and return 0 if it does.
@@ -968,6 +1054,9 @@ check_noncircular(struct lock_class *source, unsigned int depth)
 {
        struct lock_list *entry;
 
+       if (lockdep_dependency_visit(source, depth))
+               return 1;
+
        debug_atomic_inc(&nr_cyclic_check_recursions);
        if (depth > max_recursion_depth)
                max_recursion_depth = depth;
@@ -977,7 +1066,7 @@ check_noncircular(struct lock_class *source, unsigned int depth)
         * Check this lock's dependency list:
         */
        list_for_each_entry(entry, &source->locks_after, entry) {
-               if (entry->class == check_target->class)
+               if (entry->class == hlock_class(check_target))
                        return print_circular_bug_header(entry, depth+1);
                debug_atomic_inc(&nr_cyclic_checks);
                if (!check_noncircular(entry->class, depth+1))
@@ -1011,6 +1100,9 @@ find_usage_forwards(struct lock_class *source, unsigned int depth)
        struct lock_list *entry;
        int ret;
 
+       if (lockdep_dependency_visit(source, depth))
+               return 1;
+
        if (depth > max_recursion_depth)
                max_recursion_depth = depth;
        if (depth >= RECURSION_LIMIT)
@@ -1050,6 +1142,9 @@ find_usage_backwards(struct lock_class *source, unsigned int depth)
        struct lock_list *entry;
        int ret;
 
+       if (lockdep_dependency_visit(source, depth))
+               return 1;
+
        if (!__raw_spin_is_locked(&lockdep_lock))
                return DEBUG_LOCKS_WARN_ON(1);
 
@@ -1064,6 +1159,11 @@ find_usage_backwards(struct lock_class *source, unsigned int depth)
                return 2;
        }
 
+       if (!source && debug_locks_off_graph_unlock()) {
+               WARN_ON(1);
+               return 0;
+       }
+
        /*
         * Check this lock's dependency list:
         */
@@ -1103,9 +1203,9 @@ print_bad_irq_dependency(struct task_struct *curr,
        printk("\nand this task is already holding:\n");
        print_lock(prev);
        printk("which would create a new lock dependency:\n");
-       print_lock_name(prev->class);
+       print_lock_name(hlock_class(prev));
        printk(" ->");
-       print_lock_name(next->class);
+       print_lock_name(hlock_class(next));
        printk("\n");
 
        printk("\nbut this new dependency connects a %s-irq-safe lock:\n",
@@ -1146,12 +1246,12 @@ check_usage(struct task_struct *curr, struct held_lock *prev,
 
        find_usage_bit = bit_backwards;
        /* fills in <backwards_match> */
-       ret = find_usage_backwards(prev->class, 0);
+       ret = find_usage_backwards(hlock_class(prev), 0);
        if (!ret || ret == 1)
                return ret;
 
        find_usage_bit = bit_forwards;
-       ret = find_usage_forwards(next->class, 0);
+       ret = find_usage_forwards(hlock_class(next), 0);
        if (!ret || ret == 1)
                return ret;
        /* ret == 2 */
@@ -1272,18 +1372,32 @@ check_deadlock(struct task_struct *curr, struct held_lock *next,
               struct lockdep_map *next_instance, int read)
 {
        struct held_lock *prev;
+       struct held_lock *nest = NULL;
        int i;
 
        for (i = 0; i < curr->lockdep_depth; i++) {
                prev = curr->held_locks + i;
-               if (prev->class != next->class)
+
+               if (prev->instance == next->nest_lock)
+                       nest = prev;
+
+               if (hlock_class(prev) != hlock_class(next))
                        continue;
+
                /*
                 * Allow read-after-read recursion of the same
                 * lock class (i.e. read_lock(lock)+read_lock(lock)):
                 */
                if ((read == 2) && prev->read)
                        return 2;
+
+               /*
+                * We're holding the nest_lock, which serializes this lock's
+                * nesting behaviour.
+                */
+               if (nest)
+                       return 2;
+
                return print_deadlock_bug(curr, prev, next);
        }
        return 1;
@@ -1329,7 +1443,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
         */
        check_source = next;
        check_target = prev;
-       if (!(check_noncircular(next->class, 0)))
+       if (!(check_noncircular(hlock_class(next), 0)))
                return print_circular_bug_tail();
 
        if (!check_prev_add_irq(curr, prev, next))
@@ -1353,8 +1467,8 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
         *  chains - the second one will be new, but L1 already has
         *  L2 added to its dependency list, due to the first chain.)
         */
-       list_for_each_entry(entry, &prev->class->locks_after, entry) {
-               if (entry->class == next->class) {
+       list_for_each_entry(entry, &hlock_class(prev)->locks_after, entry) {
+               if (entry->class == hlock_class(next)) {
                        if (distance == 1)
                                entry->distance = 1;
                        return 2;
@@ -1365,26 +1479,28 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,
         * Ok, all validations passed, add the new lock
         * to the previous lock's dependency list:
         */
-       ret = add_lock_to_list(prev->class, next->class,
-                              &prev->class->locks_after, next->acquire_ip, distance);
+       ret = add_lock_to_list(hlock_class(prev), hlock_class(next),
+                              &hlock_class(prev)->locks_after,
+                              next->acquire_ip, distance);
 
        if (!ret)
                return 0;
 
-       ret = add_lock_to_list(next->class, prev->class,
-                              &next->class->locks_before, next->acquire_ip, distance);
+       ret = add_lock_to_list(hlock_class(next), hlock_class(prev),
+                              &hlock_class(next)->locks_before,
+                              next->acquire_ip, distance);
        if (!ret)
                return 0;
 
        /*
         * Debugging printouts:
         */
-       if (verbose(prev->class) || verbose(next->class)) {
+       if (verbose(hlock_class(prev)) || verbose(hlock_class(next))) {
                graph_unlock();
                printk("\n new dependency: ");
-               print_lock_name(prev->class);
+               print_lock_name(hlock_class(prev));
                printk(" => ");
-               print_lock_name(next->class);
+               print_lock_name(hlock_class(next));
                printk("\n");
                dump_stack();
                return graph_lock();
@@ -1481,7 +1597,7 @@ static inline int lookup_chain_cache(struct task_struct *curr,
                                     struct held_lock *hlock,
                                     u64 chain_key)
 {
-       struct lock_class *class = hlock->class;
+       struct lock_class *class = hlock_class(hlock);
        struct list_head *hash_head = chainhashentry(chain_key);
        struct lock_chain *chain;
        struct held_lock *hlock_curr, *hlock_next;
@@ -1554,7 +1670,7 @@ cache_hit:
        if (likely(cn + chain->depth <= MAX_LOCKDEP_CHAIN_HLOCKS)) {
                chain->base = cn;
                for (j = 0; j < chain->depth - 1; j++, i++) {
-                       int lock_id = curr->held_locks[i].class - lock_classes;
+                       int lock_id = curr->held_locks[i].class_idx - 1;
                        chain_hlocks[chain->base + j] = lock_id;
                }
                chain_hlocks[chain->base + j] = class - lock_classes;
@@ -1650,7 +1766,7 @@ static void check_chain_key(struct task_struct *curr)
                        WARN_ON(1);
                        return;
                }
-               id = hlock->class - lock_classes;
+               id = hlock->class_idx - 1;
                if (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
                        return;
 
@@ -1695,7 +1811,7 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
        print_lock(this);
 
        printk("{%s} state was registered at:\n", usage_str[prev_bit]);
-       print_stack_trace(this->class->usage_traces + prev_bit, 1);
+       print_stack_trace(hlock_class(this)->usage_traces + prev_bit, 1);
 
        print_irqtrace_events(curr);
        printk("\nother info that might help us debug this:\n");
@@ -1714,7 +1830,7 @@ static inline int
 valid_state(struct task_struct *curr, struct held_lock *this,
            enum lock_usage_bit new_bit, enum lock_usage_bit bad_bit)
 {
-       if (unlikely(this->class->usage_mask & (1 << bad_bit)))
+       if (unlikely(hlock_class(this)->usage_mask & (1 << bad_bit)))
                return print_usage_bug(curr, this, bad_bit, new_bit);
        return 1;
 }
@@ -1753,7 +1869,7 @@ print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other,
        lockdep_print_held_locks(curr);
 
        printk("\nthe first lock's dependencies:\n");
-       print_lock_dependencies(this->class, 0);
+       print_lock_dependencies(hlock_class(this), 0);
 
        printk("\nthe second lock's dependencies:\n");
        print_lock_dependencies(other, 0);
@@ -1776,7 +1892,7 @@ check_usage_forwards(struct task_struct *curr, struct held_lock *this,
 
        find_usage_bit = bit;
        /* fills in <forwards_match> */
-       ret = find_usage_forwards(this->class, 0);
+       ret = find_usage_forwards(hlock_class(this), 0);
        if (!ret || ret == 1)
                return ret;
 
@@ -1795,7 +1911,7 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this,
 
        find_usage_bit = bit;
        /* fills in <backwards_match> */
-       ret = find_usage_backwards(this->class, 0);
+       ret = find_usage_backwards(hlock_class(this), 0);
        if (!ret || ret == 1)
                return ret;
 
@@ -1861,7 +1977,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                LOCK_ENABLED_HARDIRQS_READ, "hard-read"))
                        return 0;
 #endif
-               if (hardirq_verbose(this->class))
+               if (hardirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_USED_IN_SOFTIRQ:
@@ -1886,7 +2002,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                LOCK_ENABLED_SOFTIRQS_READ, "soft-read"))
                        return 0;
 #endif
-               if (softirq_verbose(this->class))
+               if (softirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_USED_IN_HARDIRQ_READ:
@@ -1899,7 +2015,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                if (!check_usage_forwards(curr, this,
                                          LOCK_ENABLED_HARDIRQS, "hard"))
                        return 0;
-               if (hardirq_verbose(this->class))
+               if (hardirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_USED_IN_SOFTIRQ_READ:
@@ -1912,7 +2028,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                if (!check_usage_forwards(curr, this,
                                          LOCK_ENABLED_SOFTIRQS, "soft"))
                        return 0;
-               if (softirq_verbose(this->class))
+               if (softirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_ENABLED_HARDIRQS:
@@ -1938,7 +2054,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                   LOCK_USED_IN_HARDIRQ_READ, "hard-read"))
                        return 0;
 #endif
-               if (hardirq_verbose(this->class))
+               if (hardirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_ENABLED_SOFTIRQS:
@@ -1964,7 +2080,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                   LOCK_USED_IN_SOFTIRQ_READ, "soft-read"))
                        return 0;
 #endif
-               if (softirq_verbose(this->class))
+               if (softirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_ENABLED_HARDIRQS_READ:
@@ -1979,7 +2095,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                           LOCK_USED_IN_HARDIRQ, "hard"))
                        return 0;
 #endif
-               if (hardirq_verbose(this->class))
+               if (hardirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        case LOCK_ENABLED_SOFTIRQS_READ:
@@ -1994,7 +2110,7 @@ static int mark_lock_irq(struct task_struct *curr, struct held_lock *this,
                                           LOCK_USED_IN_SOFTIRQ, "soft"))
                        return 0;
 #endif
-               if (softirq_verbose(this->class))
+               if (softirq_verbose(hlock_class(this)))
                        ret = 2;
                break;
        default:
@@ -2310,7 +2426,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
         * If already set then do not dirty the cacheline,
         * nor do any checks:
         */
-       if (likely(this->class->usage_mask & new_mask))
+       if (likely(hlock_class(this)->usage_mask & new_mask))
                return 1;
 
        if (!graph_lock())
@@ -2318,14 +2434,14 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
        /*
         * Make sure we didnt race:
         */
-       if (unlikely(this->class->usage_mask & new_mask)) {
+       if (unlikely(hlock_class(this)->usage_mask & new_mask)) {
                graph_unlock();
                return 1;
        }
 
-       this->class->usage_mask |= new_mask;
+       hlock_class(this)->usage_mask |= new_mask;
 
-       if (!save_trace(this->class->usage_traces + new_bit))
+       if (!save_trace(hlock_class(this)->usage_traces + new_bit))
                return 0;
 
        switch (new_bit) {
@@ -2405,7 +2521,7 @@ EXPORT_SYMBOL_GPL(lockdep_init_map);
  */
 static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
                          int trylock, int read, int check, int hardirqs_off,
-                         unsigned long ip)
+                         struct lockdep_map *nest_lock, unsigned long ip)
 {
        struct task_struct *curr = current;
        struct lock_class *class = NULL;
@@ -2459,10 +2575,12 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
                return 0;
 
        hlock = curr->held_locks + depth;
-
-       hlock->class = class;
+       if (DEBUG_LOCKS_WARN_ON(!class))
+               return 0;
+       hlock->class_idx = class - lock_classes + 1;
        hlock->acquire_ip = ip;
        hlock->instance = lock;
+       hlock->nest_lock = nest_lock;
        hlock->trylock = trylock;
        hlock->read = read;
        hlock->check = check;
@@ -2574,6 +2692,55 @@ static int check_unlock(struct task_struct *curr, struct lockdep_map *lock,
        return 1;
 }
 
+static int
+__lock_set_subclass(struct lockdep_map *lock,
+                   unsigned int subclass, unsigned long ip)
+{
+       struct task_struct *curr = current;
+       struct held_lock *hlock, *prev_hlock;
+       struct lock_class *class;
+       unsigned int depth;
+       int i;
+
+       depth = curr->lockdep_depth;
+       if (DEBUG_LOCKS_WARN_ON(!depth))
+               return 0;
+
+       prev_hlock = NULL;
+       for (i = depth-1; i >= 0; i--) {
+               hlock = curr->held_locks + i;
+               /*
+                * We must not cross into another context:
+                */
+               if (prev_hlock && prev_hlock->irq_context != hlock->irq_context)
+                       break;
+               if (hlock->instance == lock)
+                       goto found_it;
+               prev_hlock = hlock;
+       }
+       return print_unlock_inbalance_bug(curr, lock, ip);
+
+found_it:
+       class = register_lock_class(lock, subclass, 0);
+       hlock->class_idx = class - lock_classes + 1;
+
+       curr->lockdep_depth = i;
+       curr->curr_chain_key = hlock->prev_chain_key;
+
+       for (; i < depth; i++) {
+               hlock = curr->held_locks + i;
+               if (!__lock_acquire(hlock->instance,
+                       hlock_class(hlock)->subclass, hlock->trylock,
+                               hlock->read, hlock->check, hlock->hardirqs_off,
+                               hlock->nest_lock, hlock->acquire_ip))
+                       return 0;
+       }
+
+       if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth))
+               return 0;
+       return 1;
+}
+
 /*
  * Remove the lock to the list of currently held locks in a
  * potentially non-nested (out of order) manner. This is a
@@ -2624,9 +2791,9 @@ found_it:
        for (i++; i < depth; i++) {
                hlock = curr->held_locks + i;
                if (!__lock_acquire(hlock->instance,
-                       hlock->class->subclass, hlock->trylock,
+                       hlock_class(hlock)->subclass, hlock->trylock,
                                hlock->read, hlock->check, hlock->hardirqs_off,
-                               hlock->acquire_ip))
+                               hlock->nest_lock, hlock->acquire_ip))
                        return 0;
        }
 
@@ -2669,7 +2836,7 @@ static int lock_release_nested(struct task_struct *curr,
 
 #ifdef CONFIG_DEBUG_LOCKDEP
        hlock->prev_chain_key = 0;
-       hlock->class = NULL;
+       hlock->class_idx = 0;
        hlock->acquire_ip = 0;
        hlock->irq_context = 0;
 #endif
@@ -2738,18 +2905,36 @@ static void check_flags(unsigned long flags)
 #endif
 }
 
+void
+lock_set_subclass(struct lockdep_map *lock,
+                 unsigned int subclass, unsigned long ip)
+{
+       unsigned long flags;
+
+       if (unlikely(current->lockdep_recursion))
+               return;
+
+       raw_local_irq_save(flags);
+       current->lockdep_recursion = 1;
+       check_flags(flags);
+       if (__lock_set_subclass(lock, subclass, ip))
+               check_chain_key(current);
+       current->lockdep_recursion = 0;
+       raw_local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL_GPL(lock_set_subclass);
+
 /*
  * We are not always called with irqs disabled - do that here,
  * and also avoid lockdep recursion:
  */
 void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
-                         int trylock, int read, int check, unsigned long ip)
+                         int trylock, int read, int check,
+                         struct lockdep_map *nest_lock, unsigned long ip)
 {
        unsigned long flags;
 
-       if (unlikely(!lock_stat && !prove_locking))
-               return;
-
        if (unlikely(current->lockdep_recursion))
                return;
 
@@ -2758,7 +2943,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
 
        current->lockdep_recursion = 1;
        __lock_acquire(lock, subclass, trylock, read, check,
-                      irqs_disabled_flags(flags), ip);
+                      irqs_disabled_flags(flags), nest_lock, ip);
        current->lockdep_recursion = 0;
        raw_local_irq_restore(flags);
 }
@@ -2770,9 +2955,6 @@ void lock_release(struct lockdep_map *lock, int nested,
 {
        unsigned long flags;
 
-       if (unlikely(!lock_stat && !prove_locking))
-               return;
-
        if (unlikely(current->lockdep_recursion))
                return;
 
@@ -2845,9 +3027,9 @@ __lock_contended(struct lockdep_map *lock, unsigned long ip)
 found_it:
        hlock->waittime_stamp = sched_clock();
 
-       point = lock_contention_point(hlock->class, ip);
+       point = lock_contention_point(hlock_class(hlock), ip);
 
-       stats = get_lock_stats(hlock->class);
+       stats = get_lock_stats(hlock_class(hlock));
        if (point < ARRAY_SIZE(stats->contention_point))
                stats->contention_point[i]++;
        if (lock->cpu != smp_processor_id())
@@ -2893,7 +3075,7 @@ found_it:
                hlock->holdtime_stamp = now;
        }
 
-       stats = get_lock_stats(hlock->class);
+       stats = get_lock_stats(hlock_class(hlock));
        if (waittime) {
                if (hlock->read)
                        lock_time_inc(&stats->read_waittime, waittime);
@@ -2988,6 +3170,7 @@ static void zap_class(struct lock_class *class)
        list_del_rcu(&class->hash_entry);
        list_del_rcu(&class->lock_entry);
 
+       class->key = NULL;
 }
 
 static inline int within(const void *addr, void *start, unsigned long size)
index c3600a091a2874952e97c149f21080ede90ded95..55db193d366dcd8489290883f411c4938f45df0e 100644 (file)
@@ -17,9 +17,6 @@
  */
 #define MAX_LOCKDEP_ENTRIES    8192UL
 
-#define MAX_LOCKDEP_KEYS_BITS  11
-#define MAX_LOCKDEP_KEYS       (1UL << MAX_LOCKDEP_KEYS_BITS)
-
 #define MAX_LOCKDEP_CHAINS_BITS        14
 #define MAX_LOCKDEP_CHAINS     (1UL << MAX_LOCKDEP_CHAINS_BITS)
 
@@ -53,6 +50,9 @@ extern unsigned int nr_process_chains;
 extern unsigned int max_lockdep_depth;
 extern unsigned int max_recursion_depth;
 
+extern unsigned long lockdep_count_forward_deps(struct lock_class *);
+extern unsigned long lockdep_count_backward_deps(struct lock_class *);
+
 #ifdef CONFIG_DEBUG_LOCKDEP
 /*
  * Various lockdep statistics:
index 9b0e940e2545efe99012dd1526ef79a4739f02d2..fa19aee604c28233822701ac5f86bcb288ffe239 100644 (file)
@@ -63,34 +63,6 @@ static void l_stop(struct seq_file *m, void *v)
 {
 }
 
-static unsigned long count_forward_deps(struct lock_class *class)
-{
-       struct lock_list *entry;
-       unsigned long ret = 1;
-
-       /*
-        * Recurse this class's dependency list:
-        */
-       list_for_each_entry(entry, &class->locks_after, entry)
-               ret += count_forward_deps(entry->class);
-
-       return ret;
-}
-
-static unsigned long count_backward_deps(struct lock_class *class)
-{
-       struct lock_list *entry;
-       unsigned long ret = 1;
-
-       /*
-        * Recurse this class's dependency list:
-        */
-       list_for_each_entry(entry, &class->locks_before, entry)
-               ret += count_backward_deps(entry->class);
-
-       return ret;
-}
-
 static void print_name(struct seq_file *m, struct lock_class *class)
 {
        char str[128];
@@ -124,10 +96,10 @@ static int l_show(struct seq_file *m, void *v)
 #ifdef CONFIG_DEBUG_LOCKDEP
        seq_printf(m, " OPS:%8ld", class->ops);
 #endif
-       nr_forward_deps = count_forward_deps(class);
+       nr_forward_deps = lockdep_count_forward_deps(class);
        seq_printf(m, " FD:%5ld", nr_forward_deps);
 
-       nr_backward_deps = count_backward_deps(class);
+       nr_backward_deps = lockdep_count_backward_deps(class);
        seq_printf(m, " BD:%5ld", nr_backward_deps);
 
        get_usage_chars(class, &c1, &c2, &c3, &c4);
@@ -229,6 +201,9 @@ static int lc_show(struct seq_file *m, void *v)
 
        for (i = 0; i < chain->depth; i++) {
                class = lock_chain_get_class(chain, i);
+               if (!class->key)
+                       continue;
+
                seq_printf(m, "[%p] ", class->key);
                print_name(m, class);
                seq_puts(m, "\n");
@@ -350,7 +325,7 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
                if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
                        nr_hardirq_read_unsafe++;
 
-               sum_forward_deps += count_forward_deps(class);
+               sum_forward_deps += lockdep_count_forward_deps(class);
        }
 #ifdef CONFIG_DEBUG_LOCKDEP
        DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);
index 61d212120df48e82a1b6521120fdbd428d983a81..08864d257eb0ece2239cd86008973826bc49abd0 100644 (file)
@@ -2288,7 +2288,7 @@ sys_init_module(void __user *umod,
 
        /* Start the module */
        if (mod->init != NULL)
-               ret = mod->init();
+               ret = do_one_initcall(mod->init);
        if (ret < 0) {
                /* Init routine failed: abort.  Try to protect us from
                    buggy refcounters. */
index 9a21681aa80f82f0123917725f341a526d484c89..e36d5798cbff427fca02fd8c9a8fb6f615dbd3fe 100644 (file)
@@ -289,21 +289,29 @@ void do_schedule_next_timer(struct siginfo *info)
                else
                        schedule_next_timer(timr);
 
-               info->si_overrun = timr->it_overrun_last;
+               info->si_overrun += timr->it_overrun_last;
        }
 
        if (timr)
                unlock_timer(timr, flags);
 }
 
-int posix_timer_event(struct k_itimer *timr,int si_private)
+int posix_timer_event(struct k_itimer *timr, int si_private)
 {
-       memset(&timr->sigq->info, 0, sizeof(siginfo_t));
+       /*
+        * FIXME: if ->sigq is queued we can race with
+        * dequeue_signal()->do_schedule_next_timer().
+        *
+        * If dequeue_signal() sees the "right" value of
+        * si_sys_private it calls do_schedule_next_timer().
+        * We re-queue ->sigq and drop ->it_lock().
+        * do_schedule_next_timer() locks the timer
+        * and re-schedules it while ->sigq is pending.
+        * Not really bad, but not that we want.
+        */
        timr->sigq->info.si_sys_private = si_private;
-       /* Send signal to the process that owns this timer.*/
 
        timr->sigq->info.si_signo = timr->it_sigev_signo;
-       timr->sigq->info.si_errno = 0;
        timr->sigq->info.si_code = SI_TIMER;
        timr->sigq->info.si_tid = timr->it_id;
        timr->sigq->info.si_value = timr->it_sigev_value;
@@ -435,6 +443,7 @@ static struct k_itimer * alloc_posix_timer(void)
                kmem_cache_free(posix_timers_cache, tmr);
                tmr = NULL;
        }
+       memset(&tmr->sigq->info, 0, sizeof(siginfo_t));
        return tmr;
 }
 
index 04160d277e7aeafe5b34e58da1bcb5a786b1696d..d601fb0406caefd39cb4eaf2dca25105f2ce3f0c 100644 (file)
@@ -600,7 +600,6 @@ struct rq {
        /* BKL stats */
        unsigned int bkl_count;
 #endif
-       struct lock_class_key rq_lock_key;
 };
 
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
@@ -834,7 +833,7 @@ static inline u64 global_rt_period(void)
 
 static inline u64 global_rt_runtime(void)
 {
-       if (sysctl_sched_rt_period < 0)
+       if (sysctl_sched_rt_runtime < 0)
                return RUNTIME_INF;
 
        return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
@@ -2759,10 +2758,10 @@ static void double_rq_lock(struct rq *rq1, struct rq *rq2)
        } else {
                if (rq1 < rq2) {
                        spin_lock(&rq1->lock);
-                       spin_lock(&rq2->lock);
+                       spin_lock_nested(&rq2->lock, SINGLE_DEPTH_NESTING);
                } else {
                        spin_lock(&rq2->lock);
-                       spin_lock(&rq1->lock);
+                       spin_lock_nested(&rq1->lock, SINGLE_DEPTH_NESTING);
                }
        }
        update_rq_clock(rq1);
@@ -2805,14 +2804,21 @@ static int double_lock_balance(struct rq *this_rq, struct rq *busiest)
                if (busiest < this_rq) {
                        spin_unlock(&this_rq->lock);
                        spin_lock(&busiest->lock);
-                       spin_lock(&this_rq->lock);
+                       spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
                        ret = 1;
                } else
-                       spin_lock(&busiest->lock);
+                       spin_lock_nested(&busiest->lock, SINGLE_DEPTH_NESTING);
        }
        return ret;
 }
 
+static void double_unlock_balance(struct rq *this_rq, struct rq *busiest)
+       __releases(busiest->lock)
+{
+       spin_unlock(&busiest->lock);
+       lock_set_subclass(&this_rq->lock.dep_map, 0, _RET_IP_);
+}
+
 /*
  * If dest_cpu is allowed for this process, migrate the task to it.
  * This is accomplished by forcing the cpu_allowed mask to only
@@ -3637,7 +3643,7 @@ redo:
                ld_moved = move_tasks(this_rq, this_cpu, busiest,
                                        imbalance, sd, CPU_NEWLY_IDLE,
                                        &all_pinned);
-               spin_unlock(&busiest->lock);
+               double_unlock_balance(this_rq, busiest);
 
                if (unlikely(all_pinned)) {
                        cpu_clear(cpu_of(busiest), *cpus);
@@ -3752,7 +3758,7 @@ static void active_load_balance(struct rq *busiest_rq, int busiest_cpu)
                else
                        schedstat_inc(sd, alb_failed);
        }
-       spin_unlock(&target_rq->lock);
+       double_unlock_balance(busiest_rq, target_rq);
 }
 
 #ifdef CONFIG_NO_HZ
@@ -8000,7 +8006,6 @@ void __init sched_init(void)
 
                rq = cpu_rq(i);
                spin_lock_init(&rq->lock);
-               lockdep_set_class(&rq->lock, &rq->rq_lock_key);
                rq->nr_running = 0;
                init_cfs_rq(&rq->cfs, rq);
                init_rt_rq(&rq->rt, rq);
index 22ed55d1167f3b4aa2f1c820ab78f97842f2df1b..204991a0bfa7d707e6da0e5c27b593b81b42ddb8 100644 (file)
 #include <linux/ktime.h>
 #include <linux/module.h>
 
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ * This is default implementation.
+ * Architectures and sub-architectures can override this.
+ */
+unsigned long long __attribute__((weak)) sched_clock(void)
+{
+       return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
+}
 
-#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
+static __read_mostly int sched_clock_running;
 
-#define MULTI_SHIFT 15
-/* Max is double, Min is 1/2 */
-#define MAX_MULTI (2LL << MULTI_SHIFT)
-#define MIN_MULTI (1LL << (MULTI_SHIFT-1))
+#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
 
 struct sched_clock_data {
        /*
@@ -49,14 +55,9 @@ struct sched_clock_data {
        raw_spinlock_t          lock;
 
        unsigned long           tick_jiffies;
-       u64                     prev_raw;
        u64                     tick_raw;
        u64                     tick_gtod;
        u64                     clock;
-       s64                     multi;
-#ifdef CONFIG_NO_HZ
-       int                     check_max;
-#endif
 };
 
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct sched_clock_data, sched_clock_data);
@@ -71,8 +72,6 @@ static inline struct sched_clock_data *cpu_sdc(int cpu)
        return &per_cpu(sched_clock_data, cpu);
 }
 
-static __read_mostly int sched_clock_running;
-
 void sched_clock_init(void)
 {
        u64 ktime_now = ktime_to_ns(ktime_get());
@@ -84,90 +83,39 @@ void sched_clock_init(void)
 
                scd->lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
                scd->tick_jiffies = now_jiffies;
-               scd->prev_raw = 0;
                scd->tick_raw = 0;
                scd->tick_gtod = ktime_now;
                scd->clock = ktime_now;
-               scd->multi = 1 << MULTI_SHIFT;
-#ifdef CONFIG_NO_HZ
-               scd->check_max = 1;
-#endif
        }
 
        sched_clock_running = 1;
 }
 
-#ifdef CONFIG_NO_HZ
-/*
- * The dynamic ticks makes the delta jiffies inaccurate. This
- * prevents us from checking the maximum time update.
- * Disable the maximum check during stopped ticks.
- */
-void sched_clock_tick_stop(int cpu)
-{
-       struct sched_clock_data *scd = cpu_sdc(cpu);
-
-       scd->check_max = 0;
-}
-
-void sched_clock_tick_start(int cpu)
-{
-       struct sched_clock_data *scd = cpu_sdc(cpu);
-
-       scd->check_max = 1;
-}
-
-static int check_max(struct sched_clock_data *scd)
-{
-       return scd->check_max;
-}
-#else
-static int check_max(struct sched_clock_data *scd)
-{
-       return 1;
-}
-#endif /* CONFIG_NO_HZ */
-
 /*
  * update the percpu scd from the raw @now value
  *
  *  - filter out backward motion
  *  - use jiffies to generate a min,max window to clip the raw values
  */
-static void __update_sched_clock(struct sched_clock_data *scd, u64 now, u64 *time)
+static u64 __update_sched_clock(struct sched_clock_data *scd, u64 now)
 {
        unsigned long now_jiffies = jiffies;
        long delta_jiffies = now_jiffies - scd->tick_jiffies;
        u64 clock = scd->clock;
        u64 min_clock, max_clock;
-       s64 delta = now - scd->prev_raw;
+       s64 delta = now - scd->tick_raw;
 
        WARN_ON_ONCE(!irqs_disabled());
-
-       /*
-        * At schedule tick the clock can be just under the gtod. We don't
-        * want to push it too prematurely.
-        */
-       min_clock = scd->tick_gtod + (delta_jiffies * TICK_NSEC);
-       if (min_clock > TICK_NSEC)
-               min_clock -= TICK_NSEC / 2;
+       min_clock = scd->tick_gtod + delta_jiffies * TICK_NSEC;
 
        if (unlikely(delta < 0)) {
                clock++;
                goto out;
        }
 
-       /*
-        * The clock must stay within a jiffie of the gtod.
-        * But since we may be at the start of a jiffy or the end of one
-        * we add another jiffy buffer.
-        */
-       max_clock = scd->tick_gtod + (2 + delta_jiffies) * TICK_NSEC;
-
-       delta *= scd->multi;
-       delta >>= MULTI_SHIFT;
+       max_clock = min_clock + TICK_NSEC;
 
-       if (unlikely(clock + delta > max_clock) && check_max(scd)) {
+       if (unlikely(clock + delta > max_clock)) {
                if (clock < max_clock)
                        clock = max_clock;
                else
@@ -180,12 +128,10 @@ static void __update_sched_clock(struct sched_clock_data *scd, u64 now, u64 *tim
        if (unlikely(clock < min_clock))
                clock = min_clock;
 
-       if (time)
-               *time = clock;
-       else {
-               scd->prev_raw = now;
-               scd->clock = clock;
-       }
+       scd->tick_jiffies = now_jiffies;
+       scd->clock = clock;
+
+       return clock;
 }
 
 static void lock_double_clock(struct sched_clock_data *data1,
@@ -203,7 +149,7 @@ static void lock_double_clock(struct sched_clock_data *data1,
 u64 sched_clock_cpu(int cpu)
 {
        struct sched_clock_data *scd = cpu_sdc(cpu);
-       u64 now, clock;
+       u64 now, clock, this_clock, remote_clock;
 
        if (unlikely(!sched_clock_running))
                return 0ull;
@@ -212,43 +158,44 @@ u64 sched_clock_cpu(int cpu)
        now = sched_clock();
 
        if (cpu != raw_smp_processor_id()) {
-               /*
-                * in order to update a remote cpu's clock based on our
-                * unstable raw time rebase it against:
-                *   tick_raw           (offset between raw counters)
-                *   tick_gotd          (tick offset between cpus)
-                */
                struct sched_clock_data *my_scd = this_scd();
 
                lock_double_clock(scd, my_scd);
 
-               now -= my_scd->tick_raw;
-               now += scd->tick_raw;
+               this_clock = __update_sched_clock(my_scd, now);
+               remote_clock = scd->clock;
 
-               now += my_scd->tick_gtod;
-               now -= scd->tick_gtod;
+               /*
+                * Use the opportunity that we have both locks
+                * taken to couple the two clocks: we take the
+                * larger time as the latest time for both
+                * runqueues. (this creates monotonic movement)
+                */
+               if (likely(remote_clock < this_clock)) {
+                       clock = this_clock;
+                       scd->clock = clock;
+               } else {
+                       /*
+                        * Should be rare, but possible:
+                        */
+                       clock = remote_clock;
+                       my_scd->clock = remote_clock;
+               }
 
                __raw_spin_unlock(&my_scd->lock);
-
-               __update_sched_clock(scd, now, &clock);
-
-               __raw_spin_unlock(&scd->lock);
-
        } else {
                __raw_spin_lock(&scd->lock);
-               __update_sched_clock(scd, now, NULL);
-               clock = scd->clock;
-               __raw_spin_unlock(&scd->lock);
+               clock = __update_sched_clock(scd, now);
        }
 
+       __raw_spin_unlock(&scd->lock);
+
        return clock;
 }
 
 void sched_clock_tick(void)
 {
        struct sched_clock_data *scd = this_scd();
-       unsigned long now_jiffies = jiffies;
-       s64 mult, delta_gtod, delta_raw;
        u64 now, now_gtod;
 
        if (unlikely(!sched_clock_running))
@@ -260,29 +207,14 @@ void sched_clock_tick(void)
        now = sched_clock();
 
        __raw_spin_lock(&scd->lock);
-       __update_sched_clock(scd, now, NULL);
+       __update_sched_clock(scd, now);
        /*
         * update tick_gtod after __update_sched_clock() because that will
         * already observe 1 new jiffy; adding a new tick_gtod to that would
         * increase the clock 2 jiffies.
         */
-       delta_gtod = now_gtod - scd->tick_gtod;
-       delta_raw = now - scd->tick_raw;
-
-       if ((long)delta_raw > 0) {
-               mult = delta_gtod << MULTI_SHIFT;
-               do_div(mult, delta_raw);
-               scd->multi = mult;
-               if (scd->multi > MAX_MULTI)
-                       scd->multi = MAX_MULTI;
-               else if (scd->multi < MIN_MULTI)
-                       scd->multi = MIN_MULTI;
-       } else
-               scd->multi = 1 << MULTI_SHIFT;
-
        scd->tick_raw = now;
        scd->tick_gtod = now_gtod;
-       scd->tick_jiffies = now_jiffies;
        __raw_spin_unlock(&scd->lock);
 }
 
@@ -301,7 +233,6 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_sleep_event);
 void sched_clock_idle_wakeup_event(u64 delta_ns)
 {
        struct sched_clock_data *scd = this_scd();
-       u64 now = sched_clock();
 
        /*
         * Override the previous timestamp and ignore all
@@ -310,27 +241,30 @@ void sched_clock_idle_wakeup_event(u64 delta_ns)
         * rq clock:
         */
        __raw_spin_lock(&scd->lock);
-       scd->prev_raw = now;
        scd->clock += delta_ns;
-       scd->multi = 1 << MULTI_SHIFT;
        __raw_spin_unlock(&scd->lock);
 
        touch_softlockup_watchdog();
 }
 EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);
 
-#endif
+#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
 
-/*
- * Scheduler clock - returns current time in nanosec units.
- * This is default implementation.
- * Architectures and sub-architectures can override this.
- */
-unsigned long long __attribute__((weak)) sched_clock(void)
+void sched_clock_init(void)
 {
-       return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
+       sched_clock_running = 1;
 }
 
+u64 sched_clock_cpu(int cpu)
+{
+       if (unlikely(!sched_clock_running))
+               return 0;
+
+       return sched_clock();
+}
+
+#endif
+
 unsigned long long cpu_clock(int cpu)
 {
        unsigned long long clock;
index cf2cd6ce4cb25ad2bedc59b94205b33b24f8a9e9..fb8994c6d4bb4bbe90a71f89341baee3cc6e9806 100644 (file)
@@ -899,7 +899,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p)
                 * doesn't make sense. Rely on vruntime for fairness.
                 */
                if (rq->curr != p)
-                       delta = max(10000LL, delta);
+                       delta = max_t(s64, 10000LL, delta);
 
                hrtick_start(rq, delta);
        }
@@ -1442,18 +1442,23 @@ __load_balance_iterator(struct cfs_rq *cfs_rq, struct list_head *next)
        struct task_struct *p = NULL;
        struct sched_entity *se;
 
-       while (next != &cfs_rq->tasks) {
+       if (next == &cfs_rq->tasks)
+               return NULL;
+
+       /* Skip over entities that are not tasks */
+       do {
                se = list_entry(next, struct sched_entity, group_node);
                next = next->next;
+       } while (next != &cfs_rq->tasks && !entity_is_task(se));
 
-               /* Skip over entities that are not tasks */
-               if (entity_is_task(se)) {
-                       p = task_of(se);
-                       break;
-               }
-       }
+       if (next == &cfs_rq->tasks)
+               return NULL;
 
        cfs_rq->balance_iterator = next;
+
+       if (entity_is_task(se))
+               p = task_of(se);
+
        return p;
 }
 
index 908c04f9dad02d23df66fbc55a28f5619fc10081..6163e4cf885b90075fd2734427fac4f3f24eae1f 100644 (file)
@@ -861,6 +861,8 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p)
 #define RT_MAX_TRIES 3
 
 static int double_lock_balance(struct rq *this_rq, struct rq *busiest);
+static void double_unlock_balance(struct rq *this_rq, struct rq *busiest);
+
 static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep);
 
 static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu)
@@ -1022,7 +1024,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)
                        break;
 
                /* try again */
-               spin_unlock(&lowest_rq->lock);
+               double_unlock_balance(rq, lowest_rq);
                lowest_rq = NULL;
        }
 
@@ -1091,7 +1093,7 @@ static int push_rt_task(struct rq *rq)
 
        resched_task(lowest_rq->curr);
 
-       spin_unlock(&lowest_rq->lock);
+       double_unlock_balance(rq, lowest_rq);
 
        ret = 1;
 out:
@@ -1197,7 +1199,7 @@ static int pull_rt_task(struct rq *this_rq)
 
                }
  skip:
-               spin_unlock(&src_rq->lock);
+               double_unlock_balance(this_rq, src_rq);
        }
 
        return ret;
index 954f77d7e3bc2368f405fa2ab83aaf58d6280fb3..c539f60c6f41bc2b9e170b93bf66a8bca5e93ce3 100644 (file)
@@ -1304,6 +1304,7 @@ int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
                q->info.si_overrun++;
                goto out;
        }
+       q->info.si_overrun = 0;
 
        signalfd_notify(t, sig);
        pending = group ? &t->signal->shared_pending : &t->pending;
index 96fc7c0edc59d1f09ca56a500d90b0a8a212c7d7..782e2b93e4652214ad5b6f21cd89935178e3b9f9 100644 (file)
@@ -135,7 +135,8 @@ void generic_smp_call_function_interrupt(void)
                         */
                        smp_wmb();
                        data->csd.flags &= ~CSD_FLAG_WAIT;
-               } else
+               }
+               if (data->csd.flags & CSD_FLAG_ALLOC)
                        call_rcu(&data->rcu_head, rcu_free_call_data);
        }
        rcu_read_unlock();
@@ -260,6 +261,42 @@ void __smp_call_function_single(int cpu, struct call_single_data *data)
        generic_exec_single(cpu, data);
 }
 
+/* Dummy function */
+static void quiesce_dummy(void *unused)
+{
+}
+
+/*
+ * Ensure stack based data used in call function mask is safe to free.
+ *
+ * This is needed by smp_call_function_mask when using on-stack data, because
+ * a single call function queue is shared by all CPUs, and any CPU may pick up
+ * the data item on the queue at any time before it is deleted. So we need to
+ * ensure that all CPUs have transitioned through a quiescent state after
+ * this call.
+ *
+ * This is a very slow function, implemented by sending synchronous IPIs to
+ * all possible CPUs. For this reason, we have to alloc data rather than use
+ * stack based data even in the case of synchronous calls. The stack based
+ * data is then just used for deadlock/oom fallback which will be very rare.
+ *
+ * If a faster scheme can be made, we could go back to preferring stack based
+ * data -- the data allocation/free is non-zero cost.
+ */
+static void smp_call_function_mask_quiesce_stack(cpumask_t mask)
+{
+       struct call_single_data data;
+       int cpu;
+
+       data.func = quiesce_dummy;
+       data.info = NULL;
+
+       for_each_cpu_mask(cpu, mask) {
+               data.flags = CSD_FLAG_WAIT;
+               generic_exec_single(cpu, &data);
+       }
+}
+
 /**
  * smp_call_function_mask(): Run a function on a set of other CPUs.
  * @mask: The set of cpus to run on.
@@ -285,6 +322,7 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info,
        cpumask_t allbutself;
        unsigned long flags;
        int cpu, num_cpus;
+       int slowpath = 0;
 
        /* Can deadlock when called with interrupts disabled */
        WARN_ON(irqs_disabled());
@@ -306,15 +344,16 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info,
                return smp_call_function_single(cpu, func, info, wait);
        }
 
-       if (!wait) {
-               data = kmalloc(sizeof(*data), GFP_ATOMIC);
-               if (data)
-                       data->csd.flags = CSD_FLAG_ALLOC;
-       }
-       if (!data) {
+       data = kmalloc(sizeof(*data), GFP_ATOMIC);
+       if (data) {
+               data->csd.flags = CSD_FLAG_ALLOC;
+               if (wait)
+                       data->csd.flags |= CSD_FLAG_WAIT;
+       } else {
                data = &d;
                data->csd.flags = CSD_FLAG_WAIT;
                wait = 1;
+               slowpath = 1;
        }
 
        spin_lock_init(&data->lock);
@@ -331,8 +370,11 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info,
        arch_send_call_function_ipi(mask);
 
        /* optionally wait for the CPUs to complete */
-       if (wait)
+       if (wait) {
                csd_flag_wait(&data->csd);
+               if (unlikely(slowpath))
+                       smp_call_function_mask_quiesce_stack(mask);
+       }
 
        return 0;
 }
index a1fb54c93cdd2381f23573748852a4a105e8ddd3..44baeea94ab906b06ff87d6bf936f8a19d71915d 100644 (file)
@@ -292,6 +292,7 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
 }
 
 EXPORT_SYMBOL(_spin_lock_nested);
+
 unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
 {
        unsigned long flags;
@@ -314,6 +315,16 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas
 
 EXPORT_SYMBOL(_spin_lock_irqsave_nested);
 
+void __lockfunc _spin_lock_nest_lock(spinlock_t *lock,
+                                    struct lockdep_map *nest_lock)
+{
+       preempt_disable();
+       spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_);
+       LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
+}
+
+EXPORT_SYMBOL(_spin_lock_nest_lock);
+
 #endif
 
 void __lockfunc _spin_unlock(spinlock_t *lock)
index e446c7c7d6a9230dc1205cb73dd0370568696ed0..af3c7cea258b00d57762913a8986978495c2a81e 100644 (file)
@@ -65,7 +65,6 @@ static void ack_state(void)
 static int stop_cpu(struct stop_machine_data *smdata)
 {
        enum stopmachine_state curstate = STOPMACHINE_NONE;
-       int uninitialized_var(ret);
 
        /* Simple state machine */
        do {
index 825b4c00fe4436a1921d4f57a6cb6d9e37510d3d..f5da526424a9b7c5dcaf965cbf00a49f09642eb0 100644 (file)
@@ -289,7 +289,6 @@ void tick_nohz_stop_sched_tick(int inidle)
                        ts->tick_stopped = 1;
                        ts->idle_jiffies = last_jiffies;
                        rcu_enter_nohz();
-                       sched_clock_tick_stop(cpu);
                }
 
                /*
@@ -392,7 +391,6 @@ void tick_nohz_restart_sched_tick(void)
        select_nohz_load_balancer(0);
        now = ktime_get();
        tick_do_update_jiffies64(now);
-       sched_clock_tick_start(cpu);
        cpu_clear(cpu, nohz_cpu_mask);
 
        /*
index 4a26a1382df05febed4a94bce11be2bc2a46b648..4048e92aa04f21e7e105563fac7bf24e1be5411f 100644 (file)
@@ -290,11 +290,11 @@ static void run_workqueue(struct cpu_workqueue_struct *cwq)
 
                BUG_ON(get_wq_data(work) != cwq);
                work_clear_pending(work);
-               lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-               lock_acquire(&lockdep_map, 0, 0, 0, 2, _THIS_IP_);
+               lock_map_acquire(&cwq->wq->lockdep_map);
+               lock_map_acquire(&lockdep_map);
                f(work);
-               lock_release(&lockdep_map, 1, _THIS_IP_);
-               lock_release(&cwq->wq->lockdep_map, 1, _THIS_IP_);
+               lock_map_release(&lockdep_map);
+               lock_map_release(&cwq->wq->lockdep_map);
 
                if (unlikely(in_atomic() || lockdep_depth(current) > 0)) {
                        printk(KERN_ERR "BUG: workqueue leaked lock or atomic: "
@@ -413,8 +413,8 @@ void flush_workqueue(struct workqueue_struct *wq)
        int cpu;
 
        might_sleep();
-       lock_acquire(&wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-       lock_release(&wq->lockdep_map, 1, _THIS_IP_);
+       lock_map_acquire(&wq->lockdep_map);
+       lock_map_release(&wq->lockdep_map);
        for_each_cpu_mask_nr(cpu, *cpu_map)
                flush_cpu_workqueue(per_cpu_ptr(wq->cpu_wq, cpu));
 }
@@ -441,8 +441,8 @@ int flush_work(struct work_struct *work)
        if (!cwq)
                return 0;
 
-       lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-       lock_release(&cwq->wq->lockdep_map, 1, _THIS_IP_);
+       lock_map_acquire(&cwq->wq->lockdep_map);
+       lock_map_release(&cwq->wq->lockdep_map);
 
        prev = NULL;
        spin_lock_irq(&cwq->lock);
@@ -536,8 +536,8 @@ static void wait_on_work(struct work_struct *work)
 
        might_sleep();
 
-       lock_acquire(&work->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-       lock_release(&work->lockdep_map, 1, _THIS_IP_);
+       lock_map_acquire(&work->lockdep_map);
+       lock_map_release(&work->lockdep_map);
 
        cwq = get_wq_data(work);
        if (!cwq)
@@ -872,8 +872,8 @@ static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq)
        if (cwq->thread == NULL)
                return;
 
-       lock_acquire(&cwq->wq->lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-       lock_release(&cwq->wq->lockdep_map, 1, _THIS_IP_);
+       lock_map_acquire(&cwq->wq->lockdep_map);
+       lock_map_release(&cwq->wq->lockdep_map);
 
        flush_cpu_workqueue(cwq);
        /*
index e1d4764435ed842ea1875c7739bfd668f6453fae..800ac848554425015c626e60ce2f6a02e949c229 100644 (file)
@@ -735,6 +735,15 @@ config FIREWIRE_OHCI_REMOTE_DMA
 
          If unsure, say N.
 
+menuconfig BUILD_DOCSRC
+       bool "Build targets in Documentation/ tree"
+       depends on HEADERS_CHECK
+       help
+         This option attempts to build objects from the source files in the
+         kernel Documentation/ tree.
+
+         Say N if you are unsure.
+
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
index 482df94ea21eb3e9ab7b2ef4efe88643147c3d80..06fb57c86de07007dad10f4bbeb3b1adcc0742c4 100644 (file)
@@ -315,6 +315,17 @@ int bitmap_scnprintf(char *buf, unsigned int buflen,
 }
 EXPORT_SYMBOL(bitmap_scnprintf);
 
+/**
+ * bitmap_scnprintf_len - return buffer length needed to convert
+ * bitmap to an ASCII hex string
+ * @nr_bits: number of bits to be converted
+ */
+int bitmap_scnprintf_len(unsigned int nr_bits)
+{
+       unsigned int nr_nibbles = ALIGN(nr_bits, 4) / 4;
+       return nr_nibbles + ALIGN(nr_nibbles, CHUNKSZ / 4) / (CHUNKSZ / 4) - 1;
+}
+
 /**
  * __bitmap_parse - convert an ASCII hex string into a bitmap.
  * @buf: pointer to buffer containing string.
index 0ef01d14727c03c9861175e010e6f7c75c0d693f..0218b4693dd8c250f83c741bf6ffbfbbca31f94b 100644 (file)
@@ -8,6 +8,7 @@
  *
  *  Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
  */
+#include <linux/kernel.h>
 #include <linux/rwsem.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
@@ -37,6 +38,7 @@ int debug_locks_off(void)
 {
        if (xchg(&debug_locks, 0)) {
                if (!debug_locks_silent) {
+                       oops_in_progress = 1;
                        console_verbose();
                        return 1;
                }
index 1dc2d1d18fa8fddb9887dad750461d9f63faeb6f..d8d1d1142248a511561b401a87b1590a5f94ba33 100644 (file)
@@ -220,7 +220,7 @@ int strict_strtou##type(const char *cp, unsigned int base, valtype *res)\
        if (len == 0)                                                   \
                return -EINVAL;                                         \
                                                                        \
-       val = simple_strtoul(cp, &tail, base);                          \
+       val = simple_strtou##type(cp, &tail, base);                     \
        if ((*tail == '\0') ||                                          \
                ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {\
                *res = val;                                             \
index 446c6588c75398ab91e9413c20363dcd076432da..0bd9c2dbb2a0be8d184b4b9f1d75dc03ec2a14ba 100644 (file)
@@ -77,9 +77,6 @@ config FLAT_NODE_MEM_MAP
        def_bool y
        depends on !SPARSEMEM
 
-config HAVE_GET_USER_PAGES_FAST
-       bool
-
 #
 # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
 # to represent different areas of memory.  This variable allows
index 757ca983fd99cba4b73c563da5c0bb34c1ee396d..67a71191136ed8f6ad9dad03b472440baa322210 100644 (file)
@@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
                huge_page_order(h));
        if (page) {
                if (arch_prepare_hugepage(page)) {
-                       __free_pages(page, HUGETLB_PAGE_ORDER);
+                       __free_pages(page, huge_page_order(h));
                        return NULL;
                }
                prep_new_huge_page(h, page, nid);
@@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_page(struct hstate *h,
                                        __GFP_REPEAT|__GFP_NOWARN,
                                        huge_page_order(h));
 
+       if (page && arch_prepare_hugepage(page)) {
+               __free_pages(page, huge_page_order(h));
+               return NULL;
+       }
+
        spin_lock(&hugetlb_lock);
        if (page) {
                /*
@@ -1937,6 +1942,18 @@ retry:
                        lock_page(page);
        }
 
+       /*
+        * If we are going to COW a private mapping later, we examine the
+        * pending reservations for this page now. This will ensure that
+        * any allocations necessary to record that reservation occur outside
+        * the spinlock.
+        */
+       if (write_access && !(vma->vm_flags & VM_SHARED))
+               if (vma_needs_reservation(h, vma, address) < 0) {
+                       ret = VM_FAULT_OOM;
+                       goto backout_unlocked;
+               }
+
        spin_lock(&mm->page_table_lock);
        size = i_size_read(mapping->host) >> huge_page_shift(h);
        if (idx >= size)
@@ -1962,6 +1979,7 @@ out:
 
 backout:
        spin_unlock(&mm->page_table_lock);
+backout_unlocked:
        unlock_page(page);
        put_page(page);
        goto out;
@@ -1973,6 +1991,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        pte_t *ptep;
        pte_t entry;
        int ret;
+       struct page *pagecache_page = NULL;
        static DEFINE_MUTEX(hugetlb_instantiation_mutex);
        struct hstate *h = hstate_vma(vma);
 
@@ -1989,25 +2008,44 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        entry = huge_ptep_get(ptep);
        if (huge_pte_none(entry)) {
                ret = hugetlb_no_page(mm, vma, address, ptep, write_access);
-               mutex_unlock(&hugetlb_instantiation_mutex);
-               return ret;
+               goto out_unlock;
        }
 
        ret = 0;
 
+       /*
+        * If we are going to COW the mapping later, we examine the pending
+        * reservations for this page now. This will ensure that any
+        * allocations necessary to record that reservation occur outside the
+        * spinlock. For private mappings, we also lookup the pagecache
+        * page now as it is used to determine if a reservation has been
+        * consumed.
+        */
+       if (write_access && !pte_write(entry)) {
+               if (vma_needs_reservation(h, vma, address) < 0) {
+                       ret = VM_FAULT_OOM;
+                       goto out_unlock;
+               }
+
+               if (!(vma->vm_flags & VM_SHARED))
+                       pagecache_page = hugetlbfs_pagecache_page(h,
+                                                               vma, address);
+       }
+
        spin_lock(&mm->page_table_lock);
        /* Check for a racing update before calling hugetlb_cow */
        if (likely(pte_same(entry, huge_ptep_get(ptep))))
-               if (write_access && !pte_write(entry)) {
-                       struct page *page;
-                       page = hugetlbfs_pagecache_page(h, vma, address);
-                       ret = hugetlb_cow(mm, vma, address, ptep, entry, page);
-                       if (page) {
-                               unlock_page(page);
-                               put_page(page);
-                       }
-               }
+               if (write_access && !pte_write(entry))
+                       ret = hugetlb_cow(mm, vma, address, ptep, entry,
+                                                       pagecache_page);
        spin_unlock(&mm->page_table_lock);
+
+       if (pagecache_page) {
+               unlock_page(pagecache_page);
+               put_page(pagecache_page);
+       }
+
+out_unlock:
        mutex_unlock(&hugetlb_instantiation_mutex);
 
        return ret;
index 7056c3bdb47821d791ba7bc6a9355018094ef34e..0f1f7a7374bade23cf0052719a349a97322c5af4 100644 (file)
@@ -796,6 +796,8 @@ int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask)
 
        if (mem_cgroup_subsys.disabled)
                return 0;
+       if (!mm)
+               return 0;
 
        rcu_read_lock();
        mem = mem_cgroup_from_task(rcu_dereference(mm->owner));
index e550bec205826bd63f46082d6c5aac7bc69aa23e..83369058ec133b380a482ca86792087134b944f6 100644 (file)
@@ -803,7 +803,6 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
 int do_migrate_pages(struct mm_struct *mm,
        const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags)
 {
-       LIST_HEAD(pagelist);
        int busy = 0;
        int err = 0;
        nodemask_t tmp;
index 971d0eda754a539d73d669fa8d91bd2459f10715..339cf5c4d5d8c3a82b04cf57fa6b973f5ad75408 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2273,14 +2273,14 @@ int install_special_mapping(struct mm_struct *mm,
 
 static DEFINE_MUTEX(mm_all_locks_mutex);
 
-static void vm_lock_anon_vma(struct anon_vma *anon_vma)
+static void vm_lock_anon_vma(struct mm_struct *mm, struct anon_vma *anon_vma)
 {
        if (!test_bit(0, (unsigned long *) &anon_vma->head.next)) {
                /*
                 * The LSB of head.next can't change from under us
                 * because we hold the mm_all_locks_mutex.
                 */
-               spin_lock(&anon_vma->lock);
+               spin_lock_nest_lock(&anon_vma->lock, &mm->mmap_sem);
                /*
                 * We can safely modify head.next after taking the
                 * anon_vma->lock. If some other vma in this mm shares
@@ -2296,7 +2296,7 @@ static void vm_lock_anon_vma(struct anon_vma *anon_vma)
        }
 }
 
-static void vm_lock_mapping(struct address_space *mapping)
+static void vm_lock_mapping(struct mm_struct *mm, struct address_space *mapping)
 {
        if (!test_bit(AS_MM_ALL_LOCKS, &mapping->flags)) {
                /*
@@ -2310,7 +2310,7 @@ static void vm_lock_mapping(struct address_space *mapping)
                 */
                if (test_and_set_bit(AS_MM_ALL_LOCKS, &mapping->flags))
                        BUG();
-               spin_lock(&mapping->i_mmap_lock);
+               spin_lock_nest_lock(&mapping->i_mmap_lock, &mm->mmap_sem);
        }
 }
 
@@ -2358,11 +2358,17 @@ int mm_take_all_locks(struct mm_struct *mm)
        for (vma = mm->mmap; vma; vma = vma->vm_next) {
                if (signal_pending(current))
                        goto out_unlock;
-               if (vma->anon_vma)
-                       vm_lock_anon_vma(vma->anon_vma);
                if (vma->vm_file && vma->vm_file->f_mapping)
-                       vm_lock_mapping(vma->vm_file->f_mapping);
+                       vm_lock_mapping(mm, vma->vm_file->f_mapping);
+       }
+
+       for (vma = mm->mmap; vma; vma = vma->vm_next) {
+               if (signal_pending(current))
+                       goto out_unlock;
+               if (vma->anon_vma)
+                       vm_lock_anon_vma(mm, vma->anon_vma);
        }
+
        ret = 0;
 
 out_unlock:
index 401d104d2bb6e12c08e70700eebad915e72c7c2a..af982f7cdb2a8d409315f8fd95b140277e62c3af 100644 (file)
@@ -4437,7 +4437,7 @@ void *__init alloc_large_system_hash(const char *tablename,
        do {
                size = bucketsize << log2qty;
                if (flags & HASH_EARLY)
-                       table = alloc_bootmem(size);
+                       table = alloc_bootmem_nopanic(size);
                else if (hashdist)
                        table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
                else {
index 5d9dbbb9d39e34759e2a858049901927f379f6a3..39db301b920d18383c8cac57416ad57f8f4976ca 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/dma.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
-#include "internal.h"
 
 /*
  * Permanent SPARSEMEM data:
index 9341ca77bd88240741afbcbabed9019f247a7531..cb00b748ce47886446975d96466c2154f4d52fa3 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -171,3 +171,18 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        mm->unmap_area = arch_unmap_area;
 }
 #endif
+
+int __attribute__((weak)) get_user_pages_fast(unsigned long start,
+                               int nr_pages, int write, struct page **pages)
+{
+       struct mm_struct *mm = current->mm;
+       int ret;
+
+       down_read(&mm->mmap_sem);
+       ret = get_user_pages(current, mm, start, nr_pages,
+                                       write, 0, pages, NULL);
+       up_read(&mm->mmap_sem);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(get_user_pages_fast);
index ef9f072b47fcc65749729d22fa8e1390c1f8a8de..a73d6ca0a90655104c48b7ea50b4089815de5b70 100644 (file)
@@ -101,6 +101,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
                         "{Intel, ICH8},"
                         "{Intel, ICH9},"
                         "{Intel, ICH10},"
+                        "{Intel, PCH},"
                         "{Intel, SCH},"
                         "{ATI, SB450},"
                         "{ATI, SB600},"
@@ -2263,6 +2264,8 @@ static struct pci_device_id azx_ids[] = {
        { PCI_DEVICE(0x8086, 0x293f), .driver_data = AZX_DRIVER_ICH },
        { PCI_DEVICE(0x8086, 0x3a3e), .driver_data = AZX_DRIVER_ICH },
        { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH },
+       /* PCH */
+       { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH },
        /* SCH */
        { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH },
        /* ATI SB 450/600 */
@@ -2272,6 +2275,7 @@ static struct pci_device_id azx_ids[] = {
        { PCI_DEVICE(0x1002, 0x793b), .driver_data = AZX_DRIVER_ATIHDMI },
        { PCI_DEVICE(0x1002, 0x7919), .driver_data = AZX_DRIVER_ATIHDMI },
        { PCI_DEVICE(0x1002, 0x960f), .driver_data = AZX_DRIVER_ATIHDMI },
+       { PCI_DEVICE(0x1002, 0x970f), .driver_data = AZX_DRIVER_ATIHDMI },
        { PCI_DEVICE(0x1002, 0xaa00), .driver_data = AZX_DRIVER_ATIHDMI },
        { PCI_DEVICE(0x1002, 0xaa08), .driver_data = AZX_DRIVER_ATIHDMI },
        { PCI_DEVICE(0x1002, 0xaa10), .driver_data = AZX_DRIVER_ATIHDMI },
index e23cb09f0d1499ef76a1fd50790b14e4aef1500a..c6a8edf302ad58d44a4e9a9dd8bebb8b1b1ba777 100644 (file)
@@ -348,8 +348,9 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = {
        SND_SOC_DAPM_OUTPUT("ROUT1"),
        SND_SOC_DAPM_OUTPUT("LOUT2"),
        SND_SOC_DAPM_OUTPUT("ROUT2"),
-       SND_SOC_DAPM_OUTPUT("MONO"),
+       SND_SOC_DAPM_OUTPUT("MONO1"),
        SND_SOC_DAPM_OUTPUT("OUT3"),
+       SND_SOC_DAPM_OUTPUT("VREF"),
 
        SND_SOC_DAPM_INPUT("LINPUT1"),
        SND_SOC_DAPM_INPUT("LINPUT2"),
index eefc25b83514c399d3f7481f29576fee86a8c63b..37cb768fc933d377647f89b92d8c999efeaf2393 100644 (file)
@@ -297,7 +297,7 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
        snd_soc_dapm_disable_pin(codec, "LINPUT3");
        snd_soc_dapm_disable_pin(codec, "RINPUT3");
        snd_soc_dapm_disable_pin(codec, "OUT3");
-       snd_soc_dapm_disable_pin(codec, "MONO");
+       snd_soc_dapm_disable_pin(codec, "MONO1");
 
        /* Add spitz specific controls */
        for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {