Merge branches 'release', 'acpi_pm_device_sleep_state' and 'battery' into release
authorLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:07:03 +0000 (03:07 -0500)
committerLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:07:03 +0000 (03:07 -0500)
561 files changed:
Documentation/BUG-HUNTING
Documentation/DocBook/kernel-api.tmpl
Documentation/DocBook/kernel-locking.tmpl
Documentation/fb/deferred_io.txt
Documentation/feature-removal-schedule.txt
Documentation/filesystems/proc.txt
Documentation/kernel-parameters.txt
Documentation/kprobes.txt
Documentation/kref.txt
Documentation/md.txt
Documentation/rtc.txt
Documentation/sysctl/fs.txt
Documentation/unaligned-memory-access.txt [new file with mode: 0644]
Documentation/w1/masters/00-INDEX
Documentation/w1/masters/w1-gpio [new file with mode: 0644]
MAINTAINERS
arch/alpha/Kconfig.debug
arch/alpha/defconfig
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/smp.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-rpc/riscpc.c
arch/avr32/kernel/syscall_table.S
arch/avr32/lib/delay.c
arch/blackfin/mach-bf527/boards/ezkit.c
arch/blackfin/mach-bf533/boards/H8606.c
arch/blackfin/mach-bf533/boards/cm_bf533.c
arch/blackfin/mach-bf533/boards/ezkit.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf537/boards/cm_bf537.c
arch/blackfin/mach-bf537/boards/generic_board.c
arch/blackfin/mach-bf537/boards/minotaur.c
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf561/boards/cm_bf561.c
arch/blackfin/mach-bf561/boards/ezkit.c
arch/frv/kernel/entry.S
arch/frv/kernel/setup.c
arch/h8300/kernel/irq.c
arch/ia64/kernel/smpboot.c
arch/ia64/sn/pci/pcibr/pcibr_provider.c
arch/m32r/kernel/syscall_table.S
arch/m68k/amiga/chipram.c
arch/m68k/amiga/cia.c
arch/m68knommu/lib/memcpy.c
arch/mips/au1000/common/gpio.c
arch/mips/kernel/smp.c
arch/mips/kernel/sysirix.c
arch/parisc/Kconfig.debug
arch/parisc/configs/a500_defconfig
arch/powerpc/kernel/time.c
arch/powerpc/platforms/powermac/cpufreq_32.c
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/kernel/vmlinux.lds.S
arch/ppc/platforms/prep_setup.c
arch/sh/boards/landisk/setup.c
arch/sh/boards/lboxre2/setup.c
arch/sh/boards/renesas/r7780rp/setup.c
arch/sh/boards/renesas/rts7751r2d/setup.c
arch/sh/boards/renesas/sdk7780/setup.c
arch/sh/boards/se/7722/setup.c
arch/sh/kernel/syscalls_32.S
arch/sh/kernel/syscalls_64.S
arch/sparc/kernel/sun4d_smp.c
arch/sparc/kernel/sun4m_smp.c
arch/sparc/kernel/systbls.S
arch/sparc64/defconfig
arch/sparc64/kernel/Makefile
arch/sparc64/kernel/iommu.c
arch/sparc64/kernel/iommu_common.c [deleted file]
arch/sparc64/kernel/iommu_common.h
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/systbls.S
arch/sparc64/kernel/time.c
arch/sparc64/solaris/fs.c
arch/sparc64/solaris/timod.c
arch/x86/Kconfig
arch/x86/Kconfig.debug
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/cyrix.c
arch/x86/kernel/cpu/mtrr/main.c
arch/x86/kernel/entry_64.S
arch/x86/kernel/head_64.S
arch/x86/kernel/ptrace.c
arch/x86/kernel/quirks.c
arch/x86/kernel/smpboot_32.c
arch/x86/kernel/test_nx.c
arch/x86/kernel/traps_32.c
arch/x86/lib/delay_32.c
arch/x86/lib/delay_64.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86/mm/fault.c
arch/x86/mm/init_64.c
arch/x86/mm/pageattr-test.c
arch/x86/mm/pageattr.c
arch/xtensa/kernel/time.c
crypto/async_tx/async_memcpy.c
crypto/async_tx/async_memset.c
crypto/async_tx/async_tx.c
crypto/async_tx/async_xor.c
drivers/acpi/sleep/main.c
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_of_platform.c
drivers/ata/pata_platform.c
drivers/ata/sata_fsl.c
drivers/ata/sata_mv.c
drivers/ata/sata_nv.c
drivers/ata/sata_via.c
drivers/base/Makefile
drivers/base/cpu.c
drivers/base/dmapool.c [deleted file]
drivers/block/ataflop.c
drivers/block/cciss.c
drivers/block/loop.c
drivers/block/paride/pt.c
drivers/block/pktcdvd.c
drivers/block/rd.c
drivers/cdrom/cdrom.c
drivers/char/Kconfig
drivers/char/hvc_console.c
drivers/char/hvcs.c
drivers/char/hw_random/via-rng.c
drivers/char/i8k.c
drivers/char/ip27-rtc.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/lp.c
drivers/char/mxser.c
drivers/char/mxser_new.c
drivers/char/n_tty.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/random.c
drivers/char/riscom8.c
drivers/char/ser_a2232.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm_infineon.c
drivers/char/tty_io.c
drivers/char/vt.c
drivers/dma/Kconfig
drivers/dma/dmaengine.c
drivers/dma/ioat_dma.c
drivers/dma/iop-adma.c
drivers/firmware/dcdbas.c
drivers/firmware/dmi-id.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/pca9539.c [deleted file]
drivers/gpio/pca953x.c [new file with mode: 0644]
drivers/ide/Kconfig
drivers/ide/arm/Makefile
drivers/ide/arm/icside.c
drivers/ide/arm/palm_bk3710.c [new file with mode: 0644]
drivers/ide/cris/ide-cris.c
drivers/ide/ide-acpi.c
drivers/ide/ide-cd.c
drivers/ide/ide-dma.c
drivers/ide/ide-floppy.c
drivers/ide/ide-generic.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-lib.c
drivers/ide/ide-probe.c
drivers/ide/ide-proc.c
drivers/ide/ide-tape.c
drivers/ide/ide-taskfile.c
drivers/ide/ide.c
drivers/ide/legacy/buddha.c
drivers/ide/legacy/falconide.c
drivers/ide/legacy/gayle.c
drivers/ide/legacy/hd.c
drivers/ide/legacy/ide_platform.c
drivers/ide/legacy/macide.c
drivers/ide/legacy/q40ide.c
drivers/ide/pci/Makefile
drivers/ide/pci/generic.c
drivers/ide/pci/siimage.c
drivers/input/touchscreen/h3600_ts_input.c
drivers/isdn/act2000/module.c
drivers/isdn/gigaset/asyncdata.c
drivers/isdn/gigaset/bas-gigaset.c
drivers/isdn/gigaset/common.c
drivers/isdn/gigaset/ev-layer.c
drivers/isdn/gigaset/gigaset.h
drivers/isdn/gigaset/interface.c
drivers/isdn/gigaset/isocdata.c
drivers/isdn/gigaset/ser-gigaset.c
drivers/isdn/gigaset/usb-gigaset.c
drivers/isdn/hardware/eicon/debug.c
drivers/isdn/hardware/eicon/diva.c
drivers/isdn/hardware/eicon/message.c
drivers/isdn/hisax/avm_pci.c
drivers/isdn/i4l/isdn_tty.c
drivers/isdn/i4l/isdn_ttyfax.c
drivers/isdn/icn/icn.c
drivers/isdn/isdnloop/isdnloop.c
drivers/macintosh/mediabay.c
drivers/md/bitmap.c
drivers/md/faulty.c
drivers/md/linear.c
drivers/md/md.c
drivers/md/mktables.c
drivers/md/multipath.c
drivers/md/raid0.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/md/raid6test/test.c
drivers/media/video/Makefile
drivers/media/video/tvmixer.c [deleted file]
drivers/misc/asus-laptop.c
drivers/misc/fujitsu-laptop.c
drivers/misc/lkdtm.c
drivers/misc/msi-laptop.c
drivers/misc/phantom.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/phram.c
drivers/mtd/maps/mtx-1_flash.c
drivers/net/forcedeth.c
drivers/net/gianfar_mii.c
drivers/net/iseries_veth.c
drivers/net/ixgbe/ixgbe.h
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/mv643xx_eth.c
drivers/net/pppol2tp.c
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/tlan.c
drivers/net/tulip/xircom_cb.c
drivers/net/ucc_geth_mii.c
drivers/net/virtio_net.c
drivers/net/wan/hdlc.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wan/hdlc_raw.c
drivers/net/wan/hdlc_raw_eth.c
drivers/net/wan/hdlc_x25.c
drivers/net/wireless/b43/dma.c
drivers/net/wireless/b43/dma.h
drivers/net/wireless/b43legacy/dma.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/b43legacy/pio.c
drivers/net/wireless/b43legacy/xmit.c
drivers/net/wireless/b43legacy/xmit.h
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/parport/parport_pc.c
drivers/parport/parport_serial.c
drivers/pci/dmar.c
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.h
drivers/pci/iova.c
drivers/pci/iova.h
drivers/pnp/driver.c
drivers/pnp/interface.c
drivers/pnp/manager.c
drivers/pnp/pnpacpi/rsparser.c
drivers/pnp/pnpbios/core.c
drivers/pnp/pnpbios/rsparser.c
drivers/pnp/quirks.c
drivers/ps3/ps3av.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-at91sam9.c [new file with mode: 0644]
drivers/rtc/rtc-bfin.c
drivers/rtc/rtc-cmos.c
drivers/rtc/rtc-dev.c
drivers/rtc/rtc-ds1302.c [new file with mode: 0644]
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-ds1511.c [new file with mode: 0644]
drivers/rtc/rtc-pcf8583.c
drivers/rtc/rtc-r9701.c [new file with mode: 0644]
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-sysfs.c
drivers/s390/sysinfo.c
drivers/scsi/a2091.c
drivers/scsi/a3000.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/gvp11.c
drivers/scsi/ibmvscsi/ibmvstgt.c
drivers/scsi/ide-scsi.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/serial/Kconfig
drivers/serial/Makefile
drivers/serial/cpm_uart/cpm_uart_core.c
drivers/serial/dz.c
drivers/serial/imx.c
drivers/serial/sc26xx.c [new file with mode: 0644]
drivers/serial/uartlite.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/atmel_spi.c
drivers/spi/omap2_mcspi.c
drivers/spi/pxa2xx_spi.c
drivers/spi/spi.c
drivers/spi/spi_bfin5xx.c
drivers/spi/spi_imx.c
drivers/spi/spi_s3c24xx.c
drivers/spi/spi_s3c24xx_gpio.c
drivers/spi/spi_sh_sci.c [new file with mode: 0644]
drivers/uio/uio.c
drivers/video/atmel_lcdfb.c
drivers/video/backlight/Kconfig
drivers/video/bf54x-lq043fb.c
drivers/video/console/bitblit.c
drivers/video/console/fbcon.c
drivers/video/console/fbcon.h
drivers/video/console/fbcon_ccw.c
drivers/video/console/fbcon_cw.c
drivers/video/console/fbcon_ud.c
drivers/video/console/fonts.c
drivers/video/console/tileblit.c
drivers/video/console/vgacon.c
drivers/video/fb_defio.c
drivers/video/fb_draw.h
drivers/video/fbmon.c
drivers/video/geode/lxfb_core.c
drivers/video/hpfb.c
drivers/video/i810/i810_main.c
drivers/video/igafb.c
drivers/video/intelfb/intelfbhw.c
drivers/video/neofb.c
drivers/video/nvidia/nvidia.c
drivers/video/pm2fb.c
drivers/video/pm3fb.c
drivers/video/pmag-aa-fb.c
drivers/video/ps3fb.c
drivers/video/s3c2410fb.c
drivers/video/s3c2410fb.h
drivers/video/sis/sis_main.c
drivers/video/sm501fb.c
drivers/video/tdfxfb.c
drivers/video/uvesafb.c
drivers/video/vermilion/vermilion.c
drivers/virtio/virtio_balloon.c
drivers/w1/masters/Kconfig
drivers/w1/masters/Makefile
drivers/w1/masters/w1-gpio.c [new file with mode: 0644]
drivers/w1/slaves/w1_therm.c
drivers/w1/w1.c
fs/9p/fid.c
fs/9p/v9fs.c
fs/9p/v9fs.h
fs/9p/vfs_file.c
fs/9p/vfs_inode.c
fs/Kconfig
fs/binfmt_elf.c
fs/block_dev.c
fs/compat.c
fs/dcache.c
fs/dquot.c
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/file.c
fs/ecryptfs/inode.c
fs/ecryptfs/keystore.c
fs/ecryptfs/main.c
fs/ecryptfs/mmap.c
fs/ecryptfs/read_write.c
fs/ecryptfs/super.c
fs/eventfd.c
fs/ext2/balloc.c
fs/ext2/dir.c
fs/ext2/ext2.h
fs/ext2/file.c
fs/ext2/inode.c
fs/ext2/ioctl.c
fs/ext2/super.c
fs/ext3/balloc.c
fs/ext3/inode.c
fs/ext3/namei.c
fs/ext3/super.c
fs/ext4/balloc.c
fs/ext4/inode.c
fs/ext4/super.c
fs/fat/file.c
fs/fat/inode.c
fs/fat/misc.c
fs/file.c
fs/fs-writeback.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/hfs/bfind.c
fs/hfs/brec.c
fs/hfs/btree.c
fs/hfs/hfs.h
fs/hfs/super.c
fs/inotify.c
fs/inotify_user.c
fs/jbd/journal.c
fs/jbd/recovery.c
fs/jbd2/recovery.c
fs/namei.c
fs/namespace.c
fs/ncpfs/inode.c
fs/partitions/Kconfig
fs/pnode.c
fs/proc/proc_misc.c
fs/reiserfs/prints.c
fs/reiserfs/xattr.c
fs/select.c
fs/signalfd.c
fs/smbfs/inode.c
fs/smbfs/sock.c
fs/utimes.c
include/asm-arm/arch-iop13xx/adma.h
include/asm-arm/arch-s3c2410/regs-lcd.h
include/asm-arm/arch-s3c2410/spi-gpio.h
include/asm-arm/arch-s3c2410/spi.h
include/asm-arm/hardware/iop3xx-adma.h
include/asm-avr32/delay.h
include/asm-avr32/timex.h
include/asm-avr32/unistd.h
include/asm-blackfin/io.h
include/asm-frv/unistd.h
include/asm-generic/cputime.h
include/asm-generic/sections.h
include/asm-h8300/io.h
include/asm-h8300/virtconvert.h
include/asm-m32r/delay.h
include/asm-m32r/unistd.h
include/asm-m68k/pgtable.h
include/asm-m68knommu/io.h
include/asm-powerpc/cputime.h
include/asm-powerpc/dma.h
include/asm-powerpc/mediabay.h
include/asm-powerpc/paca.h
include/asm-powerpc/ps3av.h
include/asm-s390/cputime.h
include/asm-sh/delay.h
include/asm-sh/unistd_32.h
include/asm-sh/unistd_64.h
include/asm-sparc/unistd.h
include/asm-sparc64/io.h
include/asm-sparc64/timex.h
include/asm-sparc64/unistd.h
include/asm-v850/io.h
include/asm-x86/delay.h
include/asm-x86/pgalloc_64.h
include/asm-x86/timex.h
include/linux/ac97_codec.h
include/linux/acct.h
include/linux/async_tx.h
include/linux/ata_platform.h [moved from include/linux/pata_platform.h with 75% similarity]
include/linux/compat.h
include/linux/cpuidle.h
include/linux/dmaengine.h
include/linux/fs.h
include/linux/fsnotify.h
include/linux/hash.h
include/linux/hdlc.h
include/linux/i2c/pca953x.h [moved from include/linux/i2c/pca9539.h with 93% similarity]
include/linux/ide.h
include/linux/if_vlan.h
include/linux/init.h
include/linux/interrupt.h
include/linux/isdn.h
include/linux/jbd.h
include/linux/kernel.h
include/linux/kprobes.h
include/linux/libata.h
include/linux/log2.h
include/linux/loop.h
include/linux/lp.h
include/linux/pci_ids.h
include/linux/percpu.h
include/linux/pkt_cls.h
include/linux/pnp.h
include/linux/ptrace.h
include/linux/raid/bitmap.h
include/linux/raid/md_k.h
include/linux/rcupdate.h
include/linux/sched.h
include/linux/signal.h
include/linux/sm501.h
include/linux/ssb/ssb.h
include/linux/timex.h
include/linux/tty.h
include/linux/vt_kern.h
include/linux/w1-gpio.h [new file with mode: 0644]
include/net/9p/9p.h
include/net/9p/client.h
include/net/9p/conn.h [deleted file]
include/net/9p/transport.h
include/video/atmel_lcdc.h
init/Kconfig
init/calibrate.c
init/do_mounts.c
init/initramfs.c
init/main.c
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.c
kernel/exit.c
kernel/fork.c
kernel/kallsyms.c
kernel/kprobes.c
kernel/notifier.c
kernel/params.c
kernel/printk.c
kernel/ptrace.c
kernel/relay.c
kernel/signal.c
kernel/srcu.c
kernel/stop_machine.c
kernel/sys.c
kernel/sysctl.c
kernel/test_kprobes.c
kernel/time.c
kernel/time/clocksource.c
kernel/timer.c
lib/extable.c
lib/smp_processor_id.c
mm/Makefile
mm/allocpercpu.c
mm/dmapool.c [new file with mode: 0644]
mm/memory.c
mm/mmap.c
net/9p/Makefile
net/9p/client.c
net/9p/fcprint.c
net/9p/mod.c
net/9p/mux.c [deleted file]
net/9p/trans_fd.c
net/9p/trans_virtio.c
net/9p/util.c
net/ipv4/ipvs/ip_vs_wrr.c
net/mac80211/Kconfig
net/sched/cls_flow.c
net/sched/em_meta.c
scripts/checkstack.pl
scripts/kallsyms.c
security/Kconfig
security/security.c
security/selinux/include/security.h
security/selinux/ss/services.c
sound/oss/Makefile
sound/oss/ac97_codec.c
sound/oss/btaudio.c [deleted file]
sound/oss/cs4232.c [deleted file]
sound/oss/dmasound/Kconfig
sound/oss/dmasound/dmasound_paula.c
sound/oss/i810_audio.c [deleted file]
sound/oss/pss.c
sound/oss/sb_common.c
sound/oss/trident.c
sound/oss/via82cxxx_audio.c [deleted file]

index 6c816751b8686394d8cbdbd1fc639154d7f5b7ac..65022a87bf17902f9e04fe5ecff611a41ffaf4d8 100644 (file)
@@ -214,6 +214,23 @@ And recompile the kernel with CONFIG_DEBUG_INFO enabled:
   gdb vmlinux
   (gdb) p vt_ioctl
   (gdb) l *(0x<address of vt_ioctl> + 0xda8)
+or, as one command
+  (gdb) l *(vt_ioctl + 0xda8)
+
+If you have a call trace, such as :-
+>Call Trace:
+> [<ffffffff8802c8e9>] :jbd:log_wait_commit+0xa3/0xf5
+> [<ffffffff810482d9>] autoremove_wake_function+0x0/0x2e
+> [<ffffffff8802770b>] :jbd:journal_stop+0x1be/0x1ee
+> ...
+this shows the problem in the :jbd: module. You can load that module in gdb
+and list the relevant code.
+  gdb fs/jbd/jbd.ko
+  (gdb) p log_wait_commit
+  (gdb) l *(0x<address> + 0xa3)
+or
+  (gdb) l *(log_wait_commit + 0xa3)
+
 
 Another very useful option of the Kernel Hacking section in menuconfig is
 Debug memory allocations. This will help you see whether data has been
index 77436d735013f37195750aec890f7db57a1b130d..059aaf20951a3bb54a4604084b2b33d70d306af2 100644 (file)
@@ -165,6 +165,7 @@ X!Ilib/string.c
 !Emm/vmalloc.c
 !Imm/page_alloc.c
 !Emm/mempool.c
+!Emm/dmapool.c
 !Emm/page-writeback.c
 !Emm/truncate.c
      </sect1>
@@ -371,7 +372,6 @@ X!Iinclude/linux/device.h
 !Edrivers/base/class.c
 !Edrivers/base/firmware_class.c
 !Edrivers/base/transport_class.c
-!Edrivers/base/dmapool.c
 <!-- Cannot be included, because
      attribute_container_add_class_device_adapter
  and attribute_container_classdev_to_container
index 01825ee7db64031878c6c9e647cd698547c9d558..2e9d6b41f034594b3b1af87c97ab1da81f5caccd 100644 (file)
@@ -717,7 +717,7 @@ used, and when it gets full, throws out the least used one.
     <para>
 For our first example, we assume that all operations are in user
 context (ie. from system calls), so we can sleep.  This means we can
-use a semaphore to protect the cache and all the objects within
+use a mutex to protect the cache and all the objects within
 it.  Here's the code:
     </para>
 
@@ -725,7 +725,7 @@ it.  Here's the code:
 #include &lt;linux/list.h&gt;
 #include &lt;linux/slab.h&gt;
 #include &lt;linux/string.h&gt;
-#include &lt;asm/semaphore.h&gt;
+#include &lt;linux/mutex.h&gt;
 #include &lt;asm/errno.h&gt;
 
 struct object
@@ -737,7 +737,7 @@ struct object
 };
 
 /* Protects the cache, cache_num, and the objects within it */
-static DECLARE_MUTEX(cache_lock);
+static DEFINE_MUTEX(cache_lock);
 static LIST_HEAD(cache);
 static unsigned int cache_num = 0;
 #define MAX_CACHE_SIZE 10
@@ -789,17 +789,17 @@ int cache_add(int id, const char *name)
         obj-&gt;id = id;
         obj-&gt;popularity = 0;
 
-        down(&amp;cache_lock);
+        mutex_lock(&amp;cache_lock);
         __cache_add(obj);
-        up(&amp;cache_lock);
+        mutex_unlock(&amp;cache_lock);
         return 0;
 }
 
 void cache_delete(int id)
 {
-        down(&amp;cache_lock);
+        mutex_lock(&amp;cache_lock);
         __cache_delete(__cache_find(id));
-        up(&amp;cache_lock);
+        mutex_unlock(&amp;cache_lock);
 }
 
 int cache_find(int id, char *name)
@@ -807,13 +807,13 @@ int cache_find(int id, char *name)
         struct object *obj;
         int ret = -ENOENT;
 
-        down(&amp;cache_lock);
+        mutex_lock(&amp;cache_lock);
         obj = __cache_find(id);
         if (obj) {
                 ret = 0;
                 strcpy(name, obj-&gt;name);
         }
-        up(&amp;cache_lock);
+        mutex_unlock(&amp;cache_lock);
         return ret;
 }
 </programlisting>
@@ -853,7 +853,7 @@ The change is shown below, in standard patch format: the
          int popularity;
  };
 
--static DECLARE_MUTEX(cache_lock);
+-static DEFINE_MUTEX(cache_lock);
 +static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
  static LIST_HEAD(cache);
  static unsigned int cache_num = 0;
@@ -870,22 +870,22 @@ The change is shown below, in standard patch format: the
          obj-&gt;id = id;
          obj-&gt;popularity = 0;
 
--        down(&amp;cache_lock);
+-        mutex_lock(&amp;cache_lock);
 +        spin_lock_irqsave(&amp;cache_lock, flags);
          __cache_add(obj);
--        up(&amp;cache_lock);
+-        mutex_unlock(&amp;cache_lock);
 +        spin_unlock_irqrestore(&amp;cache_lock, flags);
          return 0;
  }
 
  void cache_delete(int id)
  {
--        down(&amp;cache_lock);
+-        mutex_lock(&amp;cache_lock);
 +        unsigned long flags;
 +
 +        spin_lock_irqsave(&amp;cache_lock, flags);
          __cache_delete(__cache_find(id));
--        up(&amp;cache_lock);
+-        mutex_unlock(&amp;cache_lock);
 +        spin_unlock_irqrestore(&amp;cache_lock, flags);
  }
 
@@ -895,14 +895,14 @@ The change is shown below, in standard patch format: the
          int ret = -ENOENT;
 +        unsigned long flags;
 
--        down(&amp;cache_lock);
+-        mutex_lock(&amp;cache_lock);
 +        spin_lock_irqsave(&amp;cache_lock, flags);
          obj = __cache_find(id);
          if (obj) {
                  ret = 0;
                  strcpy(name, obj-&gt;name);
          }
--        up(&amp;cache_lock);
+-        mutex_unlock(&amp;cache_lock);
 +        spin_unlock_irqrestore(&amp;cache_lock, flags);
          return ret;
  }
index 63883a892120e125be75db301e1c49322c1c7a71..74832837025032dcd0f4ee21a665b3a59612b701 100644 (file)
@@ -7,10 +7,10 @@ IO. The following example may be a useful explanation of how one such setup
 works:
 
 - userspace app like Xfbdev mmaps framebuffer
-- deferred IO and driver sets up nopage and page_mkwrite handlers
+- deferred IO and driver sets up fault and page_mkwrite handlers
 - userspace app tries to write to mmaped vaddress
-- we get pagefault and reach nopage handler
-- nopage handler finds and returns physical page
+- we get pagefault and reach fault handler
+- fault handler finds and returns physical page
 - we get page_mkwrite where we add this page to a list
 - schedule a workqueue task to be run after a delay
 - app continues writing to that page with no additional cost. this is
index a7d9d179131a76c1f3ef297792ddaae95786e283..68ce1300a3609f9a5e0061cf61c0a5f3c05f80fe 100644 (file)
@@ -208,13 +208,6 @@ Who:       Randy Dunlap <randy.dunlap@oracle.com>
 
 ---------------------------
 
-What:  drivers depending on OSS_OBSOLETE
-When:  options in 2.6.23, code in 2.6.25
-Why:   obsolete OSS drivers
-Who:   Adrian Bunk <bunk@stusta.de>
-
----------------------------
-
 What: libata spindown skipping and warning
 When: Dec 2008
 Why:  Some halt(8) implementations synchronize caches for and spin
index e2799b5fafea890153b2d94acb25a712fe6a2587..5681e2fa1496167e6f876b6dab39e9605597a117 100644 (file)
@@ -1029,6 +1029,14 @@ nr_inodes
 Denotes the  number  of  inodes the system has allocated. This number will
 grow and shrink dynamically.
 
+nr_open
+-------
+
+Denotes the maximum number of file-handles a process can
+allocate. Default value is 1024*1024 (1048576) which should be
+enough for most machines. Actual limit depends on RLIMIT_NOFILE
+resource limit.
+
 nr_free_inodes
 --------------
 
index 9ad4e6fc56fdb7a880e5276ea5f9b0c1d780778e..8fd5aa40585ff8419cc730104079ddd61b5ccb8e 100644 (file)
@@ -780,6 +780,9 @@ and is between 256 and 4096 characters. It is defined in the file
                        loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
                        as idle=poll.
 
+       ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
+                       Claim all unknown PCI IDE storage controllers.
+
        ignore_loglevel [KNL]
                        Ignore loglevel setting - this will print /all/
                        kernel messages to the console. Useful for debugging.
index 53a63890aea49a9def4240e426ddce1db32439c8..30c101761d0d54f532122e8a804d376de2aa61d8 100644 (file)
@@ -96,7 +96,9 @@ or in registers (e.g., for x86_64 or for an i386 fastcall function).
 The jprobe will work in either case, so long as the handler's
 prototype matches that of the probed function.
 
-1.3 How Does a Return Probe Work?
+1.3 Return Probes
+
+1.3.1 How Does a Return Probe Work?
 
 When you call register_kretprobe(), Kprobes establishes a kprobe at
 the entry to the function.  When the probed function is called and this
@@ -107,9 +109,9 @@ At boot time, Kprobes registers a kprobe at the trampoline.
 
 When the probed function executes its return instruction, control
 passes to the trampoline and that probe is hit.  Kprobes' trampoline
-handler calls the user-specified handler associated with the kretprobe,
-then sets the saved instruction pointer to the saved return address,
-and that's where execution resumes upon return from the trap.
+handler calls the user-specified return handler associated with the
+kretprobe, then sets the saved instruction pointer to the saved return
+address, and that's where execution resumes upon return from the trap.
 
 While the probed function is executing, its return address is
 stored in an object of type kretprobe_instance.  Before calling
@@ -131,6 +133,30 @@ zero when the return probe is registered, and is incremented every
 time the probed function is entered but there is no kretprobe_instance
 object available for establishing the return probe.
 
+1.3.2 Kretprobe entry-handler
+
+Kretprobes also provides an optional user-specified handler which runs
+on function entry. This handler is specified by setting the entry_handler
+field of the kretprobe struct. Whenever the kprobe placed by kretprobe at the
+function entry is hit, the user-defined entry_handler, if any, is invoked.
+If the entry_handler returns 0 (success) then a corresponding return handler
+is guaranteed to be called upon function return. If the entry_handler
+returns a non-zero error then Kprobes leaves the return address as is, and
+the kretprobe has no further effect for that particular function instance.
+
+Multiple entry and return handler invocations are matched using the unique
+kretprobe_instance object associated with them. Additionally, a user
+may also specify per return-instance private data to be part of each
+kretprobe_instance object. This is especially useful when sharing private
+data between corresponding user entry and return handlers. The size of each
+private data object can be specified at kretprobe registration time by
+setting the data_size field of the kretprobe struct. This data can be
+accessed through the data field of each kretprobe_instance object.
+
+In case probed function is entered but there is no kretprobe_instance
+object available, then in addition to incrementing the nmissed count,
+the user entry_handler invocation is also skipped.
+
 2. Architectures Supported
 
 Kprobes, jprobes, and return probes are implemented on the following
@@ -274,6 +300,8 @@ of interest:
 - ret_addr: the return address
 - rp: points to the corresponding kretprobe object
 - task: points to the corresponding task struct
+- data: points to per return-instance private data; see "Kretprobe
+       entry-handler" for details.
 
 The regs_return_value(regs) macro provides a simple abstraction to
 extract the return value from the appropriate register as defined by
@@ -556,23 +584,52 @@ report failed calls to sys_open().
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/kprobes.h>
+#include <linux/ktime.h>
+
+/* per-instance private data */
+struct my_data {
+       ktime_t entry_stamp;
+};
 
 static const char *probed_func = "sys_open";
 
-/* Return-probe handler: If the probed function fails, log the return value. */
-static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
+/* Timestamp function entry. */
+static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
+{
+       struct my_data *data;
+
+       if(!current->mm)
+               return 1; /* skip kernel threads */
+
+       data = (struct my_data *)ri->data;
+       data->entry_stamp = ktime_get();
+       return 0;
+}
+
+/* If the probed function failed, log the return value and duration.
+ * Duration may turn out to be zero consistently, depending upon the
+ * granularity of time accounting on the platform. */
+static int return_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
        int retval = regs_return_value(regs);
+       struct my_data *data = (struct my_data *)ri->data;
+       s64 delta;
+       ktime_t now;
+
        if (retval < 0) {
-               printk("%s returns %d\n", probed_func, retval);
+               now = ktime_get();
+               delta = ktime_to_ns(ktime_sub(now, data->entry_stamp));
+               printk("%s: return val = %d (duration = %lld ns)\n",
+                      probed_func, retval, delta);
        }
        return 0;
 }
 
 static struct kretprobe my_kretprobe = {
-       .handler = ret_handler,
-       /* Probe up to 20 instances concurrently. */
-       .maxactive = 20
+       .handler = return_handler,
+       .entry_handler = entry_handler,
+       .data_size = sizeof(struct my_data),
+       .maxactive = 20, /* probe up to 20 instances concurrently */
 };
 
 static int __init kretprobe_init(void)
@@ -584,7 +641,7 @@ static int __init kretprobe_init(void)
                printk("register_kretprobe failed, returned %d\n", ret);
                return -1;
        }
-       printk("Planted return probe at %p\n", my_kretprobe.kp.addr);
+       printk("Kretprobe active on %s\n", my_kretprobe.kp.symbol_name);
        return 0;
 }
 
@@ -594,7 +651,7 @@ static void __exit kretprobe_exit(void)
        printk("kretprobe unregistered\n");
        /* nmissed > 0 suggests that maxactive was set too low. */
        printk("Missed probing %d instances of %s\n",
-               my_kretprobe.nmissed, probed_func);
+              my_kretprobe.nmissed, probed_func);
 }
 
 module_init(kretprobe_init)
index f38b59d00c63a1a635983eaee2278c40b6f744a6..130b6e87aa7ed04af9d3504acecfd7dc0e07ccfc 100644 (file)
@@ -141,10 +141,10 @@ The last rule (rule 3) is the nastiest one to handle.  Say, for
 instance, you have a list of items that are each kref-ed, and you wish
 to get the first one.  You can't just pull the first item off the list
 and kref_get() it.  That violates rule 3 because you are not already
-holding a valid pointer.  You must add locks or semaphores.  For
-instance:
+holding a valid pointer.  You must add a mutex (or some other lock).
+For instance:
 
-static DECLARE_MUTEX(sem);
+static DEFINE_MUTEX(mutex);
 static LIST_HEAD(q);
 struct my_data
 {
@@ -155,12 +155,12 @@ struct my_data
 static struct my_data *get_entry()
 {
        struct my_data *entry = NULL;
-       down(&sem);
+       mutex_lock(&mutex);
        if (!list_empty(&q)) {
                entry = container_of(q.next, struct my_q_entry, link);
                kref_get(&entry->refcount);
        }
-       up(&sem);
+       mutex_unlock(&mutex);
        return entry;
 }
 
@@ -174,9 +174,9 @@ static void release_entry(struct kref *ref)
 
 static void put_entry(struct my_data *entry)
 {
-       down(&sem);
+       mutex_lock(&mutex);
        kref_put(&entry->refcount, release_entry);
-       up(&sem);
+       mutex_unlock(&mutex);
 }
 
 The kref_put() return value is useful if you do not want to hold the
@@ -191,13 +191,13 @@ static void release_entry(struct kref *ref)
 
 static void put_entry(struct my_data *entry)
 {
-       down(&sem);
+       mutex_lock(&mutex);
        if (kref_put(&entry->refcount, release_entry)) {
                list_del(&entry->link);
-               up(&sem);
+               mutex_unlock(&mutex);
                kfree(entry);
        } else
-               up(&sem);
+               mutex_unlock(&mutex);
 }
 
 This is really more useful if you have to call other routines as part
index 5818628207b5ec8b5f32ed6d727857f5f6dcbbec..396cdd982c26505ee39a577a64a7fb2c7472985e 100644 (file)
@@ -416,6 +416,16 @@ also have
      sectors in total that could need to be processed.  The two
      numbers are separated by a '/'  thus effectively showing one
      value, a fraction of the process that is complete.
+     A 'select' on this attribute will return when resync completes,
+     when it reaches the current sync_max (below) and possibly at
+     other times.
+
+   sync_max
+     This is a number of sectors at which point a resync/recovery
+     process will pause.  When a resync is active, the value can
+     only ever be increased, never decreased.  The value of 'max'
+     effectively disables the limit.
+
 
    sync_speed
      This shows the current actual speed, in K/sec, of the current
index e20b19c1b60da04b95cfc62a0cec57428a53bb12..8deffcd68cb8d3fc2737279e780a28bee3726f57 100644 (file)
@@ -182,8 +182,8 @@ driver returns ENOIOCTLCMD.  Some common examples:
        since the frequency is stored in the irq_freq member of the rtc_device
        structure.  Your driver needs to initialize the irq_freq member during
        init.  Make sure you check the requested frequency is in range of your
-       hardware in the irq_set_freq function.  If you cannot actually change
-       the frequency, just return -ENOTTY.
+       hardware in the irq_set_freq function.  If it isn't, return -EINVAL.  If
+       you cannot actually change the frequency, do not define irq_set_freq.
 
 If all else fails, check out the rtc-test.c driver!
 
@@ -268,8 +268,8 @@ int main(int argc, char **argv)
                /* This read will block */
                retval = read(fd, &data, sizeof(unsigned long));
                if (retval == -1) {
-                       perror("read");
-                       exit(errno);
+                       perror("read");
+                       exit(errno);
                }
                fprintf(stderr, " %d",i);
                fflush(stderr);
@@ -326,11 +326,11 @@ test_READ:
                rtc_tm.tm_sec %= 60;
                rtc_tm.tm_min++;
        }
-       if  (rtc_tm.tm_min == 60) {
+       if (rtc_tm.tm_min == 60) {
                rtc_tm.tm_min = 0;
                rtc_tm.tm_hour++;
        }
-       if  (rtc_tm.tm_hour == 24)
+       if (rtc_tm.tm_hour == 24)
                rtc_tm.tm_hour = 0;
 
        retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
@@ -407,8 +407,8 @@ test_PIE:
                                        "\n...Periodic IRQ rate is fixed\n");
                                goto done;
                        }
-                       perror("RTC_IRQP_SET ioctl");
-                       exit(errno);
+                       perror("RTC_IRQP_SET ioctl");
+                       exit(errno);
                }
 
                fprintf(stderr, "\n%ldHz:\t", tmp);
@@ -417,27 +417,27 @@ test_PIE:
                /* Enable periodic interrupts */
                retval = ioctl(fd, RTC_PIE_ON, 0);
                if (retval == -1) {
-                       perror("RTC_PIE_ON ioctl");
-                       exit(errno);
+                       perror("RTC_PIE_ON ioctl");
+                       exit(errno);
                }
 
                for (i=1; i<21; i++) {
-                       /* This blocks */
-                       retval = read(fd, &data, sizeof(unsigned long));
-                       if (retval == -1) {
-                                      perror("read");
-                                      exit(errno);
-                       }
-                       fprintf(stderr, " %d",i);
-                       fflush(stderr);
-                       irqcount++;
+                       /* This blocks */
+                       retval = read(fd, &data, sizeof(unsigned long));
+                       if (retval == -1) {
+                               perror("read");
+                               exit(errno);
+                       }
+                       fprintf(stderr, " %d",i);
+                       fflush(stderr);
+                       irqcount++;
                }
 
                /* Disable periodic interrupts */
                retval = ioctl(fd, RTC_PIE_OFF, 0);
                if (retval == -1) {
-                       perror("RTC_PIE_OFF ioctl");
-                       exit(errno);
+                       perror("RTC_PIE_OFF ioctl");
+                       exit(errno);
                }
        }
 
index aa986a35e9945071abed471776565a2cf4644787..f99254327ae59b59971d979b38cc083d3ac096e5 100644 (file)
@@ -23,6 +23,7 @@ Currently, these files are in /proc/sys/fs:
 - inode-max
 - inode-nr
 - inode-state
+- nr_open
 - overflowuid
 - overflowgid
 - suid_dumpable
@@ -91,6 +92,15 @@ usage of file handles and you don't need to increase the maximum.
 
 ==============================================================
 
+nr_open:
+
+This denotes the maximum number of file-handles a process can
+allocate. Default value is 1024*1024 (1048576) which should be
+enough for most machines. Actual limit depends on RLIMIT_NOFILE
+resource limit.
+
+==============================================================
+
 inode-max, inode-nr & inode-state:
 
 As with file handles, the kernel allocates the inode structures
diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt
new file mode 100644 (file)
index 0000000..6223eac
--- /dev/null
@@ -0,0 +1,226 @@
+UNALIGNED MEMORY ACCESSES
+=========================
+
+Linux runs on a wide variety of architectures which have varying behaviour
+when it comes to memory access. This document presents some details about
+unaligned accesses, why you need to write code that doesn't cause them,
+and how to write such code!
+
+
+The definition of an unaligned access
+=====================================
+
+Unaligned memory accesses occur when you try to read N bytes of data starting
+from an address that is not evenly divisible by N (i.e. addr % N != 0).
+For example, reading 4 bytes of data from address 0x10004 is fine, but
+reading 4 bytes of data from address 0x10005 would be an unaligned memory
+access.
+
+The above may seem a little vague, as memory access can happen in different
+ways. The context here is at the machine code level: certain instructions read
+or write a number of bytes to or from memory (e.g. movb, movw, movl in x86
+assembly). As will become clear, it is relatively easy to spot C statements
+which will compile to multiple-byte memory access instructions, namely when
+dealing with types such as u16, u32 and u64.
+
+
+Natural alignment
+=================
+
+The rule mentioned above forms what we refer to as natural alignment:
+When accessing N bytes of memory, the base memory address must be evenly
+divisible by N, i.e. addr % N == 0.
+
+When writing code, assume the target architecture has natural alignment
+requirements.
+
+In reality, only a few architectures require natural alignment on all sizes
+of memory access. However, we must consider ALL supported architectures;
+writing code that satisfies natural alignment requirements is the easiest way
+to achieve full portability.
+
+
+Why unaligned access is bad
+===========================
+
+The effects of performing an unaligned memory access vary from architecture
+to architecture. It would be easy to write a whole document on the differences
+here; a summary of the common scenarios is presented below:
+
+ - Some architectures are able to perform unaligned memory accesses
+   transparently, but there is usually a significant performance cost.
+ - Some architectures raise processor exceptions when unaligned accesses
+   happen. The exception handler is able to correct the unaligned access,
+   at significant cost to performance.
+ - Some architectures raise processor exceptions when unaligned accesses
+   happen, but the exceptions do not contain enough information for the
+   unaligned access to be corrected.
+ - Some architectures are not capable of unaligned memory access, but will
+   silently perform a different memory access to the one that was requested,
+   resulting a a subtle code bug that is hard to detect!
+
+It should be obvious from the above that if your code causes unaligned
+memory accesses to happen, your code will not work correctly on certain
+platforms and will cause performance problems on others.
+
+
+Code that does not cause unaligned access
+=========================================
+
+At first, the concepts above may seem a little hard to relate to actual
+coding practice. After all, you don't have a great deal of control over
+memory addresses of certain variables, etc.
+
+Fortunately things are not too complex, as in most cases, the compiler
+ensures that things will work for you. For example, take the following
+structure:
+
+       struct foo {
+               u16 field1;
+               u32 field2;
+               u8 field3;
+       };
+
+Let us assume that an instance of the above structure resides in memory
+starting at address 0x10000. With a basic level of understanding, it would
+not be unreasonable to expect that accessing field2 would cause an unaligned
+access. You'd be expecting field2 to be located at offset 2 bytes into the
+structure, i.e. address 0x10002, but that address is not evenly divisible
+by 4 (remember, we're reading a 4 byte value here).
+
+Fortunately, the compiler understands the alignment constraints, so in the
+above case it would insert 2 bytes of padding in between field1 and field2.
+Therefore, for standard structure types you can always rely on the compiler
+to pad structures so that accesses to fields are suitably aligned (assuming
+you do not cast the field to a type of different length).
+
+Similarly, you can also rely on the compiler to align variables and function
+parameters to a naturally aligned scheme, based on the size of the type of
+the variable.
+
+At this point, it should be clear that accessing a single byte (u8 or char)
+will never cause an unaligned access, because all memory addresses are evenly
+divisible by one.
+
+On a related topic, with the above considerations in mind you may observe
+that you could reorder the fields in the structure in order to place fields
+where padding would otherwise be inserted, and hence reduce the overall
+resident memory size of structure instances. The optimal layout of the
+above example is:
+
+       struct foo {
+               u32 field2;
+               u16 field1;
+               u8 field3;
+       };
+
+For a natural alignment scheme, the compiler would only have to add a single
+byte of padding at the end of the structure. This padding is added in order
+to satisfy alignment constraints for arrays of these structures.
+
+Another point worth mentioning is the use of __attribute__((packed)) on a
+structure type. This GCC-specific attribute tells the compiler never to
+insert any padding within structures, useful when you want to use a C struct
+to represent some data that comes in a fixed arrangement 'off the wire'.
+
+You might be inclined to believe that usage of this attribute can easily
+lead to unaligned accesses when accessing fields that do not satisfy
+architectural alignment requirements. However, again, the compiler is aware
+of the alignment constraints and will generate extra instructions to perform
+the memory access in a way that does not cause unaligned access. Of course,
+the extra instructions obviously cause a loss in performance compared to the
+non-packed case, so the packed attribute should only be used when avoiding
+structure padding is of importance.
+
+
+Code that causes unaligned access
+=================================
+
+With the above in mind, let's move onto a real life example of a function
+that can cause an unaligned memory access. The following function adapted
+from include/linux/etherdevice.h is an optimized routine to compare two
+ethernet MAC addresses for equality.
+
+unsigned int compare_ether_addr(const u8 *addr1, const u8 *addr2)
+{
+       const u16 *a = (const u16 *) addr1;
+       const u16 *b = (const u16 *) addr2;
+       return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
+}
+
+In the above function, the reference to a[0] causes 2 bytes (16 bits) to
+be read from memory starting at address addr1. Think about what would happen
+if addr1 was an odd address such as 0x10003. (Hint: it'd be an unaligned
+access.)
+
+Despite the potential unaligned access problems with the above function, it
+is included in the kernel anyway but is understood to only work on
+16-bit-aligned addresses. It is up to the caller to ensure this alignment or
+not use this function at all. This alignment-unsafe function is still useful
+as it is a decent optimization for the cases when you can ensure alignment,
+which is true almost all of the time in ethernet networking context.
+
+
+Here is another example of some code that could cause unaligned accesses:
+       void myfunc(u8 *data, u32 value)
+       {
+               [...]
+               *((u32 *) data) = cpu_to_le32(value);
+               [...]
+       }
+
+This code will cause unaligned accesses every time the data parameter points
+to an address that is not evenly divisible by 4.
+
+In summary, the 2 main scenarios where you may run into unaligned access
+problems involve:
+ 1. Casting variables to types of different lengths
+ 2. Pointer arithmetic followed by access to at least 2 bytes of data
+
+
+Avoiding unaligned accesses
+===========================
+
+The easiest way to avoid unaligned access is to use the get_unaligned() and
+put_unaligned() macros provided by the <asm/unaligned.h> header file.
+
+Going back to an earlier example of code that potentially causes unaligned
+access:
+
+       void myfunc(u8 *data, u32 value)
+       {
+               [...]
+               *((u32 *) data) = cpu_to_le32(value);
+               [...]
+       }
+
+To avoid the unaligned memory access, you would rewrite it as follows:
+
+       void myfunc(u8 *data, u32 value)
+       {
+               [...]
+               value = cpu_to_le32(value);
+               put_unaligned(value, (u32 *) data);
+               [...]
+       }
+
+The get_unaligned() macro works similarly. Assuming 'data' is a pointer to
+memory and you wish to avoid unaligned access, its usage is as follows:
+
+       u32 value = get_unaligned((u32 *) data);
+
+These macros work work for memory accesses of any length (not just 32 bits as
+in the examples above). Be aware that when compared to standard access of
+aligned memory, using these macros to access unaligned memory can be costly in
+terms of performance.
+
+If use of such macros is not convenient, another option is to use memcpy(),
+where the source or destination (or both) are of type u8* or unsigned char*.
+Due to the byte-wise nature of this operation, unaligned accesses are avoided.
+
+--
+Author: Daniel Drake <dsd@gentoo.org>
+With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt,
+Johannes Berg, Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock,
+Uli Kunitz, Vadim Lobanov
+
index 752613c4cea2b5e7951b8cd661996745c2b0a1c4..7b0ceaaad7af916ab0ed24d2e8ed05738bd830e0 100644 (file)
@@ -4,3 +4,5 @@ ds2482
        - The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
 ds2490
        - The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
+w1-gpio
+       - GPIO 1-wire bus master driver.
diff --git a/Documentation/w1/masters/w1-gpio b/Documentation/w1/masters/w1-gpio
new file mode 100644 (file)
index 0000000..af5d3b4
--- /dev/null
@@ -0,0 +1,33 @@
+Kernel driver w1-gpio
+=====================
+
+Author: Ville Syrjala <syrjala@sci.fi>
+
+
+Description
+-----------
+
+GPIO 1-wire bus master driver. The driver uses the GPIO API to control the
+wire and the GPIO pin can be specified using platform data.
+
+
+Example (mach-at91)
+-------------------
+
+#include <linux/w1-gpio.h>
+
+static struct w1_gpio_platform_data foo_w1_gpio_pdata = {
+       .pin            = AT91_PIN_PB20,
+       .is_open_drain  = 1,
+};
+
+static struct platform_device foo_w1_device = {
+       .name                   = "w1-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &foo_w1_gpio_pdata,
+};
+
+...
+       at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1);
+       at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1);
+       platform_device_register(&foo_w1_device);
index 4f3da8b56979c5365ab8403a90eaebd3ec3a378b..0885aa2b095a44b3cd66567f80f50aab75ce6d95 100644 (file)
@@ -338,13 +338,12 @@ S:        Maintained for 2.4; PCI support for 2.6.
 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
 P:     Thomas Dahlmann
 M:     thomas.dahlmann@amd.com
-L:     info-linux@geode.amd.com
+L:     info-linux@geode.amd.com        (subscribers-only)
 S:     Supported
 
 AMD GEODE PROCESSOR/CHIPSET SUPPORT
 P:     Jordan Crouse
-M:     info-linux@geode.amd.com
-L:     info-linux@geode.amd.com
+L:     info-linux@geode.amd.com        (subscribers-only)
 W:     http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
 S:     Supported
 
@@ -841,6 +840,12 @@ L: linux-kernel@vger.kernel.org
 T:     git kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
 S:     Maintained
 
+BLOCK2MTD DRIVER
+P:     Joern Engel
+M:     joern@lazybastard.org
+L:     linux-mtd@lists.infradead.org
+S:     Maintained
+
 BLUETOOTH SUBSYSTEM
 P:     Marcel Holtmann
 M:     marcel@holtmann.org
@@ -3031,8 +3036,8 @@ L:        linux-abi-devel@lists.sourceforge.net
 S:     Maintained
 
 PHRAM MTD DRIVER
-P:     Jörn Engel
-M:     joern@wh.fh-wedel.de
+P:     Joern Engel
+M:     joern@lazybastard.org
 L:     linux-mtd@lists.infradead.org
 S:     Maintained
 
@@ -3219,6 +3224,12 @@ M:       mporter@kernel.crashing.org
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
+RDC R-321X SoC
+P:     Florian Fainelli
+M:     florian.fainelli@telecomint.eu
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+
 RDC R6040 FAST ETHERNET DRIVER
 P:     Florian Fainelli
 M:     florian.fainelli@telecomint.eu
@@ -3856,6 +3867,12 @@ M:       oliver@neukum.name
 L:     linux-usb@vger.kernel.org
 S:     Maintained
 
+USB AUERSWALD DRIVER
+P:     Wolfgang Muees
+M:     wolfgang@iksw-muees.de
+L:      linux-usb@vger.kernel.org
+S:     Maintained
+
 USB BLOCK DRIVER (UB ub)
 P:     Pete Zaitcev
 M:     zaitcev@redhat.com
@@ -4006,12 +4023,6 @@ S:       Maintained
 W:     http://geocities.com/i0xox0i
 W:     http://firstlight.net/cvs
 
-USB AUERSWALD DRIVER
-P:     Wolfgang Muees
-M:     wolfgang@iksw-muees.de
-L:      linux-usb@vger.kernel.org
-S:     Maintained
-
 USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
 P:     Gary Brubaker
 M:     xavyer@ix.netcom.com
index f45f28cc10da94e24c4add02315f950f9787ec37..3f6265f2d9d4749a032bb28e325622bc92d81a1f 100644 (file)
@@ -7,15 +7,6 @@ config EARLY_PRINTK
        depends on ALPHA_GENERIC || ALPHA_SRM
        default y
 
-config DEBUG_RWLOCK
-       bool "Read-write spinlock debugging"
-       depends on DEBUG_KERNEL
-       help
-         If you say Y here then read-write lock processing will count how many
-         times it has tried to get the lock and issue an error message after
-         too many attempts.  If you suspect a rwlock problem or a kernel
-         hacker asks for this option then say Y.  Otherwise say N.
-
 config ALPHA_LEGACY_START_ADDRESS
        bool "Legacy kernel start address"
        depends on ALPHA_GENERIC
index 6da9c3dbde448fd38f737560bb919f0eb8186022..e43f68fd66b0d5fae206f3935492938f33e48941 100644 (file)
@@ -882,7 +882,6 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_INFO=y
 CONFIG_EARLY_PRINTK=y
-# CONFIG_DEBUG_RWLOCK is not set
 # CONFIG_DEBUG_SEMAPHORE is not set
 CONFIG_ALPHA_LEGACY_START_ADDRESS=y
 CONFIG_MATHEMU=y
index 6413c5f232264dbc9b165489396dbb6987d42351..72f9a619a66d8055b03df676979b0645879c7160 100644 (file)
@@ -430,7 +430,7 @@ sys_getpagesize(void)
 asmlinkage unsigned long
 sys_getdtablesize(void)
 {
-       return NR_OPEN;
+       return sysctl_nr_open;
 }
 
 /*
index f4ab233201b296013c7c45511a953838d29226d8..63c2073401ee5ce9bf75cbe90f28bffb88cc8375 100644 (file)
@@ -77,10 +77,6 @@ int smp_num_probed;          /* Internal processor count */
 int smp_num_cpus = 1;          /* Number that came online.  */
 EXPORT_SYMBOL(smp_num_cpus);
 
-extern void calibrate_delay(void);
-
-\f
-
 /*
  * Called by both boot and secondaries to move global data into
  *  per-processor storage.
index aa29ea58ca09ee9b99286b78a022264d800c71bc..0ce38dfa6ebe3cdc1e3140a9cc030b99707feb24 100644 (file)
@@ -383,6 +383,7 @@ static void at91_lcdc_tft_power_control(int on)
 }
 
 static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
+       .lcdcon_is_backlight            = true,
        .default_bpp                    = 16,
        .default_dmacon                 = ATMEL_LCDC_DMAEN,
        .default_lcdcon2                = AT91SAM9261_DEFAULT_TFT_LCDCON2,
index f09347a86e7116c31d59c43468b1b749b8adba85..38313abef657d0a01684634c3aaf43eba6e82c2b 100644 (file)
@@ -253,6 +253,7 @@ static void at91_lcdc_power_control(int on)
 
 /* Driver datas */
 static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
+       .lcdcon_is_backlight            = true,
        .default_bpp                    = 16,
        .default_dmacon                 = ATMEL_LCDC_DMAEN,
        .default_lcdcon2                = AT91SAM9263_DEFAULT_LCDCON2,
index a454451c97c36ea77ee9abb2a74e6b9f99ff0f6e..eca558c6bf5d1d121b18e89e68279c3f99c0706b 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/serial_8250.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 
 #include <asm/elf.h>
 #include <asm/io.h>
index 75c81f2dd0b3a623fb19722dc961bd99e788ccc3..478bda4c4a09a9ac57f119b4c8529d970cbc48e2 100644 (file)
@@ -293,6 +293,6 @@ sys_call_table:
        .long   sys_shmctl
        .long   sys_utimensat
        .long   sys_signalfd
-       .long   sys_timerfd             /* 280 */
+       .long   sys_ni_syscall          /* 280, was sys_timerfd */
        .long   sys_eventfd
        .long   sys_ni_syscall          /* r8 is saturated at nr_syscalls */
index b3bc0b56e2c6506849de3ba758aae262f552f477..9aa8800830f396b8ef4fb79a4186b1f9b95dc60a 100644 (file)
 
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/timex.h>
 #include <linux/param.h>
 #include <linux/types.h>
+#include <linux/init.h>
 
 #include <asm/processor.h>
 #include <asm/sysreg.h>
 
-int read_current_timer(unsigned long *timer_value)
+int __devinit read_current_timer(unsigned long *timer_value)
 {
        *timer_value = sysreg_read(COUNT);
        return 0;
index f8c411a24af79e6767c0f834a1daf6d0b4f5f61c..1795aab79064c1ce468cd92d053bc46b0fd7f430 100644 (file)
@@ -37,7 +37,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/usb/sl811.h>
index a72c7a620fa1ddbf0dc228e441700aa64f7c156f..97378b0a975308047004fb89eb2768038968597f 100644 (file)
@@ -38,7 +38,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 
 #include <asm/dma.h>
index 21df2f3754975b44ae60746ebe93ddbcfcee7ad6..886f260d9359f35b9e754ecab4eccccbd35ceb94 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/usb/isp1362.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
index c37dd45c8803fad0817b0eef3e47433e57264a3b..4026c2f3ab4e19e1d9558028b98575bcb7095acc 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/usb/isp1362.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
index ac52b040b336f13fafee8bda080479880c146b5f..0185350feacc165768899bd959a4cd946549a53b 100644 (file)
@@ -38,7 +38,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
index 8703b67d5ec66c95af77c7b2e8773a05fd279041..f7c1f964f13b1a42d38bd14e81dfe5f4c70ca12c 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/usb/isp1362.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
index 3e52f3f5bd5888b7aa0e0d0c7b10242531a011ec..8a3397db1d212ec35dc10b08d71bc0d1026c494a 100644 (file)
@@ -38,7 +38,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/usb/sl811.h>
index b8bbba85af536286e34e6f17cf23e4760e08d70b..d71e0be339212c752a14aeea214ee7d1b72f654f 100644 (file)
@@ -10,7 +10,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb_isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/usb_sl811.h>
index 772541548b7623d4e0fd2871fe053471559e206c..119e6ea833848a6b8498a48babf1bd668d718d2b 100644 (file)
@@ -38,7 +38,7 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/usb/sl811.h>
index 3a79a9061bdc8309cf6f53e0c3af637068270954..bf9e738a7c6451938a3254039e324c68cc71ff85 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/usb/isp1362.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
index 7601c3be1b5c3a70256d8d7d3af091261a7a88d6..ed863ce9a2d8c13042160d0cba4d4bc7288f5291 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/spi/spi.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/portmux.h>
index 99046b1f51c8f733c5c406f9985f7a3a3414a21e..ca6a345b87e401f7309e89c0a41702a91f38a35d 100644 (file)
@@ -1494,7 +1494,7 @@ sys_call_table:
        .long sys_epoll_pwait
        .long sys_utimensat             /* 320 */
        .long sys_signalfd
-       .long sys_timerfd
+       .long sys_ni_syscall
        .long sys_eventfd
        .long sys_fallocate
 
index a74c08786b21a8500067c2b442cb08b0b2c41daf..b38ae1fc15fd701728d67e30e37d7370a146a2ce 100644 (file)
@@ -708,7 +708,7 @@ static void __init reserve_dma_coherent(void)
 /*
  * calibrate the delay loop
  */
-void __init calibrate_delay(void)
+void __cpuinit calibrate_delay(void)
 {
        loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ);
 
index 8dec4dd57b4e06ff44f26da88a0f9d89d8b954da..5a1b4cfea05b37660fbf54d57016bb06e67be6e7 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/random.h>
 #include <linux/bootmem.h>
 #include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #include <asm/system.h>
 #include <asm/traps.h>
index 480b1a5085d542d22618b29a7e763e8f8f3904d6..32ee5979a042c35e120ea1bc9fa0acd49bb411c8 100644 (file)
@@ -120,7 +120,6 @@ static volatile unsigned long go[SLAVE + 1];
 
 #define DEBUG_ITC_SYNC 0
 
-extern void __devinit calibrate_delay (void);
 extern void start_ap (void);
 extern unsigned long ia64_iobase;
 
@@ -477,7 +476,7 @@ start_secondary (void *unused)
        return 0;
 }
 
-struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
+struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
 {
        return NULL;
 }
index ab3eaf85fe4d40d3a273ca101e132574f21e74bf..2c676cc05418a76f60a3d888cad8eb9006347de6 100644 (file)
@@ -100,11 +100,11 @@ u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
 static irqreturn_t
 pcibr_error_intr_handler(int irq, void *arg)
 {
-       struct pcibus_info *soft = (struct pcibus_info *)arg;
+       struct pcibus_info *soft = arg;
 
-       if (sal_pcibr_error_interrupt(soft) < 0) {
+       if (sal_pcibr_error_interrupt(soft) < 0)
                panic("pcibr_error_intr_handler(): Fatal Bridge Error");
-       }
+
        return IRQ_HANDLED;
 }
 
index 95aa79874847135989d141c7aa6bf52f3a3ed2cf..aa3bf4cfab37cd8b0f999ba5211baeef6ebae3c3 100644 (file)
@@ -321,6 +321,6 @@ ENTRY(sys_call_table)
        .long sys_epoll_pwait
        .long sys_utimensat             /* 320 */
        .long sys_signalfd
-       .long sys_timerfd
+       .long sys_ni_syscall
        .long sys_eventfd
        .long sys_fallocate
index d10726f9038b91606bf894c472703f383a81baf9..cbe36538af47be5cd2914fe7172ad2ea0f96c026 100644 (file)
@@ -32,12 +32,10 @@ void __init amiga_chip_init(void)
     if (!AMIGAHW_PRESENT(CHIP_RAM))
        return;
 
-#ifndef CONFIG_APUS_FAST_EXCEPT
     /*
      *  Remove the first 4 pages where PPC exception handlers will be located
      */
     amiga_chip_size -= 0x4000;
-#endif
     chipram_res.end = amiga_chip_size-1;
     request_resource(&iomem_resource, &chipram_res);
 
index c4a4ffd45bc0feeb68c8f84ff3332e1ac7bc4dd9..343fab49bd9a751435ae710bd4e848c9b6abd6ec 100644 (file)
@@ -84,7 +84,7 @@ unsigned char cia_able_irq(struct ciabase *base, unsigned char mask)
 
 static irqreturn_t cia_handler(int irq, void *dev_id)
 {
-       struct ciabase *base = (struct ciabase *)dev_id;
+       struct ciabase *base = dev_id;
        int mach_irq;
        unsigned char ints;
 
index 0d5577569e4c7230b42db6ebcfe7968ce24f6474..b50dbcad47464534688b7414997d488e4ba721bd 100644 (file)
@@ -1,6 +1,5 @@
 
 #include <linux/types.h>
-#include <linux/autoconf.h>
 
 void * memcpy(void * to, const void * from, size_t n)
 {
index 8527856aec45c2c36dff1a15b83ef2d12ca97571..0b658f1db4cedde3021e4eea3916091b36e4ab87 100644 (file)
@@ -27,7 +27,6 @@
  *     others have a second one : GPIO2
  */
 
-#include <linux/autoconf.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/types.h>
index 1e5dfc28294a48efac28259fc610c37db4b257e0..9d41dab90a809732e1c2eab6ed234e989d5637cd 100644 (file)
@@ -52,7 +52,6 @@ int __cpu_logical_map[NR_CPUS];               /* Map logical to physical */
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-extern void __init calibrate_delay(void);
 extern void cpu_idle(void);
 
 /* Number of TCs (or siblings in Intel speak) per CPU core */
index 4c477c7ff74a1388c21a85392ed19ac7033cbeec..22fd41e946b28c3d9e2a8a853c4951bcada5b629 100644 (file)
@@ -356,7 +356,7 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
                        retval = NGROUPS_MAX;
                        goto out;
                case 5:
-                       retval = NR_OPEN;
+                       retval = sysctl_nr_open;
                        goto out;
                case 6:
                        retval = 1;
index 9166bd1172675c2cbadd1c80de98042005e6c30b..bc989e522a045c17ca4514478b7cb5ef9d77fc4d 100644 (file)
@@ -2,15 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_RWLOCK
-        bool "Read-write spinlock debugging"
-        depends on DEBUG_KERNEL && SMP
-        help
-          If you say Y here then read-write lock processing will count how many
-          times it has tried to get the lock and issue an error message after
-          too many attempts.  If you suspect a rwlock problem or a kernel
-          hacker asks for this option then say Y.  Otherwise say N.
-
 config DEBUG_RODATA
        bool "Write protect kernel read-only data structures"
        depends on DEBUG_KERNEL
index ea071218a3ed2cf68b4e1e98e7fa91ac2355101b..ddacc72e38fb8e92b1bac2a1d5cc30743924f75d 100644 (file)
@@ -1050,7 +1050,6 @@ CONFIG_SCHED_DEBUG=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
-# CONFIG_DEBUG_RWLOCK is not set
 # CONFIG_DEBUG_RODATA is not set
 
 #
index 5cd3db5cae415198653a8d1a4e4bce846a7a40ef..3b26fbd6bec9ee4978ff6430ce1ef27a55723089 100644 (file)
@@ -66,6 +66,7 @@
 #include <asm/smp.h>
 #include <asm/vdso_datapage.h>
 #include <asm/firmware.h>
+#include <asm/cputime.h>
 #ifdef CONFIG_PPC_ISERIES
 #include <asm/iseries/it_lp_queue.h>
 #include <asm/iseries/hv_call_xm.h>
@@ -189,6 +190,8 @@ u64 __cputime_sec_factor;
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
+DEFINE_PER_CPU(unsigned long, cputime_last_delta);
+DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static void calc_cputime_factors(void)
 {
@@ -257,8 +260,8 @@ void account_system_vtime(struct task_struct *tsk)
        }
        account_system_time(tsk, 0, delta);
        account_system_time_scaled(tsk, deltascaled);
-       get_paca()->purrdelta = delta;
-       get_paca()->spurrdelta = deltascaled;
+       per_cpu(cputime_last_delta, smp_processor_id()) = delta;
+       per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
        local_irq_restore(flags);
 }
 
@@ -276,10 +279,7 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
        get_paca()->user_time = 0;
        account_user_time(tsk, utime);
 
-       /* Estimate the scaled utime by scaling the real utime based
-        * on the last spurr to purr ratio */
-       utimescaled = utime * get_paca()->spurrdelta / get_paca()->purrdelta;
-       get_paca()->spurrdelta = get_paca()->purrdelta = 0;
+       utimescaled = cputime_to_scaled(utime);
        account_user_time_scaled(tsk, utimescaled);
 }
 
index c04abcc28a7a88060a9cb6be50922c9ef41bd4a9..792d3ce8112e0778425cfc1f3531db3fb8e69776 100644 (file)
@@ -113,8 +113,6 @@ static inline void debug_calc_bogomips(void)
         * result. We backup/restore the value to avoid affecting the
         * core cpufreq framework's own calculation.
         */
-       extern void calibrate_delay(void);
-
        unsigned long save_lpj = loops_per_jiffy;
        calibrate_delay();
        loops_per_jiffy = save_lpj;
index 25ef55bacd99e50545caf74b8a493b15622425a6..ec1defea9c1e4885fe974722c8dc8cb00d45eac3 100644 (file)
@@ -418,7 +418,7 @@ scc_enet_rx(struct net_device *dev)
        struct  sk_buff *skb;
        ushort  pkt_len;
 
-       cep = (struct scc_enet_private *)dev->priv;
+       cep = dev->priv;
 
        /* First, grab all of the stats for the incoming packet.
         * These get messed up if we get called due to a busy condition.
index a3a27dafff1fc73fc3d1ebc777213fc3a9819598..bcc3aa9d04f397fa62f7ef83fef80262c2eba942 100644 (file)
@@ -682,7 +682,7 @@ fcc_enet_rx(struct net_device *dev)
        struct  sk_buff *skb;
        ushort  pkt_len;
 
-       cep = (struct fcc_enet_private *)dev->priv;
+       cep = dev->priv;
 
        /* First, grab all of the stats for the incoming packet.
         * These get messed up if we get called due to a busy condition.
index 52b64fcbdfc50d493a76bef799400e2365cdd15e..8a24bc47eb6cc76f52496d0efd9417f827c0c586 100644 (file)
@@ -143,11 +143,6 @@ SECTIONS
 
   . = ALIGN(4096);
   __init_end = .;
-
-  . = ALIGN(4096);
-  _sextratext = .;
-  _eextratext = .;
-
   __bss_start = .;
   .bss       :
   {
index 3c56654bfc6f28580a42a7e4cc4a043dcd8e300d..38449855d5ffbede401cf147a5d8af8a76abc086 100644 (file)
@@ -91,20 +91,11 @@ extern void prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi
 #define cached_21      (((char *)(ppc_cached_irq_mask))[3])
 #define cached_A1      (((char *)(ppc_cached_irq_mask))[2])
 
-#ifdef CONFIG_SOUND_CS4232
-long ppc_cs4232_dma, ppc_cs4232_dma2;
-#endif
-
 extern PTE *Hash, *Hash_end;
 extern unsigned long Hash_size, Hash_mask;
 extern int probingmem;
 extern unsigned long loops_per_jiffy;
 
-#ifdef CONFIG_SOUND_CS4232
-EXPORT_SYMBOL(ppc_cs4232_dma);
-EXPORT_SYMBOL(ppc_cs4232_dma2);
-#endif
-
 /* useful ISA ports */
 #define PREP_SYSCTL    0x81c
 /* present in the IBM reference design; possibly identical in Mot boxes: */
@@ -569,74 +560,6 @@ prep_show_percpuinfo(struct seq_file *m, int i)
        return 0;
 }
 
-#ifdef CONFIG_SOUND_CS4232
-static long __init masktoint(unsigned int i)
-{
-       int t = -1;
-       while (i >> ++t)
-               ;
-       return (t-1);
-}
-
-/*
- * ppc_cs4232_dma and ppc_cs4232_dma2 are used in include/asm/dma.h
- * to distinguish sound dma-channels from others. This is because
- * blocksize on 16 bit dma-channels 5,6,7 is 128k, but
- * the cs4232.c uses 64k like on 8 bit dma-channels 0,1,2,3
- */
-
-static void __init prep_init_sound(void)
-{
-       PPC_DEVICE *audiodevice = NULL;
-
-       /*
-        * Get the needed resource information from residual data.
-        *
-        */
-       if (have_residual_data)
-               audiodevice = residual_find_device(~0, NULL,
-                               MultimediaController, AudioController, -1, 0);
-
-       if (audiodevice != NULL) {
-               PnP_TAG_PACKET *pkt;
-
-               pkt = PnP_find_packet((unsigned char *)&res->DevicePnPHeap[audiodevice->AllocatedOffset],
-                               S5_Packet, 0);
-               if (pkt != NULL)
-                       ppc_cs4232_dma = masktoint(pkt->S5_Pack.DMAMask);
-               pkt = PnP_find_packet((unsigned char*)&res->DevicePnPHeap[audiodevice->AllocatedOffset],
-                               S5_Packet, 1);
-               if (pkt != NULL)
-                       ppc_cs4232_dma2 = masktoint(pkt->S5_Pack.DMAMask);
-       }
-
-       /*
-        * These are the PReP specs' defaults for the cs4231.  We use these
-        * as fallback incase we don't have residual data.
-        * At least the IBM Thinkpad 850 with IDE DMA Channels at 6 and 7
-        * will use the other values.
-        */
-       if (audiodevice == NULL) {
-               switch (_prep_type) {
-               case _PREP_IBM:
-                       ppc_cs4232_dma = 1;
-                       ppc_cs4232_dma2 = -1;
-                       break;
-               default:
-                       ppc_cs4232_dma = 6;
-                       ppc_cs4232_dma2 = 7;
-               }
-       }
-
-       /*
-        * Find a way to push this information to the cs4232 driver
-        * Give it out with printk, when not in cmd_line?
-        * Append it to cmd_line and boot_command_line?
-        * Format is cs4232=io,irq,dma,dma2
-        */
-}
-#endif /* CONFIG_SOUND_CS4232 */
-
 /*
  * Fill out screen_info according to the residual data. This allows us to use
  * at least vesafb.
@@ -898,10 +821,6 @@ prep_setup_arch(void)
                }
        }
 
-#ifdef CONFIG_SOUND_CS4232
-       prep_init_sound();
-#endif /* CONFIG_SOUND_CS4232 */
-
        prep_init_vesa();
 
        switch (_prep_type) {
index eda71763ecc5281c1173012d9767a18f7300c580..2b708ec7255868981874b87354fae33661529376 100644 (file)
@@ -14,7 +14,7 @@
  */
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/pm.h>
 #include <linux/mm.h>
 #include <asm/machvec.h>
index 9c830fdc411b346b056ed2b5885bcae750adcc26..c74440d38ee974aa40482ed5a2af56334f25e9a1 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <asm/machvec.h>
 #include <asm/addrspace.h>
 #include <asm/lboxre2.h>
index a43b47726f545539467a8325c845648cea01b300..f7a8d5c9d510577f085f0ac3f96bcf5ffeb10cc7 100644 (file)
@@ -15,7 +15,7 @@
  */
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/types.h>
 #include <net/ax88796.h>
 #include <asm/machvec.h>
index 3452b072addece1706a68720e48c32bd52e83c54..a0ef81b7de3743e42c6933dc5f2e82481f0f89c6 100644 (file)
@@ -10,7 +10,7 @@
  */
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <linux/serial_8250.h>
 #include <linux/sm501.h>
 #include <linux/sm501-regs.h>
index 5df32f2018703a557ed7fc63b39d565f6d8457aa..acc5932587f11ad994793d1f5d6941b2aa8bcdc3 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <asm/machvec.h>
 #include <asm/sdk7780.h>
 #include <asm/heartbeat.h>
index eb97dca5b736c4fce596c74c55476ace350b3424..b1a3d9d0172f50678c5add2c1388bb5094afbcf2 100644 (file)
@@ -12,7 +12,7 @@
  */
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pata_platform.h>
+#include <linux/ata_platform.h>
 #include <asm/machvec.h>
 #include <asm/se7722.h>
 #include <asm/io.h>
index 10bec45415ba0c09f856533418f1775e4e94eb96..719e127a7c05921be389465d2630c6821700603d 100644 (file)
@@ -338,6 +338,6 @@ ENTRY(sys_call_table)
        .long sys_epoll_pwait
        .long sys_utimensat             /* 320 */
        .long sys_signalfd
-       .long sys_timerfd
+       .long sys_ni_syscall
        .long sys_eventfd
        .long sys_fallocate
index 98a93efe36911a040084565d4ce09936b06b2ff7..12c7340356ae4bb78819e83cf8fa11fef0939217 100644 (file)
@@ -376,6 +376,6 @@ sys_call_table:
        .long sys_epoll_pwait
        .long sys_utimensat
        .long sys_signalfd
-       .long sys_timerfd               /* 350 */
+       .long sys_ni_syscall            /* 350 */
        .long sys_eventfd
        .long sys_fallocate
index 89a6de95070c761d0fe3237bc89a49f2063fc1fb..0def48158c7d165ca34688a51053205372e79cf4 100644 (file)
 #include <linux/mm.h>
 #include <linux/swap.h>
 #include <linux/profile.h>
+#include <linux/delay.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
 #include <asm/irq_regs.h>
 
-#include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
@@ -41,8 +41,6 @@
 
 extern ctxd_t *srmmu_ctx_table_phys;
 
-extern void calibrate_delay(void);
-
 static volatile int smp_processors_ready = 0;
 static int smp_highest_cpu;
 extern volatile unsigned long cpu_callin_map[NR_CPUS];
index 730eb5796f8edb98b83332e4a9099996ca1e3083..0b94072671623287c6c819fb4f405b18a0bb7038 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/mm.h>
 #include <linux/swap.h>
 #include <linux/profile.h>
+#include <linux/delay.h>
+
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/irq_regs.h>
@@ -23,7 +25,6 @@
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
 
-#include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
@@ -39,8 +40,6 @@
 
 extern ctxd_t *srmmu_ctx_table_phys;
 
-extern void calibrate_delay(void);
-
 extern volatile unsigned long cpu_callin_map[NR_CPUS];
 extern unsigned char boot_cpu_id;
 
index ee010f4532a0dd3979b764b99f0b775f795f61d3..9064485dc40be66266882a5fd3a13531344610d1 100644 (file)
@@ -79,7 +79,8 @@ sys_call_table:
 /*295*/        .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
 /*300*/        .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
 /*305*/        .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
-/*310*/        .long sys_utimensat, sys_signalfd, sys_ni_syscall, sys_eventfd, sys_fallocate
+/*310*/        .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
+/*315*/        .long sys_timerfd_settime, sys_timerfd_gettime
 
 #ifdef CONFIG_SUNOS_EMUL
        /* Now the SunOS syscall table. */
@@ -197,6 +198,7 @@ sunos_sys_table:
        .long sunos_nosys, sunos_nosys, sunos_nosys
        .long sunos_nosys
 /*310*/        .long sunos_nosys, sunos_nosys, sunos_nosys
-       .long sunos_nosys, sunos_nosys
+       .long sunos_nosys, sunos_nosys, sunos_nosys
+       .long sunos_nosys
 
 #endif
index f62d9f6c5e2a8d45519b1dba2a454e1faa718d1a..833d74b2b1923faa08e95c3604f2bbb5a7dddb86 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc4
-# Tue Dec  4 00:37:59 2007
+# Linux kernel version: 2.6.24
+# Tue Feb  5 17:28:19 2008
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -17,6 +17,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_AUDIT_ARCH=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_OF=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
@@ -30,13 +31,15 @@ CONFIG_HZ_100=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+CONFIG_HOTPLUG_CPU=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # General setup
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
@@ -76,6 +79,7 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -83,6 +87,14 @@ CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
@@ -92,6 +104,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_BLK_DEV_BSG=y
@@ -109,6 +122,8 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_GENERIC_HARDIRQS=y
 
@@ -119,7 +134,8 @@ CONFIG_TICK_ONESHOT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-# CONFIG_SMP is not set
+CONFIG_SMP=y
+CONFIG_NR_CPUS=64
 # CONFIG_CPU_FREQ is not set
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -169,9 +185,12 @@ CONFIG_BINFMT_ELF32=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 CONFIG_SOLARIS_EMUL=y
+CONFIG_SCHED_SMT=y
+CONFIG_SCHED_MC=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_PREEMPT is not set
+# CONFIG_RCU_TRACE is not set
 # CONFIG_CMDLINE_BOOL is not set
 
 #
@@ -189,6 +208,7 @@ CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 # CONFIG_XFRM_SUB_POLICY is not set
 CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
 CONFIG_NET_KEY=m
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
@@ -249,9 +269,9 @@ CONFIG_IP_DCCP_ACKVEC=y
 CONFIG_IP_DCCP_CCID2=m
 # CONFIG_IP_DCCP_CCID2_DEBUG is not set
 CONFIG_IP_DCCP_CCID3=m
-CONFIG_IP_DCCP_TFRC_LIB=m
 # CONFIG_IP_DCCP_CCID3_DEBUG is not set
 CONFIG_IP_DCCP_CCID3_RTO=100
+CONFIG_IP_DCCP_TFRC_LIB=m
 
 #
 # DCCP Kernel Hacking
@@ -279,6 +299,7 @@ CONFIG_VLAN_8021Q=m
 CONFIG_NET_PKTGEN=m
 CONFIG_NET_TCPPROBE=m
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
@@ -343,6 +364,7 @@ CONFIG_BLK_DEV_IDE=y
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
 CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
@@ -359,7 +381,6 @@ CONFIG_IDE_GENERIC=y
 # PCI IDE chipsets support
 #
 CONFIG_BLK_DEV_IDEPCI=y
-# CONFIG_IDEPCI_SHARE_IRQ is not set
 CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
@@ -389,7 +410,6 @@ CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_BLK_DEV_TC86C001 is not set
-# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_IDE_ARCH_OBSOLETE_INIT=y
 # CONFIG_BLK_DEV_HD is not set
@@ -501,7 +521,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -533,6 +552,7 @@ CONFIG_NET_PCI=y
 # CONFIG_NE2K_PCI is not set
 # CONFIG_8139CP is not set
 # CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -545,6 +565,9 @@ CONFIG_E1000=m
 CONFIG_E1000_NAPI=y
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
 # CONFIG_E1000E is not set
+# CONFIG_E1000E_ENABLED is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_MYRI_SBUS is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
@@ -570,6 +593,7 @@ CONFIG_NETDEV_10000=y
 CONFIG_NIU=m
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
 # CONFIG_TR is not set
 
 #
@@ -602,7 +626,6 @@ CONFIG_PPPOE=m
 # CONFIG_SLIP is not set
 CONFIG_SLHC=m
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -679,6 +702,7 @@ CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -747,13 +771,13 @@ CONFIG_I2C_ALGOBIT=y
 #
 # Miscellaneous I2C Chip support
 #
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
 # CONFIG_DS1682 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
@@ -990,6 +1014,7 @@ CONFIG_SND_ALI5451=m
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
 # CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_OXYGEN is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
 # CONFIG_SND_DARLA20 is not set
@@ -1014,6 +1039,7 @@ CONFIG_SND_ALI5451=m
 # CONFIG_SND_HDA_INTEL is not set
 # CONFIG_SND_HDSP is not set
 # CONFIG_SND_HDSPM is not set
+# CONFIG_SND_HIFIER is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
@@ -1031,6 +1057,7 @@ CONFIG_SND_ALI5451=m
 # CONFIG_SND_TRIDENT is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VIRTUOSO is not set
 # CONFIG_SND_VX222 is not set
 # CONFIG_SND_YMFPCI is not set
 # CONFIG_SND_AC97_POWER_SAVE is not set
@@ -1057,6 +1084,10 @@ CONFIG_SND_SUN_CS4231=m
 # SoC Audio support for SuperH
 #
 
+#
+# ALSA SoC audio for Freescale SOCs
+#
+
 #
 # Open Sound System
 #
@@ -1080,6 +1111,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
 # CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
@@ -1093,7 +1125,6 @@ CONFIG_USB_DEVICEFS=y
 # USB Host Controller Drivers
 #
 CONFIG_USB_EHCI_HCD=m
-# CONFIG_USB_EHCI_SPLIT_ISO is not set
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_ISP116X_HCD is not set
@@ -1143,10 +1174,6 @@ CONFIG_USB_STORAGE=m
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 # CONFIG_USB_SERIAL is not set
 
 #
@@ -1172,14 +1199,6 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
 # CONFIG_NEW_LEDS is not set
@@ -1332,11 +1351,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 # CONFIG_DLM is not set
-CONFIG_INSTRUMENTATION=y
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
-CONFIG_KPROBES=y
-# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
@@ -1374,6 +1388,8 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_LKDTM is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
@@ -1396,8 +1412,9 @@ CONFIG_ASYNC_MEMCPY=m
 CONFIG_ASYNC_XOR=m
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_HMAC=y
@@ -1416,6 +1433,9 @@ CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_FCRYPT=m
@@ -1431,13 +1451,16 @@ CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_ANUBIS=m
 CONFIG_CRYPTO_SEED=m
+# CONFIG_CRYPTO_SALSA20 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
index ef50d217432f151f1ab3ed6e701d3ed2281c9afd..4b78b24ef413744c579d935355f6a3c0c0d06cda 100644 (file)
@@ -11,7 +11,7 @@ obj-y         := process.o setup.o cpu.o idprom.o \
                   traps.o auxio.o una_asm.o sysfs.o iommu.o \
                   irq.o ptrace.o time.o sys_sparc.o signal.o \
                   unaligned.o central.o pci.o starfire.o semaphore.o \
-                  power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
+                  power.o sbus.o sparc64_ksyms.o chmc.o \
                   visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
 
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
index 4b9115a4d92ecf909d17a0a5e5c1964b450dfe35..5623a4d59dff0a642ca0e468527214d9b456384a 100644 (file)
@@ -472,94 +472,15 @@ static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr,
        spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-#define SG_ENT_PHYS_ADDRESS(SG)        (__pa(sg_virt((SG))))
-
-static void fill_sg(iopte_t *iopte, struct scatterlist *sg,
-                   int nused, int nelems,
-                   unsigned long iopte_protection)
-{
-       struct scatterlist *dma_sg = sg;
-       int i;
-
-       for (i = 0; i < nused; i++) {
-               unsigned long pteval = ~0UL;
-               u32 dma_npages;
-
-               dma_npages = ((dma_sg->dma_address & (IO_PAGE_SIZE - 1UL)) +
-                             dma_sg->dma_length +
-                             ((IO_PAGE_SIZE - 1UL))) >> IO_PAGE_SHIFT;
-               do {
-                       unsigned long offset;
-                       signed int len;
-
-                       /* If we are here, we know we have at least one
-                        * more page to map.  So walk forward until we
-                        * hit a page crossing, and begin creating new
-                        * mappings from that spot.
-                        */
-                       for (;;) {
-                               unsigned long tmp;
-
-                               tmp = SG_ENT_PHYS_ADDRESS(sg);
-                               len = sg->length;
-                               if (((tmp ^ pteval) >> IO_PAGE_SHIFT) != 0UL) {
-                                       pteval = tmp & IO_PAGE_MASK;
-                                       offset = tmp & (IO_PAGE_SIZE - 1UL);
-                                       break;
-                               }
-                               if (((tmp ^ (tmp + len - 1UL)) >> IO_PAGE_SHIFT) != 0UL) {
-                                       pteval = (tmp + IO_PAGE_SIZE) & IO_PAGE_MASK;
-                                       offset = 0UL;
-                                       len -= (IO_PAGE_SIZE - (tmp & (IO_PAGE_SIZE - 1UL)));
-                                       break;
-                               }
-                               sg = sg_next(sg);
-                               nelems--;
-                       }
-
-                       pteval = iopte_protection | (pteval & IOPTE_PAGE);
-                       while (len > 0) {
-                               *iopte++ = __iopte(pteval);
-                               pteval += IO_PAGE_SIZE;
-                               len -= (IO_PAGE_SIZE - offset);
-                               offset = 0;
-                               dma_npages--;
-                       }
-
-                       pteval = (pteval & IOPTE_PAGE) + len;
-                       sg = sg_next(sg);
-                       nelems--;
-
-                       /* Skip over any tail mappings we've fully mapped,
-                        * adjusting pteval along the way.  Stop when we
-                        * detect a page crossing event.
-                        */
-                       while (nelems &&
-                              (pteval << (64 - IO_PAGE_SHIFT)) != 0UL &&
-                              (pteval == SG_ENT_PHYS_ADDRESS(sg)) &&
-                              ((pteval ^
-                                (SG_ENT_PHYS_ADDRESS(sg) + sg->length - 1UL)) >> IO_PAGE_SHIFT) == 0UL) {
-                               pteval += sg->length;
-                               sg = sg_next(sg);
-                               nelems--;
-                       }
-                       if ((pteval << (64 - IO_PAGE_SHIFT)) == 0UL)
-                               pteval = ~0UL;
-               } while (dma_npages != 0);
-               dma_sg = sg_next(dma_sg);
-       }
-}
-
 static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
                         int nelems, enum dma_data_direction direction)
 {
-       struct iommu *iommu;
+       unsigned long flags, ctx, i, npages, iopte_protection;
+       struct scatterlist *sg;
        struct strbuf *strbuf;
-       unsigned long flags, ctx, npages, iopte_protection;
+       struct iommu *iommu;
        iopte_t *base;
        u32 dma_base;
-       struct scatterlist *sgtmp;
-       int used;
 
        /* Fast path single entry scatterlists. */
        if (nelems == 1) {
@@ -578,11 +499,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
        if (unlikely(direction == DMA_NONE))
                goto bad_no_ctx;
 
-       /* Step 1: Prepare scatter list. */
-
-       npages = prepare_sg(dev, sglist, nelems);
-
-       /* Step 2: Allocate a cluster and context, if necessary. */
+       npages = calc_npages(sglist, nelems);
 
        spin_lock_irqsave(&iommu->lock, flags);
 
@@ -599,18 +516,6 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
        dma_base = iommu->page_table_map_base +
                ((base - iommu->page_table) << IO_PAGE_SHIFT);
 
-       /* Step 3: Normalize DMA addresses. */
-       used = nelems;
-
-       sgtmp = sglist;
-       while (used && sgtmp->dma_length) {
-               sgtmp->dma_address += dma_base;
-               sgtmp = sg_next(sgtmp);
-               used--;
-       }
-       used = nelems - used;
-
-       /* Step 4: Create the mappings. */
        if (strbuf->strbuf_enabled)
                iopte_protection = IOPTE_STREAMING(ctx);
        else
@@ -618,13 +523,27 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
        if (direction != DMA_TO_DEVICE)
                iopte_protection |= IOPTE_WRITE;
 
-       fill_sg(base, sglist, used, nelems, iopte_protection);
+       for_each_sg(sglist, sg, nelems, i) {
+               unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg);
+               unsigned long slen = sg->length;
+               unsigned long this_npages;
 
-#ifdef VERIFY_SG
-       verify_sglist(sglist, nelems, base, npages);
-#endif
+               this_npages = iommu_num_pages(paddr, slen);
 
-       return used;
+               sg->dma_address = dma_base | (paddr & ~IO_PAGE_MASK);
+               sg->dma_length = slen;
+
+               paddr &= IO_PAGE_MASK;
+               while (this_npages--) {
+                       iopte_val(*base) = iopte_protection | paddr;
+
+                       base++;
+                       paddr += IO_PAGE_SIZE;
+                       dma_base += IO_PAGE_SIZE;
+               }
+       }
+
+       return nelems;
 
 bad:
        iommu_free_ctx(iommu, ctx);
@@ -637,11 +556,10 @@ bad_no_ctx:
 static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
                            int nelems, enum dma_data_direction direction)
 {
-       struct iommu *iommu;
+       unsigned long flags, ctx, i, npages;
        struct strbuf *strbuf;
+       struct iommu *iommu;
        iopte_t *base;
-       unsigned long flags, ctx, i, npages;
-       struct scatterlist *sg, *sgprv;
        u32 bus_addr;
 
        if (unlikely(direction == DMA_NONE)) {
@@ -654,15 +572,7 @@ static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist,
 
        bus_addr = sglist->dma_address & IO_PAGE_MASK;
 
-       sgprv = NULL;
-       for_each_sg(sglist, sg, nelems, i) {
-               if (sg->dma_length == 0)
-                       break;
-               sgprv = sg;
-       }
-
-       npages = (IO_PAGE_ALIGN(sgprv->dma_address + sgprv->dma_length) -
-                 bus_addr) >> IO_PAGE_SHIFT;
+       npages = calc_npages(sglist, nelems);
 
        base = iommu->page_table +
                ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c
deleted file mode 100644 (file)
index 72a4acf..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/* $Id: iommu_common.c,v 1.9 2001/12/17 07:05:09 davem Exp $
- * iommu_common.c: UltraSparc SBUS/PCI common iommu code.
- *
- * Copyright (C) 1999 David S. Miller (davem@redhat.com)
- */
-
-#include <linux/dma-mapping.h>
-#include "iommu_common.h"
-
-/* You are _strongly_ advised to enable the following debugging code
- * any time you make changes to the sg code below, run it for a while
- * with filesystems mounted read-only before buying the farm... -DaveM
- */
-
-#ifdef VERIFY_SG
-static int verify_lengths(struct scatterlist *sglist, int nents, int npages)
-{
-       int sg_len, dma_len;
-       int i, pgcount;
-       struct scatterlist *sg;
-
-       sg_len = 0;
-       for_each_sg(sglist, sg, nents, i)
-               sg_len += sg->length;
-
-       dma_len = 0;
-       for_each_sg(sglist, sg, nents, i) {
-               if (!sg->dma_length)
-                       break;
-               dma_len += sg->dma_length;
-       }
-
-       if (sg_len != dma_len) {
-               printk("verify_lengths: Error, different, sg[%d] dma[%d]\n",
-                      sg_len, dma_len);
-               return -1;
-       }
-
-       pgcount = 0;
-       for_each_sg(sglist, sg, nents, i) {
-               unsigned long start, end;
-
-               if (!sg->dma_length)
-                       break;
-
-               start = sg->dma_address;
-               start = start & IO_PAGE_MASK;
-
-               end = sg->dma_address + sg->dma_length;
-               end = (end + (IO_PAGE_SIZE - 1)) & IO_PAGE_MASK;
-
-               pgcount += ((end - start) >> IO_PAGE_SHIFT);
-       }
-
-       if (pgcount != npages) {
-               printk("verify_lengths: Error, page count wrong, "
-                      "npages[%d] pgcount[%d]\n",
-                      npages, pgcount);
-               return -1;
-       }
-
-       /* This test passes... */
-       return 0;
-}
-
-static int verify_one_map(struct scatterlist *dma_sg, struct scatterlist **__sg, int nents, iopte_t **__iopte)
-{
-       struct scatterlist *sg = *__sg;
-       iopte_t *iopte = *__iopte;
-       u32 dlen = dma_sg->dma_length;
-       u32 daddr;
-       unsigned int sglen;
-       unsigned long sgaddr;
-
-       daddr = dma_sg->dma_address;
-       sglen = sg->length;
-       sgaddr = (unsigned long) sg_virt(sg);
-       while (dlen > 0) {
-               unsigned long paddr;
-
-               /* SG and DMA_SG must begin at the same sub-page boundary. */
-               if ((sgaddr & ~IO_PAGE_MASK) != (daddr & ~IO_PAGE_MASK)) {
-                       printk("verify_one_map: Wrong start offset "
-                              "sg[%08lx] dma[%08x]\n",
-                              sgaddr, daddr);
-                       nents = -1;
-                       goto out;
-               }
-
-               /* Verify the IOPTE points to the right page. */
-               paddr = iopte_val(*iopte) & IOPTE_PAGE;
-               if ((paddr + PAGE_OFFSET) != (sgaddr & IO_PAGE_MASK)) {
-                       printk("verify_one_map: IOPTE[%08lx] maps the "
-                              "wrong page, should be [%08lx]\n",
-                              iopte_val(*iopte), (sgaddr & IO_PAGE_MASK) - PAGE_OFFSET);
-                       nents = -1;
-                       goto out;
-               }
-
-               /* If this SG crosses a page, adjust to that next page
-                * boundary and loop.
-                */
-               if ((sgaddr & IO_PAGE_MASK) ^ ((sgaddr + sglen - 1) & IO_PAGE_MASK)) {
-                       unsigned long next_page, diff;
-
-                       next_page = (sgaddr + IO_PAGE_SIZE) & IO_PAGE_MASK;
-                       diff = next_page - sgaddr;
-                       sgaddr += diff;
-                       daddr += diff;
-                       sglen -= diff;
-                       dlen -= diff;
-                       if (dlen > 0)
-                               iopte++;
-                       continue;
-               }
-
-               /* SG wholly consumed within this page. */
-               daddr += sglen;
-               dlen -= sglen;
-
-               if (dlen > 0 && ((daddr & ~IO_PAGE_MASK) == 0))
-                       iopte++;
-
-               sg = sg_next(sg);
-               if (--nents <= 0)
-                       break;
-               sgaddr = (unsigned long) sg_virt(sg);
-               sglen = sg->length;
-       }
-       if (dlen < 0) {
-               /* Transfer overrun, big problems. */
-               printk("verify_one_map: Transfer overrun by %d bytes.\n",
-                      -dlen);
-               nents = -1;
-       } else {
-               /* Advance to next dma_sg implies that the next iopte will
-                * begin it.
-                */
-               iopte++;
-       }
-
-out:
-       *__sg = sg;
-       *__iopte = iopte;
-       return nents;
-}
-
-static int verify_maps(struct scatterlist *sg, int nents, iopte_t *iopte)
-{
-       struct scatterlist *dma_sg = sg;
-       struct scatterlist *orig_dma_sg = dma_sg;
-       int orig_nents = nents;
-
-       for (;;) {
-               nents = verify_one_map(dma_sg, &sg, nents, &iopte);
-               if (nents <= 0)
-                       break;
-               dma_sg = sg_next(dma_sg);
-               if (dma_sg->dma_length == 0)
-                       break;
-       }
-
-       if (nents > 0) {
-               printk("verify_maps: dma maps consumed by some sgs remain (%d)\n",
-                      nents);
-               return -1;
-       }
-
-       if (nents < 0) {
-               printk("verify_maps: Error, messed up mappings, "
-                      "at sg %d dma_sg %d\n",
-                      (int) (orig_nents + nents), (int) (dma_sg - orig_dma_sg));
-               return -1;
-       }
-
-       /* This test passes... */
-       return 0;
-}
-
-void verify_sglist(struct scatterlist *sglist, int nents, iopte_t *iopte, int npages)
-{
-       struct scatterlist *sg;
-
-       if (verify_lengths(sglist, nents, npages) < 0 ||
-           verify_maps(sglist, nents, iopte) < 0) {
-               int i;
-
-               printk("verify_sglist: Crap, messed up mappings, dumping, iodma at ");
-               printk("%016lx.\n", sglist->dma_address & IO_PAGE_MASK);
-
-               for_each_sg(sglist, sg, nents, i) {
-                       printk("sg(%d): page_addr(%p) off(%x) length(%x) "
-                              "dma_address[%016x] dma_length[%016x]\n",
-                              i,
-                              page_address(sg_page(sg)), sg->offset,
-                              sg->length,
-                              sg->dma_address, sg->dma_length);
-               }
-       }
-
-       /* Seems to be ok */
-}
-#endif
-
-unsigned long prepare_sg(struct device *dev, struct scatterlist *sg, int nents)
-{
-       struct scatterlist *dma_sg = sg;
-       unsigned long prev;
-       u32 dent_addr, dent_len;
-       unsigned int max_seg_size;
-
-       prev  = (unsigned long) sg_virt(sg);
-       prev += (unsigned long) (dent_len = sg->length);
-       dent_addr = (u32) ((unsigned long)(sg_virt(sg)) & (IO_PAGE_SIZE - 1UL));
-       max_seg_size = dma_get_max_seg_size(dev);
-       while (--nents) {
-               unsigned long addr;
-
-               sg = sg_next(sg);
-               addr = (unsigned long) sg_virt(sg);
-               if (! VCONTIG(prev, addr) ||
-                       dent_len + sg->length > max_seg_size) {
-                       dma_sg->dma_address = dent_addr;
-                       dma_sg->dma_length = dent_len;
-                       dma_sg = sg_next(dma_sg);
-
-                       dent_addr = ((dent_addr +
-                                     dent_len +
-                                     (IO_PAGE_SIZE - 1UL)) >> IO_PAGE_SHIFT);
-                       dent_addr <<= IO_PAGE_SHIFT;
-                       dent_addr += addr & (IO_PAGE_SIZE - 1UL);
-                       dent_len = 0;
-               }
-               dent_len += sg->length;
-               prev = addr + sg->length;
-       }
-       dma_sg->dma_address = dent_addr;
-       dma_sg->dma_length = dent_len;
-
-       if (dma_sg != sg) {
-               dma_sg = sg_next(dma_sg);
-               dma_sg->dma_length = 0;
-       }
-
-       return ((unsigned long) dent_addr +
-               (unsigned long) dent_len +
-               (IO_PAGE_SIZE - 1UL)) >> IO_PAGE_SHIFT;
-}
index a90d046e8024fd1eb7667d478f2a9f6fd16e245e..4b5cafa2877a4330b6f3f23d46be309009f2a2cc 100644 (file)
  */
 #define IOMMU_PAGE_SHIFT               13
 
+#define SG_ENT_PHYS_ADDRESS(SG)        (__pa(sg_virt((SG))))
+
+static inline unsigned long iommu_num_pages(unsigned long vaddr,
+                                           unsigned long slen)
+{
+       unsigned long npages;
+
+       npages = IO_PAGE_ALIGN(vaddr + slen) - (vaddr & IO_PAGE_MASK);
+       npages >>= IO_PAGE_SHIFT;
+
+       return npages;
+}
+
+static inline unsigned long calc_npages(struct scatterlist *sglist, int nelems)
+{
+       unsigned long i, npages = 0;
+       struct scatterlist *sg;
+
+       for_each_sg(sglist, sg, nelems, i) {
+               unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg);
+               npages += iommu_num_pages(paddr, sg->length);
+       }
+
+       return npages;
+}
+
 /* You are _strongly_ advised to enable the following debugging code
  * any time you make changes to the sg code below, run it for a while
  * with filesystems mounted read-only before buying the farm... -DaveM
index 5ea2eab1ccdad4d63ea0125db2b65d8a3ad082e9..61baf8dc095e2d2631e7958b4473d419524e47d9 100644 (file)
@@ -365,113 +365,14 @@ static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr,
        spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-#define SG_ENT_PHYS_ADDRESS(SG)        (__pa(sg_virt((SG))))
-
-static long fill_sg(long entry, struct device *dev,
-                   struct scatterlist *sg,
-                   int nused, int nelems, unsigned long prot)
-{
-       struct scatterlist *dma_sg = sg;
-       unsigned long flags;
-       int i;
-
-       local_irq_save(flags);
-
-       iommu_batch_start(dev, prot, entry);
-
-       for (i = 0; i < nused; i++) {
-               unsigned long pteval = ~0UL;
-               u32 dma_npages;
-
-               dma_npages = ((dma_sg->dma_address & (IO_PAGE_SIZE - 1UL)) +
-                             dma_sg->dma_length +
-                             ((IO_PAGE_SIZE - 1UL))) >> IO_PAGE_SHIFT;
-               do {
-                       unsigned long offset;
-                       signed int len;
-
-                       /* If we are here, we know we have at least one
-                        * more page to map.  So walk forward until we
-                        * hit a page crossing, and begin creating new
-                        * mappings from that spot.
-                        */
-                       for (;;) {
-                               unsigned long tmp;
-
-                               tmp = SG_ENT_PHYS_ADDRESS(sg);
-                               len = sg->length;
-                               if (((tmp ^ pteval) >> IO_PAGE_SHIFT) != 0UL) {
-                                       pteval = tmp & IO_PAGE_MASK;
-                                       offset = tmp & (IO_PAGE_SIZE - 1UL);
-                                       break;
-                               }
-                               if (((tmp ^ (tmp + len - 1UL)) >> IO_PAGE_SHIFT) != 0UL) {
-                                       pteval = (tmp + IO_PAGE_SIZE) & IO_PAGE_MASK;
-                                       offset = 0UL;
-                                       len -= (IO_PAGE_SIZE - (tmp & (IO_PAGE_SIZE - 1UL)));
-                                       break;
-                               }
-                               sg = sg_next(sg);
-                               nelems--;
-                       }
-
-                       pteval = (pteval & IOPTE_PAGE);
-                       while (len > 0) {
-                               long err;
-
-                               err = iommu_batch_add(pteval);
-                               if (unlikely(err < 0L))
-                                       goto iommu_map_failed;
-
-                               pteval += IO_PAGE_SIZE;
-                               len -= (IO_PAGE_SIZE - offset);
-                               offset = 0;
-                               dma_npages--;
-                       }
-
-                       pteval = (pteval & IOPTE_PAGE) + len;
-                       sg = sg_next(sg);
-                       nelems--;
-
-                       /* Skip over any tail mappings we've fully mapped,
-                        * adjusting pteval along the way.  Stop when we
-                        * detect a page crossing event.
-                        */
-                       while (nelems &&
-                              (pteval << (64 - IO_PAGE_SHIFT)) != 0UL &&
-                              (pteval == SG_ENT_PHYS_ADDRESS(sg)) &&
-                              ((pteval ^
-                                (SG_ENT_PHYS_ADDRESS(sg) + sg->length - 1UL)) >> IO_PAGE_SHIFT) == 0UL) {
-                               pteval += sg->length;
-                               sg = sg_next(sg);
-                               nelems--;
-                       }
-                       if ((pteval << (64 - IO_PAGE_SHIFT)) == 0UL)
-                               pteval = ~0UL;
-               } while (dma_npages != 0);
-               dma_sg = sg_next(dma_sg);
-       }
-
-       if (unlikely(iommu_batch_end() < 0L))
-               goto iommu_map_failed;
-
-       local_irq_restore(flags);
-       return 0;
-
-iommu_map_failed:
-       local_irq_restore(flags);
-       return -1L;
-}
-
 static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
                         int nelems, enum dma_data_direction direction)
 {
+       unsigned long flags, npages, i, prot;
+       struct scatterlist *sg;
        struct iommu *iommu;
-       unsigned long flags, npages, prot;
-       u32 dma_base;
-       struct scatterlist *sgtmp;
        long entry, err;
-       int used;
+       u32 dma_base;
 
        /* Fast path single entry scatterlists. */
        if (nelems == 1) {
@@ -489,10 +390,8 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
        if (unlikely(direction == DMA_NONE))
                goto bad;
 
-       /* Step 1: Prepare scatter list. */
-       npages = prepare_sg(dev, sglist, nelems);
+       npages = calc_npages(sglist, nelems);
 
-       /* Step 2: Allocate a cluster and context, if necessary. */
        spin_lock_irqsave(&iommu->lock, flags);
        entry = arena_alloc(&iommu->arena, npages);
        spin_unlock_irqrestore(&iommu->lock, flags);
@@ -503,27 +402,45 @@ static int dma_4v_map_sg(struct device *dev, struct scatterlist *sglist,
        dma_base = iommu->page_table_map_base +
                (entry << IO_PAGE_SHIFT);
 
-       /* Step 3: Normalize DMA addresses. */
-       used = nelems;
-
-       sgtmp = sglist;
-       while (used && sgtmp->dma_length) {
-               sgtmp->dma_address += dma_base;
-               sgtmp = sg_next(sgtmp);
-               used--;
-       }
-       used = nelems - used;
-
-       /* Step 4: Create the mappings. */
        prot = HV_PCI_MAP_ATTR_READ;
        if (direction != DMA_TO_DEVICE)
                prot |= HV_PCI_MAP_ATTR_WRITE;
 
-       err = fill_sg(entry, dev, sglist, used, nelems, prot);
+       local_irq_save(flags);
+
+       iommu_batch_start(dev, prot, entry);
+
+       for_each_sg(sglist, sg, nelems, i) {
+               unsigned long paddr = SG_ENT_PHYS_ADDRESS(sg);
+               unsigned long slen = sg->length;
+               unsigned long this_npages;
+
+               this_npages = iommu_num_pages(paddr, slen);
+
+               sg->dma_address = dma_base | (paddr & ~IO_PAGE_MASK);
+               sg->dma_length = slen;
+
+               paddr &= IO_PAGE_MASK;
+               while (this_npages--) {
+                       err = iommu_batch_add(paddr);
+                       if (unlikely(err < 0L)) {
+                               local_irq_restore(flags);
+                               goto iommu_map_failed;
+                       }
+
+                       paddr += IO_PAGE_SIZE;
+                       dma_base += IO_PAGE_SIZE;
+               }
+       }
+
+       err = iommu_batch_end();
+
+       local_irq_restore(flags);
+
        if (unlikely(err < 0L))
                goto iommu_map_failed;
 
-       return used;
+       return nelems;
 
 bad:
        if (printk_ratelimit())
@@ -541,12 +458,11 @@ iommu_map_failed:
 static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
                            int nelems, enum dma_data_direction direction)
 {
+       unsigned long flags, npages;
        struct pci_pbm_info *pbm;
+       u32 devhandle, bus_addr;
        struct iommu *iommu;
-       unsigned long flags, i, npages;
-       struct scatterlist *sg, *sgprv;
        long entry;
-       u32 devhandle, bus_addr;
 
        if (unlikely(direction == DMA_NONE)) {
                if (printk_ratelimit())
@@ -558,16 +474,8 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,
        devhandle = pbm->devhandle;
        
        bus_addr = sglist->dma_address & IO_PAGE_MASK;
-       sgprv = NULL;
-       for_each_sg(sglist, sg, nelems, i) {
-               if (sg->dma_length == 0)
-                       break;
-
-               sgprv = sg;
-       }
 
-       npages = (IO_PAGE_ALIGN(sgprv->dma_address + sgprv->dma_length) -
-                 bus_addr) >> IO_PAGE_SHIFT;
+       npages = calc_npages(sglist, nelems);
 
        entry = ((bus_addr - iommu->page_table_map_base) >> IO_PAGE_SHIFT);
 
index c39944927f1ac7f39f8ddb36671216ca6c2c0162..a8052b76df41b3c15694493cd7e92df7d9b8d1bb 100644 (file)
@@ -46,8 +46,6 @@
 #include <asm/ldc.h>
 #include <asm/hypervisor.h>
 
-extern void calibrate_delay(void);
-
 int sparc64_multi_core __read_mostly;
 
 cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE;
index 60765e314bd8624dfb1dd94329fd2fb0f59ad7f9..8649635d6d74f67e2b184903c3c1d3241fe3c47b 100644 (file)
@@ -277,6 +277,7 @@ EXPORT_SYMBOL(sys_getpid);
 EXPORT_SYMBOL(sys_geteuid);
 EXPORT_SYMBOL(sys_getuid);
 EXPORT_SYMBOL(sys_getegid);
+EXPORT_SYMBOL(sysctl_nr_open);
 EXPORT_SYMBOL(sys_getgid);
 EXPORT_SYMBOL(svr4_getcontext);
 EXPORT_SYMBOL(svr4_setcontext);
index b8058906e7271dc3b593d42c299d638138ea987c..adc62f490f368f494e1543d7d7485f39098ae41b 100644 (file)
@@ -80,7 +80,8 @@ sys_call_table32:
        .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
 /*300*/        .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy
        .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
-/*310*/        .word compat_sys_utimensat, compat_sys_signalfd, sys_ni_syscall, sys_eventfd, compat_sys_fallocate
+/*310*/        .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate
+       .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime
 
 #endif /* CONFIG_COMPAT */
 
@@ -152,7 +153,8 @@ sys_call_table:
        .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
 /*300*/        .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy
        .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
-/*310*/        .word sys_utimensat, sys_signalfd, sys_ni_syscall, sys_eventfd, sys_fallocate
+/*310*/        .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
+       .word sys_timerfd_settime, sys_timerfd_gettime
 
 #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
     defined(CONFIG_SOLARIS_EMUL_MODULE)
@@ -271,6 +273,7 @@ sunos_sys_table:
        .word sunos_nosys, sunos_nosys, sunos_nosys
        .word sunos_nosys
 /*310*/        .word sunos_nosys, sunos_nosys, sunos_nosys
-       .word sunos_nosys, sunos_nosys
+       .word sunos_nosys, sunos_nosys, sunos_nosys
+       .word sunos_nosys
 
 #endif
index 4352ee4d8dac32863bd588f47ce91ad5f2d8859c..d204f1ab1d4c25a62a5e01a03b3f8fe1ff4e85bf 100644 (file)
@@ -1707,6 +1707,11 @@ static void __exit rtc_mini_exit(void)
        misc_deregister(&rtc_mini_dev);
 }
 
+int __devinit read_current_timer(unsigned long *timer_val)
+{
+       *timer_val = tick_ops->get_tick();
+       return 0;
+}
 
 module_init(rtc_mini_init);
 module_exit(rtc_mini_exit);
index 61be597bf43037d3df41bd85997db373f7cbde61..9311bfe4f2f7e98cf6940782e26cabbbc5b4fd0f 100644 (file)
@@ -624,7 +624,7 @@ asmlinkage int solaris_ulimit(int cmd, int val)
        case 3: /* UL_GMEMLIM */
                return current->signal->rlim[RLIMIT_DATA].rlim_cur;
        case 4: /* UL_GDESLIM */
-               return NR_OPEN;
+               return sysctl_nr_open;
        }
        return -EINVAL;
 }
index a9d32ceabf26e5bed3c6cf2dc2810a2d94e2a07d..f53123c02c2b6b76f9b687bd1f675753d1342633 100644 (file)
@@ -859,7 +859,8 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 
        SOLD("entry");
        lock_kernel();
-       if(fd >= NR_OPEN) goto out;
+       if (fd >= sysctl_nr_open)
+               goto out;
 
        fdt = files_fdtable(current->files);
        filp = fdt->fd[fd];
@@ -927,7 +928,8 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 
        SOLD("entry");
        lock_kernel();
-       if(fd >= NR_OPEN) goto out;
+       if (fd >= sysctl_nr_open)
+               goto out;
 
        fdt = files_fdtable(current->files);
        filp = fdt->fd[fd];
index 434821187cfccf9c34b32f91f3784113b6b741f6..e6728bd61cc106fdd71f0ce7a4a025db020a1348 100644 (file)
@@ -415,7 +415,7 @@ config HPET_TIMER
 
 config HPET_EMULATE_RTC
        def_bool y
-       depends on HPET_TIMER && (RTC=y || RTC=m)
+       depends on HPET_TIMER && (RTC=y || RTC=m || RTC_DRV_CMOS=m || RTC_DRV_CMOS=y)
 
 # Mark as embedded because too many people got it wrong.
 # The code disables itself when not needed.
index 2e1e3af28c3a2d5c455b048a330b720a74d1f8bf..fa555148823de98079ced8464fb31a28c25c4063 100644 (file)
@@ -220,9 +220,9 @@ config DEBUG_BOOT_PARAMS
          This option will cause struct boot_params to be exported via debugfs.
 
 config CPA_DEBUG
-       bool "CPA self test code"
+       bool "CPA self-test code"
        depends on DEBUG_KERNEL
        help
-         Do change_page_attr self tests at boot.
+         Do change_page_attr() self-tests every 30 seconds.
 
 endmenu
index d9313d9adcedd04479a041a11709627032ca3a52..f86a3c4a2669909be340d195a6ee93201c53cdf9 100644 (file)
@@ -637,7 +637,7 @@ void __init early_cpu_init(void)
 }
 
 /* Make sure %fs is initialized properly in idle threads */
-struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
+struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
 {
        memset(regs, 0, sizeof(struct pt_regs));
        regs->fs = __KERNEL_PERCPU;
index a0522735dd9d9298122b5069baabe2bc12c0cda4..5affe91ca1e5964ff9bd309c78c3619f04379c7b 100644 (file)
@@ -827,7 +827,6 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf
 
        for (i = 0; i < data->acpi_data.state_count; i++) {
                u32 index;
-               u32 hi = 0, lo = 0;
 
                index = data->acpi_data.states[i].control & HW_PSTATE_MASK;
                if (index > data->max_hw_pstate) {
index 404a6a2d4016c790c6457b966703f8ebdc669dc2..7139b02627034cb3f69482541b62b1102bbe6287 100644 (file)
@@ -83,8 +83,6 @@ static char cyrix_model_mult2[] __cpuinitdata = "12233445";
  * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
  */
 
-extern void calibrate_delay(void) __init;
-
 static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c)
 {
        unsigned long flags;
index 1e27b69a7a0eca1750e4c16dd2470e49ab706112..b6e136f23d3d3219094bc9fdadaeaba048f01b96 100644 (file)
@@ -659,7 +659,7 @@ static __init int amd_special_default_mtrr(void)
  */
 int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 {
-       unsigned long i, base, size, highest_addr = 0, def, dummy;
+       unsigned long i, base, size, highest_pfn = 0, def, dummy;
        mtrr_type type;
        u64 trim_start, trim_size;
 
@@ -682,28 +682,27 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
                mtrr_if->get(i, &base, &size, &type);
                if (type != MTRR_TYPE_WRBACK)
                        continue;
-               base <<= PAGE_SHIFT;
-               size <<= PAGE_SHIFT;
-               if (highest_addr < base + size)
-                       highest_addr = base + size;
+               if (highest_pfn < base + size)
+                       highest_pfn = base + size;
        }
 
        /* kvm/qemu doesn't have mtrr set right, don't trim them all */
-       if (!highest_addr) {
+       if (!highest_pfn) {
                printk(KERN_WARNING "WARNING: strange, CPU MTRRs all blank?\n");
                WARN_ON(1);
                return 0;
        }
 
-       if ((highest_addr >> PAGE_SHIFT) < end_pfn) {
+       if (highest_pfn < end_pfn) {
                printk(KERN_WARNING "WARNING: BIOS bug: CPU MTRRs don't cover"
-                       " all of memory, losing %LdMB of RAM.\n",
-                       (((u64)end_pfn << PAGE_SHIFT) - highest_addr) >> 20);
+                       " all of memory, losing %luMB of RAM.\n",
+                       (end_pfn - highest_pfn) >> (20 - PAGE_SHIFT));
 
                WARN_ON(1);
 
                printk(KERN_INFO "update e820 for mtrr\n");
-               trim_start = highest_addr;
+               trim_start = highest_pfn;
+               trim_start <<= PAGE_SHIFT;
                trim_size = end_pfn;
                trim_size <<= PAGE_SHIFT;
                trim_size -= trim_start;
index bea8474744ffb633ad2d367bc478ec8cae3fb962..c7341e81941cc0e7d6863e317953316c2f045392 100644 (file)
@@ -582,7 +582,6 @@ retint_restore_args:        /* return to kernel space */
        TRACE_IRQS_IRETQ
 restore_args:
        RESTORE_ARGS 0,8,0                                              
-iret_label:    
 #ifdef CONFIG_PARAVIRT
        INTERRUPT_RETURN
 #endif
@@ -593,13 +592,22 @@ ENTRY(native_iret)
        .quad native_iret, bad_iret
        .previous
        .section .fixup,"ax"
-       /* force a signal here? this matches i386 behaviour */
-       /* running with kernel gs */
 bad_iret:
-       movq $11,%rdi   /* SIGSEGV */
-       TRACE_IRQS_ON
-       ENABLE_INTERRUPTS(CLBR_ANY | ~(CLBR_RDI))
-       jmp do_exit
+       /*
+        * The iret traps when the %cs or %ss being restored is bogus.
+        * We've lost the original trap vector and error code.
+        * #GPF is the most likely one to get for an invalid selector.
+        * So pretend we completed the iret and took the #GPF in user mode.
+        *
+        * We are now running with the kernel GS after exception recovery.
+        * But error_entry expects us to have user GS to match the user %cs,
+        * so swap back.
+        */
+       pushq $0
+
+       SWAPGS
+       jmp general_protection
+
        .previous
 
        /* edi: workmask, edx: work */
@@ -911,7 +919,7 @@ error_kernelspace:
           iret run with kernel gs again, so don't set the user space flag.
           B stepping K8s sometimes report an truncated RIP for IRET 
           exceptions returning to compat mode. Check for these here too. */
-       leaq iret_label(%rip),%rbp
+       leaq native_iret(%rip),%rbp
        cmpq %rbp,RIP(%rsp) 
        je   error_swapgs
        movl %ebp,%ebp  /* zero extend */
index 4f283ad215ecac483909e1510ddb98e6f37607d0..09b38d539b09deb0874029b2e28fb7d5b7d2418f 100644 (file)
@@ -250,18 +250,13 @@ ENTRY(secondary_startup_64)
        lretq
 
        /* SMP bootup changes these two */
-#ifndef CONFIG_HOTPLUG_CPU
-       .pushsection .init.data
-#endif
+       __CPUINITDATA
        .align  8
-       .globl  initial_code
-initial_code:
+       ENTRY(initial_code)
        .quad   x86_64_start_kernel
-#ifndef CONFIG_HOTPLUG_CPU
-       .popsection
-#endif
-       .globl init_rsp
-init_rsp:
+       __FINITDATA
+
+       ENTRY(init_rsp)
        .quad  init_thread_union+THREAD_SIZE-8
 
 bad_address:
index 96286df1bb817fff6e314fead079d40c0cb29f6c..702c33efea84dfad40b15d62cd7775958d653979 100644 (file)
@@ -103,9 +103,26 @@ static int set_segment_reg(struct task_struct *task,
        if (invalid_selector(value))
                return -EIO;
 
-       if (offset != offsetof(struct user_regs_struct, gs))
+       /*
+        * For %cs and %ss we cannot permit a null selector.
+        * We can permit a bogus selector as long as it has USER_RPL.
+        * Null selectors are fine for other segment registers, but
+        * we will never get back to user mode with invalid %cs or %ss
+        * and will take the trap in iret instead.  Much code relies
+        * on user_mode() to distinguish a user trap frame (which can
+        * safely use invalid selectors) from a kernel trap frame.
+        */
+       switch (offset) {
+       case offsetof(struct user_regs_struct, cs):
+       case offsetof(struct user_regs_struct, ss):
+               if (unlikely(value == 0))
+                       return -EIO;
+
+       default:
                *pt_regs_access(task_pt_regs(task), offset) = value;
-       else {
+               break;
+
+       case offsetof(struct user_regs_struct, gs):
                task->thread.gs = value;
                if (task == current)
                        /*
@@ -227,12 +244,16 @@ static int set_segment_reg(struct task_struct *task,
                 * Can't actually change these in 64-bit mode.
                 */
        case offsetof(struct user_regs_struct,cs):
+               if (unlikely(value == 0))
+                       return -EIO;
 #ifdef CONFIG_IA32_EMULATION
                if (test_tsk_thread_flag(task, TIF_IA32))
                        task_pt_regs(task)->cs = value;
 #endif
                break;
        case offsetof(struct user_regs_struct,ss):
+               if (unlikely(value == 0))
+                       return -EIO;
 #ifdef CONFIG_IA32_EMULATION
                if (test_tsk_thread_flag(task, TIF_IA32))
                        task_pt_regs(task)->ss = value;
index 3cd7a2dcd4fe729986267ed1c3d2e20d35ab0a0e..6ba33ca8715abc3e925debf55797b0834aee1a38 100644 (file)
@@ -380,19 +380,19 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0367,
 void force_hpet_resume(void)
 {
        switch (force_hpet_resume_type) {
-           case ICH_FORCE_HPET_RESUME:
-               return ich_force_hpet_resume();
-
-           case OLD_ICH_FORCE_HPET_RESUME:
-               return old_ich_force_hpet_resume();
-
-           case VT8237_FORCE_HPET_RESUME:
-               return vt8237_force_hpet_resume();
-
-           case NVIDIA_FORCE_HPET_RESUME:
-               return nvidia_force_hpet_resume();
-
-           default:
+       case ICH_FORCE_HPET_RESUME:
+               ich_force_hpet_resume();
+               return;
+       case OLD_ICH_FORCE_HPET_RESUME:
+               old_ich_force_hpet_resume();
+               return;
+       case VT8237_FORCE_HPET_RESUME:
+               vt8237_force_hpet_resume();
+               return;
+       case NVIDIA_FORCE_HPET_RESUME:
+               nvidia_force_hpet_resume();
+               return;
+       default:
                break;
        }
 }
index 5787a0c3e2960919f6dc82f0b034a5ba1d19735c..579b9b740c7c79326c079440cda33341b3ba6472 100644 (file)
@@ -202,8 +202,6 @@ valid_k7:
        ;
 }
 
-extern void calibrate_delay(void);
-
 static atomic_t init_deasserted;
 
 static void __cpuinit smp_callin(void)
index 36c100c323aa5d1a01d0fdf2316deeba5c3c37ec..10b8a6f69f84d51348827655903580cdfa6a5e93 100644 (file)
@@ -139,7 +139,6 @@ static int test_NX(void)
         * Until then, don't run them to avoid too many people getting scared
         * by the error message
         */
-#if 0
 
 #ifdef CONFIG_DEBUG_RODATA
        /* Test 3: Check if the .rodata section is executable */
@@ -152,6 +151,7 @@ static int test_NX(void)
        }
 #endif
 
+#if 0
        /* Test 4: Check if the .data section of a module is executable */
        if (test_address(&test_data)) {
                printk(KERN_ERR "test_nx: .data section is executable\n");
index 3cf72977d01292bbea4492568d85277a8ba6680f..b22c01e05a1841d4a3960a2e62a2881ee9c5babc 100644 (file)
@@ -1176,17 +1176,12 @@ void __init trap_init(void)
 #endif
        set_trap_gate(19,&simd_coprocessor_error);
 
+       /*
+        * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
+        * Generate a build-time error if the alignment is wrong.
+        */
+       BUILD_BUG_ON(offsetof(struct task_struct, thread.i387.fxsave) & 15);
        if (cpu_has_fxsr) {
-               /*
-                * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
-                * Generates a compile-time "error: zero width for bit-field" if
-                * the alignment is wrong.
-                */
-               struct fxsrAlignAssert {
-                       int _:!(offsetof(struct task_struct,
-                                       thread.i387.fxsave) & 15);
-               };
-
                printk(KERN_INFO "Enabling fast FPU save and restore... ");
                set_in_cr4(X86_CR4_OSFXSR);
                printk("done.\n");
index aad9d95469dc68dcb25b9fac93b743d44b7d9038..4535e6d147adb11ffb570a9adcb4e08c6d638130 100644 (file)
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/timex.h>
 #include <linux/preempt.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #include <asm/processor.h>
 #include <asm/delay.h>
@@ -63,7 +65,7 @@ void use_tsc_delay(void)
        delay_fn = delay_tsc;
 }
 
-int read_current_timer(unsigned long *timer_val)
+int __devinit read_current_timer(unsigned long *timer_val)
 {
        if (delay_fn == delay_tsc) {
                rdtscl(*timer_val);
index 45cdd3fbd91c514f38e2c2782f7dbc0dcecd8e90..bbc610518516b11c4bdbe1d10dacd29ce41130c6 100644 (file)
 
 #include <linux/module.h>
 #include <linux/sched.h>
+#include <linux/timex.h>
 #include <linux/preempt.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #include <asm/delay.h>
 #include <asm/msr.h>
@@ -20,7 +22,7 @@
 #include <asm/smp.h>
 #endif
 
-int read_current_timer(unsigned long *timer_value)
+int __devinit read_current_timer(unsigned long *timer_value)
 {
        rdtscll(*timer_value);
        return 0;
index dffa786f61fe1b17c2a3a4b2e00f07d7e3a8bc2f..3cc8eb2f36a995ad57252be8310ece8fcd32327a 100644 (file)
@@ -444,8 +444,6 @@ static __u32 __init setup_trampoline(void)
 static void __init start_secondary(void *unused)
 {
        __u8 cpuid = hard_smp_processor_id();
-       /* external functions not defined in the headers */
-       extern void calibrate_delay(void);
 
        cpu_init();
 
index ad8b9733d6b3fee4d2f90e2981e54dc2b71299e4..621afb6343dc359d4205a56021658380b1dda427 100644 (file)
@@ -428,6 +428,16 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
 }
 #endif
 
+static int spurious_fault_check(unsigned long error_code, pte_t *pte)
+{
+       if ((error_code & PF_WRITE) && !pte_write(*pte))
+               return 0;
+       if ((error_code & PF_INSTR) && !pte_exec(*pte))
+               return 0;
+
+       return 1;
+}
+
 /*
  * Handle a spurious fault caused by a stale TLB entry.  This allows
  * us to lazily refresh the TLB when increasing the permissions of a
@@ -457,20 +467,21 @@ static int spurious_fault(unsigned long address,
        if (!pud_present(*pud))
                return 0;
 
+       if (pud_large(*pud))
+               return spurious_fault_check(error_code, (pte_t *) pud);
+
        pmd = pmd_offset(pud, address);
        if (!pmd_present(*pmd))
                return 0;
 
+       if (pmd_large(*pmd))
+               return spurious_fault_check(error_code, (pte_t *) pmd);
+
        pte = pte_offset_kernel(pmd, address);
        if (!pte_present(*pte))
                return 0;
 
-       if ((error_code & PF_WRITE) && !pte_write(*pte))
-               return 0;
-       if ((error_code & PF_INSTR) && !pte_exec(*pte))
-               return 0;
-
-       return 1;
+       return spurious_fault_check(error_code, pte);
 }
 
 /*
@@ -947,11 +958,12 @@ void vmalloc_sync_all(void)
        for (address = start; address <= VMALLOC_END; address += PGDIR_SIZE) {
                if (!test_bit(pgd_index(address), insync)) {
                        const pgd_t *pgd_ref = pgd_offset_k(address);
+                       unsigned long flags;
                        struct page *page;
 
                        if (pgd_none(*pgd_ref))
                                continue;
-                       spin_lock(&pgd_lock);
+                       spin_lock_irqsave(&pgd_lock, flags);
                        list_for_each_entry(page, &pgd_list, lru) {
                                pgd_t *pgd;
                                pgd = (pgd_t *)page_address(page) + pgd_index(address);
@@ -960,7 +972,7 @@ void vmalloc_sync_all(void)
                                else
                                        BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
                        }
-                       spin_unlock(&pgd_lock);
+                       spin_unlock_irqrestore(&pgd_lock, flags);
                        set_bit(pgd_index(address), insync);
                }
                if (address == start)
index 3a98d6f724ab69b9ed4d075a0a14895efe482dbc..9b61c75a23556f76898ca2f8b1d26d71b206ca26 100644 (file)
@@ -591,10 +591,17 @@ void mark_rodata_ro(void)
        if (end <= start)
                return;
 
-       set_memory_ro(start, (end - start) >> PAGE_SHIFT);
 
        printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
               (end - start) >> 10);
+       set_memory_ro(start, (end - start) >> PAGE_SHIFT);
+
+       /*
+        * The rodata section (but not the kernel text!) should also be
+        * not-executable.
+        */
+       start = ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
+       set_memory_nx(start, (end - start) >> PAGE_SHIFT);
 
        rodata_test();
 
index 398f3a578dde446e292109a6463409f1b70d3415..ed82016003540ec66ccd7b18157188f6a9d7a5cf 100644 (file)
@@ -5,6 +5,7 @@
  * and compares page tables forwards and afterwards.
  */
 #include <linux/bootmem.h>
+#include <linux/kthread.h>
 #include <linux/random.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/pgtable.h>
 #include <asm/kdebug.h>
 
+/*
+ * Only print the results of the first pass:
+ */
+static __read_mostly int print = 1;
+
 enum {
-       NTEST                   = 4000,
+       NTEST                   = 400,
 #ifdef CONFIG_X86_64
        LPS                     = (1 << PMD_SHIFT),
 #elif defined(CONFIG_X86_PAE)
@@ -31,7 +37,7 @@ struct split_state {
        long min_exec, max_exec;
 };
 
-static __init int print_split(struct split_state *s)
+static int print_split(struct split_state *s)
 {
        long i, expected, missed = 0;
        int printed = 0;
@@ -82,10 +88,13 @@ static __init int print_split(struct split_state *s)
                                s->max_exec = addr;
                }
        }
-       printk(KERN_INFO
-               "CPA mapping 4k %lu large %lu gb %lu x %lu[%lx-%lx] miss %lu\n",
-               s->spg, s->lpg, s->gpg, s->exec,
-               s->min_exec != ~0UL ? s->min_exec : 0, s->max_exec, missed);
+       if (print) {
+               printk(KERN_INFO
+                       " 4k %lu large %lu gb %lu x %lu[%lx-%lx] miss %lu\n",
+                       s->spg, s->lpg, s->gpg, s->exec,
+                       s->min_exec != ~0UL ? s->min_exec : 0,
+                       s->max_exec, missed);
+       }
 
        expected = (s->gpg*GPS + s->lpg*LPS)/PAGE_SIZE + s->spg + missed;
        if (expected != i) {
@@ -96,11 +105,11 @@ static __init int print_split(struct split_state *s)
        return err;
 }
 
-static unsigned long __initdata addr[NTEST];
-static unsigned int __initdata len[NTEST];
+static unsigned long addr[NTEST];
+static unsigned int len[NTEST];
 
 /* Change the global bit on random pages in the direct mapping */
-static __init int exercise_pageattr(void)
+static int pageattr_test(void)
 {
        struct split_state sa, sb, sc;
        unsigned long *bm;
@@ -110,7 +119,8 @@ static __init int exercise_pageattr(void)
        int i, k;
        int err;
 
-       printk(KERN_INFO "CPA exercising pageattr\n");
+       if (print)
+               printk(KERN_INFO "CPA self-test:\n");
 
        bm = vmalloc((max_pfn_mapped + 7) / 8);
        if (!bm) {
@@ -186,7 +196,6 @@ static __init int exercise_pageattr(void)
 
        failed += print_split(&sb);
 
-       printk(KERN_INFO "CPA reverting everything\n");
        for (i = 0; i < NTEST; i++) {
                if (!addr[i])
                        continue;
@@ -214,12 +223,40 @@ static __init int exercise_pageattr(void)
        failed += print_split(&sc);
 
        if (failed) {
-               printk(KERN_ERR "CPA selftests NOT PASSED. Please report.\n");
+               printk(KERN_ERR "NOT PASSED. Please report.\n");
                WARN_ON(1);
+               return -EINVAL;
        } else {
-               printk(KERN_INFO "CPA selftests PASSED\n");
+               if (print)
+                       printk(KERN_INFO "ok.\n");
        }
 
        return 0;
 }
-module_init(exercise_pageattr);
+
+static int do_pageattr_test(void *__unused)
+{
+       while (!kthread_should_stop()) {
+               schedule_timeout_interruptible(HZ*30);
+               if (pageattr_test() < 0)
+                       break;
+               if (print)
+                       print--;
+       }
+       return 0;
+}
+
+static int start_pageattr_test(void)
+{
+       struct task_struct *p;
+
+       p = kthread_create(do_pageattr_test, NULL, "pageattr-test");
+       if (!IS_ERR(p))
+               wake_up_process(p);
+       else
+               WARN_ON(1);
+
+       return 0;
+}
+
+module_init(start_pageattr_test);
index bb55a78dcd621cad4a608073ed46c438f4940163..8493c855582bf56a5a36d2e6e64266332c9d26c0 100644 (file)
@@ -167,8 +167,6 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address)
        if (within(address, virt_to_highmap(_text), virt_to_highmap(_etext)))
                pgprot_val(forbidden) |= _PAGE_NX;
 
-
-#ifdef CONFIG_DEBUG_RODATA
        /* The .rodata section needs to be read-only */
        if (within(address, (unsigned long)__start_rodata,
                                (unsigned long)__end_rodata))
@@ -179,7 +177,6 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address)
        if (within(address, virt_to_highmap(__start_rodata),
                                virt_to_highmap(__end_rodata)))
                pgprot_val(forbidden) |= _PAGE_RW;
-#endif
 
        prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden));
 
@@ -237,7 +234,6 @@ static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte)
        if (!SHARED_KERNEL_PMD) {
                struct page *page;
 
-               address = __pa(address);
                list_for_each_entry(page, &pgd_list, lru) {
                        pgd_t *pgd;
                        pud_t *pud;
@@ -261,17 +257,6 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
        pgprot_t old_prot, new_prot;
        int level, do_split = 1;
 
-       /*
-        * An Athlon 64 X2 showed hard hangs if we tried to preserve
-        * largepages and changed the PSE entry from RW to RO.
-        *
-        * As AMD CPUs have a long series of erratas in this area,
-        * (and none of the known ones seem to explain this hang),
-        * disable this code until the hang can be debugged:
-        */
-       if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
-               return 1;
-
        spin_lock_irqsave(&pgd_lock, flags);
        /*
         * Check for races, another CPU might have split this page
index 60d29fe0b1bdfd7dac917d5b6ad9f3114acc08e3..8df1e842f6d401d060d077246d97d942c2033cad 100644 (file)
@@ -204,7 +204,7 @@ again:
 }
 
 #ifndef CONFIG_GENERIC_CALIBRATE_DELAY
-void __devinit calibrate_delay(void)
+void __cpuinit calibrate_delay(void)
 {
        loops_per_jiffy = CCOUNT_PER_JIFFY;
        printk("Calibrating delay loop (skipped)... "
index 047e533fcc5ba249977895ea1c3969f6a6b0be2e..0f6282207b3223baf9910332681fd5b3eb98295c 100644 (file)
@@ -35,7 +35,7 @@
  * @src: src page
  * @offset: offset in pages to start transaction
  * @len: length in bytes
- * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK,
+ * @flags: ASYNC_TX_ACK, ASYNC_TX_DEP_ACK,
  * @depend_tx: memcpy depends on the result of this transaction
  * @cb_fn: function to call when the memcpy completes
  * @cb_param: parameter to pass to the callback routine
@@ -46,33 +46,29 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
        struct dma_async_tx_descriptor *depend_tx,
        dma_async_tx_callback cb_fn, void *cb_param)
 {
-       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMCPY);
+       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMCPY,
+                                                     &dest, 1, &src, 1, len);
        struct dma_device *device = chan ? chan->device : NULL;
-       int int_en = cb_fn ? 1 : 0;
-       struct dma_async_tx_descriptor *tx = device ?
-               device->device_prep_dma_memcpy(chan, len,
-               int_en) : NULL;
+       struct dma_async_tx_descriptor *tx = NULL;
 
-       if (tx) { /* run the memcpy asynchronously */
-               dma_addr_t addr;
-               enum dma_data_direction dir;
+       if (device) {
+               dma_addr_t dma_dest, dma_src;
+               unsigned long dma_prep_flags = cb_fn ? DMA_PREP_INTERRUPT : 0;
 
-               pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
-
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_FROM_DEVICE;
-
-               addr = dma_map_page(device->dev, dest, dest_offset, len, dir);
-               tx->tx_set_dest(addr, tx, 0);
+               dma_dest = dma_map_page(device->dev, dest, dest_offset, len,
+                                       DMA_FROM_DEVICE);
 
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_TO_DEVICE;
+               dma_src = dma_map_page(device->dev, src, src_offset, len,
+                                      DMA_TO_DEVICE);
 
-               addr = dma_map_page(device->dev, src, src_offset, len, dir);
-               tx->tx_set_src(addr, tx, 0);
+               tx = device->device_prep_dma_memcpy(chan, dma_dest, dma_src,
+                                                   len, dma_prep_flags);
+       }
 
+       if (tx) {
+               pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
                async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param);
-       } else { /* run the memcpy synchronously */
+       } else {
                void *dest_buf, *src_buf;
                pr_debug("%s: (sync) len: %zu\n", __FUNCTION__, len);
 
index 66ef6351202ef9cf0f9ddb162524141b92e8b1cf..09c0e83664bc23f4465cad7b6c477ca76b1d46da 100644 (file)
@@ -35,7 +35,7 @@
  * @val: fill value
  * @offset: offset in pages to start transaction
  * @len: length in bytes
- * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
+ * @flags: ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
  * @depend_tx: memset depends on the result of this transaction
  * @cb_fn: function to call when the memcpy completes
  * @cb_param: parameter to pass to the callback routine
@@ -46,24 +46,24 @@ async_memset(struct page *dest, int val, unsigned int offset,
        struct dma_async_tx_descriptor *depend_tx,
        dma_async_tx_callback cb_fn, void *cb_param)
 {
-       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMSET);
+       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_MEMSET,
+                                                     &dest, 1, NULL, 0, len);
        struct dma_device *device = chan ? chan->device : NULL;
-       int int_en = cb_fn ? 1 : 0;
-       struct dma_async_tx_descriptor *tx = device ?
-               device->device_prep_dma_memset(chan, val, len,
-                       int_en) : NULL;
+       struct dma_async_tx_descriptor *tx = NULL;
 
-       if (tx) { /* run the memset asynchronously */
-               dma_addr_t dma_addr;
-               enum dma_data_direction dir;
+       if (device) {
+               dma_addr_t dma_dest;
+               unsigned long dma_prep_flags = cb_fn ? DMA_PREP_INTERRUPT : 0;
 
-               pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_FROM_DEVICE;
+               dma_dest = dma_map_page(device->dev, dest, offset, len,
+                                       DMA_FROM_DEVICE);
 
-               dma_addr = dma_map_page(device->dev, dest, offset, len, dir);
-               tx->tx_set_dest(dma_addr, tx, 0);
+               tx = device->device_prep_dma_memset(chan, dma_dest, val, len,
+                                                   dma_prep_flags);
+       }
 
+       if (tx) {
+               pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
                async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param);
        } else { /* run the memset synchronously */
                void *dest_buf;
index bc18cbb8ea79562ce05401a5734d8310cf2ea938..562882189de589587c475b25770ff46b90eac6ac 100644 (file)
@@ -57,8 +57,7 @@ static struct chan_ref_percpu *channel_table[DMA_TX_TYPE_END];
  */
 static spinlock_t async_tx_lock;
 
-static struct list_head
-async_tx_master_list = LIST_HEAD_INIT(async_tx_master_list);
+static LIST_HEAD(async_tx_master_list);
 
 /* async_tx_issue_pending_all - start all transactions on all channels */
 void async_tx_issue_pending_all(void)
@@ -362,13 +361,13 @@ static void __exit async_tx_exit(void)
 }
 
 /**
- * async_tx_find_channel - find a channel to carry out the operation or let
+ * __async_tx_find_channel - find a channel to carry out the operation or let
  *     the transaction execute synchronously
  * @depend_tx: transaction dependency
  * @tx_type: transaction type
  */
 struct dma_chan *
-async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
+__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
        enum dma_transaction_type tx_type)
 {
        /* see if we can keep the chain on one channel */
@@ -384,7 +383,7 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
        } else
                return NULL;
 }
-EXPORT_SYMBOL_GPL(async_tx_find_channel);
+EXPORT_SYMBOL_GPL(__async_tx_find_channel);
 #else
 static int __init async_tx_init(void)
 {
index 2575f674dcd5ee226cb2a29f946e27ab9b9b7c1a..2259a4ff15cb9ce7253f4cc5d4f6132586fe762d 100644 (file)
 #include <linux/raid/xor.h>
 #include <linux/async_tx.h>
 
-static void
-do_async_xor(struct dma_async_tx_descriptor *tx, struct dma_device *device,
+/* do_async_xor - dma map the pages and perform the xor with an engine.
+ *     This routine is marked __always_inline so it can be compiled away
+ *     when CONFIG_DMA_ENGINE=n
+ */
+static __always_inline struct dma_async_tx_descriptor *
+do_async_xor(struct dma_device *device,
        struct dma_chan *chan, struct page *dest, struct page **src_list,
        unsigned int offset, unsigned int src_cnt, size_t len,
        enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
        dma_async_tx_callback cb_fn, void *cb_param)
 {
-       dma_addr_t dma_addr;
-       enum dma_data_direction dir;
+       dma_addr_t dma_dest;
+       dma_addr_t *dma_src = (dma_addr_t *) src_list;
+       struct dma_async_tx_descriptor *tx;
        int i;
+       unsigned long dma_prep_flags = cb_fn ? DMA_PREP_INTERRUPT : 0;
 
        pr_debug("%s: len: %zu\n", __FUNCTION__, len);
 
-       dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-               DMA_NONE : DMA_FROM_DEVICE;
-
-       dma_addr = dma_map_page(device->dev, dest, offset, len, dir);
-       tx->tx_set_dest(dma_addr, tx, 0);
-
-       dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-               DMA_NONE : DMA_TO_DEVICE;
+       dma_dest = dma_map_page(device->dev, dest, offset, len,
+                               DMA_FROM_DEVICE);
 
-       for (i = 0; i < src_cnt; i++) {
-               dma_addr = dma_map_page(device->dev, src_list[i],
-                       offset, len, dir);
-               tx->tx_set_src(dma_addr, tx, i);
+       for (i = 0; i < src_cnt; i++)
+               dma_src[i] = dma_map_page(device->dev, src_list[i], offset,
+                                         len, DMA_TO_DEVICE);
+
+       /* Since we have clobbered the src_list we are committed
+        * to doing this asynchronously.  Drivers force forward progress
+        * in case they can not provide a descriptor
+        */
+       tx = device->device_prep_dma_xor(chan, dma_dest, dma_src, src_cnt, len,
+                                        dma_prep_flags);
+       if (!tx) {
+               if (depend_tx)
+                       dma_wait_for_async_tx(depend_tx);
+
+               while (!tx)
+                       tx = device->device_prep_dma_xor(chan, dma_dest,
+                                                        dma_src, src_cnt, len,
+                                                        dma_prep_flags);
        }
 
        async_tx_submit(chan, tx, flags, depend_tx, cb_fn, cb_param);
+
+       return tx;
 }
 
 static void
@@ -102,7 +118,7 @@ do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset,
  * @src_cnt: number of source pages
  * @len: length in bytes
  * @flags: ASYNC_TX_XOR_ZERO_DST, ASYNC_TX_XOR_DROP_DEST,
- *     ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
+ *     ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
  * @depend_tx: xor depends on the result of this transaction.
  * @cb_fn: function to call when the xor completes
  * @cb_param: parameter to pass to the callback routine
@@ -113,14 +129,16 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset,
        struct dma_async_tx_descriptor *depend_tx,
        dma_async_tx_callback cb_fn, void *cb_param)
 {
-       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_XOR);
+       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_XOR,
+                                                     &dest, 1, src_list,
+                                                     src_cnt, len);
        struct dma_device *device = chan ? chan->device : NULL;
        struct dma_async_tx_descriptor *tx = NULL;
        dma_async_tx_callback _cb_fn;
        void *_cb_param;
        unsigned long local_flags;
        int xor_src_cnt;
-       int i = 0, src_off = 0, int_en;
+       int i = 0, src_off = 0;
 
        BUG_ON(src_cnt <= 1);
 
@@ -140,20 +158,11 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset,
                                _cb_param = cb_param;
                        }
 
-                       int_en = _cb_fn ? 1 : 0;
-
-                       tx = device->device_prep_dma_xor(
-                               chan, xor_src_cnt, len, int_en);
-
-                       if (tx) {
-                               do_async_xor(tx, device, chan, dest,
-                               &src_list[src_off], offset, xor_src_cnt, len,
-                               local_flags, depend_tx, _cb_fn,
-                               _cb_param);
-                       } else /* fall through */
-                               goto xor_sync;
+                       tx = do_async_xor(device, chan, dest,
+                                         &src_list[src_off], offset,
+                                         xor_src_cnt, len, local_flags,
+                                         depend_tx, _cb_fn, _cb_param);
                } else { /* run the xor synchronously */
-xor_sync:
                        /* in the sync case the dest is an implied source
                         * (assumes the dest is at the src_off index)
                         */
@@ -242,7 +251,7 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
  * @src_cnt: number of source pages
  * @len: length in bytes
  * @result: 0 if sum == 0 else non-zero
- * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
+ * @flags: ASYNC_TX_ACK, ASYNC_TX_DEP_ACK
  * @depend_tx: xor depends on the result of this transaction.
  * @cb_fn: function to call when the xor completes
  * @cb_param: parameter to pass to the callback routine
@@ -254,29 +263,36 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
        struct dma_async_tx_descriptor *depend_tx,
        dma_async_tx_callback cb_fn, void *cb_param)
 {
-       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_ZERO_SUM);
+       struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_ZERO_SUM,
+                                                     &dest, 1, src_list,
+                                                     src_cnt, len);
        struct dma_device *device = chan ? chan->device : NULL;
-       int int_en = cb_fn ? 1 : 0;
-       struct dma_async_tx_descriptor *tx = device ?
-               device->device_prep_dma_zero_sum(chan, src_cnt, len, result,
-                       int_en) : NULL;
-       int i;
+       struct dma_async_tx_descriptor *tx = NULL;
 
        BUG_ON(src_cnt <= 1);
 
-       if (tx) {
-               dma_addr_t dma_addr;
-               enum dma_data_direction dir;
+       if (device) {
+               dma_addr_t *dma_src = (dma_addr_t *) src_list;
+               unsigned long dma_prep_flags = cb_fn ? DMA_PREP_INTERRUPT : 0;
+               int i;
 
                pr_debug("%s: (async) len: %zu\n", __FUNCTION__, len);
 
-               dir = (flags & ASYNC_TX_ASSUME_COHERENT) ?
-                       DMA_NONE : DMA_TO_DEVICE;
-
-               for (i = 0; i < src_cnt; i++) {
-         &