]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jan 2009 20:40:11 +0000 (12:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jan 2009 20:40:11 +0000 (12:40 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  netxen: include ipv6.h (fixes build failure)
  netxen: avoid invalid iounmap

456 files changed:
CREDITS
Documentation/DMA-API.txt
Documentation/accounting/getdelays.c
Documentation/cgroups/cgroups.txt
Documentation/cgroups/cpuacct.txt [moved from Documentation/controllers/cpuacct.txt with 100% similarity]
Documentation/cgroups/cpusets.txt [moved from Documentation/cpusets.txt with 100% similarity]
Documentation/cgroups/devices.txt [moved from Documentation/controllers/devices.txt with 100% similarity]
Documentation/cgroups/memcg_test.txt [moved from Documentation/controllers/memcg_test.txt with 99% similarity]
Documentation/cgroups/memory.txt [moved from Documentation/controllers/memory.txt with 100% similarity]
Documentation/cgroups/resource_counter.txt [moved from Documentation/controllers/resource_counter.txt with 100% similarity]
Documentation/filesystems/proc.txt
Documentation/hwmon/adt7475 [new file with mode: 0644]
Documentation/hwmon/lis3lv02d
Documentation/mips/AU1xxx_IDE.README
Documentation/scheduler/sched-design-CFS.txt
Documentation/sound/alsa/HD-Audio-Models.txt
Documentation/sysctl/vm.txt
Documentation/sysrq.txt
MAINTAINERS
arch/Kconfig
arch/alpha/include/asm/Kbuild
arch/alpha/include/asm/byteorder.h
arch/alpha/include/asm/machvec.h
arch/alpha/include/asm/pgalloc.h
arch/alpha/include/asm/rtc.h
arch/alpha/kernel/.gitignore [new file with mode: 0644]
arch/alpha/kernel/core_marvel.c
arch/alpha/kernel/entry.S
arch/alpha/kernel/irq_srm.c
arch/alpha/kernel/machvec_impl.h
arch/alpha/kernel/proto.h
arch/alpha/kernel/sys_jensen.c
arch/alpha/kernel/sys_marvel.c
arch/alpha/kernel/sys_nautilus.c
arch/alpha/kernel/systbls.S
arch/alpha/kernel/time.c
arch/alpha/mm/init.c
arch/arm/include/asm/Kbuild
arch/arm/include/asm/byteorder.h
arch/arm/kernel/calls.S
arch/arm/mach-imx/clock.c
arch/arm/mach-imx/generic.c
arch/arm/mach-imx/include/mach/imx-regs.h
arch/arm/mach-w90x900/mach-w90p910evb.c
arch/arm/mach-w90x900/time.c
arch/arm/mm/proc-syms.c
arch/avr32/include/asm/Kbuild
arch/avr32/include/asm/byteorder.h
arch/blackfin/include/asm/Kbuild
arch/blackfin/include/asm/byteorder.h
arch/cris/arch-v10/kernel/entry.S
arch/cris/arch-v32/kernel/entry.S
arch/cris/include/arch-v10/arch/swab.h [moved from arch/cris/include/arch-v10/arch/byteorder.h with 55% similarity]
arch/cris/include/arch-v32/arch/byteorder.h [deleted file]
arch/cris/include/arch-v32/arch/swab.h [new file with mode: 0644]
arch/cris/include/asm/byteorder.h
arch/cris/include/asm/swab.h [new file with mode: 0644]
arch/h8300/include/asm/Kbuild
arch/h8300/include/asm/byteorder.h
arch/h8300/kernel/syscalls.S
arch/ia64/Kconfig
arch/ia64/configs/generic_defconfig
arch/ia64/ia32/ia32_entry.S
arch/ia64/include/asm/Kbuild
arch/ia64/include/asm/byteorder.h
arch/ia64/include/asm/dma-mapping.h
arch/ia64/include/asm/machvec.h
arch/ia64/include/asm/machvec_init.h
arch/ia64/include/asm/machvec_sn2.h
arch/ia64/include/asm/unistd.h
arch/ia64/kernel/entry.S
arch/ia64/kernel/sys_ia64.c
arch/ia64/kernel/unaligned.c
arch/ia64/pci/pci.c
arch/ia64/sn/pci/pci_dma.c
arch/ia64/xen/time.c
arch/m68k/kernel/entry.S
arch/m68knommu/include/asm/Kbuild
arch/m68knommu/include/asm/byteorder.h
arch/m68knommu/kernel/syscalltable.S
arch/mips/include/asm/Kbuild
arch/mips/include/asm/byteorder.h
arch/mips/kernel/scall32-o32.S
arch/mn10300/kernel/entry.S
arch/parisc/include/asm/Kbuild
arch/parisc/include/asm/byteorder.h
arch/powerpc/Kconfig
arch/powerpc/boot/dts/mpc8315erdb.dts
arch/powerpc/boot/dts/mpc8544ds.dts
arch/powerpc/boot/dts/mpc8572ds.dts
arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/include/asm/Kbuild
arch/powerpc/include/asm/byteorder.h
arch/powerpc/include/asm/ps3.h
arch/powerpc/include/asm/qe.h
arch/powerpc/include/asm/rtas.h
arch/powerpc/include/asm/systbl.h
arch/powerpc/include/asm/types.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/cacheinfo.c
arch/powerpc/kernel/dma-iommu.c
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/lparcfg.c
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/mm/fsl_booke_mmu.c
arch/powerpc/mm/mmu_decl.h
arch/powerpc/mm/slice.c
arch/powerpc/mm/stab.c
arch/powerpc/oprofile/op_model_pa6t.c
arch/powerpc/platforms/512x/clock.c
arch/powerpc/platforms/52xx/mpc52xx_gpio.c
arch/powerpc/platforms/52xx/mpc52xx_pic.c
arch/powerpc/platforms/83xx/Makefile
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c [moved from drivers/i2c/chips/mcu_mpc8349emitx.c with 100% similarity]
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/cell/beat_interrupt.c
arch/powerpc/platforms/cell/celleb_scc_epci.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/cell/ras.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spu_callbacks.c
arch/powerpc/platforms/cell/spufs/coredump.c
arch/powerpc/platforms/cell/spufs/fault.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/fsl_uli1575.c
arch/powerpc/platforms/iseries/iommu.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/ps3/device-init.c
arch/powerpc/platforms/ps3/htab.c
arch/powerpc/platforms/ps3/interrupt.c
arch/powerpc/platforms/ps3/mm.c
arch/powerpc/platforms/ps3/os-area.c
arch/powerpc/platforms/ps3/repository.c
arch/powerpc/platforms/ps3/setup.c
arch/powerpc/platforms/ps3/spu.c
arch/powerpc/platforms/ps3/system-bus.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/sysdev/mpic.c
arch/s390/Kconfig
arch/s390/include/asm/Kbuild
arch/s390/include/asm/byteorder.h
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/entry.h
arch/s390/kernel/process.c
arch/s390/kernel/signal.c
arch/s390/kernel/sys_s390.c
arch/s390/kernel/syscalls.S
arch/sh/include/asm/Kbuild
arch/sh/include/asm/byteorder.h
arch/sh/include/asm/syscalls_32.h
arch/sh/kernel/sys_sh32.c
arch/sh/kernel/syscalls_32.S
arch/sh/kernel/syscalls_64.S
arch/sparc/include/asm/Kbuild
arch/sparc/include/asm/byteorder.h
arch/sparc/kernel/entry.S
arch/sparc/kernel/sparc_ksyms_64.c
arch/sparc/kernel/syscalls.S
arch/sparc/kernel/systbls_32.S
arch/sparc/kernel/systbls_64.S
arch/x86/include/asm/Kbuild
arch/x86/include/asm/byteorder.h
arch/x86/include/asm/pgtable.h
arch/x86/kernel/entry_32.S
arch/x86/kernel/syscall_table_32.S
arch/x86/mm/pat.c
arch/x86/pci/i386.c
arch/xtensa/include/asm/Kbuild
arch/xtensa/include/asm/byteorder.h
drivers/ata/Kconfig
drivers/ata/Makefile
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/libata-sff.c
drivers/ata/pata_ali.c
drivers/ata/pata_atiixp.c
drivers/ata/pata_it821x.c
drivers/ata/pata_octeon_cf.c [new file with mode: 0644]
drivers/ata/sata_fsl.c
drivers/ata/sata_via.c
drivers/block/nbd.c
drivers/block/ps3disk.c
drivers/block/xsysace.c
drivers/char/bsr.c
drivers/char/hvc_console.c
drivers/char/hvc_irq.c
drivers/char/ps3flash.c
drivers/char/synclink_gt.c
drivers/char/sysrq.c
drivers/char/tty_ioctl.c
drivers/gpio/max7301.c
drivers/gpio/max732x.c
drivers/gpio/mcp23s08.c
drivers/gpio/pca953x.c
drivers/gpio/pcf857x.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/hwmon/Kconfig
drivers/hwmon/Makefile
drivers/hwmon/abituguru3.c
drivers/hwmon/adt7475.c [new file with mode: 0644]
drivers/hwmon/applesmc.c
drivers/hwmon/hp_accel.c
drivers/hwmon/k8temp.c
drivers/i2c/chips/Kconfig
drivers/i2c/chips/Makefile
drivers/ide/Kconfig
drivers/ide/ide-disk.c
drivers/ide/ide-iops.c
drivers/ide/ide-pm.c
drivers/ide/ide-probe.c
drivers/ide/it821x.c
drivers/ide/sl82c105.c
drivers/ide/tx4938ide.c
drivers/ide/via82cxxx.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/hw/nes/nes_utils.c
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/infiniband/ulp/iser/Kconfig
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-hp-disk.c [deleted file]
drivers/message/fusion/lsi/mpi.h
drivers/message/fusion/lsi/mpi_cnfg.h
drivers/message/fusion/lsi/mpi_fc.h
drivers/message/fusion/lsi/mpi_history.txt
drivers/message/fusion/lsi/mpi_init.h
drivers/message/fusion/lsi/mpi_ioc.h
drivers/message/fusion/lsi/mpi_lan.h
drivers/message/fusion/lsi/mpi_log_fc.h
drivers/message/fusion/lsi/mpi_log_sas.h
drivers/message/fusion/lsi/mpi_raid.h
drivers/message/fusion/lsi/mpi_sas.h
drivers/message/fusion/lsi/mpi_targ.h
drivers/message/fusion/lsi/mpi_tool.h
drivers/message/fusion/lsi/mpi_type.h
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptscsih.c
drivers/mfd/twl4030-core.c
drivers/misc/sgi-xp/xpc_sn2.c
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_qmr.c
drivers/net/ibmveth.c
drivers/net/iseries_veth.c
drivers/net/mlx4/main.c
drivers/net/pasemi_mac.c
drivers/net/usb/hso.c
drivers/of/of_i2c.c
drivers/parisc/superio.c
drivers/pci/intel-iommu.c
drivers/pci/pci.c
drivers/pci/syscall.c
drivers/pcmcia/electra_cf.c
drivers/ps3/ps3-lpm.c
drivers/ps3/ps3-vuart.c
drivers/ps3/ps3stor_lib.c
drivers/rtc/rtc-pxa.c
drivers/rtc/rtc-twl4030.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ibmvscsi/ibmvfc.h
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ipr.c
drivers/scsi/libiscsi_tcp.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/ps3rom.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mid.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi.c
drivers/scsi/scsi_devinfo.c
drivers/serial/8250.c
drivers/serial/8250_pci.c
drivers/serial/8250_pnp.c
drivers/serial/atmel_serial.c
drivers/serial/of_serial.c
drivers/serial/pnx8xxx_uart.c
drivers/spi/atmel_spi.c
drivers/spi/xilinx_spi.c
drivers/usb/core/hub.c
drivers/usb/serial/ftdi_sio.c
drivers/video/bf54x-lq043fb.c
drivers/video/bfin-t350mcqb-fb.c
drivers/video/ps3fb.c
fs/aio.c
fs/btrfs/ioctl.h
fs/btrfs/super.c
fs/btrfs/volumes.c
fs/buffer.c
fs/compat.c
fs/dcache.c
fs/dcookies.c
fs/eventfd.c
fs/eventpoll.c
fs/exec.c
fs/ext2/dir.c
fs/fcntl.c
fs/filesystems.c
fs/ioctl.c
fs/ioprio.c
fs/locks.c
fs/namei.c
fs/namespace.c
fs/nfsctl.c
fs/notify/inotify/inotify_user.c
fs/open.c
fs/pipe.c
fs/quota.c
fs/read_write.c
fs/readdir.c
fs/select.c
fs/signalfd.c
fs/splice.c
fs/squashfs/squashfs_fs.h
fs/squashfs/super.c
fs/stat.c
fs/super.c
fs/sync.c
fs/timerfd.c
fs/utimes.c
fs/xattr.c
fs/xfs/linux-2.6/xfs_aops.h
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_export.c
fs/xfs/xfs_acl.h
fs/xfs/xfs_ag.h
fs/xfs/xfs_attr_leaf.c
fs/xfs/xfs_attr_leaf.h
fs/xfs/xfs_bit.h
fs/xfs/xfs_bmap_btree.c
fs/xfs/xfs_btree.c
fs/xfs/xfs_dir2_block.c
fs/xfs/xfs_dir2_leaf.c
fs/xfs/xfs_dir2_sf.c
fs/xfs/xfs_types.h
include/asm-frv/Kbuild
include/asm-frv/byteorder.h
include/asm-generic/Kbuild.asm
include/asm-generic/pgtable.h
include/asm-generic/rtc.h
include/asm-m32r/Kbuild
include/asm-m32r/byteorder.h
include/asm-m68k/Kbuild
include/asm-m68k/byteorder.h
include/asm-mn10300/Kbuild
include/asm-mn10300/byteorder.h
include/drm/drm_crtc.h
include/drm/drm_crtc_helper.h
include/linux/agpgart.h
include/linux/atm_idt77105.h
include/linux/capi.h
include/linux/compat.h
include/linux/connector.h
include/linux/cyclades.h
include/linux/fb.h
include/linux/ide.h
include/linux/if_pppol2tp.h
include/linux/if_pppox.h
include/linux/input.h
include/linux/ioport.h
include/linux/jbd.h
include/linux/joystick.h
include/linux/kvm.h
include/linux/libata.h
include/linux/loop.h
include/linux/magic.h
include/linux/matroxfb.h
include/linux/mm.h
include/linux/of_i2c.h
include/linux/pci_ids.h
include/linux/phantom.h
include/linux/radeonfb.h
include/linux/res_counter.h
include/linux/swab.h
include/linux/syscalls.h
include/scsi/libiscsi_tcp.h
init/Kconfig
ipc/mqueue.c
ipc/msg.c
ipc/sem.c
ipc/shm.c
kernel/Makefile
kernel/acct.c
kernel/capability.c
kernel/cpuset.c
kernel/exec_domain.c
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/hrtimer.c
kernel/itimer.c
kernel/kexec.c
kernel/module.c
kernel/posix-timers.c
kernel/printk.c
kernel/ptrace.c
kernel/resource.c
kernel/sched.c
kernel/sched_fair.c
kernel/signal.c
kernel/sys.c
kernel/sys_ni.c
kernel/sysctl.c
kernel/time.c
kernel/timer.c
kernel/uid16.c
kernel/up.c
lib/idr.c
mm/fadvise.c
mm/filemap.c
mm/fremap.c
mm/madvise.c
mm/memcontrol.c
mm/memory.c
mm/mempolicy.c
mm/migrate.c
mm/mincore.c
mm/mlock.c
mm/mmap.c
mm/mprotect.c
mm/mremap.c
mm/msync.c
mm/nommu.c
mm/swapfile.c
mm/vmalloc.c
net/9p/Kconfig
net/socket.c
scripts/checkpatch.pl
security/keys/keyctl.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_nvhdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/oxygen/virtuoso.c
sound/ppc/snd_ps3.c
sound/soc/soc-dapm.c
sound/usb/usbquirks.h

diff --git a/CREDITS b/CREDITS
index 939da46a87fb69628ff96b46b32e7687f8285434..2b39168c06aabe35bc35c10753cb42438e65eaed 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -3786,14 +3786,11 @@ S: The Netherlands
 
 N: David Woodhouse
 E: dwmw2@infradead.org
-D: ARCnet stuff, Applicom board driver, SO_BINDTODEVICE,
-D: some Alpha platform porting from 2.0, Memory Technology Devices,
-D: Acquire watchdog timer, PC speaker driver maintenance,
+D: JFFS2 file system, Memory Technology Device subsystem,
 D: various other stuff that annoyed me by not working.
-S: c/o Red Hat Engineering
-S: Rustat House
-S: 60 Clifton Road
-S: Cambridge. CB1 7EG
+S: c/o Intel Corporation
+S: Pipers Way
+S: Swindon. SN3 1RJ
 S: England
 
 N: Chris Wright
index b462bb1495438b4854564151cdddb9b3c98e91a2..52441694fe039abca40fd83217a82fa88aca4176 100644 (file)
@@ -170,16 +170,15 @@ Returns: 0 if successful and a negative error if not.
 u64
 dma_get_required_mask(struct device *dev)
 
-After setting the mask with dma_set_mask(), this API returns the
-actual mask (within that already set) that the platform actually
-requires to operate efficiently.  Usually this means the returned mask
+This API returns the mask that the platform requires to
+operate efficiently.  Usually this means the returned mask
 is the minimum required to cover all of memory.  Examining the
 required mask gives drivers with variable descriptor sizes the
 opportunity to use smaller descriptors as necessary.
 
 Requesting the required mask does not alter the current mask.  If you
-wish to take advantage of it, you should issue another dma_set_mask()
-call to lower the mask again.
+wish to take advantage of it, you should issue a dma_set_mask()
+call to set the mask to the value returned.
 
 
 Part Id - Streaming DMA mappings
index cc49400b4af899abf34b30cf955b52d378617948..7ea231172c850db1a7eed7127d0bb8a036e56364 100644 (file)
@@ -392,6 +392,10 @@ int main(int argc, char *argv[])
                        goto err;
                }
        }
+       if (!maskset && !tid && !containerset) {
+               usage();
+               goto err;
+       }
 
        do {
                int i;
index e33ee74eee77000bc6a2df9ac437a0aa88632dcf..d9e5d6f41b927c09ce0c98e8dfd6a448bddee236 100644 (file)
@@ -1,7 +1,8 @@
                                CGROUPS
                                -------
 
-Written by Paul Menage <menage@google.com> based on Documentation/cpusets.txt
+Written by Paul Menage <menage@google.com> based on
+Documentation/cgroups/cpusets.txt
 
 Original copyright statements from cpusets.txt:
 Portions Copyright (C) 2004 BULL SA.
@@ -68,7 +69,7 @@ On their own, the only use for cgroups is for simple job
 tracking. The intention is that other subsystems hook into the generic
 cgroup support to provide new attributes for cgroups, such as
 accounting/limiting the resources which processes in a cgroup can
-access. For example, cpusets (see Documentation/cpusets.txt) allows
+access. For example, cpusets (see Documentation/cgroups/cpusets.txt) allows
 you to associate a set of CPUs and a set of memory nodes with the
 tasks in each cgroup.
 
similarity index 99%
rename from Documentation/controllers/memcg_test.txt
rename to Documentation/cgroups/memcg_test.txt
index 08d4d3ea0d79696444af3785fb82eda617346bbb..19533f93b7a2ac4175142947142569199dacc51f 100644 (file)
@@ -6,7 +6,7 @@ Because VM is getting complex (one of reasons is memcg...), memcg's behavior
 is complex. This is a document for memcg's internal behavior.
 Please note that implementation details can be changed.
 
-(*) Topics on API should be in Documentation/controllers/memory.txt)
+(*) Topics on API should be in Documentation/cgroups/memory.txt)
 
 0. How to record usage ?
    2 objects are used.
index d105eb45282ae5f6a1f978872fdb6a101f089b12..bbebc3a43ac04e7e905b4d18d00e9ea42f0ffcc2 100644 (file)
@@ -1371,292 +1371,8 @@ auto_msgmni default value is 1.
 2.4 /proc/sys/vm - The virtual memory subsystem
 -----------------------------------------------
 
-The files  in  this directory can be used to tune the operation of the virtual
-memory (VM)  subsystem  of  the  Linux  kernel.
-
-vfs_cache_pressure
-------------------
-
-Controls the tendency of the kernel to reclaim the memory which is used for
-caching of directory and inode objects.
-
-At the default value of vfs_cache_pressure=100 the kernel will attempt to
-reclaim dentries and inodes at a "fair" rate with respect to pagecache and
-swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer
-to retain dentry and inode caches.  Increasing vfs_cache_pressure beyond 100
-causes the kernel to prefer to reclaim dentries and inodes.
-
-dirty_background_bytes
-----------------------
-
-Contains the amount of dirty memory at which the pdflush background writeback
-daemon will start writeback.
-
-If dirty_background_bytes is written, dirty_background_ratio becomes a function
-of its value (dirty_background_bytes / the amount of dirtyable system memory).
-
-dirty_background_ratio
-----------------------
-
-Contains, as a percentage of the dirtyable system memory (free pages + mapped
-pages + file cache, not including locked pages and HugePages), the number of
-pages at which the pdflush background writeback daemon will start writing out
-dirty data.
-
-If dirty_background_ratio is written, dirty_background_bytes becomes a function
-of its value (dirty_background_ratio * the amount of dirtyable system memory).
-
-dirty_bytes
------------
-
-Contains the amount of dirty memory at which a process generating disk writes
-will itself start writeback.
-
-If dirty_bytes is written, dirty_ratio becomes a function of its value
-(dirty_bytes / the amount of dirtyable system memory).
-
-dirty_ratio
------------
-
-Contains, as a percentage of the dirtyable system memory (free pages + mapped
-pages + file cache, not including locked pages and HugePages), the number of
-pages at which a process which is generating disk writes will itself start
-writing out dirty data.
-
-If dirty_ratio is written, dirty_bytes becomes a function of its value
-(dirty_ratio * the amount of dirtyable system memory).
-
-dirty_writeback_centisecs
--------------------------
-
-The pdflush writeback daemons will periodically wake up and write `old' data
-out to disk.  This tunable expresses the interval between those wakeups, in
-100'ths of a second.
-
-Setting this to zero disables periodic writeback altogether.
-
-dirty_expire_centisecs
-----------------------
-
-This tunable is used to define when dirty data is old enough to be eligible
-for writeout by the pdflush daemons.  It is expressed in 100'ths of a second. 
-Data which has been dirty in-memory for longer than this interval will be
-written out next time a pdflush daemon wakes up.
-
-highmem_is_dirtyable
---------------------
-
-Only present if CONFIG_HIGHMEM is set.
-
-This defaults to 0 (false), meaning that the ratios set above are calculated
-as a percentage of lowmem only.  This protects against excessive scanning
-in page reclaim, swapping and general VM distress.
-
-Setting this to 1 can be useful on 32 bit machines where you want to make
-random changes within an MMAPed file that is larger than your available
-lowmem without causing large quantities of random IO.  Is is safe if the
-behavior of all programs running on the machine is known and memory will
-not be otherwise stressed.
-
-legacy_va_layout
-----------------
-
-If non-zero, this sysctl disables the new 32-bit mmap mmap layout - the kernel
-will use the legacy (2.4) layout for all processes.
-
-lowmem_reserve_ratio
----------------------
-
-For some specialised workloads on highmem machines it is dangerous for
-the kernel to allow process memory to be allocated from the "lowmem"
-zone.  This is because that memory could then be pinned via the mlock()
-system call, or by unavailability of swapspace.
-
-And on large highmem machines this lack of reclaimable lowmem memory
-can be fatal.
-
-So the Linux page allocator has a mechanism which prevents allocations
-which _could_ use highmem from using too much lowmem.  This means that
-a certain amount of lowmem is defended from the possibility of being
-captured into pinned user memory.
-
-(The same argument applies to the old 16 megabyte ISA DMA region.  This
-mechanism will also defend that region from allocations which could use
-highmem or lowmem).
-
-The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is
-in defending these lower zones.
-
-If you have a machine which uses highmem or ISA DMA and your
-applications are using mlock(), or if you are running with no swap then
-you probably should change the lowmem_reserve_ratio setting.
-
-The lowmem_reserve_ratio is an array. You can see them by reading this file.
--
-% cat /proc/sys/vm/lowmem_reserve_ratio
-256     256     32
--
-Note: # of this elements is one fewer than number of zones. Because the highest
-      zone's value is not necessary for following calculation.
-
-But, these values are not used directly. The kernel calculates # of protection
-pages for each zones from them. These are shown as array of protection pages
-in /proc/zoneinfo like followings. (This is an example of x86-64 box).
-Each zone has an array of protection pages like this.
-
--
-Node 0, zone      DMA
-  pages free     1355
-        min      3
-        low      3
-        high     4
-       :
-       :
-    numa_other   0
-        protection: (0, 2004, 2004, 2004)
-       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-  pagesets
-    cpu: 0 pcp: 0
-        :
--
-These protections are added to score to judge whether this zone should be used
-for page allocation or should be reclaimed.
-
-In this example, if normal pages (index=2) are required to this DMA zone and
-pages_high is used for watermark, the kernel judges this zone should not be
-used because pages_free(1355) is smaller than watermark + protection[2]
-(4 + 2004 = 2008). If this protection value is 0, this zone would be used for
-normal page requirement. If requirement is DMA zone(index=0), protection[0]
-(=0) is used.
-
-zone[i]'s protection[j] is calculated by following expression.
-
-(i < j):
-  zone[i]->protection[j]
-  = (total sums of present_pages from zone[i+1] to zone[j] on the node)
-    / lowmem_reserve_ratio[i];
-(i = j):
-   (should not be protected. = 0;
-(i > j):
-   (not necessary, but looks 0)
-
-The default values of lowmem_reserve_ratio[i] are
-    256 (if zone[i] means DMA or DMA32 zone)
-    32  (others).
-As above expression, they are reciprocal number of ratio.
-256 means 1/256. # of protection pages becomes about "0.39%" of total present
-pages of higher zones on the node.
-
-If you would like to protect more pages, smaller values are effective.
-The minimum value is 1 (1/1 -> 100%).
-
-page-cluster
-------------
-
-page-cluster controls the number of pages which are written to swap in
-a single attempt.  The swap I/O size.
-
-It is a logarithmic value - setting it to zero means "1 page", setting
-it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
-
-The default value is three (eight pages at a time).  There may be some
-small benefits in tuning this to a different value if your workload is
-swap-intensive.
-
-overcommit_memory
------------------
-
-Controls overcommit of system memory, possibly allowing processes
-to allocate (but not use) more memory than is actually available.
-
-
-0      -       Heuristic overcommit handling. Obvious overcommits of
-               address space are refused. Used for a typical system. It
-               ensures a seriously wild allocation fails while allowing
-               overcommit to reduce swap usage.  root is allowed to
-               allocate slightly more memory in this mode. This is the
-               default.
-
-1      -       Always overcommit. Appropriate for some scientific
-               applications.
-
-2      -       Don't overcommit. The total address space commit
-               for the system is not permitted to exceed swap plus a
-               configurable percentage (default is 50) of physical RAM.
-               Depending on the percentage you use, in most situations
-               this means a process will not be killed while attempting
-               to use already-allocated memory but will receive errors
-               on memory allocation as appropriate.
-
-overcommit_ratio
-----------------
-
-Percentage of physical memory size to include in overcommit calculations
-(see above.)
-
-Memory allocation limit = swapspace + physmem * (overcommit_ratio / 100)
-
-       swapspace = total size of all swap areas
-       physmem = size of physical memory in system
-
-nr_hugepages and hugetlb_shm_group
-----------------------------------
-
-nr_hugepages configures number of hugetlb page reserved for the system.
-
-hugetlb_shm_group contains group id that is allowed to create SysV shared
-memory segment using hugetlb page.
-
-hugepages_treat_as_movable
---------------------------
-
-This parameter is only useful when kernelcore= is specified at boot time to
-create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages
-are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero
-value written to hugepages_treat_as_movable allows huge pages to be allocated
-from ZONE_MOVABLE.
-
-Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge
-pages pool can easily grow or shrink within. Assuming that applications are
-not running that mlock() a lot of memory, it is likely the huge pages pool
-can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value
-into nr_hugepages and triggering page reclaim.
-
-laptop_mode
------------
-
-laptop_mode is a knob that controls "laptop mode". All the things that are
-controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt.
-
-block_dump
-----------
-
-block_dump enables block I/O debugging when set to a nonzero value. More
-information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.
-
-swap_token_timeout
-------------------
-
-This file contains valid hold time of swap out protection token. The Linux
-VM has token based thrashing control mechanism and uses the token to prevent
-unnecessary page faults in thrashing situation. The unit of the value is
-second. The value would be useful to tune thrashing behavior.
-
-drop_caches
------------
-
-Writing to this will cause the kernel to drop clean caches, dentries and
-inodes from memory, causing that memory to become free.
-
-To free pagecache:
-       echo 1 > /proc/sys/vm/drop_caches
-To free dentries and inodes:
-       echo 2 > /proc/sys/vm/drop_caches
-To free pagecache, dentries and inodes:
-       echo 3 > /proc/sys/vm/drop_caches
-
-As this is a non-destructive operation and dirty objects are not freeable, the
-user should run `sync' first.
+Please see: Documentation/sysctls/vm.txt for a description of these
+entries.
 
 
 2.5 /proc/sys/dev - Device specific parameters
diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475
new file mode 100644 (file)
index 0000000..a2b1abe
--- /dev/null
@@ -0,0 +1,87 @@
+This describes the interface for the ADT7475 driver:
+
+(there are 4 fans, numbered fan1 to fan4):
+
+fanX_input             Read the current speed of the fan (in RPMs)
+fanX_min               Read/write the minimum speed of the fan.  Dropping
+                       below this sets an alarm.
+
+(there are three PWMs, numbered pwm1 to pwm3):
+
+pwmX                   Read/write the current duty cycle of the PWM.  Writes
+                       only have effect when auto mode is turned off (see
+                       below).  Range is 0 - 255.
+
+pwmX_enable            Fan speed control method:
+
+                       0 - No control (fan at full speed)
+                       1 - Manual fan speed control (using pwm[1-*])
+                       2 - Automatic fan speed control
+
+pwmX_auto_channels_temp        Select which channels affect this PWM
+
+                       1 - TEMP1 controls PWM
+                       2 - TEMP2 controls PWM
+                       4 - TEMP3 controls PWM
+                       6 - TEMP2 and TEMP3 control PWM
+                       7 - All three inputs control PWM
+
+pwmX_freq              Read/write the PWM frequency in Hz. The number
+                       should be one of the following:
+
+                       11 Hz
+                       14 Hz
+                       22 Hz
+                       29 Hz
+                       35 Hz
+                       44 Hz
+                       58 Hz
+                       88 Hz
+
+pwmX_auto_point1_pwm   Read/write the minimum PWM duty cycle in automatic mode
+
+pwmX_auto_point2_pwm   Read/write the maximum PWM duty cycle in automatic mode
+
+(there are three temperature settings numbered temp1 to temp3):
+
+tempX_input            Read the current temperature.  The value is in milli
+                       degrees of Celsius.
+
+tempX_max              Read/write the upper temperature limit - exceeding this
+                       will cause an alarm.
+
+tempX_min              Read/write the lower temperature limit - exceeding this
+                       will cause an alarm.
+
+tempX_offset           Read/write the temperature adjustment offset
+
+tempX_crit             Read/write the THERM limit for remote1.
+
+tempX_crit_hyst                Set the temperature value below crit where the
+                       fans will stay on - this helps drive the temperature
+                       low enough so it doesn't stay near the edge and
+                       cause THERM to keep tripping.
+
+tempX_auto_point1_temp Read/write the minimum temperature where the fans will
+                       turn on in automatic mode.
+
+tempX_auto_point2_temp Read/write the maximum temperature over which the fans
+                       will run in automatic mode.  tempX_auto_point1_temp
+                       and tempX_auto_point2_temp together define the
+                       range of automatic control.
+
+tempX_alarm            Read a 1 if the max/min alarm is set
+tempX_fault            Read a 1 if either temp1 or temp3 diode has a fault
+
+(There are two voltage settings, in1 and in2):
+
+inX_input              Read the current voltage on VCC.  Value is in
+                       millivolts.
+
+inX_min                        read/write the minimum voltage limit.
+                       Dropping below this causes an alarm.
+
+inX_max                        read/write the maximum voltage limit.
+                       Exceeding this causes an alarm.
+
+inX_alarm              Read a 1 if the max/min alarm is set.
index 65dfb0c0fd679f9c9588c44656aa3142a9d7a047..0fcfc4a7ccdc0c9b7934a42054d60139e3320a4a 100644 (file)
@@ -13,18 +13,21 @@ Author:
 Description
 -----------
 
-This driver provides support for the accelerometer found in various HP laptops
-sporting the feature officially called "HP Mobile Data Protection System 3D" or
-"HP 3D DriveGuard". It detect automatically laptops with this sensor. Known models
-(for now the HP 2133, nc6420, nc2510, nc8510, nc84x0, nw9440 and nx9420) will
-have their axis automatically oriented on standard way (eg: you can directly
-play neverball).  The accelerometer data is readable via
+This driver provides support for the accelerometer found in various HP
+laptops sporting the feature officially called "HP Mobile Data
+Protection System 3D" or "HP 3D DriveGuard". It detect automatically
+laptops with this sensor. Known models (for now the HP 2133, nc6420,
+nc2510, nc8510, nc84x0, nw9440 and nx9420) will have their axis
+automatically oriented on standard way (eg: you can directly play
+neverball).  The accelerometer data is readable via
 /sys/devices/platform/lis3lv02d.
 
 Sysfs attributes under /sys/devices/platform/lis3lv02d/:
 position - 3D position that the accelerometer reports. Format: "(x,y,z)"
-calibrate - read: values (x, y, z) that are used as the base for input class device operation.
-            write: forces the base to be recalibrated with the current position.
+calibrate - read: values (x, y, z) that are used as the base for input
+                 class device operation.
+            write: forces the base to be recalibrated with the current
+                 position.
 rate - reports the sampling rate of the accelerometer device in HZ
 
 This driver also provides an absolute input class device, allowing
@@ -39,11 +42,12 @@ the accelerometer are converted into a "standard" organisation of the axes
  * When the laptop is horizontal the position reported is about 0 for X and Y
 and a positive value for Z
  * If the left side is elevated, X increases (becomes positive)
- * If the front side (where the touchpad is) is elevated, Y decreases (becomes negative)
+ * If the front side (where the touchpad is) is elevated, Y decreases
+       (becomes negative)
  * If the laptop is put upside-down, Z becomes negative
 
-If your laptop model is not recognized (cf "dmesg"), you can send an email to the
-authors to add it to the database.  When reporting a new laptop, please include
-the output of "dmidecode" plus the value of /sys/devices/platform/lis3lv02d/position
-in these four cases.
+If your laptop model is not recognized (cf "dmesg"), you can send an
+email to the authors to add it to the database.  When reporting a new
+laptop, please include the output of "dmidecode" plus the value of
+/sys/devices/platform/lis3lv02d/position in these four cases.
 
index f54962aea84dd571ef0f2f25adb1381b9ce69335..8ace35ebdcd55adce48f19ad30108aa1d516e87f 100644 (file)
@@ -52,14 +52,12 @@ Two files are introduced:
   b) 'drivers/ide/mips/au1xxx-ide.c'
      contains the functionality of the AU1XXX IDE driver
 
-Four configs variables are introduced:
+Following extra configs variables are introduced:
 
   CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA    - enable the PIO+DBDMA mode
   CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA  - enable the MWDMA mode
   CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON - set Burstable FIFO in DBDMA
                                            controller
-  CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size
-                                           per descriptor
 
 
 SUPPORTED IDE MODES
@@ -87,7 +85,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDE_AU1XXX=y
 CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
-CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_IDEDMA_AUTO=y
 
@@ -105,7 +102,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDE_AU1XXX=y
 CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
-CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_IDEDMA_AUTO=y
 
index 8398ca4ff4ede1e4671f334bdb417e4787593aec..6f33593e59e21d898fa38fd59ce297a438dfbdf1 100644 (file)
@@ -231,7 +231,7 @@ CPU bandwidth control purposes:
 
    This options needs CONFIG_CGROUPS to be defined, and lets the administrator
    create arbitrary groups of tasks, using the "cgroup" pseudo filesystem.  See
-   Documentation/cgroups.txt for more information about this filesystem.
+   Documentation/cgroups/cgroups.txt for more information about this filesystem.
 
 Only one of these options to group tasks can be chosen and not both.
 
index 4b7ac21ea9eb15eb3c6ef4a350e3b640d998b1e2..64eb1100eec1d1aca87a5adb155c550eb365c97d 100644 (file)
@@ -275,7 +275,8 @@ STAC9200
   dell-m25     Dell Inspiron E1505n
   dell-m26     Dell Inspiron 1501
   dell-m27     Dell Inspiron E1705/9400
-  gateway      Gateway laptops with EAPD control
+  gateway-m4   Gateway laptops with EAPD control
+  gateway-m4-2 Gateway laptops with EAPD control
   panasonic    Panasonic CF-74
 
 STAC9205/9254
@@ -302,6 +303,7 @@ STAC9220/9221
   macbook-pro  Intel Mac Book Pro 2nd generation (eq. type 3)
   imac-intel   Intel iMac (eq. type 2)
   imac-intel-20        Intel iMac (newer version) (eq. type 3)
+  ecs202       ECS/PC chips
   dell-d81     Dell (unknown)
   dell-d82     Dell (unknown)
   dell-m81     Dell (unknown)
@@ -310,9 +312,13 @@ STAC9220/9221
 STAC9202/9250/9251
 ==================
   ref          Reference board, base config
+  m1           Some Gateway MX series laptops (NX560XL)
+  m1-2         Some Gateway MX series laptops (MX6453)
+  m2           Some Gateway MX series laptops (M255)
   m2-2         Some Gateway MX series laptops
+  m3           Some Gateway MX series laptops
+  m5           Some Gateway MX series laptops (MP6954)
   m6           Some Gateway NX series laptops
-  pa6          Gateway NX860 series
 
 STAC9227/9228/9229/927x
 =======================
@@ -329,6 +335,7 @@ STAC92HD71B*
   dell-m4-1    Dell desktops
   dell-m4-2    Dell desktops
   dell-m4-3    Dell desktops
+  hp-m4                HP dv laptops
 
 STAC92HD73*
 ===========
@@ -337,6 +344,7 @@ STAC92HD73*
   dell-m6-amic Dell desktops/laptops with analog mics
   dell-m6-dmic Dell desktops/laptops with digital mics
   dell-m6      Dell desktops/laptops with both type of mics
+  dell-eq      Dell desktops/laptops
 
 STAC92HD83*
 ===========
index a3415070bcac1fe6e16c8eafebccea30e3c55cb7..3197fc83bc51c0b42559be7c14c3d11471a1448b 100644 (file)
@@ -1,12 +1,13 @@
-Documentation for /proc/sys/vm/*       kernel version 2.2.10
+Documentation for /proc/sys/vm/*       kernel version 2.6.29
        (c) 1998, 1999,  Rik van Riel <riel@nl.linux.org>
+       (c) 2008         Peter W. Morreale <pmorreale@novell.com>
 
 For general info and legal blurb, please look in README.
 
 ==============================================================
 
 This file contains the documentation for the sysctl files in
-/proc/sys/vm and is valid for Linux kernel version 2.2.
+/proc/sys/vm and is valid for Linux kernel version 2.6.29.
 
 The files in this directory can be used to tune the operation
 of the virtual memory (VM) subsystem of the Linux kernel and
@@ -16,180 +17,274 @@ Default values and initialization routines for most of these
 files can be found in mm/swap.c.
 
 Currently, these files are in /proc/sys/vm:
-- overcommit_memory
-- page-cluster
-- dirty_ratio
+
+- block_dump
+- dirty_background_bytes
 - dirty_background_ratio
+- dirty_bytes
 - dirty_expire_centisecs
+- dirty_ratio
 - dirty_writeback_centisecs
-- highmem_is_dirtyable   (only if CONFIG_HIGHMEM set)
+- drop_caches
+- hugepages_treat_as_movable
+- hugetlb_shm_group
+- laptop_mode
+- legacy_va_layout
+- lowmem_reserve_ratio
 - max_map_count
 - min_free_kbytes
-- laptop_mode
-- block_dump
-- drop-caches
-- zone_reclaim_mode
-- min_unmapped_ratio
 - min_slab_ratio
-- panic_on_oom
-- oom_dump_tasks
-- oom_kill_allocating_task
-- mmap_min_address
-- numa_zonelist_order
+- min_unmapped_ratio
+- mmap_min_addr
 - nr_hugepages
 - nr_overcommit_hugepages
-- nr_trim_pages                (only if CONFIG_MMU=n)
+- nr_pdflush_threads
+- nr_trim_pages         (only if CONFIG_MMU=n)
+- numa_zonelist_order
+- oom_dump_tasks
+- oom_kill_allocating_task
+- overcommit_memory
+- overcommit_ratio
+- page-cluster
+- panic_on_oom
+- percpu_pagelist_fraction
+- stat_interval
+- swappiness
+- vfs_cache_pressure
+- zone_reclaim_mode
+
 
 ==============================================================
 
-dirty_bytes, dirty_ratio, dirty_background_bytes,
-dirty_background_ratio, dirty_expire_centisecs,
-dirty_writeback_centisecs, highmem_is_dirtyable,
-vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout,
-drop-caches, hugepages_treat_as_movable:
+block_dump
 
-See Documentation/filesystems/proc.txt
+block_dump enables block I/O debugging when set to a nonzero value. More
+information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.
 
 ==============================================================
 
-overcommit_memory:
+dirty_background_bytes
 
-This value contains a flag that enables memory overcommitment.
+Contains the amount of dirty memory at which the pdflush background writeback
+daemon will start writeback.
 
-When this flag is 0, the kernel attempts to estimate the amount
-of free memory left when userspace requests more memory.
+If dirty_background_bytes is written, dirty_background_ratio becomes a function
+of its value (dirty_background_bytes / the amount of dirtyable system memory).
 
-When this flag is 1, the kernel pretends there is always enough
-memory until it actually runs out.
+==============================================================
 
-When this flag is 2, the kernel uses a "never overcommit"
-policy that attempts to prevent any overcommit of memory.  
+dirty_background_ratio
 
-This feature can be very useful because there are a lot of
-programs that malloc() huge amounts of memory "just-in-case"
-and don't use much of it.
+Contains, as a percentage of total system memory, the number of pages at which
+the pdflush background writeback daemon will start writing out dirty data.
 
-The default value is 0.
+==============================================================
 
-See Documentation/vm/overcommit-accounting and
-security/commoncap.c::cap_vm_enough_memory() for more information.
+dirty_bytes
+
+Contains the amount of dirty memory at which a process generating disk writes
+will itself start writeback.
+
+If dirty_bytes is written, dirty_ratio becomes a function of its value
+(dirty_bytes / the amount of dirtyable system memory).
 
 ==============================================================
 
-overcommit_ratio:
+dirty_expire_centisecs
 
-When overcommit_memory is set to 2, the committed address
-space is not permitted to exceed swap plus this percentage
-of physical RAM.  See above.
+This tunable is used to define when dirty data is old enough to be eligible
+for writeout by the pdflush daemons.  It is expressed in 100'ths of a second.
+Data which has been dirty in-memory for longer than this interval will be
+written out next time a pdflush daemon wakes up.
+
+==============================================================
+
+dirty_ratio
+
+Contains, as a percentage of total system memory, the number of pages at which
+a process which is generating disk writes will itself start writing out dirty
+data.
 
 ==============================================================
 
-page-cluster:
+dirty_writeback_centisecs
 
-The Linux VM subsystem avoids excessive disk seeks by reading
-multiple pages on a page fault. The number of pages it reads
-is dependent on the amount of memory in your machine.
+The pdflush writeback daemons will periodically wake up and write `old' data
+out to disk.  This tunable expresses the interval between those wakeups, in
+100'ths of a second.
 
-The number of pages the kernel reads in at once is equal to
-2 ^ page-cluster. Values above 2 ^ 5 don't make much sense
-for swap because we only cluster swap data in 32-page groups.
+Setting this to zero disables periodic writeback altogether.
 
 ==============================================================
 
-max_map_count:
+drop_caches
 
-This file contains the maximum number of memory map areas a process
-may have. Memory map areas are used as a side-effect of calling
-malloc, directly by mmap and mprotect, and also when loading shared
-libraries.
+Writing to this will cause the kernel to drop clean caches, dentries and
+inodes from memory, causing that memory to become free.
 
-While most applications need less than a thousand maps, certain
-programs, particularly malloc debuggers, may consume lots of them,
-e.g., up to one or two maps per allocation.
+To free pagecache:
+       echo 1 > /proc/sys/vm/drop_caches
+To free dentries and inodes:
+       echo 2 > /proc/sys/vm/drop_caches
+To free pagecache, dentries and inodes:
+       echo 3 > /proc/sys/vm/drop_caches
 
-The default value is 65536.
+As this is a non-destructive operation and dirty objects are not freeable, the
+user should run `sync' first.
 
 ==============================================================
 
-min_free_kbytes:
+hugepages_treat_as_movable
 
-This is used to force the Linux VM to keep a minimum number 
-of kilobytes free.  The VM uses this number to compute a pages_min
-value for each lowmem zone in the system.  Each lowmem zone gets 
-a number of reserved free pages based proportionally on its size.
+This parameter is only useful when kernelcore= is specified at boot time to
+create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages
+are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero
+value written to hugepages_treat_as_movable allows huge pages to be allocated
+from ZONE_MOVABLE.
 
-Some minimal amount of memory is needed to satisfy PF_MEMALLOC
-allocations; if you set this to lower than 1024KB, your system will
-become subtly broken, and prone to deadlock under high loads.
-
-Setting this too high will OOM your machine instantly.
+Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge
+pages pool can easily grow or shrink within. Assuming that applications are
+not running that mlock() a lot of memory, it is likely the huge pages pool
+can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value
+into nr_hugepages and triggering page reclaim.
 
 ==============================================================
 
-percpu_pagelist_fraction
+hugetlb_shm_group
 
-This is the fraction of pages at most (high mark pcp->high) in each zone that
-are allocated for each per cpu page list.  The min value for this is 8.  It
-means that we don't allow more than 1/8th of pages in each zone to be
-allocated in any single per_cpu_pagelist.  This entry only changes the value
-of hot per cpu pagelists.  User can specify a number like 100 to allocate
-1/100th of each zone to each per cpu page list.
+hugetlb_shm_group contains group id that is allowed to create SysV
+shared memory segment using hugetlb page.
 
-The batch value of each per cpu pagelist is also updated as a result.  It is
-set to pcp->high/4.  The upper limit of batch is (PAGE_SHIFT * 8)
+==============================================================
 
-The initial value is zero.  Kernel does not use this value at boot time to set
-the high water marks for each per cpu page list.
+laptop_mode
 
-===============================================================
+laptop_mode is a knob that controls "laptop mode". All the things that are
+controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt.
 
-zone_reclaim_mode:
+==============================================================
 
-Zone_reclaim_mode allows someone to set more or less aggressive approaches to
-reclaim memory when a zone runs out of memory. If it is set to zero then no
-zone reclaim occurs. Allocations will be satisfied from other zones / nodes
-in the system.
+legacy_va_layout
 
-This is value ORed together of
+If non-zero, this sysctl disables the new 32-bit mmap mmap layout - the kernel
+will use the legacy (2.4) layout for all processes.
 
-1      = Zone reclaim on
-2      = Zone reclaim writes dirty pages out
-4      = Zone reclaim swaps pages
+==============================================================
 
-zone_reclaim_mode is set during bootup to 1 if it is determined that pages
-from remote zones will cause a measurable performance reduction. The
-page allocator will then reclaim easily reusable pages (those page
-cache pages that are currently not used) before allocating off node pages.
+lowmem_reserve_ratio
+
+For some specialised workloads on highmem machines it is dangerous for
+the kernel to allow process memory to be allocated from the "lowmem"
+zone.  This is because that memory could then be pinned via the mlock()
+system call, or by unavailability of swapspace.
+
+And on large highmem machines this lack of reclaimable lowmem memory
+can be fatal.
+
+So the Linux page allocator has a mechanism which prevents allocations
+which _could_ use highmem from using too much lowmem.  This means that
+a certain amount of lowmem is defended from the possibility of being
+captured into pinned user memory.
+
+(The same argument applies to the old 16 megabyte ISA DMA region.  This
+mechanism will also defend that region from allocations which could use
+highmem or lowmem).
+
+The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is
+in defending these lower zones.
+
+If you have a machine which uses highmem or ISA DMA and your
+applications are using mlock(), or if you are running with no swap then
+you probably should change the lowmem_reserve_ratio setting.
+
+The lowmem_reserve_ratio is an array. You can see them by reading this file.
+-
+% cat /proc/sys/vm/lowmem_reserve_ratio
+256     256     32
+-
+Note: # of this elements is one fewer than number of zones. Because the highest
+      zone's value is not necessary for following calculation.
+
+But, these values are not used directly. The kernel calculates # of protection
+pages for each zones from them. These are shown as array of protection pages
+in /proc/zoneinfo like followings. (This is an example of x86-64 box).
+Each zone has an array of protection pages like this.
+
+-
+Node 0, zone      DMA
+  pages free     1355
+        min      3
+        low      3
+        high     4
+       :
+       :
+    numa_other   0
+        protection: (0, 2004, 2004, 2004)
+       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  pagesets
+    cpu: 0 pcp: 0
+        :
+-
+These protections are added to score to judge whether this zone should be used
+for page allocation or should be reclaimed.
+
+In this example, if normal pages (index=2) are required to this DMA zone and
+pages_high is used for watermark, the kernel judges this zone should not be
+used because pages_free(1355) is smaller than watermark + protection[2]
+(4 + 2004 = 2008). If this protection value is 0, this zone would be used for
+normal page requirement. If requirement is DMA zone(index=0), protection[0]
+(=0) is used.
+
+zone[i]'s protection[j] is calculated by following expression.
+
+(i < j):
+  zone[i]->protection[j]
+  = (total sums of present_pages from zone[i+1] to zone[j] on the node)
+    / lowmem_reserve_ratio[i];
+(i = j):
+   (should not be protected. = 0;
+(i > j):
+   (not necessary, but looks 0)
+
+The default values of lowmem_reserve_ratio[i] are
+    256 (if zone[i] means DMA or DMA32 zone)
+    32  (others).
+As above expression, they are reciprocal number of ratio.
+256 means 1/256. # of protection pages becomes about "0.39%" of total present
+pages of higher zones on the node.
+
+If you would like to protect more pages, smaller values are effective.
+The minimum value is 1 (1/1 -> 100%).
 
-It may be beneficial to switch off zone reclaim if the system is
-used for a file server and all of memory should be used for caching files
-from disk. In that case the caching effect is more important than
-data locality.
+==============================================================
 
-Allowing zone reclaim to write out pages stops processes that are
-writing large amounts of data from dirtying pages on other nodes. Zone
-reclaim will write out dirty pages if a zone fills up and so effectively
-throttle the process. This may decrease the performance of a single process
-since it cannot use all of system memory to buffer the outgoing writes
-anymore but it preserve the memory on other nodes so that the performance
-of other processes running on other nodes will not be affected.
+max_map_count:
 
-Allowing regular swap effectively restricts allocations to the local
-node unless explicitly overridden by memory policies or cpuset
-configurations.
+This file contains the maximum number of memory map areas a process
+may have. Memory map areas are used as a side-effect of calling
+malloc, directly by mmap and mprotect, and also when loading shared
+libraries.
 
-=============================================================
+While most applications need less than a thousand maps, certain
+programs, particularly malloc debuggers, may consume lots of them,
+e.g., up to one or two maps per allocation.
 
-min_unmapped_ratio:
+The default value is 65536.
 
-This is available only on NUMA kernels.
+==============================================================
 
-A percentage of the total pages in each zone.  Zone reclaim will only
-occur if more than this percentage of pages are file backed and unmapped.
-This is to insure that a minimal amount of local pages is still available for
-file I/O even if the node is overallocated.
+min_free_kbytes:
 
-The default is 1 percent.
+This is used to force the Linux VM to keep a minimum number
+of kilobytes free.  The VM uses this number to compute a pages_min
+value for each lowmem zone in the system.  Each lowmem zone gets
+a number of reserved free pages based proportionally on its size.
+
+Some minimal amount of memory is needed to satisfy PF_MEMALLOC
+allocations; if you set this to lower than 1024KB, your system will
+become subtly broken, and prone to deadlock under high loads.
+
+Setting this too high will OOM your machine instantly.
 
 =============================================================
 
@@ -211,82 +306,73 @@ and may not be fast.
 
 =============================================================
 
-panic_on_oom
+min_unmapped_ratio:
 
-This enables or disables panic on out-of-memory feature.
+This is available only on NUMA kernels.
 
-If this is set to 0, the kernel will kill some rogue process,
-called oom_killer.  Usually, oom_killer can kill rogue processes and
-system will survive.
+A percentage of the total pages in each zone.  Zone reclaim will only
+occur if more than this percentage of pages are file backed and unmapped.
+This is to insure that a minimal amount of local pages is still available for
+file I/O even if the node is overallocated.
 
-If this is set to 1, the kernel panics when out-of-memory happens.
-However, if a process limits using nodes by mempolicy/cpusets,
-and those nodes become memory exhaustion status, one process
-may be killed by oom-killer. No panic occurs in this case.
-Because other nodes' memory may be free. This means system total status
-may be not fatal yet.
+The default is 1 percent.
 
-If this is set to 2, the kernel panics compulsorily even on the
-above-mentioned.
+==============================================================
 
-The default value is 0.
-1 and 2 are for failover of clustering. Please select either
-according to your policy of failover.
+mmap_min_addr
 
-=============================================================
+This file indicates the amount of address space  which a user process will
+be restricted from mmaping.  Since kernel null dereference bugs could
+accidentally operate based on the information in the first couple of pages
+of memory userspace processes should not be allowed to write to them.  By
+default this value is set to 0 and no protections will be enforced by the
+security module.  Setting this value to something like 64k will allow the
+vast majority of applications to work correctly and provide defense in depth
+against future potential kernel bugs.
 
-oom_dump_tasks
+==============================================================
 
-Enables a system-wide task dump (excluding kernel threads) to be
-produced when the kernel performs an OOM-killing and includes such
-information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and
-name.  This is helpful to determine why the OOM killer was invoked
-and to identify the rogue task that caused it.
+nr_hugepages
 
-If this is set to zero, this information is suppressed.  On very
-large systems with thousands of tasks it may not be feasible to dump
-the memory state information for each one.  Such systems should not
-be forced to incur a performance penalty in OOM conditions when the
-information may not be desired.
+Change the minimum size of the hugepage pool.
 
-If this is set to non-zero, this information is shown whenever the
-OOM killer actually kills a memory-hogging task.
+See Documentation/vm/hugetlbpage.txt
 
-The default value is 0.
+==============================================================
 
-=============================================================
+nr_overcommit_hugepages
 
-oom_kill_allocating_task
+Change the maximum size of the hugepage pool. The maximum is
+nr_hugepages + nr_overcommit_hugepages.
 
-This enables or disables killing the OOM-triggering task in
-out-of-memory situations.
+See Documentation/vm/hugetlbpage.txt
 
-If this is set to zero, the OOM killer will scan through the entire
-tasklist and select a task based on heuristics to kill.  This normally
-selects a rogue memory-hogging task that frees up a large amount of
-memory when killed.
+==============================================================
 
-If this is set to non-zero, the OOM killer simply kills the task that
-triggered the out-of-memory condition.  This avoids the expensive
-tasklist scan.
+nr_pdflush_threads
 
-If panic_on_oom is selected, it takes precedence over whatever value
-is used in oom_kill_allocating_task.
+The current number of pdflush threads.  This value is read-only.
+The value changes according to the number of dirty pages in the system.
 
-The default value is 0.
+When neccessary, additional pdflush threads are created, one per second, up to
+nr_pdflush_threads_max.
 
 ==============================================================
 
-mmap_min_addr
+nr_trim_pages
 
-This file indicates the amount of address space  which a user process will
-be restricted from mmaping.  Since kernel null dereference bugs could
-accidentally operate based on the information in the first couple of pages
-of memory userspace processes should not be allowed to write to them.  By
-default this value is set to 0 and no protections will be enforced by the
-security module.  Setting this value to something like 64k will allow the
-vast majority of applications to work correctly and provide defense in depth
-against future potential kernel bugs.
+This is available only on NOMMU kernels.
+
+This value adjusts the excess page trimming behaviour of power-of-2 aligned
+NOMMU mmap allocations.
+
+A value of 0 disables trimming of allocations entirely, while a value of 1
+trims excess pages aggressively. Any value >= 1 acts as the watermark where
+trimming of allocations is initiated.
+
+The default value is 1.
+
+See Documentation/nommu-mmap.txt for more information.
 
 ==============================================================
 
@@ -335,34 +421,199 @@ this is causing problems for your system/application.
 
 ==============================================================
 
-nr_hugepages
+oom_dump_tasks
 
-Change the minimum size of the hugepage pool.
+Enables a system-wide task dump (excluding kernel threads) to be
+produced when the kernel performs an OOM-killing and includes such
+information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and
+name.  This is helpful to determine why the OOM killer was invoked
+and to identify the rogue task that caused it.
 
-See Documentation/vm/hugetlbpage.txt
+If this is set to zero, this information is suppressed.  On very
+large systems with thousands of tasks it may not be feasible to dump
+the memory state information for each one.  Such systems should not
+be forced to incur a performance penalty in OOM conditions when the
+information may not be desired.
+
+If this is set to non-zero, this information is shown whenever the
+OOM killer actually kills a memory-hogging task.
+
+The default value is 0.
 
 ==============================================================
 
-nr_overcommit_hugepages
+oom_kill_allocating_task
 
-Change the maximum size of the hugepage pool. The maximum is
-nr_hugepages + nr_overcommit_hugepages.
+This enables or disables killing the OOM-triggering task in
+out-of-memory situations.
 
-See Documentation/vm/hugetlbpage.txt
+If this is set to zero, the OOM killer will scan through the entire
+tasklist and select a task based on heuristics to kill.  This normally
+selects a rogue memory-hogging task that frees up a large amount of
+memory when killed.
+
+If this is set to non-zero, the OOM killer simply kills the task that
+triggered the out-of-memory condition.  This avoids the expensive
+tasklist scan.
+
+If panic_on_oom is selected, it takes precedence over whatever value
+is used in oom_kill_allocating_task.
+
+The default value is 0.
 
 ==============================================================
 
-nr_trim_pages
+overcommit_memory:
 
-This is available only on NOMMU kernels.
+This value contains a flag that enables memory overcommitment.
 
-This value adjusts the excess page trimming behaviour of power-of-2 aligned
-NOMMU mmap allocations.
+When this flag is 0, the kernel attempts to estimate the amount
+of free memory left when userspace requests more memory.
 
-A value of 0 disables trimming of allocations entirely, while a value of 1
-trims excess pages aggressively. Any value >= 1 acts as the watermark where
-trimming of allocations is initiated.
+When this flag is 1, the kernel pretends there is always enough
+memory until it actually runs out.
 
-The default value is 1.
+When this flag is 2, the kernel uses a "never overcommit"
+policy that attempts to prevent any overcommit of memory.
 
-See Documentation/nommu-mmap.txt for more information.
+This feature can be very useful because there are a lot of
+programs that malloc() huge amounts of memory "just-in-case"
+and don't use much of it.
+
+The default value is 0.
+
+See Documentation/vm/overcommit-accounting and
+security/commoncap.c::cap_vm_enough_memory() for more information.
+
+==============================================================
+
+overcommit_ratio:
+
+When overcommit_memory is set to 2, the committed address
+space is not permitted to exceed swap plus this percentage
+of physical RAM.  See above.
+
+==============================================================
+
+page-cluster
+
+page-cluster controls the number of pages which are written to swap in
+a single attempt.  The swap I/O size.
+
+It is a logarithmic value - setting it to zero means "1 page", setting
+it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
+
+The default value is three (eight pages at a time).  There may be some
+small benefits in tuning this to a different value if your workload is
+swap-intensive.
+
+=============================================================
+
+panic_on_oom
+
+This enables or disables panic on out-of-memory feature.
+
+If this is set to 0, the kernel will kill some rogue process,
+called oom_killer.  Usually, oom_killer can kill rogue processes and
+system will survive.
+
+If this is set to 1, the kernel panics when out-of-memory happens.
+However, if a process limits using nodes by mempolicy/cpusets,
+and those nodes become memory exhaustion status, one process
+may be killed by oom-killer. No panic occurs in this case.
+Because other nodes' memory may be free. This means system total status
+may be not fatal yet.
+
+If this is set to 2, the kernel panics compulsorily even on the
+above-mentioned.
+
+The default value is 0.
+1 and 2 are for failover of clustering. Please select either
+according to your policy of failover.
+
+=============================================================
+
+percpu_pagelist_fraction
+
+This is the fraction of pages at most (high mark pcp->high) in each zone that
+are allocated for each per cpu page list.  The min value for this is 8.  It
+means that we don't allow more than 1/8th of pages in each zone to be
+allocated in any single per_cpu_pagelist.  This entry only changes the value
+of hot per cpu pagelists.  User can specify a number like 100 to allocate
+1/100th of each zone to each per cpu page list.
+
+The batch value of each per cpu pagelist is also updated as a result.  It is
+set to pcp->high/4.  The upper limit of batch is (PAGE_SHIFT * 8)
+
+The initial value is zero.  Kernel does not use this value at boot time to set
+the high water marks for each per cpu page list.
+
+==============================================================
+
+stat_interval
+
+The time interval between which vm statistics are updated.  The default
+is 1 second.
+
+==============================================================
+
+swappiness
+
+This control is used to define how aggressive the kernel will swap
+memory pages.  Higher values will increase agressiveness, lower values
+descrease the amount of swap.
+
+The default value is 60.
+
+==============================================================
+
+vfs_cache_pressure
+------------------
+
+Controls the tendency of the kernel to reclaim the memory which is used for
+caching of directory and inode objects.
+
+At the default value of vfs_cache_pressure=100 the kernel will attempt to
+reclaim dentries and inodes at a "fair" rate with respect to pagecache and
+swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer
+to retain dentry and inode caches.  Increasing vfs_cache_pressure beyond 100
+causes the kernel to prefer to reclaim dentries and inodes.
+
+==============================================================
+
+zone_reclaim_mode:
+
+Zone_reclaim_mode allows someone to set more or less aggressive approaches to
+reclaim memory when a zone runs out of memory. If it is set to zero then no
+zone reclaim occurs. Allocations will be satisfied from other zones / nodes
+in the system.
+
+This is value ORed together of
+
+1      = Zone reclaim on
+2      = Zone reclaim writes dirty pages out
+4      = Zone reclaim swaps pages
+
+zone_reclaim_mode is set during bootup to 1 if it is determined that pages
+from remote zones will cause a measurable performance reduction. The
+page allocator will then reclaim easily reusable pages (those page
+cache pages that are currently not used) before allocating off node pages.
+
+It may be beneficial to switch off zone reclaim if the system is
+used for a file server and all of memory should be used for caching files
+from disk. In that case the caching effect is more important than
+data locality.
+
+Allowing zone reclaim to write out pages stops processes that are
+writing large amounts of data from dirtying pages on other nodes. Zone
+reclaim will write out dirty pages if a zone fills up and so effectively
+throttle the process. This may decrease the performance of a single process
+since it cannot use all of system memory to buffer the outgoing writes
+anymore but it preserve the memory on other nodes so that the performance
+of other processes running on other nodes will not be affected.
+
+Allowing regular swap effectively restricts allocations to the local
+node unless explicitly overridden by memory policies or cpuset
+configurations.
+
+============ End of Document =================================
index 10a0263ebb3f01e832c7827cc75d7fe54b341a6f..9e592c718afb4bb41737399b29ff088adca386da 100644 (file)
@@ -1,6 +1,5 @@
 Linux Magic System Request Key Hacks
 Documentation for sysrq.c
-Last update: 2007-AUG-04
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -211,6 +210,24 @@ within a function called by handle_sysrq, you must be aware that you are in
 a lock (you are also in an interrupt handler, which means don't sleep!), so
 you must call __handle_sysrq_nolock instead.
 
+*  When I hit a SysRq key combination only the header appears on the console?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Sysrq output is subject to the same console loglevel control as all
+other console output.  This means that if the kernel was booted 'quiet'
+as is common on distro kernels the output may not appear on the actual
+console, even though it will appear in the dmesg buffer, and be accessible
+via the dmesg command and to the consumers of /proc/kmsg.  As a specific
+exception the header line from the sysrq command is passed to all console
+consumers as if the current loglevel was maximum.  If only the header
+is emitted it is almost certain that the kernel loglevel is too low.
+Should you require the output on the console channel then you will need
+to temporarily up the console loglevel using alt-sysrq-8 or:
+
+    echo 8 > /proc/sysrq-trigger
+
+Remember to return the loglevel to normal after triggering the sysrq
+command you are interested in.
+
 *  I have more questions, who can I ask?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 And I'll answer any questions about the registration system you got, also
index 6f65a269cb17f5d767ee1e62d67b4eb54b1dafad..3fe4dc2c2564bb17af6123c64dcaa25334d23ea8 100644 (file)
@@ -1581,6 +1581,13 @@ L:       bluesmoke-devel@lists.sourceforge.net
 W:     bluesmoke.sourceforge.net
 S:     Maintained
 
+EDAC-I5400
+P:     Mauro Carvalho Chehab
+M:     mchehab@redhat.com
+L:     bluesmoke-devel@lists.sourceforge.net
+W:     bluesmoke.sourceforge.net
+S:     Maintained
+
 EDAC-I82975X
 P:     Ranganathan Desikan
 P:     Arvind R.
@@ -1814,6 +1821,14 @@ M:       hch@infradead.org
 W:     ftp://ftp.openlinux.org/pub/people/hch/vxfs
 S:     Maintained
 
+FREEZER
+P:     Pavel Machek
+M:     pavel@suse.cz
+P:     Rafael J. Wysocki
+M:     rjw@sisk.pl
+L:     linux-pm@lists.linux-foundation.org
+S:     Supported
+
 FTRACE
 P:     Steven Rostedt
 M:     rostedt@goodmis.org
@@ -4842,11 +4857,11 @@ S:      Supported
 
 XFS FILESYSTEM
 P:     Silicon Graphics Inc
-P:     Tim Shimmin
+P:     Bill O'Donnell
 M:     xfs-masters@oss.sgi.com
 L:     xfs@oss.sgi.com
 W:     http://oss.sgi.com/projects/xfs
-T:     git git://oss.sgi.com:8090/xfs/xfs-2.6.git
+T:     git://oss.sgi.com/xfs/xfs.git
 S:     Supported
 
 XILINX SYSTEMACE DRIVER
index 2e13aa261929fd3a3689c41b0bfe6dcdf9805d5c..550dab22daa14b492d88258c9eb8ae7498d76ec1 100644 (file)
@@ -62,6 +62,9 @@ config HAVE_EFFICIENT_UNALIGNED_ACCESS
          See Documentation/unaligned-memory-access.txt for more
          information on the topic of unaligned memory accesses.
 
+config HAVE_SYSCALL_WRAPPERS
+       bool
+
 config KRETPROBES
        def_bool y
        depends on KPROBES && HAVE_KRETPROBES
index 4dad27360576114a67bfcb821aefb4e8a795c18d..b7c8f188b313baf91119c8df0f4327c6969c849e 100644 (file)
@@ -9,4 +9,3 @@ unifdef-y += console.h
 unifdef-y += fpu.h
 unifdef-y += sysinfo.h
 unifdef-y += compiler.h
-unifdef-y += swab.h
index 6772f316870145cab289a4871ed39a81fa3689f7..73683093202da1160edce0942b8b40b2eb41292c 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ALPHA_BYTEORDER_H
 #define _ALPHA_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/little_endian.h>
 
 #endif /* _ALPHA_BYTEORDER_H */
index a86c083cdf7f19e6556c9267cc4912a2f3b28118..fea4ea75b79d20d08cac71369968a5d95c4a104b 100644 (file)
@@ -21,6 +21,7 @@ struct pci_dev;
 struct pci_ops;
 struct pci_controller;
 struct _alpha_agp_info;
+struct rtc_time;
 
 struct alpha_machine_vector
 {
@@ -94,6 +95,9 @@ struct alpha_machine_vector
 
        struct _alpha_agp_info *(*agp_info)(void);
 
+       unsigned int (*rtc_get_time)(struct rtc_time *);
+       int (*rtc_set_time)(struct rtc_time *);
+
        const char *vector_name;
 
        /* NUMA information */
index fd090155dccd14367fcde13c425f5d224de7eb21..bc2a0daf2d9266f067af47feb0bd469893cc3658 100644 (file)
@@ -50,7 +50,12 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd)
        free_page((unsigned long)pmd);
 }
 
-extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
+static inline pte_t *
+pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+{
+       pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
+       return pte;
+}
 
 static inline void
 pte_free_kernel(struct mm_struct *mm, pte_t *pte)
index 4e854b1333ebbd6595b6ae2cfe9d7af68c9f9a9b..1f7fba671ae68a25f204cf819e3e04bde362810e 100644 (file)
@@ -1,9 +1,15 @@
 #ifndef _ALPHA_RTC_H
 #define _ALPHA_RTC_H
 
-/*
- * Alpha uses the default access methods for the RTC.
- */
+#if defined(CONFIG_ALPHA_GENERIC)
+# define get_rtc_time          alpha_mv.rtc_get_time
+# define set_rtc_time          alpha_mv.rtc_set_time
+#else
+# if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP)
+#  define get_rtc_time         marvel_get_rtc_time
+#  define set_rtc_time         marvel_set_rtc_time
+# endif
+#endif
 
 #include <asm-generic/rtc.h>
 
diff --git a/arch/alpha/kernel/.gitignore b/arch/alpha/kernel/.gitignore
new file mode 100644 (file)
index 0000000..c5f676c
--- /dev/null
@@ -0,0 +1 @@
+vmlinux.lds
index 9cd8dca742a733f8791b850872f96d68e72497a7..e302daecbe56cbe5ac5a9cca91046da88fad51da 100644 (file)
@@ -658,16 +658,8 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write)
                rtc_access.data = bcd2bin(b);
                rtc_access.function = 0x48 + !write;    /* GET/PUT_TOY */
 
-#ifdef CONFIG_SMP
-               if (smp_processor_id() != boot_cpuid)
-                       smp_call_function_single(boot_cpuid,
-                                                __marvel_access_rtc,
-                                                &rtc_access, 1);
-               else
-                       __marvel_access_rtc(&rtc_access);
-#else
                __marvel_access_rtc(&rtc_access);
-#endif
+
                ret = bin2bcd(rtc_access.data);
                break;
 
index f77345bc66a975ff244c2e4b83be931fbc50a096..aa2e50cf98578033c73a548e60b653a88e6087ec 100644 (file)
@@ -896,9 +896,9 @@ sys_getxpid:
 .end sys_getxpid
 
        .align  4
-       .globl  sys_pipe
-       .ent    sys_pipe
-sys_pipe:
+       .globl  sys_alpha_pipe
+       .ent    sys_alpha_pipe
+sys_alpha_pipe:
        lda     $sp, -16($sp)
        stq     $26, 0($sp)
        .prologue 0
@@ -916,7 +916,7 @@ sys_pipe:
        stq     $1, 80+16($sp)
 1:     lda     $sp, 16($sp)
        ret
-.end sys_pipe
+.end sys_alpha_pipe
 
        .align  4
        .globl  sys_execve
index 32212014fbe91632e9bb80b5307725d16e758d1a..a03fbca4940eb0d0881b4d197cd3e84a3cf2b68a 100644 (file)
@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask)
 {
        long i;
 
+       if (NR_IRQS <= 16)
+               return;
        for (i = 16; i < max; ++i) {
                if (i < 64 && ((ignore_mask >> i) & 1))
                        continue;
index 466c9dff818192de44302c5feacd495c6a542c74..512685f78097a0ed5406e1e2226641cc007545c8 100644 (file)
 #define CAT1(x,y)  x##y
 #define CAT(x,y)   CAT1(x,y)
 
-#define DO_DEFAULT_RTC .rtc_port = 0x70
+#define DO_DEFAULT_RTC \
+       .rtc_port = 0x70, \
+       .rtc_get_time = common_get_rtc_time, \
+       .rtc_set_time = common_set_rtc_time
 
 #define DO_EV4_MMU                                                     \
        .max_asn =                      EV4_MAX_ASN,                    \
index 708d5ca87782ad011019250399787e6e1c4258e5..fe14c6747cd651d56e07d10d6094f5671eb532c6 100644 (file)
@@ -145,6 +145,8 @@ extern void smp_percpu_timer_interrupt(struct pt_regs *);
 extern irqreturn_t timer_interrupt(int irq, void *dev);
 extern void common_init_rtc(void);
 extern unsigned long est_cycle_freq;
+extern unsigned int common_get_rtc_time(struct rtc_time *time);
+extern int common_set_rtc_time(struct rtc_time *time);
 
 /* smc37c93x.c */
 extern void SMC93x_Init(void);
index 2c3de97de46ca54416b7f52f6fc50bbac7684f6b..e2516f9a8967e45aa8c4df23f3de48cae1cdd67e 100644 (file)
@@ -261,6 +261,8 @@ struct alpha_machine_vector jensen_mv __initmv = {
        .machine_check          = jensen_machine_check,
        .max_isa_dma_address    = ALPHA_MAX_ISA_DMA_ADDRESS,
        .rtc_port               = 0x170,
+       .rtc_get_time           = common_get_rtc_time,
+       .rtc_set_time           = common_set_rtc_time,
 
        .nr_irqs                = 16,
        .device_interrupt       = jensen_device_interrupt,
index 828449cd263687c18bc278358a8e8e2c8c8a01be..c5a1a2438c678191eeb6bb1c39b518cdf1c4adc9 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/hwrpb.h>
 #include <asm/tlbflush.h>
 #include <asm/vga.h>
+#include <asm/rtc.h>
 
 #include "proto.h"
 #include "err_impl.h"
@@ -426,6 +427,57 @@ marvel_init_rtc(void)
        init_rtc_irq();
 }
 
+struct marvel_rtc_time {
+       struct rtc_time *time;
+       int retval;
+};
+
+#ifdef CONFIG_SMP
+static void
+smp_get_rtc_time(void *data)
+{
+       struct marvel_rtc_time *mrt = data;
+       mrt->retval = __get_rtc_time(mrt->time);
+}
+
+static void
+smp_set_rtc_time(void *data)
+{
+       struct marvel_rtc_time *mrt = data;
+       mrt->retval = __set_rtc_time(mrt->time);
+}
+#endif
+
+static unsigned int
+marvel_get_rtc_time(struct rtc_time *time)
+{
+#ifdef CONFIG_SMP
+       struct marvel_rtc_time mrt;
+
+       if (smp_processor_id() != boot_cpuid) {
+               mrt.time = time;
+               smp_call_function_single(boot_cpuid, smp_get_rtc_time, &mrt, 1);
+               return mrt.retval;
+       }
+#endif
+       return __get_rtc_time(time);
+}
+
+static int
+marvel_set_rtc_time(struct rtc_time *time)
+{
+#ifdef CONFIG_SMP
+       struct marvel_rtc_time mrt;
+
+       if (smp_processor_id() != boot_cpuid) {
+               mrt.time = time;
+               smp_call_function_single(boot_cpuid, smp_set_rtc_time, &mrt, 1);
+               return mrt.retval;
+       }
+#endif
+       return __set_rtc_time(time);
+}
+
 static void
 marvel_smp_callin(void)
 {
@@ -466,7 +518,9 @@ marvel_smp_callin(void)
 struct alpha_machine_vector marvel_ev7_mv __initmv = {
        .vector_name            = "MARVEL/EV7",
        DO_EV7_MMU,
-       DO_DEFAULT_RTC,
+       .rtc_port               = 0x70,
+       .rtc_get_time           = marvel_get_rtc_time,
+       .rtc_set_time           = marvel_set_rtc_time,
        DO_MARVEL_IO,
        .machine_check          = marvel_machine_check,
        .max_isa_dma_address    = ALPHA_MAX_ISA_DMA_ADDRESS,
index a7f23b5ab814580a480bb5c7b6b932d3227f828c..99c0f46f6b9cc75007499c10f4fb84f8a2c6d1ee 100644 (file)
@@ -245,6 +245,10 @@ nautilus_init_pci(void)
                IRONGATE0->pci_mem = pci_mem;
 
        pci_bus_assign_resources(bus);
+
+       /* pci_common_swizzle() relies on bus->self being NULL
+          for the root bus, so just clear it. */
+       bus->self = NULL;
        pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
 }
 
index ba914af18c4f30cc60d915277a04c9865d68308c..9d9e3a98bb9584ddbbe05d7d8ed944af7436c5e9 100644 (file)
@@ -52,7 +52,7 @@ sys_call_table:
        .quad sys_setpgid
        .quad alpha_ni_syscall                  /* 40 */
        .quad sys_dup
-       .quad sys_pipe
+       .quad sys_alpha_pipe
        .quad osf_set_program_attributes
        .quad alpha_ni_syscall
        .quad sys_open                          /* 45 */
index e6a231435cbac57f90ffe77907af51cf4b5ccc4f..b04e2cbf23a445cb441839a415f204e49665830e 100644 (file)
@@ -46,6 +46,7 @@
 #include <asm/io.h>
 #include <asm/hwrpb.h>
 #include <asm/8253pit.h>
+#include <asm/rtc.h>
 
 #include <linux/mc146818rtc.h>
 #include <linux/time.h>
@@ -180,6 +181,15 @@ common_init_rtc(void)
        init_rtc_irq();
 }
 
+unsigned int common_get_rtc_time(struct rtc_time *time)
+{
+       return __get_rtc_time(time);
+}
+
+int common_set_rtc_time(struct rtc_time *time)
+{
+       return __set_rtc_time(time);
+}
 
 /* Validate a computed cycle counter result against the known bounds for
    the given processor core.  There's too much brokenness in the way of
index 234e42b8ee7436cb61455c3eabe8f3d8f61ea183..5d7a16eab312619f94cc48515715ae81b298b296 100644 (file)
@@ -59,13 +59,6 @@ pgd_alloc(struct mm_struct *mm)
        return ret;
 }
 
-pte_t *
-pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
-{
-       pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-       return pte;
-}
-
 
 /*
  * BAD_PAGE is the page that is used for page faults when linux
index 43b0b2ba392fa3257f8ff11e75b1727d0dd56901..73237bd130a28b16f35709fa432c2457f8c0191c 100644 (file)
@@ -1,4 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
 unifdef-y += hwcap.h
-unifdef-y += swab.h
index c02b6fc28e1a0f44601e3649cd06263c4590efb0..77379748b17135c6dc03e0542e1a80d5ce171063 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef __ASM_ARM_BYTEORDER_H
 #define __ASM_ARM_BYTEORDER_H
 
-#include <asm/swab.h>
-
 #ifdef __ARMEB__
 #include <linux/byteorder/big_endian.h>
 #else
index 09a061cb7838c311109b3712c9539c77f9f1c39f..9ca8d13f05f72f6908c137c2db38cc914fb1ba1d 100644 (file)
@@ -98,7 +98,7 @@
                CALL(sys_uselib)
                CALL(sys_swapon)
                CALL(sys_reboot)
-               CALL(OBSOLETE(old_readdir))     /* used by libc4 */
+               CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */
 /* 90 */       CALL(OBSOLETE(old_mmap))        /* used by libc4 */
                CALL(sys_munmap)
                CALL(sys_truncate)
index 7ec60fc91565f481e207d368421eef00354d6b00..cf332aeb942e5a81c8d75b7e799b250fc110ff14 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/err.h>
 #include <linux/io.h>
 
-#include <mach/imx-regs.h>
+#include <mach/hardware.h>
 
 /*
  * Very simple approach: We can't disable clocks, so we do
index fa72174dd95ce6c08797beca119f624a7cd6c91a..887cb21f75b016b955e0f265db6cbd096f3fd4eb 100644 (file)
@@ -245,11 +245,11 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
        imx_mmc_device.dev.platform_data = info;
 }
 
-static struct imxfb_mach_info imx_fb_info;
+static struct imx_fb_platform_data imx_fb_info;
 
-void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
+void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info)
 {
-       memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
+       memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data));
 }
 
 static struct resource imxfb_resources[] = {
index fb9de27338796ab23d480cc250b86c55c27d8ed6..490297fc0e3861329084a1235ce328cee8c9bf7d 100644 (file)
 #define TSTAT_CAPT         (1<<1)
 #define TSTAT_COMP         (1<<0)
 
-/*
- * LCD Controller
- */
-
-#define LCDC_SSA       __REG(IMX_LCDC_BASE+0x00)
-
-#define LCDC_SIZE      __REG(IMX_LCDC_BASE+0x04)
-#define SIZE_XMAX(x)   ((((x) >> 4) & 0x3f) << 20)
-#define SIZE_YMAX(y)    ( (y) & 0x1ff )
-
-#define LCDC_VPW       __REG(IMX_LCDC_BASE+0x08)
-#define VPW_VPW(x)     ( (x) & 0x3ff )
-
-#define LCDC_CPOS      __REG(IMX_LCDC_BASE+0x0C)
-#define CPOS_CC1        (1<<31)
-#define CPOS_CC0        (1<<30)
-#define CPOS_OP         (1<<28)
-#define CPOS_CXP(x)     (((x) & 3ff) << 16)
-#define CPOS_CYP(y)     ((y) & 0x1ff)
-
-#define LCDC_LCWHB     __REG(IMX_LCDC_BASE+0x10)
-#define LCWHB_BK_EN     (1<<31)
-#define LCWHB_CW(w)     (((w) & 0x1f) << 24)
-#define LCWHB_CH(h)     (((h) & 0x1f) << 16)
-#define LCWHB_BD(x)     ((x) & 0xff)
-
-#define LCDC_LCHCC     __REG(IMX_LCDC_BASE+0x14)
-#define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11)
-#define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5)
-#define LCHCC_CUR_COL_B(b) ((b) & 0x1f)
-
-#define LCDC_PCR       __REG(IMX_LCDC_BASE+0x18)
-#define PCR_TFT         (1<<31)
-#define PCR_COLOR       (1<<30)
-#define PCR_PBSIZ_1     (0<<28)
-#define PCR_PBSIZ_2     (1<<28)
-#define PCR_PBSIZ_4     (2<<28)
-#define PCR_PBSIZ_8     (3<<28)
-#define PCR_BPIX_1      (0<<25)
-#define PCR_BPIX_2      (1<<25)
-#define PCR_BPIX_4      (2<<25)
-#define PCR_BPIX_8      (3<<25)
-#define PCR_BPIX_12     (4<<25)
-#define PCR_BPIX_16     (4<<25)
-#define PCR_PIXPOL      (1<<24)
-#define PCR_FLMPOL      (1<<23)
-#define PCR_LPPOL       (1<<22)
-#define PCR_CLKPOL      (1<<21)
-#define PCR_OEPOL       (1<<20)
-#define PCR_SCLKIDLE    (1<<19)
-#define PCR_END_SEL     (1<<18)
-#define PCR_END_BYTE_SWAP (1<<17)
-#define PCR_REV_VS      (1<<16)
-#define PCR_ACD_SEL     (1<<15)
-#define PCR_ACD(x)      (((x) & 0x7f) << 8)
-#define PCR_SCLK_SEL    (1<<7)
-#define PCR_SHARP       (1<<6)
-#define PCR_PCD(x)      ((x) & 0x3f)
-
-#define LCDC_HCR       __REG(IMX_LCDC_BASE+0x1C)
-#define HCR_H_WIDTH(x)  (((x) & 0x3f) << 26)
-#define HCR_H_WAIT_1(x) (((x) & 0xff) << 8)
-#define HCR_H_WAIT_2(x) ((x) & 0xff)
-
-#define LCDC_VCR       __REG(IMX_LCDC_BASE+0x20)
-#define VCR_V_WIDTH(x)  (((x) & 0x3f) << 26)
-#define VCR_V_WAIT_1(x) (((x) & 0xff) << 8)
-#define VCR_V_WAIT_2(x) ((x) & 0xff)
-
-#define LCDC_POS       __REG(IMX_LCDC_BASE+0x24)
-#define POS_POS(x)      ((x) & 1f)
-
-#define LCDC_LSCR1     __REG(IMX_LCDC_BASE+0x28)
-#define LSCR1_PS_RISE_DELAY(x)    (((x) & 0x7f) << 26)
-#define LSCR1_CLS_RISE_DELAY(x)   (((x) & 0x3f) << 16)
-#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
-#define LSCR1_GRAY2(x)            (((x) & 0xf) << 4)
-#define LSCR1_GRAY1(x)            (((x) & 0xf))
-
-#define LCDC_PWMR      __REG(IMX_LCDC_BASE+0x2C)
-#define PWMR_CLS(x)     (((x) & 0x1ff) << 16)
-#define PWMR_LDMSK      (1<<15)
-#define PWMR_SCR1       (1<<10)
-#define PWMR_SCR0       (1<<9)
-#define PWMR_CC_EN      (1<<8)
-#define PWMR_PW(x)      ((x) & 0xff)
-
-#define LCDC_DMACR     __REG(IMX_LCDC_BASE+0x30)
-#define DMACR_BURST     (1<<31)
-#define DMACR_HM(x)     (((x) & 0xf) << 16)
-#define DMACR_TM(x)     ((x) &0xf)
-
-#define LCDC_RMCR      __REG(IMX_LCDC_BASE+0x34)
-#define RMCR_LCDC_EN           (1<<1)
-#define RMCR_SELF_REF          (1<<0)
-
-#define LCDC_LCDICR    __REG(IMX_LCDC_BASE+0x38)
-#define LCDICR_INT_SYN  (1<<2)
-#define LCDICR_INT_CON  (1)
-
-#define LCDC_LCDISR    __REG(IMX_LCDC_BASE+0x40)
-#define LCDISR_UDR_ERR (1<<3)
-#define LCDISR_ERR_RES (1<<2)
-#define LCDISR_EOF     (1<<1)
-#define LCDISR_BOF     (1<<0)
-
 #endif                         // _IMX_REGS_H
index 9307a2475438be0b546400c89331fd60aaf49690..9ebc93f485305f82b4651294127029535007402d 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/mach-types.h>
 
 #include <mach/regs-serial.h>
+#include <mach/map.h>
 
 #include "cpu.h"
 
index 3a69e381f31676e245ad792303c4d90653b53844..bcc838f6b3936236d68c50bc54be24f775ecb263 100644 (file)
@@ -28,7 +28,6 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
-#include <mach/system.h>
 #include <mach/map.h>
 #include <mach/regs-timer.h>
 
index 4ad3bf291ad31aa4d4db670a7bda4e3d46e6c3e6..195e48edd8c2ce951cb8ac5b3272e962785d6bae 100644 (file)
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all);
 EXPORT_SYMBOL(__cpuc_flush_user_all);
 EXPORT_SYMBOL(__cpuc_flush_user_range);
 EXPORT_SYMBOL(__cpuc_coherent_kern_range);
+EXPORT_SYMBOL(dmac_inv_range);  /* because of flush_ioremap_region() */
 #else
 EXPORT_SYMBOL(cpu_cache);
 #endif
index 219822c8ad18a356ee238ef47121312c9d3cdfaf..3136628ba8d20feba7de4ed07a51261a65c4a3b2 100644 (file)
@@ -1,4 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
-header-y       += swab.h
 header-y       += cachectl.h
index 2aba64b4e12200895d4bdbbf2334dc2786bd5078..50abc21619a8a288b9c46a2ac0d38ca56ce344e7 100644 (file)
@@ -4,7 +4,6 @@
 #ifndef __ASM_AVR32_BYTEORDER_H
 #define __ASM_AVR32_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* __ASM_AVR32_BYTEORDER_H */
index d0d1ac435544b28bceb709f3b7ab3fca38657480..606ecfdcc962e19dc68a8af35d730b2623603ebf 100644 (file)
@@ -1,4 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
 unifdef-y += fixed_code.h
-unifdef-y += swab.h
index b9e797a497b4f250c2ebe6056723160d887f77b7..3e69106a4d37a893ce3a90bc941da5d15a6def5e 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _BLACKFIN_BYTEORDER_H
 #define _BLACKFIN_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/little_endian.h>
 
 #endif                         /* _BLACKFIN_BYTEORDER_H */
index ed171d389e658595e8b1b56ca64e00b0ae8b7214..72f5cd319b975802abb94eae94e2e0b7b4326a23 100644 (file)
@@ -691,7 +691,7 @@ sys_call_table:
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 7f6f93e6b70e0c94f7a08a26a6868487bece3043..5e674c8f7c513348006be197758f082ec1bb19ce 100644 (file)
@@ -614,7 +614,7 @@ sys_call_table:
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
similarity index 55%
rename from arch/cris/include/arch-v10/arch/byteorder.h
rename to arch/cris/include/arch-v10/arch/swab.h
index 255b646b7fa8dbe6a586d88e4d7136ee5a12c75d..e4e847d8a05e5099f4c7900c8590259096b65d1c 100644 (file)
@@ -1,26 +1,30 @@
-#ifndef _CRIS_ARCH_BYTEORDER_H
-#define _CRIS_ARCH_BYTEORDER_H
+#ifndef _CRIS_ARCH_SWAB_H
+#define _CRIS_ARCH_SWAB_H
 
 #include <asm/types.h>
 #include <linux/compiler.h>
 
+#define __SWAB_64_THRU_32__
+
 /* we just define these two (as we can do the swap in a single
  * asm instruction in CRIS) and the arch-independent files will put
  * them together into ntohl etc.
  */
 
-static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 {
        __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
-  
+
        return(x);
 }
+#define __arch_swab32 __arch_swab32
 
-static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
+static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 {
        __asm__ ("swapb %0" : "=r" (x) : "0" (x));
-       
+
        return(x);
 }
+#define __arch_swab16 __arch_swab16
 
 #endif
diff --git a/arch/cris/include/arch-v32/arch/byteorder.h b/arch/cris/include/arch-v32/arch/byteorder.h
deleted file mode 100644 (file)
index 6ef8fb4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ASM_CRIS_ARCH_BYTEORDER_H
-#define _ASM_CRIS_ARCH_BYTEORDER_H
-
-#include <asm/types.h>
-
-static inline __const__ __u32
-___arch__swab32(__u32 x)
-{
-       __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
-       return (x);
-}
-
-static inline __const__ __u16
-___arch__swab16(__u16 x)
-{
-       __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
-       return (x);
-}
-
-#endif /* _ASM_CRIS_ARCH_BYTEORDER_H */
diff --git a/arch/cris/include/arch-v32/arch/swab.h b/arch/cris/include/arch-v32/arch/swab.h
new file mode 100644 (file)
index 0000000..9a4ea5e
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _ASM_CRIS_ARCH_SWAB_H
+#define _ASM_CRIS_ARCH_SWAB_H
+
+#include <asm/types.h>
+
+#define __SWAB_64_THRU_32__
+
+static inline __const__ __u32
+__arch_swab32(__u32 x)
+{
+       __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
+       return (x);
+}
+#define __arch_swab32 __arch_swab32
+
+static inline __const__ __u16
+__arch_swab16(__u16 x)
+{
+       __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
+       return (x);
+}
+#define __arch_swab16 __arch_swab16
+
+#endif /* _ASM_CRIS_ARCH_SWAB_H */
index cc8e418cfd14a10c65fc1dc8a3f41c78178db713..bcd189798e2665191043c150958c2a7d6a9fd479 100644 (file)
@@ -1,25 +1,6 @@
 #ifndef _CRIS_BYTEORDER_H
 #define _CRIS_BYTEORDER_H
 
-#ifdef __GNUC__
-
-#ifdef __KERNEL__
-#include <arch/byteorder.h>
-
-/* defines are necessary because the other files detect the presence
- * of a defined __arch_swab32, not an inline
- */
-#define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab16(x) ___arch__swab16(x)
-#endif /* __KERNEL__ */
-
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
-
-#endif /* __GNUC__ */
-
 #include <linux/byteorder/little_endian.h>
 
 #endif
diff --git a/arch/cris/include/asm/swab.h b/arch/cris/include/asm/swab.h
new file mode 100644 (file)
index 0000000..80668e8
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _CRIS_SWAB_H
+#define _CRIS_SWAB_H
+
+#ifdef __KERNEL__
+#include <arch/swab.h>
+#endif /* __KERNEL__ */
+
+#endif /* _CRIS_SWAB_H */
index 27b108a86b397ccc26509f3b9d8e0d99d0091fbf..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,2 +1 @@
 include include/asm-generic/Kbuild.asm
-unifdef-y += swab.h
index c36b80a3dd844b9bd1bd5c9b228589061f44d797..13539da99efd7477631db1fa549cfd136dff9ee3 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _H8300_BYTEORDER_H
 #define _H8300_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _H8300_BYTEORDER_H */
index 54e21c3f2057359df65ae62bc10b6d7e67c89288..4eb67faac6337878717224f9d39d292bc5712846 100644 (file)
@@ -103,7 +103,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
        .long SYMBOL_NAME(sys_uselib)
        .long SYMBOL_NAME(sys_swapon)
        .long SYMBOL_NAME(sys_reboot)
-       .long SYMBOL_NAME(old_readdir)
+       .long SYMBOL_NAME(sys_old_readdir)
        .long SYMBOL_NAME(old_mmap)             /* 90 */
        .long SYMBOL_NAME(sys_munmap)
        .long SYMBOL_NAME(sys_truncate)
index 3d31636cbafb584d25995e6ae6ff9d253a95901d..6183aeccecf1f9d564cc2bc2832943a235ed3871 100644 (file)
@@ -17,6 +17,7 @@ config IA64
        select ACPI if (!IA64_HP_SIM)
        select PM if (!IA64_HP_SIM)
        select ARCH_SUPPORTS_MSI
+       select HAVE_UNSTABLE_SCHED_CLOCK
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
index 27eb67604c53bf2915dd725691a447dcd2f19903..a109db30ce55e0ade28e542f475cd0b479d45639 100644 (file)
@@ -578,7 +578,7 @@ CONFIG_ATA_PIIX=y
 # CONFIG_SATA_SIS is not set
 # CONFIG_SATA_ULI is not set
 # CONFIG_SATA_VIA is not set
-# CONFIG_SATA_VITESSE is not set
+CONFIG_SATA_VITESSE=y
 # CONFIG_SATA_INIC162X is not set
 # CONFIG_PATA_ACPI is not set
 # CONFIG_PATA_ALI is not set
index a8cf199588508e23c0d6e40e869b8540a37d965a..a46f8395e9a51857b0c0364a8b80733bd0575d64 100644 (file)
@@ -220,7 +220,7 @@ ia32_syscall_table:
        data8 sys_mkdir
        data8 sys_rmdir           /* 40 */
        data8 sys_dup
-       data8 sys_pipe
+       data8 sys_ia64_pipe
        data8 compat_sys_times
        data8 sys_ni_syscall      /* old prof syscall holder */
        data8 sys32_brk           /* 45 */
index 3b25bd9dca91bac182df681c18258509f8880823..ccbe8ae47a6127730741335b3d2362ff298409d5 100644 (file)
@@ -14,4 +14,3 @@ unifdef-y += gcc_intrin.h
 unifdef-y += intrinsics.h
 unifdef-y += perfmon.h
 unifdef-y += ustack.h
-unifdef-y += swab.h
index 0f84c5cb703dc1fff6442e72740a12158ba8f54f..a8dd735581505ae07f20e6eee7a4f7290c2f71b9 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_IA64_BYTEORDER_H
 #define _ASM_IA64_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/little_endian.h>
 
 #endif /* _ASM_IA64_BYTEORDER_H */
index bbab7e2b0fc92f3f546a48fea7095d040975422b..1f912d927585efbc69cb29734a4ddb4f67bff154 100644 (file)
@@ -9,6 +9,8 @@
 #include <linux/scatterlist.h>
 #include <asm/swiotlb.h>
 
+#define ARCH_HAS_DMA_GET_REQUIRED_MASK
+
 struct dma_mapping_ops {
        int             (*mapping_error)(struct device *dev,
                                         dma_addr_t dma_addr);
index 59c17e446683c5c12decbd3cad96f7b4a3373e7c..fe87b21217077b4765553b59d2a41742ee558562 100644 (file)
@@ -62,6 +62,7 @@ typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t
 typedef void ia64_mv_dma_unmap_single_attrs (struct device *, dma_addr_t, size_t, int, struct dma_attrs *);
 typedef int ia64_mv_dma_map_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
 typedef void ia64_mv_dma_unmap_sg_attrs (struct device *, struct scatterlist *, int, int, struct dma_attrs *);
+typedef u64 ia64_mv_dma_get_required_mask (struct device *);
 
 /*
  * WARNING: The legacy I/O space is _architected_.  Platforms are
@@ -159,6 +160,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
 #  define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
 #  define platform_dma_mapping_error           ia64_mv.dma_mapping_error
 #  define platform_dma_supported       ia64_mv.dma_supported
+#  define platform_dma_get_required_mask ia64_mv.dma_get_required_mask
 #  define platform_irq_to_vector       ia64_mv.irq_to_vector
 #  define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
 #  define platform_pci_get_legacy_mem  ia64_mv.pci_get_legacy_mem
@@ -213,6 +215,7 @@ struct ia64_machine_vector {
        ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
        ia64_mv_dma_mapping_error *dma_mapping_error;
        ia64_mv_dma_supported *dma_supported;
+       ia64_mv_dma_get_required_mask *dma_get_required_mask;
        ia64_mv_irq_to_vector *irq_to_vector;
        ia64_mv_local_vector_to_irq *local_vector_to_irq;
        ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
@@ -263,6 +266,7 @@ struct ia64_machine_vector {
        platform_dma_sync_sg_for_device,        \
        platform_dma_mapping_error,                     \
        platform_dma_supported,                 \
+       platform_dma_get_required_mask,         \
        platform_irq_to_vector,                 \
        platform_local_vector_to_irq,           \
        platform_pci_get_legacy_mem,            \
@@ -366,6 +370,9 @@ extern void machvec_init_from_cmdline(const char *cmdline);
 #ifndef platform_dma_supported
 # define  platform_dma_supported       swiotlb_dma_supported
 #endif
+#ifndef platform_dma_get_required_mask
+# define  platform_dma_get_required_mask       ia64_dma_get_required_mask
+#endif
 #ifndef platform_irq_to_vector
 # define platform_irq_to_vector                __ia64_irq_to_vector
 #endif
index ef964b2868425cf161b98cedf9060be0b63bfad9..37a469849ab9f94d3e56a2f73f2f9525de3eb1ab 100644 (file)
@@ -3,6 +3,7 @@
 
 extern ia64_mv_send_ipi_t ia64_send_ipi;
 extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
+extern ia64_mv_dma_get_required_mask ia64_dma_get_required_mask;
 extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
 extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
 extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
index 781308ea7b88baad9f1c6f58eeb039c4fc60f048..f1a6e0d6dfa582c1533e2b66f3a8cfb6744b5233 100644 (file)
@@ -67,6 +67,7 @@ extern ia64_mv_dma_sync_single_for_device sn_dma_sync_single_for_device;
 extern ia64_mv_dma_sync_sg_for_device  sn_dma_sync_sg_for_device;
 extern ia64_mv_dma_mapping_error       sn_dma_mapping_error;
 extern ia64_mv_dma_supported           sn_dma_supported;
+extern ia64_mv_dma_get_required_mask   sn_dma_get_required_mask;
 extern ia64_mv_migrate_t               sn_migrate;
 extern ia64_mv_kernel_launch_event_t   sn_kernel_launch_event;
 extern ia64_mv_setup_msi_irq_t         sn_setup_msi_irq;
@@ -123,6 +124,7 @@ extern ia64_mv_pci_fixup_bus_t              sn_pci_fixup_bus;
 #define platform_dma_sync_sg_for_device        sn_dma_sync_sg_for_device
 #define platform_dma_mapping_error             sn_dma_mapping_error
 #define platform_dma_supported         sn_dma_supported
+#define platform_dma_get_required_mask sn_dma_get_required_mask
 #define platform_migrate               sn_migrate
 #define platform_kernel_launch_event    sn_kernel_launch_event
 #ifdef CONFIG_PCI_MSI
index f791576355ad32535951d1a05b762c243da6f3a3..9015979ebe0f3481a2a7582db001097a608e0155 100644 (file)
@@ -364,7 +364,7 @@ struct pt_regs;
 struct sigaction;
 long sys_execve(char __user *filename, char __user * __user *argv,
                           char __user * __user *envp, struct pt_regs *regs);
-asmlinkage long sys_pipe(void);
+asmlinkage long sys_ia64_pipe(void);
 asmlinkage long sys_rt_sigaction(int sig,
                                 const struct sigaction __user *act,
                                 struct sigaction __user *oact,
index d435f4a7a96c0f83203a3e4be44b099694b26311..e5341e2c1175c6f0b5e16f88bd831f90422fbf03 100644 (file)
@@ -1442,7 +1442,7 @@ sys_call_table:
        data8 sys_mkdir                         // 1055
        data8 sys_rmdir
        data8 sys_dup
-       data8 sys_pipe
+       data8 sys_ia64_pipe
        data8 sys_times
        data8 ia64_brk                          // 1060
        data8 sys_setgid
index bcbb6d8792d3344352d226cb6e4fdda7c7d4182e..92ed83f34036f0b52cccc36a529bb48bdbd5127d 100644 (file)
@@ -154,7 +154,7 @@ out:
  * and r9) as this is faster than doing a copy_to_user().
  */
 asmlinkage long
-sys_pipe (void)
+sys_ia64_pipe (void)
 {
        struct pt_regs *regs = task_pt_regs(current);
        int fd[2];
index ff0e7c10faa7222d48964d355bf3322b45506800..6db08599ebbc551a372782a90dedf730ae2ca143 100644 (file)
@@ -59,6 +59,7 @@ dump (const char *str, void *vp, size_t len)
  *  (i.e. don't allow attacker to fill up logs with unaligned accesses).
  */
 int no_unaligned_warning;
+int unaligned_dump_stack;
 static int noprint_warning;
 
 /*
@@ -1371,9 +1372,12 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
                        }
                }
        } else {
-               if (within_logging_rate_limit())
+               if (within_logging_rate_limit()) {
                        printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n",
                               ifa, regs->cr_iip + ipsr->ri);
+                       if (unaligned_dump_stack)
+                               dump_stack();
+               }
                set_fs(KERNEL_DS);
        }
 
index 211fcfd115f91f1e6ec169e8abd9849c257b975f..61f1af5c23c187ec8f1a8c36e2a3f28b5c467078 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/ioport.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/bootmem.h>
 
 #include <asm/machvec.h>
 #include <asm/page.h>
@@ -748,6 +749,32 @@ static void __init set_pci_cacheline_size(void)
        pci_cache_line_size = (1 << cci.pcci_line_size) / 4;
 }
 
+u64 ia64_dma_get_required_mask(struct device *dev)
+{
+       u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT);
+       u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT));
+       u64 mask;
+
+       if (!high_totalram) {
+               /* convert to mask just covering totalram */
+               low_totalram = (1 << (fls(low_totalram) - 1));
+               low_totalram += low_totalram - 1;
+               mask = low_totalram;
+       } else {
+               high_totalram = (1 << (fls(high_totalram) - 1));
+               high_totalram += high_totalram - 1;
+               mask = (((u64)high_totalram) << 32) + 0xffffffff;
+       }
+       return mask;
+}
+EXPORT_SYMBOL_GPL(ia64_dma_get_required_mask);
+
+u64 dma_get_required_mask(struct device *dev)
+{
+       return platform_dma_get_required_mask(dev);
+}
+EXPORT_SYMBOL_GPL(dma_get_required_mask);
+
 static int __init pcibios_init(void)
 {
        set_pci_cacheline_size();
index 53ebb6484495545550e3f07e149bea575db07981..863f5017baae6d6981ff809ce2ffe931d8fdcdf6 100644 (file)
@@ -356,6 +356,12 @@ int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 }
 EXPORT_SYMBOL(sn_dma_mapping_error);
 
+u64 sn_dma_get_required_mask(struct device *dev)
+{
+       return DMA_64BIT_MASK;
+}
+EXPORT_SYMBOL_GPL(sn_dma_get_required_mask);
+
 char *sn_pci_get_legacy_mem(struct pci_bus *bus)
 {
        if (!SN_PCIBUS_BUSSOFT(bus))
index d15a94c330fbd0d192596a336f00df483fd87537..68d6204c3f1627d0bd76cb04b1aeef2cf885218f 100644 (file)
@@ -129,8 +129,8 @@ consider_steal_time(unsigned long new_itm)
                blocked = stolentick;
 
        if (stolen > 0 || blocked > 0) {
-               account_steal_time(NULL, jiffies_to_cputime(stolen));
-               account_steal_time(idle_task(cpu), jiffies_to_cputime(blocked));
+               account_steal_ticks(stolen);
+               account_idle_ticks(blocked);
                run_local_timers();
 
                if (rcu_pending(cpu))
index 5b780826647cce7e90bedfc8243c302c91ffaa71..5c332f2b9b83afee167a87c0a34e5a1d5ec113a8 100644 (file)
@@ -513,7 +513,7 @@ sys_call_table:
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 58c02a454130c659c2f8c5c3afdc8de682445cf5..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,3 +1 @@
 include include/asm-generic/Kbuild.asm
-
-unifdef-y += swab.h
index a6f0b8f7f6227d63e3a21700e17fd08e090ffe14..9c6c76a1504177e49a8676f811bed2e9a9e69a1b 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _M68KNOMMU_BYTEORDER_H
 #define _M68KNOMMU_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _M68KNOMMU_BYTEORDER_H */
index 812f8d8b7a85e8f508af7b7de71706aad8b001da..5c3e3f62194a11aa5a3e415976bcc9f137c7c5d8 100644 (file)
@@ -107,7 +107,7 @@ ENTRY(sys_call_table)
        .long sys_uselib
        .long sys_ni_syscall    /* sys_swapon */
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 023866c0c102bdf163f3d97988894f0817e6605a..7897f05e316520ed5279e479eef15a4278a6afa9 100644 (file)
@@ -1,4 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
 header-y += cachectl.h sgidefs.h sysmips.h
-header-y += swab.h
index 607b7183070773d377c68be3643ef68895a4ea6b..9579051ff1c7b9b66924c99e35490dcd925104e8 100644 (file)
@@ -8,8 +8,6 @@
 #ifndef _ASM_BYTEORDER_H
 #define _ASM_BYTEORDER_H
 
-#include <asm/swab.h>
-
 #if defined(__MIPSEB__)
 #include <linux/byteorder/big_endian.h>
 #elif defined(__MIPSEL__)
index d0916a55cd775f09f54826eb9358c626ba19dd7d..51d1ba415b90adaab205ee6fafd784ef1aa97bd6 100644 (file)
@@ -398,7 +398,7 @@ einval:     li      v0, -ENOSYS
        sys     sys_uselib              1
        sys     sys_swapon              2
        sys     sys_reboot              3
-       sys     old_readdir             3
+       sys     sys_old_readdir         3
        sys     old_mmap                6       /* 4090 */
        sys     sys_munmap              2
        sys     sys_truncate            2
index 62fba8aa9b6e1ae84aa8cc1583d57a8e628f16d6..ceeaaaa359e231431838c003c5d8cc20f56f7918 100644 (file)
@@ -478,7 +478,7 @@ ENTRY(sys_call_table)
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 2121d99f83648191266df9cad5c293ac9017b0e1..f88b252e419cb504a3c0938e3d99d541e2113372 100644 (file)
@@ -1,4 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
 unifdef-y += pdc.h
-unifdef-y += swab.h
index da66029c4cb2572a44731485180909cc1dad8208..58af2c5f5d61427d10380a3e49b1f60e9d5e3235 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _PARISC_BYTEORDER_H
 #define _PARISC_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _PARISC_BYTEORDER_H */
index 84b861316ce78b65f90febaf44227d3ffed37c83..e39b73bc0ff8e2075a710878c3d81c055c68b4cb 100644 (file)
@@ -123,6 +123,7 @@ config PPC
        select HAVE_DMA_ATTRS if PPC64
        select USE_GENERIC_SMP_HELPERS if SMP
        select HAVE_OPROFILE
+       select HAVE_SYSCALL_WRAPPERS if PPC64
 
 config EARLY_PRINTK
        bool
index 072c9b0f8c8e837845e8bb9af1b5a433186e675d..71784165b77e42624d22aadd1215c969ec923a8a 100644 (file)
                        device_type = "serial";
                        compatible = "ns16550";
                        reg = <0x4500 0x100>;
-                       clock-frequency = <0>;
+                       clock-frequency = <133333333>;
                        interrupts = <9 0x8>;
                        interrupt-parent = <&ipic>;
                };
                        device_type = "serial";
                        compatible = "ns16550";
                        reg = <0x4600 0x100>;
-                       clock-frequency = <0>;
+                       clock-frequency = <133333333>;
                        interrupts = <10 0x8>;
                        interrupt-parent = <&ipic>;
                };
index b9da42105066d37bd7a9432d530127a1d8aa100b..0668d10487795648fce808ab04b4e3da15aafd76 100644 (file)
                          0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <26 2>;
+               interrupts = <25 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
                          0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <25 2>;
+               interrupts = <26 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
index 21459e161d02ee0513a6db3c44e928eb884d401f..3dcc001b8ed3432609a281462af94293f7f47868 100644 (file)
                          0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <26 2>;
+               interrupts = <25 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
                          0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <27 2>;
+               interrupts = <26 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
index c114c4ee99313755602e53f8dac45799b6974008..fd462efa9e61c0fbc0b7541c0cf58cedc527024f 100644 (file)
                          0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <26 2>;
+               interrupts = <25 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
index 04ecda18d2066cd18861fafd099c980ad17bd15b..e35230f2ac936041573cc2899cc952e3fe9761b4 100644 (file)
                          0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
                clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <27 2>;
+               interrupts = <26 2>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
index 069ae1bbac292ad411f3a591e3360518577c82b2..d4685d1c0be867a960f69e73482e890e63f8b6d8 100644 (file)
@@ -211,11 +211,28 @@ CONFIG_PPC_PASEMI=y
 CONFIG_PPC_PASEMI_IOMMU=y
 # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
 CONFIG_PPC_PASEMI_MDIO=y
-# CONFIG_PPC_PS3 is not set
+CONFIG_PPC_PS3=y
+
+#
+# PS3 Platform Options
+#
+# CONFIG_PS3_ADVANCED is not set
+CONFIG_PS3_HTAB_SIZE=20
+# CONFIG_PS3_DYNAMIC_DMA is not set
+CONFIG_PS3_VUART=y
+CONFIG_PS3_PS3AV=y
+CONFIG_PS3_SYS_MANAGER=y
+CONFIG_PS3_STORAGE=m
+CONFIG_PS3_DISK=m
+CONFIG_PS3_ROM=m
+CONFIG_PS3_FLASH=m
+CONFIG_PS3_LPM=m
 CONFIG_PPC_CELL=y
+CONFIG_PPC_CELL_COMMON=y
 CONFIG_PPC_CELL_NATIVE=y
 CONFIG_PPC_IBM_CELL_BLADE=y
 CONFIG_PPC_CELLEB=y
+CONFIG_PPC_CELL_QPACE=y
 
 #
 # Cell Broadband Engine options
@@ -981,6 +998,9 @@ CONFIG_E1000=y
 CONFIG_TIGON3=y
 # CONFIG_BNX2 is not set
 CONFIG_SPIDER_NET=m
+CONFIG_GELIC_NET=m
+CONFIG_GELIC_WIRELESS=y
+# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
 # CONFIG_QLA3XXX is not set
 # CONFIG_ATL1 is not set
 # CONFIG_ATL1E is not set
@@ -1370,6 +1390,8 @@ CONFIG_FB_RADEON_BACKLIGHT=y
 # CONFIG_FB_PM3 is not set
 # CONFIG_FB_CARMINE is not set
 CONFIG_FB_IBM_GXT4500=y
+CONFIG_FB_PS3=m
+CONFIG_FB_PS3_DEFAULT_SIZE_M=9
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_FB_METRONOME is not set
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
@@ -1492,6 +1514,8 @@ CONFIG_SND_PCI=y
 CONFIG_SND_PPC=y
 CONFIG_SND_POWERMAC=m
 CONFIG_SND_POWERMAC_AUTO_DRC=y
+CONFIG_SND_PS3=m
+CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
 CONFIG_SND_AOA=m
 CONFIG_SND_AOA_FABRIC_LAYOUT=m
 CONFIG_SND_AOA_ONYX=m
index 9268602de5d0bb10445ed72a34bb957c64804721..5ab7d7fe198ce091708e9ba25066c3788e859ebb 100644 (file)
@@ -35,4 +35,3 @@ unifdef-y += spu_info.h
 unifdef-y += termios.h
 unifdef-y += types.h
 unifdef-y += unistd.h
-unifdef-y += swab.h
index 5cca27a4153297180b56e15765d042283b1cddd7..aa6cc4fac9651326b69a7648b13009f30dd93774 100644 (file)
@@ -7,8 +7,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _ASM_POWERPC_BYTEORDER_H */
index eead5c67197abb3478d4a3e5dd25815949e9e488..67f1812698d2703e02cad2c561fd1d0e6c6d84b2 100644 (file)
@@ -103,10 +103,10 @@ struct ps3_dma_region_ops {
        int (*map)(struct ps3_dma_region *,
                   unsigned long virt_addr,
                   unsigned long len,
-                  unsigned long *bus_addr,
+                  dma_addr_t *bus_addr,
                   u64 iopte_pp);
        int (*unmap)(struct ps3_dma_region *,
-                    unsigned long bus_addr,
+                    dma_addr_t bus_addr,
                     unsigned long len);
 };
 /**
@@ -124,9 +124,9 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
 int ps3_dma_region_create(struct ps3_dma_region *r);
 int ps3_dma_region_free(struct ps3_dma_region *r);
 int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
-       unsigned long len, unsigned long *bus_addr,
+       unsigned long len, dma_addr_t *bus_addr,
        u64 iopte_pp);
-int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr,
+int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr,
        unsigned long len);
 
 /* mmio routines */
index a0a15311d0d82bc8117c8a064cecce1ca5bc09df..2701753d9937513ee78b995893d8857da7710479 100644 (file)
@@ -624,7 +624,7 @@ struct ucc_slow_pram {
 #define UCC_GETH_UCCE_RXF1      0x00000002
 #define UCC_GETH_UCCE_RXF0      0x00000001
 
-/* UPSMR, when used as a UART */
+/* UCC Protocol Specific Mode Register (UPSMR), when used for UART */
 #define UCC_UART_UPSMR_FLC             0x8000
 #define UCC_UART_UPSMR_SL              0x4000
 #define UCC_UART_UPSMR_CL_MASK         0x3000
@@ -652,6 +652,23 @@ struct ucc_slow_pram {
 #define UCC_UART_UPSMR_TPM_EVEN                0x0002
 #define UCC_UART_UPSMR_TPM_HIGH                0x0003
 
+/* UCC Protocol Specific Mode Register (UPSMR), when used for Ethernet */
+#define UCC_GETH_UPSMR_FTFE     0x80000000
+#define UCC_GETH_UPSMR_PTPE     0x40000000
+#define UCC_GETH_UPSMR_ECM      0x04000000
+#define UCC_GETH_UPSMR_HSE      0x02000000
+#define UCC_GETH_UPSMR_PRO      0x00400000
+#define UCC_GETH_UPSMR_CAP      0x00200000
+#define UCC_GETH_UPSMR_RSH      0x00100000
+#define UCC_GETH_UPSMR_RPM      0x00080000
+#define UCC_GETH_UPSMR_R10M     0x00040000
+#define UCC_GETH_UPSMR_RLPB     0x00020000
+#define UCC_GETH_UPSMR_TBIM     0x00010000
+#define UCC_GETH_UPSMR_RES1     0x00002000
+#define UCC_GETH_UPSMR_RMM      0x00001000
+#define UCC_GETH_UPSMR_CAM      0x00000400
+#define UCC_GETH_UPSMR_BRO      0x00000200
+
 /* UCC Transmit On Demand Register (UTODR) */
 #define UCC_SLOW_TOD   0x8000
 #define UCC_FAST_TOD   0x8000
index e0175beb446291d0d92f92d5f65897fb200a4472..0aa0315fb7e8a56d5aa120e8932afb9ddf0c694f 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #define RTAS_UNKNOWN_SERVICE (-1)
-#define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */
+#define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */
 
 /* Buffer size for ppc_rtas system call. */
 #define RTAS_RMOBUF_MAX (64 * 1024)
index 803def236654a0e81b4e6ab105e994e63fb164a4..72353f6070a436747817d2394c8e8f9ff67898b0 100644 (file)
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink)
 SYSCALL(uselib)
 SYSCALL(swapon)
 SYSCALL(reboot)
-SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir)
+SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir)
 SYSCALL_SPU(mmap)
 SYSCALL_SPU(munmap)
 SYSCALL_SPU(truncate)
index c004c13f291e771fa63a6f842094b3faacee7037..7ce27a52bb3450d56ba038000febbb9e555e4572 100644 (file)
@@ -1,7 +1,12 @@
 #ifndef _ASM_POWERPC_TYPES_H
 #define _ASM_POWERPC_TYPES_H
 
-#ifdef __powerpc64__
+/*
+ * This is here because we used to use l64 for 64bit powerpc
+ * and we don't want to impact user mode with our change to ll64
+ * in the kernel.
+ */
+#if defined(__powerpc64__) && !defined(__KERNEL__)
 # include <asm-generic/int-l64.h>
 #else
 # include <asm-generic/int-ll64.h>
index 9937fe44555f3d4e15cffa5a18d597231ca6040c..19ee491e9e2380cb3b58c41ac761e7c389582342 100644 (file)
 #include "head_booke.h"
 #endif
 
+#if defined(CONFIG_FSL_BOOKE)
+#include "../mm/mmu_decl.h"
+#endif
+
 int main(void)
 {
        DEFINE(THREAD, offsetof(struct task_struct, thread));
@@ -382,6 +386,9 @@ int main(void)
        DEFINE(PGD_T_LOG2, PGD_T_LOG2);
        DEFINE(PTE_T_LOG2, PTE_T_LOG2);
 #endif
+#ifdef CONFIG_FSL_BOOKE
+       DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
+#endif
 
 #ifdef CONFIG_KVM_EXIT_TIMING
        DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
index b33f0417a4bfa42b905858235cad6ffe275d1f71..bb37b1d19a586291453ec5f460d3b1b1661185d3 100644 (file)
@@ -113,7 +113,7 @@ struct cache {
        struct cache *next_local;      /* next cache of >= level */
 };
 
-static DEFINE_PER_CPU(struct cache_dir *, cache_dir);
+static DEFINE_PER_CPU(struct cache_dir *, cache_dir_pcpu);
 
 /* traversal/modification of this list occurs only at cpu hotplug time;
  * access is serialized by cpu hotplug locking
@@ -468,9 +468,9 @@ static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_i
 
        cache_dir->kobj = kobj;
 
-       WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL);
+       WARN_ON_ONCE(per_cpu(cache_dir_pcpu, cpu_id) != NULL);
 
-       per_cpu(cache_dir, cpu_id) = cache_dir;
+       per_cpu(cache_dir_pcpu, cpu_id) = cache_dir;
 
        return cache_dir;
 err:
@@ -820,13 +820,13 @@ void cacheinfo_cpu_offline(unsigned int cpu_id)
 
        /* Prevent userspace from seeing inconsistent state - remove
         * the sysfs hierarchy first */
-       cache_dir = per_cpu(cache_dir, cpu_id);
+       cache_dir = per_cpu(cache_dir_pcpu, cpu_id);
 
        /* careful, sysfs population may have failed */
        if (cache_dir)
                remove_cache_dir(cache_dir);
 
-       per_cpu(cache_dir, cpu_id) = NULL;
+       per_cpu(cache_dir_pcpu, cpu_id) = NULL;
 
        /* clear the CPU's bit in its cache chain, possibly freeing
         * cache objects */
index 14183af1b3fb9ea208108662ed09efd82787b7c1..2983adac8cc392d6788b23fdd19f2f16eda3e510 100644 (file)
@@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)
                       "Warning: IOMMU offset too big for device mask\n");
                if (tbl)
                        printk(KERN_INFO
-                              "mask: 0x%08lx, table offset: 0x%08lx\n",
+                              "mask: 0x%08llx, table offset: 0x%08lx\n",
                                mask, tbl->it_offset);
                else
-                       printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",
+                       printk(KERN_INFO "mask: 0x%08llx, table unavailable\n",
                                mask);
                return 0;
        } else
index b4bcf5a930fafd50a350d6e97bf8cf8cde833764..ebaedafc8e67403efe716703d6110825d589a77d 100644 (file)
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start)
        /* turn on 64-bit mode */
        bl      .enable_64b_mode
 
+       li      r0,0
+       mfspr   r3,SPRN_HID4
+       rldimi  r3,r0,40,23     /* clear bit 23 (rm_ci) */
+       sync
+       mtspr   SPRN_HID4,r3
+       isync
+       sync
+       slbia
+
        /* get TOC pointer (real address) */
        bl      .relative_toc
 
index 11b549acc0340909d3f5b253e73d12ec7fa3e589..36ffb3504a4fc23ce356de9b8b97c65b1abb169e 100644 (file)
@@ -389,10 +389,6 @@ skpinv:    addi    r6,r6,1                         /* Increment */
 #endif
 #endif
 
-       mfspr   r3,SPRN_TLB1CFG
-       andi.   r3,r3,0xfff
-       lis     r4,num_tlbcam_entries@ha
-       stw     r3,num_tlbcam_entries@l(r4)
 /*
  * Decide what sort of machine this is and initialize the MMU.
  */
@@ -711,7 +707,7 @@ interrupt_base:
        EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
 
 #ifdef CONFIG_PPC_E500MC
-       EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_EE)
+       EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD)
 #endif
 
        /* Debug Interrupt */
@@ -909,7 +905,7 @@ KernelSPE:
 _GLOBAL(loadcam_entry)
        lis     r4,TLBCAM@ha
        addi    r4,r4,TLBCAM@l
-       mulli   r5,r3,20
+       mulli   r5,r3,TLBCAM_SIZE
        add     r3,r5,r4
        lwz     r4,0(r3)
        mtspr   SPRN_MAS0,r4
index 1bfa706b96e74df4957ccbae5d02a566fe65f5e0..fd51578e29dda66b276061830e32da1f28dd37e1 100644 (file)
@@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
                if (printk_ratelimit()) {
                        printk(KERN_INFO "iommu_free: invalid entry\n");
                        printk(KERN_INFO "\tentry     = 0x%lx\n", entry); 
-                       printk(KERN_INFO "\tdma_addr  = 0x%lx\n", (u64)dma_addr);
-                       printk(KERN_INFO "\tTable     = 0x%lx\n", (u64)tbl);
-                       printk(KERN_INFO "\tbus#      = 0x%lx\n", (u64)tbl->it_busno);
-                       printk(KERN_INFO "\tsize      = 0x%lx\n", (u64)tbl->it_size);
-                       printk(KERN_INFO "\tstartOff  = 0x%lx\n", (u64)tbl->it_offset);
-                       printk(KERN_INFO "\tindex     = 0x%lx\n", (u64)tbl->it_index);
+                       printk(KERN_INFO "\tdma_addr  = 0x%llx\n", (u64)dma_addr);
+                       printk(KERN_INFO "\tTable     = 0x%llx\n", (u64)tbl);
+                       printk(KERN_INFO "\tbus#      = 0x%llx\n", (u64)tbl->it_busno);
+                       printk(KERN_INFO "\tsize      = 0x%llx\n", (u64)tbl->it_size);
+                       printk(KERN_INFO "\tstartOff  = 0x%llx\n", (u64)tbl->it_offset);
+                       printk(KERN_INFO "\tindex     = 0x%llx\n", (u64)tbl->it_index);
                        WARN_ON(1);
                }
                return;
index d051e8cbcd0373138f4c88cd59538067e73bbec1..182e0f642f36eacc3fd513c7d7ee484c45096257 100644 (file)
@@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m)
        if (rc)
                return;
 
-       seq_printf(m, "partition_entitled_capacity=%ld\n",
+       seq_printf(m, "partition_entitled_capacity=%lld\n",
                   ppp_data.entitlement);
        seq_printf(m, "group=%d\n", ppp_data.group_num);
        seq_printf(m, "system_active_processors=%d\n",
@@ -265,7 +265,7 @@ static void parse_ppp_data(struct seq_file *m)
                   ppp_data.unallocated_weight);
        seq_printf(m, "capacity_weight=%d\n", ppp_data.weight);
        seq_printf(m, "capped=%d\n", ppp_data.capped);
-       seq_printf(m, "unallocated_capacity=%ld\n",
+       seq_printf(m, "unallocated_capacity=%lld\n",
                   ppp_data.unallocated_entitlement);
 }
 
@@ -509,10 +509,10 @@ static ssize_t update_ppp(u64 *entitlement, u8 *weight)
        } else
                return -EINVAL;
 
-       pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
+       pr_debug("%s: current_entitled = %llu, current_weight = %u\n",
                 __func__, ppp_data.entitlement, ppp_data.weight);
 
-       pr_debug("%s: new_entitled = %lu, new_weight = %u\n",
+       pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
                 __func__, new_entitled, new_weight);
 
        retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight);
@@ -558,7 +558,7 @@ static ssize_t update_mpp(u64 *entitlement, u8 *weight)
        pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
                 __func__, mpp_data.entitled_mem, mpp_data.mem_weight);
 
-       pr_debug("%s: new_entitled = %lu, new_weight = %u\n",
+       pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
                 __func__, new_entitled, new_weight);
 
        rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight);
index b3abebb7ee64641420fd81fd796b5c13282dccbf..d59e2b1bdcbac7f1f64cf9d7289092345323f315 100644 (file)
@@ -93,10 +93,35 @@ void __init reserve_crashkernel(void)
                                KDUMP_KERNELBASE);
 
        crashk_res.start = KDUMP_KERNELBASE;
+#else
+       if (!crashk_res.start) {
+               /*
+                * unspecified address, choose a region of specified size
+                * can overlap with initrd (ignoring corruption when retained)
+                * ppc64 requires kernel and some stacks to be in first segemnt
+                */
+               crashk_res.start = KDUMP_KERNELBASE;
+       }
+
+       crash_base = PAGE_ALIGN(crashk_res.start);
+       if (crash_base != crashk_res.start) {
+               printk("Crash kernel base must be aligned to 0x%lx\n",
+                               PAGE_SIZE);
+               crashk_res.start = crash_base;
+       }
+
 #endif
        crash_size = PAGE_ALIGN(crash_size);
        crashk_res.end = crashk_res.start + crash_size - 1;
 
+       /* The crash region must not overlap the current kernel */
+       if (overlaps_crashkernel(__pa(_stext), _end - _stext)) {
+               printk(KERN_WARNING
+                       "Crash kernel can not overlap current kernel\n");
+               crashk_res.start = crashk_res.end = 0;
+               return;
+       }
+
        /* Crash kernel trumps memory limit */
        if (memory_limit && memory_limit <= crashk_res.end) {
                memory_limit = crashk_res.end + 1;
index 586962f65c2a033d59a240e5daf85ece91859532..ea8eda8c87cf2900564864983a26be3ec679747f 100644 (file)
@@ -470,7 +470,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
        if (bus->self) {
                pr_debug("IO mapping for PCI-PCI bridge %s\n",
                         pci_name(bus->self));
-               pr_debug("  virt=0x%016lx...0x%016lx\n",
+               pr_debug("  virt=0x%016llx...0x%016llx\n",
                         bus->resource[0]->start + _IO_BASE,
                         bus->resource[0]->end + _IO_BASE);
                return 0;
@@ -502,7 +502,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
                                              hose->io_base_phys - phys_page);
 
        pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
-       pr_debug("  phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
+       pr_debug("  phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
                 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
        pr_debug("  size=0x%016lx (alloc=0x%016lx)\n",
                 hose->pci_io_size, size_page);
@@ -517,7 +517,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
        hose->io_resource.start += io_virt_offset;
        hose->io_resource.end += io_virt_offset;
 
-       pr_debug("  hose->io_resource=0x%016lx...0x%016lx\n",
+       pr_debug("  hose->io_resource=0x%016llx...0x%016llx\n",
                 hose->io_resource.start, hose->io_resource.end);
 
        return 0;
index c09cffafb6ee5f8f2697fd4f55a1cf991f5db9cf..f00f83109ab309bbe38cca6a989155795413d4a7 100644 (file)
@@ -590,6 +590,11 @@ static void __init check_cpu_slb_size(unsigned long node)
 {
        u32 *slb_size_ptr;
 
+       slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL);
+       if (slb_size_ptr != NULL) {
+               mmu_slb_size = *slb_size_ptr;
+               return;
+       }
        slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
        if (slb_size_ptr != NULL) {
                mmu_slb_size = *slb_size_ptr;
index d8bd2161e7388c55afcb53f77d2c03504cf073ff..2d34196bba8cce3403ba0674297d063932f10c80 100644 (file)
@@ -434,8 +434,8 @@ void __init setup_system(void)
        printk("Starting Linux PPC64 %s\n", init_utsname()->version);
 
        printk("-----------------------------------------------------\n");
-       printk("ppc64_pft_size                = 0x%lx\n", ppc64_pft_size);
-       printk("physicalMemorySize            = 0x%lx\n", lmb_phys_mem_size());
+       printk("ppc64_pft_size                = 0x%llx\n", ppc64_pft_size);
+       printk("physicalMemorySize            = 0x%llx\n", lmb_phys_mem_size());
        if (ppc64_caches.dline_size != 0x80)
                printk("ppc64_caches.dcache_line_size = 0x%x\n",
                       ppc64_caches.dline_size);
@@ -493,7 +493,7 @@ static void __init emergency_stack_init(void)
         * bringup, we need to get at them in real mode. This means they
         * must also be within the RMO region.
         */
-       limit = min(0x10000000UL, lmb.rmo_size);
+       limit = min(0x10000000ULL, lmb.rmo_size);
 
        for_each_possible_cpu(i) {
                unsigned long sp;
index 47bf15cd2c9eb62be6d00d12f2f1e8130976ce93..161b9b9691f0b3591c25d546202205ec79ab4a4a 100644 (file)
@@ -87,7 +87,9 @@ SECTIONS
        /* The dummy segment contents for the bug workaround mentioned above
           near PHDRS.  */
        .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) {
-               LONG(0xf177)
+               LONG(0)
+               LONG(0)
+               LONG(0)
        } :kernel :dummy
 
 /*
index 23cee39534fddf8ab832658e6a3f0cb658cabec8..1971e4ee3d6e05b657e15ddcd7e62b7bcda5f5a5 100644 (file)
 
 extern void loadcam_entry(unsigned int index);
 unsigned int tlbcam_index;
-unsigned int num_tlbcam_entries;
 static unsigned long __cam0, __cam1, __cam2;
 
 #define NUM_TLBCAMS    (16)
 
-struct tlbcam {
-       u32     MAS0;
-       u32     MAS1;
-       u32     MAS2;
-       u32     MAS3;
-       u32     MAS7;
-} TLBCAM[NUM_TLBCAMS];
+struct tlbcam TLBCAM[NUM_TLBCAMS];
 
 struct tlbcamrange {
        unsigned long start;
index ad123bced404a4cb56d467cdfbec04d761d9afef..d1f9c62dc177b527179a0db0c2b4ad7583fc85d7 100644 (file)
@@ -75,6 +75,15 @@ extern void _tlbia(void);
 #endif /* CONFIG_PPC_MMU_NOHASH */
 
 #ifdef CONFIG_PPC32
+
+struct tlbcam {
+       u32     MAS0;
+       u32     MAS1;
+       u32     MAS2;
+       u32     MAS3;
+       u32     MAS7;
+};
+
 extern void mapin_ram(void);
 extern int map_page(unsigned long va, phys_addr_t pa, int flags);
 extern void setbat(int index, unsigned long virt, phys_addr_t phys,
@@ -90,8 +99,6 @@ extern unsigned int rtas_data, rtas_size;
 struct hash_pte;
 extern struct hash_pte *Hash, *Hash_end;
 extern unsigned long Hash_size, Hash_mask;
-
-extern unsigned int num_tlbcam_entries;
 #endif
 
 extern unsigned long ioremap_bot;
index db44e02e045b2b7a058844ac5dfdfacfdbb4fd01..ba5194817f8ae67e275c49b66f4c86631c1013d4 100644 (file)
@@ -710,9 +710,18 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
                           unsigned long len)
 {
        struct slice_mask mask, available;
+       unsigned int psize = mm->context.user_psize;
 
        mask = slice_range_to_mask(addr, len);
-       available = slice_mask_for_size(mm, mm->context.user_psize);
+       available = slice_mask_for_size(mm, psize);
+#ifdef CONFIG_PPC_64K_PAGES
+       /* We need to account for 4k slices too */
+       if (psize == MMU_PAGE_64K) {
+               struct slice_mask compat_mask;
+               compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K);
+               or_mask(available, compat_mask);
+       }
+#endif
 
 #if 0 /* too verbose */
        slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n",
index 60e6032a8088eb8197eab6c0505ec18bb5cd4e20..98cd1dc2ae752f46d37b1dc28badac59794204c7 100644 (file)
@@ -251,8 +251,8 @@ void __init stabs_alloc(void)
 
                paca[cpu].stab_addr = newstab;
                paca[cpu].stab_real = virt_to_abs(newstab);
-               printk(KERN_INFO "Segment table for CPU %d at 0x%lx "
-                      "virtual, 0x%lx absolute\n",
+               printk(KERN_INFO "Segment table for CPU %d at 0x%llx "
+                      "virtual, 0x%llx absolute\n",
                       cpu, paca[cpu].stab_addr, paca[cpu].stab_real);
        }
 }
index c40de461fd4eac5aab53ccbfdb9f705eb43ae554..42f778dff919b3c75977a2dd118217259647de7a 100644 (file)
@@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counter_config *ctr,
        for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) {
                /* counters are 40 bit. Move to cputable at some point? */
                reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count;
-               pr_debug("reset_value for pmc%u inited to 0x%lx\n",
+               pr_debug("reset_value for pmc%u inited to 0x%llx\n",
                                 pmc, reset_value[pmc]);
        }
 
@@ -177,7 +177,7 @@ static int pa6t_start(struct op_counter_config *ctr)
 
        oprofile_running = 1;
 
-       pr_debug("start on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0);
+       pr_debug("start on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
 
        return 0;
 }
@@ -193,7 +193,7 @@ static void pa6t_stop(void)
 
        oprofile_running = 0;
 
-       pr_debug("stop on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0);
+       pr_debug("stop on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
 }
 
 /* handle the perfmon overflow vector */
index f416014ee727b99813017554dd654e5495210053..1bcff94eb924b054575ac58aba4a6713c0a6d0f9 100644 (file)
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
        int dev_match = 0;
        int id_match = 0;
 
-       if (dev == NULL && id == NULL)
+       if (dev == NULL || id == NULL)
                return NULL;
 
        mutex_lock(&clocks_mutex);
        list_for_each_entry(p, &clocks, node) {
-               if (dev && dev == p->dev)
+               if (dev == p->dev)
                        dev_match++;
                if (strcmp(id, p->name) == 0)
                        id_match++;
index 8a455ebce98d16306eb8b926da3e1684ac406ba0..07f89ae46d04b1953bc9d1d45f6cce0cd5b844f0 100644 (file)
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
 {
        struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
        struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
-       unsigned int ret;
 
        return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;
-
-       return ret;
 }
 
 static void
index 72865e8e4b5124b1567c4546d9cee99e499311e8..0a093f03c75898ca6b4c1b4e7943d2dc7759819f 100644 (file)
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)
 
 static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
 {
+       struct irq_desc *desc = get_irq_desc(virq);
        u32 ctrl_reg, type;
        int irq;
        int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
                type = 0;
        }
 
+       desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
+       desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
+       if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
+               desc->status |= IRQ_LEVEL;
+
        ctrl_reg = in_be32(&intr->ctrl);
        ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
        ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
 }
 
 static struct irq_chip mpc52xx_extirq_irqchip = {
-       .typename = " MPC52xx IRQ[0-3] ",
+       .typename = "MPC52xx External",
        .mask = mpc52xx_extirq_mask,
        .unmask = mpc52xx_extirq_unmask,
        .ack = mpc52xx_extirq_ack,
index ba5028e2989065a7484733b0833fda94fdf78354..051777c542c74ac741225f7a070968fd56c31514 100644 (file)
@@ -3,6 +3,7 @@
 #
 obj-y                          := misc.o usb.o
 obj-$(CONFIG_SUSPEND)          += suspend.o suspend-asm.o
+obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
 obj-$(CONFIG_MPC831x_RDB)      += mpc831x_rdb.o
 obj-$(CONFIG_MPC832x_RDB)      += mpc832x_rdb.o
 obj-$(CONFIG_MPC834x_MDS)      += mpc834x_mds.o
index 47fe2bea9865db32befbbdff10e8a14d2325de19..200b9cb900ea4b34280d270b51bebe773ca142b4 100644 (file)
@@ -323,4 +323,15 @@ config SIMPLE_GPIO
          chip-selects, Ethernet/USB PHY's power and various other small
          on-board peripherals.
 
+config MCU_MPC8349EMITX
+       tristate "MPC8349E-mITX MCU driver"
+       depends on I2C && PPC_83xx
+       select GENERIC_GPIO
+       select ARCH_REQUIRE_GPIOLIB
+       help
+         Say Y here to enable soft power-off functionality on the Freescale
+         boards with the MPC8349E-mITX-compatible MCU chips. This driver will
+         also register MCU GPIOs with the generic GPIO API, so you'll able
+         to use MCU pins as GPIOs.
+
 endmenu
index 192a93509372ec8e949bcc91943c86127d3e3803..72254848a228e86923e19310915091a3cdce632b 100644 (file)
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug)
        err = beat_downcount_of_interrupt(irq_plug);
        if (err != 0) {
                if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */
-                       panic("Failed to downcount IRQ! Error = %16lx", err);
+                       panic("Failed to downcount IRQ! Error = %16llx", err);
 
                printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
        }
index 08c285b10e30a81f89e4113773e357abd5742971..48ec88a38a120f225189a22fbc7c55100edf73a6 100644 (file)
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node,
        hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
        if (!hose->cfg_addr)
                goto error;
-       pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n",
+       pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n",
                 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1));
 
        if (of_address_to_resource(node, 2, &r))
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(struct device_node *node,
        hose->cfg_data = ioremap(r.start, (r.end - r.start + 1));
        if (!hose->cfg_data)
                goto error;
-       pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n",
+       pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n",
                 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1));
 
        hose->ops = &celleb_epci_ops;
index 88d94b59a7cb9ff7b4d4f8f301c1ef7c9739f548..ee5033eddf019de7a31b5ac8c3de1ec25e646d55 100644 (file)
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void)
         */
        if (np && size < lmb_end_of_DRAM()) {
                printk(KERN_WARNING "iommu: force-enabled, dma window"
-                      " (%ldMB) smaller than total memory (%ldMB)\n",
+                      " (%ldMB) smaller than total memory (%lldMB)\n",
                       size >> 20, lmb_end_of_DRAM() >> 20);
                return -ENODEV;
        }
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(struct device *dev)
        addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base;
        archdata->dma_data = (void *)addr;
 
-       dev_dbg(dev, "iommu: fixed addr = %lx\n", addr);
+       dev_dbg(dev, "iommu: fixed addr = %llx\n", addr);
 }
 
 static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
index 7b4cefa2199b773b74fc274db1c3483145d2bbab..5f961c464cc404dcdcb76f84b41f2e5cd6c7fe05 100644 (file)
@@ -38,16 +38,16 @@ static void dump_fir(int cpu)
        /* Todo: do some nicer parsing of bits and based on them go down
         * to other sub-units FIRs and not only IIC
         */
-       printk(KERN_ERR "Global Checkstop FIR    : 0x%016lx\n",
+       printk(KERN_ERR "Global Checkstop FIR    : 0x%016llx\n",
               in_be64(&pregs->checkstop_fir));
-       printk(KERN_ERR "Global Recoverable FIR  : 0x%016lx\n",
+       printk(KERN_ERR "Global Recoverable FIR  : 0x%016llx\n",
               in_be64(&pregs->checkstop_fir));
-       printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n",
+       printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n",
               in_be64(&pregs->spec_att_mchk_fir));
 
        if (iregs == NULL)
                return;
-       printk(KERN_ERR "IOC FIR                 : 0x%016lx\n",
+       printk(KERN_ERR "IOC FIR                 : 0x%016llx\n",
               in_be64(&iregs->ioc_fir));
 
 }
index a5bdb89a17c3bf4b40894a0e7025877579398a06..e487ad68ac1113882db05b88142dd1542b67cdd4 100644 (file)
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
 {
        struct spu_priv2 __iomem *priv2 = spu->priv2;
 
-       pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n",
+       pr_debug("%s: adding SLB[%d] 0x%016llx 0x%016llx\n",
                        __func__, slbe, slb->vsid, slb->esid);
 
        out_be64(&priv2->slb_index_W, slbe);
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
 {
        int ret;
 
-       pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea);
+       pr_debug("%s, %llx, %lx\n", __func__, dsisr, ea);
 
        /*
         * Handle kernel space hash faults immediately. User hash
index 19f6bfdbb933b889771c952700e46ae3e48960d2..fec1495e6b12f98a8a12e9c9436fa2f2fdc76782 100644 (file)
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s)
        long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
 
        if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
-               pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret);
+               pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret);
                return -ENOSYS;
        }
 
index af116aadba105674617cb97e514996797501dc5c..c4d4a19235e078c9ad834fa08e7530e327c5c18b 100644 (file)
@@ -42,7 +42,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
                return spufs_coredump_read[num].read(ctx, buffer, size, off);
 
        data = spufs_coredump_read[num].get(ctx);
-       ret = snprintf(buffer, size, "0x%.16lx", data);
+       ret = snprintf(buffer, size, "0x%.16llx", data);
        if (ret >= size)
                return size;
        return ++ret; /* count trailing NULL */
index f093a581ac7410792a9126b2b0bbc87f665e9fdc..a4dd3ae7223ac3100da4fb48f1e87d545ba7e609 100644 (file)
@@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx)
 
        spuctx_switch_state(ctx, SPU_UTIL_IOWAIT);
 
-       pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea,
+       pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea,
                dsisr, ctx->state);
 
        ctx->stats.hash_flt++;
index 7106b63d401bce3dbe5f3681c293a845f54c190c..0da7f2bf5ee195320398cb7eb3ce07d86c0935e0 100644 (file)
@@ -1654,7 +1654,7 @@ out:
 
 static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
 {
-       pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa,
+       pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa,
                 cmd->ea, cmd->size, cmd->tag, cmd->cmd);
 
        switch (cmd->cmd) {
@@ -1671,7 +1671,7 @@ static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
        }
 
        if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) {
-               pr_debug("invalid DMA alignment, ea %lx lsa %x\n",
+               pr_debug("invalid DMA alignment, ea %llx lsa %x\n",
                                cmd->ea, cmd->lsa);
                return -EIO;
        }
@@ -2633,7 +2633,7 @@ static int spufs_show_ctx(struct seq_file *s, void *private)
        }
 
        seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)"
-               " %c %lx %lx %lx %lx %x %x\n",
+               " %c %llx %llx %llx %llx %x %x\n",
                ctx->state == SPU_STATE_SAVED ? 'S' : 'R',
                ctx->flags,
                ctx->sched_flags,
index 8c619963becceed0ac702c5b4662387adcbe720f..1db6b9e037fc0a107261ed1642ab67e156905382 100644 (file)
@@ -249,6 +249,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);
+DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
 
 static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
 {
index bbe828f1b885d0fb072bbd12bad2ae7499d51297..6ed75bffc8ab55d089faec045c04607d7ed8efde 100644 (file)
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
 
                rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce);
                if (rc)
-                       panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n",
+                       panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
                                        rc);
                index++;
                uaddr += TCE_PAGE_SIZE;
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
        while (npages--) {
                rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
                if (rc)
-                       panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n",
+                       panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
                                        rc);
                index++;
        }
index 6b0711c15ecaf9ad506e6b9dfd8eec61677dd978..bd8817b00fa4a80f3d2ab4649e6ef917ec9db8aa 100644 (file)
@@ -53,7 +53,7 @@
 #include <asm/pmac_low_i2c.h>
 #include <asm/pmac_pfunc.h>
 
-#define DEBUG
+#undef DEBUG
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
index ca71a12b764c3cdbf2b3834aac3354212301e262..bb028f165fb3d0008533d2e55b3eddbec898f076 100644 (file)
@@ -82,7 +82,7 @@ static int __init ps3_register_lpm_devices(void)
                goto fail_rights;
        }
 
-       pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n",
+       pr_debug("%s:%d: pu_id %llu, rights %llu(%llxh)\n",
                __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
                dev->lpm.rights);
 
@@ -348,7 +348,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
                return -ENODEV;
        }
 
-       pr_debug("%s:%u: (%u:%u:%u): port %lu blk_size %lu num_blocks %lu "
+       pr_debug("%s:%u: (%u:%u:%u): port %llu blk_size %llu num_blocks %llu "
                 "num_regions %u\n", __func__, __LINE__, repo->bus_index,
                 repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
                 num_regions);
@@ -394,7 +394,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
                        result = -ENODEV;
                        goto fail_read_region;
                }
-               pr_debug("%s:%u: region %u: id %u start %lu size %lu\n",
+               pr_debug("%s:%u: region %u: id %u start %llu size %llu\n",
                         __func__, __LINE__, i, id, start, size);
 
                p->regions[i].id = id;
@@ -662,13 +662,13 @@ static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
                if (rem)
                        break;
        }
-       pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__,
+       pr_warning("%s:%u: device %llu:%llu not found\n", __func__, __LINE__,
                   bus_id, dev_id);
        return;
 
 found:
        if (retries)
-               pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
+               pr_debug("%s:%u: device %llu:%llu found after %u retries\n",
                         __func__, __LINE__, bus_id, dev_id, retries);
 
        ps3_setup_dynamic_device(&repo);
@@ -715,14 +715,14 @@ static irqreturn_t ps3_notification_interrupt(int irq, void *data)
        res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
                                           &status);
        if (tag != dev->tag)
-               pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n",
+               pr_err("%s:%u: tag mismatch, got %llx, expected %llx\n",
                       __func__, __LINE__, tag, dev->tag);
 
        if (res) {
-               pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res,
+               pr_err("%s:%u: res %d status 0x%llx\n", __func__, __LINE__, res,
                       status);
        } else {
-               pr_debug("%s:%u: completed, status 0x%lx\n", __func__,
+               pr_debug("%s:%u: completed, status 0x%llx\n", __func__,
                         __LINE__, status);
                dev->lv1_status = status;
                complete(&dev->done);
@@ -761,7 +761,7 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev,
        }
 
        if (dev->lv1_status) {
-               pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__,
+               pr_err("%s:%u: %s not completed, status 0x%llx\n", __func__,
                       __LINE__, op, dev->lv1_status);
                return -EIO;
        }
@@ -850,16 +850,16 @@ static int ps3_probe_thread(void *data)
                if (res)
                        break;
 
-               pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu"
-                        " type %lu port %lu\n", __func__, __LINE__,
+               pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu"
+                        " type %llu port %llu\n", __func__, __LINE__,
                         notify_event->event_type, notify_event->bus_id,
                         notify_event->dev_id, notify_event->dev_type,
                         notify_event->dev_port);
 
                if (notify_event->event_type != notify_region_probe ||
                    notify_event->bus_id != dev.sbd.bus_id) {
-                       pr_warning("%s:%u: bad notify_event: event %lu, "
-                                  "dev_id %lu, dev_type %lu\n",
+                       pr_warning("%s:%u: bad notify_event: event %llu, "
+                                  "dev_id %llu, dev_type %llu\n",
                                   __func__, __LINE__, notify_event->event_type,
                                   notify_event->dev_id,
                                   notify_event->dev_type);
index 6eb1d4d182c90653b840e0edfe7294d698150c5f..1e8a1e39dfe816abc4e97cd1c33f12463edaf267 100644 (file)
@@ -75,7 +75,7 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va,
 
        if (result) {
                /* all entries bolted !*/
-               pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%lx r=%lx\n",
+               pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%llx r=%llx\n",
                        __func__, result, va, pa, hpte_group, hpte_v, hpte_r);
                BUG();
        }
index e59634f7af9637d29bca47505508bb30cf624953..8ec5ccf76b19e02f7e14385cf757ab558ba9662c 100644 (file)
@@ -60,6 +60,8 @@
  * gives a usable range of plug values of  {NUM_ISA_INTERRUPTS..63}.  Note
  * that there is no constraint on how many in this set an individual thread
  * can acquire.
+ *
+ * The mask is declared as unsigned long so we can use set/clear_bit on it.
  */
 
 #define PS3_BMP_MINALIGN 64
@@ -68,7 +70,7 @@ struct ps3_bmp {
        struct {
                u64 status;
                u64 unused_1[3];
-               u64 mask;
+               unsigned long mask;
                u64 unused_2[3];
        };
        u64 ipi_debug_brk_mask;
@@ -102,7 +104,7 @@ static void ps3_chip_mask(unsigned int virq)
        struct ps3_private *pd = get_irq_chip_data(virq);
        unsigned long flags;
 
-       pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__,
+       pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
                pd->thread_id, virq);
 
        local_irq_save(flags);
@@ -123,7 +125,7 @@ static void ps3_chip_unmask(unsigned int virq)
        struct ps3_private *pd = get_irq_chip_data(virq);
        unsigned long flags;
 
-       pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__,
+       pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
                pd->thread_id, virq);
 
        local_irq_save(flags);
@@ -221,7 +223,7 @@ static int ps3_virq_destroy(unsigned int virq)
 {
        const struct ps3_private *pd = get_irq_chip_data(virq);
 
-       pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__,
+       pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
                __LINE__, pd->ppe_id, pd->thread_id, virq);
 
        set_irq_chip_data(virq, NULL);
@@ -291,7 +293,7 @@ int ps3_irq_plug_destroy(unsigned int virq)
        int result;
        const struct ps3_private *pd = get_irq_chip_data(virq);
 
-       pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__,
+       pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
                __LINE__, pd->ppe_id, pd->thread_id, virq);
 
        ps3_chip_mask(virq);
@@ -322,7 +324,7 @@ EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
 int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
 {
        int result;
-       unsigned long outlet;
+       u64 outlet;
 
        result = lv1_construct_event_receive_port(&outlet);
 
@@ -468,7 +470,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
        unsigned int *virq)
 {
        int result;
-       unsigned long outlet;
+       u64 outlet;
 
        result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
 
@@ -525,7 +527,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
        unsigned int *virq)
 {
        int result;
-       unsigned long outlet;
+       u64 outlet;
        u64 lpar_addr;
 
        BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
@@ -581,7 +583,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
        unsigned int class, unsigned int *virq)
 {
        int result;
-       unsigned long outlet;
+       u64 outlet;
 
        BUG_ON(class > 2);
 
@@ -691,7 +693,7 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
 
        pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq;
 
-       pr_debug("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__,
+       pr_debug("%s:%d: cpu %u, virq %u, mask %llxh\n", __func__, __LINE__,
                cpu, virq, pd->bmp.ipi_debug_brk_mask);
 }
 
@@ -710,7 +712,7 @@ static unsigned int ps3_get_irq(void)
        plug &= 0x3f;
 
        if (unlikely(plug == NO_IRQ)) {
-               pr_debug("%s:%d: no plug found: thread_id %lu\n", __func__,
+               pr_debug("%s:%d: no plug found: thread_id %llu\n", __func__,
                        __LINE__, pd->thread_id);
                dump_bmp(&per_cpu(ps3_private, 0));
                dump_bmp(&per_cpu(ps3_private, 1));
@@ -745,7 +747,7 @@ void __init ps3_init_IRQ(void)
                pd->thread_id = get_hard_smp_processor_id(cpu);
                spin_lock_init(&pd->bmp.lock);
 
-               pr_debug("%s:%d: ppe_id %lu, thread_id %lu, bmp %lxh\n",
+               pr_debug("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n",
                        __func__, __LINE__, pd->ppe_id, pd->thread_id,
                        ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
 
@@ -770,6 +772,6 @@ void ps3_shutdown_IRQ(int cpu)
        lv1_get_logical_ppe_id(&ppe_id);
        result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0);
 
-       DBG("%s:%d: lv1_configure_irq_state_bitmap (%lu:%lu/%d) %s\n", __func__,
+       DBG("%s:%d: lv1_configure_irq_state_bitmap (%llu:%llu/%d) %s\n", __func__,
                __LINE__, ppe_id, thread_id, cpu, ps3_result(result));
 }
index a4d49dd9e8a9d7f101fe42c8f5f67bda91647392..67de6bf3db3d243a6d542dec9b9028d7f9fcf111 100644 (file)
@@ -79,8 +79,8 @@ enum {
  */
 
 struct mem_region {
-       unsigned long base;
-       unsigned long size;
+       u64 base;
+       u64 size;
        unsigned long offset;
 };
 
@@ -103,9 +103,9 @@ struct mem_region {
  */
 
 struct map {
-       unsigned long total;
-       unsigned long vas_id;
-       unsigned long htab_size;
+       u64 total;
+       u64 vas_id;
+       u64 htab_size;
        struct mem_region rm;
        struct mem_region r1;
 };
@@ -114,13 +114,13 @@ struct map {
 static void __maybe_unused _debug_dump_map(const struct map *m,
        const char *func, int line)
 {
-       DBG("%s:%d: map.total     = %lxh\n", func, line, m->total);
-       DBG("%s:%d: map.rm.size   = %lxh\n", func, line, m->rm.size);
-       DBG("%s:%d: map.vas_id    = %lu\n", func, line, m->vas_id);
-       DBG("%s:%d: map.htab_size = %lxh\n", func, line, m->htab_size);
-       DBG("%s:%d: map.r1.base   = %lxh\n", func, line, m->r1.base);
+       DBG("%s:%d: map.total     = %llxh\n", func, line, m->total);
+       DBG("%s:%d: map.rm.size   = %llxh\n", func, line, m->rm.size);
+       DBG("%s:%d: map.vas_id    = %llu\n", func, line, m->vas_id);
+       DBG("%s:%d: map.htab_size = %llxh\n", func, line, m->htab_size);
+       DBG("%s:%d: map.r1.base   = %llxh\n", func, line, m->r1.base);
        DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset);
-       DBG("%s:%d: map.r1.size   = %lxh\n", func, line, m->r1.size);
+       DBG("%s:%d: map.r1.size   = %llxh\n", func, line, m->r1.size);
 }
 
 static struct map map;
@@ -146,11 +146,11 @@ EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
 void __init ps3_mm_vas_create(unsigned long* htab_size)
 {
        int result;
-       unsigned long start_address;
-       unsigned long size;
-       unsigned long access_right;
-       unsigned long max_page_size;
-       unsigned long flags;
+       u64 start_address;
+       u64 size;
+       u64 access_right;
+       u64 max_page_size;
+       u64 flags;
 
        result = lv1_query_logical_partition_address_region_info(0,
                &start_address, &size, &access_right, &max_page_size,
@@ -164,7 +164,7 @@ void __init ps3_mm_vas_create(unsigned long* htab_size)
        }
 
        if (max_page_size < PAGE_SHIFT_16M) {
-               DBG("%s:%d: bad max_page_size %lxh\n", __func__, __LINE__,
+               DBG("%s:%d: bad max_page_size %llxh\n", __func__, __LINE__,
                        max_page_size);
                goto fail;
        }
@@ -208,7 +208,7 @@ void ps3_mm_vas_destroy(void)
 {
        int result;
 
-       DBG("%s:%d: map.vas_id    = %lu\n", __func__, __LINE__, map.vas_id);
+       DBG("%s:%d: map.vas_id    = %llu\n", __func__, __LINE__, map.vas_id);
 
        if (map.vas_id) {
                result = lv1_select_virtual_address_space(0);
@@ -235,15 +235,14 @@ void ps3_mm_vas_destroy(void)
 static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
 {
        int result;
-       unsigned long muid;
+       u64 muid;
 
        r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
 
        DBG("%s:%d requested  %lxh\n", __func__, __LINE__, size);
-       DBG("%s:%d actual     %lxh\n", __func__, __LINE__, r->size);
-       DBG("%s:%d difference %lxh (%luMB)\n", __func__, __LINE__,
-               (unsigned long)(size - r->size),
-               (size - r->size) / 1024 / 1024);
+       DBG("%s:%d actual     %llxh\n", __func__, __LINE__, r->size);
+       DBG("%s:%d difference %llxh (%lluMB)\n", __func__, __LINE__,
+               size - r->size, (size - r->size) / 1024 / 1024);
 
        if (r->size == 0) {
                DBG("%s:%d: size == 0\n", __func__, __LINE__);
@@ -277,7 +276,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 {
        int result;
 
-       DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base);
+       DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
        if (r->base) {
                result = lv1_release_memory(r->base);
                BUG_ON(result);
@@ -355,7 +354,7 @@ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r,
 static void  __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
        const char *func, int line)
 {
-       DBG("%s:%d: dev        %lu:%lu\n", func, line, r->dev->bus_id,
+       DBG("%s:%d: dev        %llu:%llu\n", func, line, r->dev->bus_id,
                r->dev->dev_id);
        DBG("%s:%d: page_size  %u\n", func, line, r->page_size);
        DBG("%s:%d: bus_addr   %lxh\n", func, line, r->bus_addr);
@@ -390,7 +389,7 @@ struct dma_chunk {
 static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
        int line)
 {
-       DBG("%s:%d: r.dev        %lu:%lu\n", func, line,
+       DBG("%s:%d: r.dev        %llu:%llu\n", func, line,
                c->region->dev->bus_id, c->region->dev->dev_id);
        DBG("%s:%d: r.bus_addr   %lxh\n", func, line, c->region->bus_addr);
        DBG("%s:%d: r.page_size  %u\n", func, line, c->region->page_size);
@@ -596,7 +595,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr,
 
        /* build ioptes for the area */
        pages = len >> r->page_size;
-       DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#lx\n", __func__,
+       DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#llx\n", __func__,
            r->page_size, r->len, pages, iopte_flag);
        for (iopage = 0; iopage < pages; iopage++) {
                offset = (1 << r->page_size) * iopage;
@@ -648,13 +647,14 @@ fail_alloc:
 static int dma_sb_region_create(struct ps3_dma_region *r)
 {
        int result;
+       u64 bus_addr;
 
        DBG(" -> %s:%d:\n", __func__, __LINE__);
 
        BUG_ON(!r);
 
        if (!r->dev->bus_id) {
-               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
+               pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
                        r->dev->bus_id, r->dev->dev_id);
                return 0;
        }
@@ -671,7 +671,8 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
 
        result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id,
                roundup_pow_of_two(r->len), r->page_size, r->region_type,
-               &r->bus_addr);
+               &bus_addr);
+       r->bus_addr = bus_addr;
 
        if (result) {
                DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n",
@@ -685,6 +686,7 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
 static int dma_ioc0_region_create(struct ps3_dma_region *r)
 {
        int result;
+       u64 bus_addr;
 
        INIT_LIST_HEAD(&r->chunk_list.head);
        spin_lock_init(&r->chunk_list.lock);
@@ -692,7 +694,8 @@ static int dma_ioc0_region_create(struct ps3_dma_region *r)
        result = lv1_allocate_io_segment(0,
                                         r->len,
                                         r->page_size,
-                                        &r->bus_addr);
+                                        &bus_addr);
+       r->bus_addr = bus_addr;
        if (result) {
                DBG("%s:%d: lv1_allocate_io_segment failed: %s\n",
                        __func__, __LINE__, ps3_result(result));
@@ -720,7 +723,7 @@ static int dma_sb_region_free(struct ps3_dma_region *r)
        BUG_ON(!r);
 
        if (!r->dev->bus_id) {
-               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
+               pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__,
                        r->dev->bus_id, r->dev->dev_id);
                return 0;
        }
@@ -777,7 +780,7 @@ static int dma_ioc0_region_free(struct ps3_dma_region *r)
  */
 
 static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
-          unsigned long len, unsigned long *bus_addr,
+          unsigned long len, dma_addr_t *bus_addr,
           u64 iopte_flag)
 {
        int result;
@@ -800,7 +803,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
                DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__,
                        lpar_addr);
                DBG("%s:%d len       %lxh\n", __func__, __LINE__, len);
-               DBG("%s:%d bus_addr  %lxh (%lxh)\n", __func__, __LINE__,
+               DBG("%s:%d bus_addr  %llxh (%lxh)\n", __func__, __LINE__,
                *bus_addr, len);
        }
 
@@ -832,7 +835,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
 }
 
 static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
-            unsigned long len, unsigned long *bus_addr,
+            unsigned long len, dma_addr_t *bus_addr,
             u64 iopte_flag)
 {
        int result;
@@ -872,7 +875,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
                return result;
        }
        *bus_addr = c->bus_addr + phys_addr - aligned_phys;
-       DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#lx\n", __func__,
+       DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#llx\n", __func__,
            virt_addr, phys_addr, aligned_phys, *bus_addr);
        c->usage_count = 1;
 
@@ -889,7 +892,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr,
  * This is the common dma unmap routine.
  */
 
-static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
+static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr,
        unsigned long len)
 {
        unsigned long flags;
@@ -903,7 +906,7 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
                        1 << r->page_size);
                unsigned long aligned_len = _ALIGN_UP(len + bus_addr
                        - aligned_bus, 1 << r->page_size);
-               DBG("%s:%d: not found: bus_addr %lxh\n",
+               DBG("%s:%d: not found: bus_addr %llxh\n",
                        __func__, __LINE__, bus_addr);
                DBG("%s:%d: not found: len %lxh\n",
                        __func__, __LINE__, len);
@@ -926,12 +929,12 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr,
 }
 
 static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
-                       unsigned long bus_addr, unsigned long len)
+                       dma_addr_t bus_addr, unsigned long len)
 {
        unsigned long flags;
        struct dma_chunk *c;
 
-       DBG("%s: start a=%#lx l=%#lx\n", __func__, bus_addr, len);
+       DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len);
        spin_lock_irqsave(&r->chunk_list.lock, flags);
        c = dma_find_chunk(r, bus_addr, len);
 
@@ -941,7 +944,7 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
                unsigned long aligned_len = _ALIGN_UP(len + bus_addr
                                                      - aligned_bus,
                                                      1 << r->page_size);
-               DBG("%s:%d: not found: bus_addr %lxh\n",
+               DBG("%s:%d: not found: bus_addr %llxh\n",
                    __func__, __LINE__, bus_addr);
                DBG("%s:%d: not found: len %lxh\n",
                    __func__, __LINE__, len);
@@ -975,7 +978,8 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r,
 static int dma_sb_region_create_linear(struct ps3_dma_region *r)
 {
        int result;
-       unsigned long virt_addr, len, tmp;
+       unsigned long virt_addr, len;
+       dma_addr_t tmp;
 
        if (r->len > 16*1024*1024) {    /* FIXME: need proper fix */
                /* force 16M dma pages for linear mapping */
@@ -1027,7 +1031,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r)
 static int dma_sb_region_free_linear(struct ps3_dma_region *r)
 {
        int result;
-       unsigned long bus_addr, len, lpar_addr;
+       dma_addr_t bus_addr;
+       unsigned long len, lpar_addr;
 
        if (r->offset < map.rm.size) {
                /* Unmap (part of) 1st RAM chunk */
@@ -1072,7 +1077,7 @@ static int dma_sb_region_free_linear(struct ps3_dma_region *r)
  */
 
 static int dma_sb_map_area_linear(struct ps3_dma_region *r,
-       unsigned long virt_addr, unsigned long len, unsigned long *bus_addr,
+       unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr,
        u64 iopte_flag)
 {
        unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr)
@@ -1091,7 +1096,7 @@ static int dma_sb_map_area_linear(struct ps3_dma_region *r,
  */
 
 static int dma_sb_unmap_area_linear(struct ps3_dma_region *r,
-       unsigned long bus_addr, unsigned long len)
+       dma_addr_t bus_addr, unsigned long len)
 {
        return 0;
 };
@@ -1169,13 +1174,13 @@ int ps3_dma_region_free(struct ps3_dma_region *r)
 EXPORT_SYMBOL(ps3_dma_region_free);
 
 int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr,
-       unsigned long len, unsigned long *bus_addr,
+       unsigned long len, dma_addr_t *bus_addr,
        u64 iopte_flag)
 {
        return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag);
 }
 
-int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr,
+int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr,
        unsigned long len)
 {
        return r->region_ops->unmap(r, bus_addr, len);
index 1d201782d4e5809190fcf4bb9ff64df5e9074195..e1c83c23b435a2f8032093def6afa1a844d5d1ab 100644 (file)
@@ -306,7 +306,7 @@ static void _dump_params(const struct os_area_params *p, const char *func,
 {
        pr_debug("%s:%d: p.boot_flag:       %u\n", func, line, p->boot_flag);
        pr_debug("%s:%d: p.num_params:      %u\n", func, line, p->num_params);
-       pr_debug("%s:%d: p.rtc_diff         %ld\n", func, line, p->rtc_diff);
+       pr_debug("%s:%d: p.rtc_diff         %lld\n", func, line, p->rtc_diff);
        pr_debug("%s:%d: p.av_multi_out     %u\n", func, line, p->av_multi_out);
        pr_debug("%s:%d: p.ctrl_button:     %u\n", func, line, p->ctrl_button);
        pr_debug("%s:%d: p.static_ip_addr:  %u.%u.%u.%u\n", func, line,
index 22063adeb38be567e844482877251f89cf0d4fe6..5e304c292f68e1e22e3fff9dd3527ae8a5f1bcd1 100644 (file)
@@ -44,7 +44,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line)
                s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.';
        s[i] = 0;
 
-       pr_debug("%s:%d: %s%016lx : %s\n", func, line, hdr, n, s);
+       pr_debug("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s);
 #endif
 }
 
@@ -70,8 +70,8 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
        _dump_field("n2: ", n2, func, line);
        _dump_field("n3: ", n3, func, line);
        _dump_field("n4: ", n4, func, line);
-       pr_debug("%s:%d: v1: %016lx\n", func, line, v1);
-       pr_debug("%s:%d: v2: %016lx\n", func, line, v2);
+       pr_debug("%s:%d: v1: %016llx\n", func, line, v1);
+       pr_debug("%s:%d: v2: %016llx\n", func, line, v2);
 }
 
 /**
@@ -149,10 +149,10 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
                *_v2 = v2;
 
        if (v1 && !_v1)
-               pr_debug("%s:%d: warning: discarding non-zero v1: %016lx\n",
+               pr_debug("%s:%d: warning: discarding non-zero v1: %016llx\n",
                        __func__, __LINE__, v1);
        if (v2 && !_v2)
-               pr_debug("%s:%d: warning: discarding non-zero v2: %016lx\n",
+               pr_debug("%s:%d: warning: discarding non-zero v2: %016llx\n",
                        __func__, __LINE__, v2);
 
        return 0;
@@ -327,7 +327,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
                return result;
        }
 
-       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n",
+       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n",
                __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
                num_dev);
 
@@ -353,7 +353,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo)
                return result;
        }
 
-       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n",
+       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n",
                __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
 
        *repo = tmp;
@@ -367,7 +367,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
        struct ps3_repository_device tmp;
        unsigned int num_dev;
 
-       pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__,
+       pr_debug(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__,
                 bus_id, dev_id);
 
        for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
@@ -382,7 +382,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
                if (tmp.bus_id == bus_id)
                        goto found_bus;
 
-               pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__,
+               pr_debug("%s:%u: skip, bus_id %llu\n", __func__, __LINE__,
                         tmp.bus_id);
        }
        pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
@@ -416,7 +416,7 @@ found_bus:
                if (tmp.dev_id == dev_id)
                        goto found_dev;
 
-               pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__,
+               pr_debug("%s:%u: skip, dev_id %llu\n", __func__, __LINE__,
                         tmp.dev_id);
        }
        pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
@@ -430,7 +430,7 @@ found_dev:
                return result;
        }
 
-       pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n",
+       pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n",
                 __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
                 tmp.dev_index, tmp.bus_id, tmp.dev_id);
        *repo = tmp;
index 35f3e85cf60ea9d79ff873f10090395c791f1c99..3331ccbb8d389c6d76dd4c548beeb3c30d6404b8 100644 (file)
@@ -186,7 +186,7 @@ early_param("ps3flash", early_parse_ps3flash);
 #define prealloc_ps3flash_bounce_buffer()      do { } while (0)
 #endif
 
-static int ps3_set_dabr(u64 dabr)
+static int ps3_set_dabr(unsigned long dabr)
 {
        enum {DABR_USER = 1, DABR_KERNEL = 2,};
 
index ccae3d446b98e575ffa656f58195ecf21a3877e8..b3c6a993f9f3bc0d16a415391c631d988b887ef2 100644 (file)
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ps3_get_spe_id);
 
 static unsigned long get_vas_id(void)
 {
-       unsigned long id;
+       u64 id;
 
        lv1_get_logical_ppe_id(&id);
        lv1_get_virtual_address_space_id_of_ppe(id, &id);
@@ -160,14 +160,18 @@ static unsigned long get_vas_id(void)
 static int __init construct_spu(struct spu *spu)
 {
        int result;
-       unsigned long unused;
+       u64 unused;
+       u64 problem_phys;
+       u64 local_store_phys;
 
        result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT,
                PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL,
-               &spu_pdata(spu)->priv2_addr, &spu->problem_phys,
-               &spu->local_store_phys, &unused,
+               &spu_pdata(spu)->priv2_addr, &problem_phys,
+               &local_store_phys, &unused,
                &spu_pdata(spu)->shadow_addr,
                &spu_pdata(spu)->spe_id);
+       spu->problem_phys = problem_phys;
+       spu->local_store_phys = local_store_phys;
 
        if (result) {
                pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n",
index ee0d22911621751ebecfb1d584f10004a4033b53..58311a867851affc29310d3557dd5410350983ff 100644 (file)
@@ -182,7 +182,7 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev)
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+               pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
                        dev->bus_id);
                BUG();
                return -EINVAL;
@@ -220,7 +220,7 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev)
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+               pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
                        dev->bus_id);
                BUG();
                return -EINVAL;
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
 static void _dump_mmio_region(const struct ps3_mmio_region* r,
        const char* func, int line)
 {
-       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
+       pr_debug("%s:%d: dev       %llu:%llu\n", func, line, r->dev->bus_id,
                r->dev->dev_id);
        pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
        pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
@@ -250,9 +250,11 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r,
 static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
 {
        int result;
+       u64 lpar_addr;
 
        result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
-               r->bus_addr, r->len, r->page_size, &r->lpar_addr);
+               r->bus_addr, r->len, r->page_size, &lpar_addr);
+       r->lpar_addr = lpar_addr;
 
        if (result) {
                pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
@@ -568,7 +570,7 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page,
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
-       unsigned long bus_addr;
+       dma_addr_t bus_addr;
        void *ptr = page_address(page) + offset;
 
        result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,
@@ -590,7 +592,7 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page,
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
-       unsigned long bus_addr;
+       dma_addr_t bus_addr;
        u64 iopte_flag;
        void *ptr = page_address(page) + offset;
 
index c90817acb4729386c2634c54bd0d14efc83ec086..3ee01b4f42577261f342b831ea64e022f84f7a9f 100644 (file)
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
                }
 
                if (rc && printk_ratelimit()) {
-                       printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
-                       printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
-                       printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
-                       printk("\ttce val = 0x%lx\n", tce );
+                       printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
+                       printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
+                       printk("\ttcenum  = 0x%llx\n", (u64)tcenum);
+                       printk("\ttce val = 0x%llx\n", tce );
                        show_stack(current, (unsigned long *)__get_SP());
                }
 
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
        }
 
        if (rc && printk_ratelimit()) {
-               printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
-               printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
-               printk("\tnpages  = 0x%lx\n", (u64)npages);
-               printk("\ttce[0] val = 0x%lx\n", tcep[0]);
+               printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
+               printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
+               printk("\tnpages  = 0x%llx\n", (u64)npages);
+               printk("\ttce[0] val = 0x%llx\n", tcep[0]);
                show_stack(current, (unsigned long *)__get_SP());
        }
        return ret;
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
                rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
 
                if (rc && printk_ratelimit()) {
-                       printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
-                       printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
-                       printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
+                       printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
+                       printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
+                       printk("\ttcenum  = 0x%llx\n", (u64)tcenum);
                        show_stack(current, (unsigned long *)__get_SP());
                }
 
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
 
        if (rc && printk_ratelimit()) {
                printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
-               printk("\trc      = %ld\n", rc);
-               printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
-               printk("\tnpages  = 0x%lx\n", (u64)npages);
+               printk("\trc      = %lld\n", rc);
+               printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
+               printk("\tnpages  = 0x%llx\n", (u64)npages);
                show_stack(current, (unsigned long *)__get_SP());
        }
 }
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
        rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
 
        if (rc && printk_ratelimit()) {
-               printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n",
-                       rc);
-               printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
-               printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
+               printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc);
+               printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
+               printk("\ttcenum  = 0x%llx\n", (u64)tcenum);
                show_stack(current, (unsigned long *)__get_SP());
        }
 
index f611d0369cc8ceb275cc45a94ca04451dbe84950..9817f63723dd592d933c0dcf9de53b6a51805b8d 100644 (file)
 #include <sysdev/fsl_pci.h>
 
 #if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
+static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
+       unsigned int index, const struct resource *res,
+       resource_size_t offset)
+{
+       resource_size_t pci_addr = res->start - offset;
+       resource_size_t phys_addr = res->start;
+       resource_size_t size = res->end - res->start + 1;
+       u32 flags = 0x80044000; /* enable & mem R/W */
+       unsigned int i;
+
+       pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
+               (u64)res->start, (u64)size);
+
+       if (res->flags & IORESOURCE_PREFETCH)
+               flags |= 0x10000000; /* enable relaxed ordering */
+
+       for (i = 0; size > 0; i++) {
+               unsigned int bits = min(__ilog2(size),
+                                       __ffs(pci_addr | phys_addr));
+
+               if (index + i >= 5)
+                       return -1;
+
+               out_be32(&pci->pow[index + i].potar, pci_addr >> 12);
+               out_be32(&pci->pow[index + i].potear, (u64)pci_addr >> 44);
+               out_be32(&pci->pow[index + i].powbar, phys_addr >> 12);
+               out_be32(&pci->pow[index + i].powar, flags | (bits - 1));
+
+               pci_addr += (resource_size_t)1U << bits;
+               phys_addr += (resource_size_t)1U << bits;
+               size -= (resource_size_t)1U << bits;
+       }
+
+       return i;
+}
+
 /* atmu setup for fsl pci/pcie controller */
 static void __init setup_pci_atmu(struct pci_controller *hose,
                                  struct resource *rsrc)
 {
        struct ccsr_pci __iomem *pci;
-       int i;
+       int i, j, n;
 
        pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
                    (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
        pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
+       if (!pci) {
+           dev_err(hose->parent, "Unable to map ATMU registers\n");
+           return;
+       }
 
-       /* Disable all windows (except powar0 since its ignored) */
+       /* Disable all windows (except powar0 since it's ignored) */
        for(i = 1; i < 5; i++)
                out_be32(&pci->pow[i].powar, 0);
        for(i = 0; i < 3; i++)
                out_be32(&pci->piw[i].piwar, 0);
 
        /* Setup outbound MEM window */
-       for(i = 0; i < 3; i++)
-               if (hose->mem_resources[i].flags & IORESOURCE_MEM){
-                       resource_size_t pci_addr_start =
-                                hose->mem_resources[i].start -
-                                hose->pci_mem_offset;
-                       pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
-                               (u64)hose->mem_resources[i].start,
-                               (u64)hose->mem_resources[i].end
-                                 - (u64)hose->mem_resources[i].start + 1);
-                       out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12));
-                       out_be32(&pci->pow[i+1].potear, 0);
-                       out_be32(&pci->pow[i+1].powbar,
-                               (hose->mem_resources[i].start >> 12));
-                       /* Enable, Mem R/W */
-                       out_be32(&pci->pow[i+1].powar, 0x80044000
-                               | (__ilog2(hose->mem_resources[i].end
-                               - hose->mem_resources[i].start + 1) - 1));
-               }
+       for(i = 0, j = 1; i < 3; i++) {
+               if (!(hose->mem_resources[i].flags & IORESOURCE_MEM))
+                       continue;
+
+               n = setup_one_atmu(pci, j, &hose->mem_resources[i],
+                                  hose->pci_mem_offset);
+
+               if (n < 0 || j >= 5) {
+                       pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i);
+                       hose->mem_resources[i].flags |= IORESOURCE_DISABLED;
+               } else
+                       j += n;
+       }
 
        /* Setup outbound IO window */
-       if (hose->io_resource.flags & IORESOURCE_IO){
-               pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
-                        "phy base 0x%016llx.\n",
-                       (u64)hose->io_resource.start,
-                       (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
-                       (u64)hose->io_base_phys);
-               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12));
-               out_be32(&pci->pow[i+1].potear, 0);
-               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12));
-               /* Enable, IO R/W */
-               out_be32(&pci->pow[i+1].powar, 0x80088000
-                       | (__ilog2(hose->io_resource.end
-                       - hose->io_resource.start + 1) - 1));
+       if (hose->io_resource.flags & IORESOURCE_IO) {
+               if (j >= 5) {
+                       pr_err("Ran out of outbound PCI ATMUs for IO resource\n");
+               } else {
+                       pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
+                                "phy base 0x%016llx.\n",
+                               (u64)hose->io_resource.start,
+                               (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
+                               (u64)hose->io_base_phys);
+                       out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12));
+                       out_be32(&pci->pow[j].potear, 0);
+                       out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12));
+                       /* Enable, IO R/W */
+                       out_be32(&pci->pow[j].powar, 0x80088000
+                               | (__ilog2(hose->io_resource.end
+                               - hose->io_resource.start + 1) - 1));
+               }
        }
 
        /* Setup 2G inbound Memory Window @ 1 */
        out_be32(&pci->piw[2].pitar, 0x00000000);
        out_be32(&pci->piw[2].piwbar,0x00000000);
        out_be32(&pci->piw[2].piwar, PIWAR_2G);
+
+       iounmap(pci);
 }
 
 static void __init setup_pci_cmd(struct pci_controller *hose)
index 3e0d89dcdba2a5b4950a63a9cd79534f8e3702cf..a35297dbac28d572d061c555aacfa3103cf465d2 100644 (file)
@@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase,
                addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32);
        }
 
-       printk(KERN_DEBUG "mpic:   - HT:%02x.%x %s MSI mapping found @ 0x%lx\n",
+       printk(KERN_DEBUG "mpic:   - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
                PCI_SLOT(devfn), PCI_FUNC(devfn),
                flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr);
 
index a94a3c3ae9328ea2ab94a8534f5d1658eed1db97..6b0a3538dc63b9ab8ff62344904f186b01876702 100644 (file)
@@ -77,6 +77,7 @@ mainmenu "Linux Kernel Configuration"
 config S390
        def_bool y
        select USE_GENERIC_SMP_HELPERS if SMP
+       select HAVE_SYSCALL_WRAPPERS
        select HAVE_FUNCTION_TRACER
        select HAVE_OPROFILE
        select HAVE_KPROBES
index f2af4167bd5f527700c221363f4ee9273ac2fe3e..63a23415fba6b2ed4a80d68630f8b240eba9e64b 100644 (file)
@@ -13,4 +13,3 @@ unifdef-y += cmb.h
 unifdef-y += debug.h
 unifdef-y += chpid.h
 unifdef-y += schid.h
-unifdef-y += swab.h
index b95a2b2933fb9407cea20e8ab22da3aa05d3e18a..a332e59e26fc0b302fdaa272aa442821bccd064a 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _S390_BYTEORDER_H
 #define _S390_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _S390_BYTEORDER_H */
index fc2c97197a53ffbe9df9917e7087de4ecb1a57d9..6035cd20c7a7c542edf4e63af14200242998358f 100644 (file)
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper:
        .globl  sys32_newuname_wrapper
 sys32_newuname_wrapper:
        llgtr   %r2,%r2                 # struct new_utsname *
-       jg      s390x_newuname          # branch to system call
+       jg      sys_s390_newuname       # branch to system call
 
        .globl  compat_sys_adjtimex_wrapper
 compat_sys_adjtimex_wrapper:
@@ -615,7 +615,7 @@ sys32_sysfs_wrapper:
        .globl  sys32_personality_wrapper
 sys32_personality_wrapper:
        llgfr   %r2,%r2                 # unsigned long
-       jg      s390x_personality       # branch to system call
+       jg      sys_s390_personality    # branch to system call
 
        .globl  sys32_setfsuid16_wrapper
 sys32_setfsuid16_wrapper:
index a65afc91e8aa86dab1f859797033da334ac226d0..950c59c6688bf2cc3f6e2157f6115b5180f5b188 100644 (file)
@@ -30,23 +30,23 @@ struct fadvise64_64_args;
 struct old_sigaction;
 struct sel_arg_struct;
 
-long sys_pipe(unsigned long __user *fildes);
 long sys_mmap2(struct mmap_arg_struct __user  *arg);
-long old_mmap(struct mmap_arg_struct __user *arg);
+long sys_s390_old_mmap(struct mmap_arg_struct __user *arg);
 long sys_ipc(uint call, int first, unsigned long second,
             unsigned long third, void __user *ptr);
-long s390x_newuname(struct new_utsname __user *name);
-long s390x_personality(unsigned long personality);
-long s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
+long sys_s390_newuname(struct new_utsname __user *name);
+long sys_s390_personality(unsigned long personality);
+long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
                    size_t len, int advice);
-long s390_fadvise64_64(struct fadvise64_64_args __user *args);
-long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low);
+long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
+long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high,
+                       u32 len_low);
 long sys_fork(void);
 long sys_clone(void);
 long sys_vfork(void);
 void execve_tail(void);
 long sys_execve(void);
-int sys_sigsuspend(int history0, int history1, old_sigset_t mask);
+long sys_sigsuspend(int history0, int history1, old_sigset_t mask);
 long sys_sigaction(int sig, const struct old_sigaction __user *act,
                   struct old_sigaction __user *oact);
 long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss);
index b6110bdf8dc27b13d7f1d672086db1738bb4d5ef..5cd38a90e64d743443baa2bc1cb95e26070d0d9e 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/tick.h>
 #include <linux/elfcore.h>
 #include <linux/kernel_stat.h>
+#include <linux/syscalls.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
@@ -225,13 +226,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
         return 0;
 }
 
-asmlinkage long sys_fork(void)
+SYSCALL_DEFINE0(fork)
 {
        struct pt_regs *regs = task_pt_regs(current);
        return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL);
 }
 
-asmlinkage long sys_clone(void)
+SYSCALL_DEFINE0(clone)
 {
        struct pt_regs *regs = task_pt_regs(current);
        unsigned long clone_flags;
@@ -258,7 +259,7 @@ asmlinkage long sys_clone(void)
  * do not have enough call-clobbered registers to hold all
  * the information you need.
  */
-asmlinkage long sys_vfork(void)
+SYSCALL_DEFINE0(vfork)
 {
        struct pt_regs *regs = task_pt_regs(current);
        return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
@@ -278,7 +279,7 @@ asmlinkage void execve_tail(void)
 /*
  * sys_execve() executes a new program.
  */
-asmlinkage long sys_execve(void)
+SYSCALL_DEFINE0(execve)
 {
        struct pt_regs *regs = task_pt_regs(current);
        char *filename;
index 8e6812a22670b24704fafec7079c2136a9fa720a..3cf74c3ccb699184e7b55e9237103d6cd269b47a 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/personality.h>
 #include <linux/binfmts.h>
 #include <linux/tracehook.h>
+#include <linux/syscalls.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/lowcore.h>
@@ -53,8 +54,7 @@ typedef struct
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
-asmlinkage int
-sys_sigsuspend(int history0, int history1, old_sigset_t mask)
+SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask)
 {
        mask &= _BLOCKABLE;
        spin_lock_irq(&current->sighand->siglock);
@@ -70,9 +70,8 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask)
        return -ERESTARTNOHAND;
 }
 
-asmlinkage long
-sys_sigaction(int sig, const struct old_sigaction __user *act,
-             struct old_sigaction __user *oact)
+SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act,
+               struct old_sigaction __user *, oact)
 {
        struct k_sigaction new_ka, old_ka;
        int ret;
@@ -102,15 +101,13 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
        return ret;
 }
 
-asmlinkage long
-sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
+SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss,
+               stack_t __user *, uoss)
 {
        struct pt_regs *regs = task_pt_regs(current);
        return do_sigaltstack(uss, uoss, regs->gprs[15]);
 }
 
-
-
 /* Returns non-zero on fault. */
 static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
 {
@@ -164,7 +161,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
        return 0;
 }
 
-asmlinkage long sys_sigreturn(void)
+SYSCALL_DEFINE0(sigreturn)
 {
        struct pt_regs *regs = task_pt_regs(current);
        sigframe __user *frame = (sigframe __user *)regs->gprs[15];
@@ -191,7 +188,7 @@ badframe:
        return 0;
 }
 
-asmlinkage long sys_rt_sigreturn(void)
+SYSCALL_DEFINE0(rt_sigreturn)
 {
        struct pt_regs *regs = task_pt_regs(current);
        rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
index c34be4568b80fcc75250e3fe018994fa5683843e..c7ae4b17e0e3d85ec1aaa0064623b982df2ec968 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/personality.h>
 #include <linux/unistd.h>
 #include <linux/ipc.h>
+#include <linux/syscalls.h>
 #include <asm/uaccess.h>
 #include "entry.h"
 
@@ -74,7 +75,7 @@ struct mmap_arg_struct {
        unsigned long offset;
 };
 
-asmlinkage long sys_mmap2(struct mmap_arg_struct __user  *arg)
+SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg)
 {
        struct mmap_arg_struct a;
        int error = -EFAULT;
@@ -86,7 +87,7 @@ out:
        return error;
 }
 
-asmlinkage long old_mmap(struct mmap_arg_struct __user *arg)
+SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg)
 {
        struct mmap_arg_struct a;
        long error = -EFAULT;
@@ -108,8 +109,8 @@ out:
  *
  * This is really horribly ugly.
  */
-asmlinkage long sys_ipc(uint call, int first, unsigned long second,
-                                 unsigned long third, void __user *ptr)
+SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second,
+               unsigned long, third, void __user *, ptr)
 {
         struct ipc_kludge tmp;
        int ret;
@@ -175,7 +176,7 @@ asmlinkage long sys_ipc(uint call, int first, unsigned long second,
 }
 
 #ifdef CONFIG_64BIT
-asmlinkage long s390x_newuname(struct new_utsname __user *name)
+SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name)
 {
        int ret = sys_newuname(name);
 
@@ -186,7 +187,7 @@ asmlinkage long s390x_newuname(struct new_utsname __user *name)
        return ret;
 }
 
-asmlinkage long s390x_personality(unsigned long personality)
+SYSCALL_DEFINE1(s390_personality, unsigned long, personality)
 {
        int ret;
 
@@ -205,15 +206,13 @@ asmlinkage long s390x_personality(unsigned long personality)
  */
 #ifndef CONFIG_64BIT
 
-asmlinkage long
-s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice)
+SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low,
+               size_t, len, int, advice)
 {
        return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low,
                        len, advice);
 }
 
-#endif
-
 struct fadvise64_64_args {
        int fd;
        long long offset;
@@ -221,8 +220,7 @@ struct fadvise64_64_args {
        int advice;
 };
 
-asmlinkage long
-s390_fadvise64_64(struct fadvise64_64_args __user *args)
+SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args)
 {
        struct fadvise64_64_args a;
 
@@ -231,7 +229,6 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
        return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice);
 }
 
-#ifndef CONFIG_64BIT
 /*
  * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last
  * 64 bit argument "len" is split into the upper and lower 32 bits. The
@@ -244,9 +241,19 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args)
  * to
  *   %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
  */
-asmlinkage long s390_fallocate(int fd, int mode, loff_t offset,
+SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset,
                               u32 len_high, u32 len_low)
 {
        return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset,
+                                  long len_high, long len_low)
+{
+       return SYSC_s390_fallocate((int) fd, (int) mode, offset,
+                                  (u32) len_high, (u32) len_low);
+}
+SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate);
+#endif
+
 #endif
index 2d61787949d5b9ee99b7512373668131ad7da7b4..76d16e0140bb97789f76bd1e0b3f72230159dbc3 100644 (file)
@@ -98,7 +98,7 @@ SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper)
 SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper)
 SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)
 SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper)   /* old readdir syscall */
-SYSCALL(old_mmap,old_mmap,old32_mmap_wrapper)                  /* 90 */
+SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper)        /* 90 */
 SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper)
 SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper)
 SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper)
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper)
 SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn)
 SYSCALL(sys_clone,sys_clone,sys32_clone)                       /* 120 */
 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
-SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper)
+SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper)
 NI_SYSCALL                                                     /* modify_ldt for i386 */
 SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper)      /* 125 */
@@ -144,7 +144,7 @@ SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper)
 SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper)
 SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper)
 SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper)               /* 135 */
-SYSCALL(sys_personality,s390x_personality,sys32_personality_wrapper)
+SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper)
 NI_SYSCALL                                                     /* for afs_syscall */
 SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper)        /* old setfsuid16 syscall */
 SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper)        /* old setfsgid16 syscall */
@@ -261,7 +261,7 @@ SYSCALL(sys_epoll_create,sys_epoll_create,sys_epoll_create_wrapper)
 SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper)     /* 250 */
 SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper)
 SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper)
-SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper)
+SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper)
 SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper)
 SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper)       /* 255 */
 SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper)
@@ -272,7 +272,7 @@ SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper)    /* 260
 SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
 SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper)
 NI_SYSCALL                                                     /* reserved for vserver */
-SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
+SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
 SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper)
 SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper)
 SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper)
@@ -322,7 +322,7 @@ NI_SYSCALL                                                  /* 310 sys_move_pages */
 SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
 SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper)
 SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper)
-SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper)
+SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper)
 SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper)      /* 315 */
 SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper)
 NI_SYSCALL                                             /* 317 old sys_timer_fd */
index f1a2a0d1c79cc5c1d4111589e2f8cd6829710bc0..43910cdf78a54713bcfe0eabf6f5634d8d142742 100644 (file)
@@ -6,4 +6,3 @@ unifdef-y += unistd_32.h
 unifdef-y += unistd_64.h
 unifdef-y += posix_types_32.h
 unifdef-y += posix_types_64.h
-unifdef-y += swab.h
index e95c41a5c8cc6a75d9537df321d1ca6e356c1510..db2f5d7cb17db21a031553ac04c2338feb0dc7e9 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef __ASM_SH_BYTEORDER_H
 #define __ASM_SH_BYTEORDER_H
 
-#include <asm/swab.h>
-
 #ifdef __LITTLE_ENDIAN__
 #include <linux/byteorder/little_endian.h>
 #else
index 104c5e686106e4530697259f2c629c88ac29b992..8b30200305c34911be0727f1b434e21f8e4e7b65 100644 (file)
@@ -36,9 +36,9 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5,
 asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
                                unsigned long r6, unsigned long r7,
                                struct pt_regs __regs);
-asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
-                       unsigned long r6, unsigned long r7,
-                       struct pt_regs __regs);
+asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5,
+                          unsigned long r6, unsigned long r7,
+                          struct pt_regs __regs);
 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
                                     size_t count, long dummy, loff_t pos);
 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
index dbba1e1833d43703362aee63cbba2f2c8bfb08f2..63ba12836eae293e6fc2885ed8f8706852b281ae 100644 (file)
@@ -22,7 +22,7 @@
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
+asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5,
        unsigned long r6, unsigned long r7,
        struct pt_regs __regs)
 {
index 0af693e65764d494dc487eb9a386baeb3a95d3aa..e67c1733e1b92bcee8c3b8c99dbb47f33e8d72ac 100644 (file)
@@ -58,7 +58,7 @@ ENTRY(sys_call_table)
        .long sys_mkdir
        .long sys_rmdir         /* 40 */
        .long sys_dup
-       .long sys_pipe
+       .long sys_sh_pipe
        .long sys_times
        .long sys_ni_syscall    /* old prof syscall holder */
        .long sys_brk           /* 45 */
@@ -105,7 +105,7 @@ ENTRY(sys_call_table)
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 0b436aa3cad7931df028a5e8dfa44e0e8e02d6d5..557cb91f5caf829799c5d289a6effeabe5a9e372 100644 (file)
@@ -109,7 +109,7 @@ sys_call_table:
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap                  /* 90 */
        .long sys_munmap
        .long sys_truncate
index 95e38a43dff04915ed8e5eb89706c9a20a0c9599..deeb0fba8029246bcd7c1984a2513824696f016b 100644 (file)
@@ -17,4 +17,3 @@ header-y += traps.h
 header-y += uctx.h
 header-y += utrap.h
 header-y += watchdog.h
-header-y += swab.h
index 48a047cd6fa989163641749cdbdd2ea327d7691e..ccc1b6b7de6c11d18b8495b9b466a3acfc6e2b4c 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _SPARC_BYTEORDER_H
 #define _SPARC_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _SPARC_BYTEORDER_H */
index faf9ccd9ef5dfc32f41da7c3b9b1d74f564669bc..f41ecc5ac0b41f1d72375fe8e9efb1105412f89c 100644 (file)
@@ -1088,8 +1088,8 @@ sunos_execv:
         ld     [%sp + STACKFRAME_SZ + PT_I0], %o0
 
        .align  4
-       .globl  sys_pipe
-sys_pipe:
+       .globl  sys_sparc_pipe
+sys_sparc_pipe:
        mov     %o7, %l5
        add     %sp, STACKFRAME_SZ, %o0         ! pt_regs *regs arg
        call    sparc_pipe
index da8f804feb49d7b73739719a26a84d8dc5d33150..0f26066a08d9a897cef4fb5e8a9b3c21a8461d9d 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
-#include <asm/spinlock.h>
 #include <asm/system.h>
 #include <asm/cpudata.h>
 #include <asm/uaccess.h>
@@ -23,16 +22,6 @@ struct poll {
        short revents;
 };
 
-/* used by various drivers */
-#ifdef CONFIG_SMP
-/* Out of line rw-locking implementation. */
-EXPORT_SYMBOL(__read_lock);
-EXPORT_SYMBOL(__read_unlock);
-EXPORT_SYMBOL(__write_lock);
-EXPORT_SYMBOL(__write_unlock);
-EXPORT_SYMBOL(__write_trylock);
-#endif /* CONFIG_SMP */
-
 /* from helpers.S */
 EXPORT_SYMBOL(__flushw_user);
 EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
index 7a6786a71363c71f64e6686b31adb50f0faa1175..87f5a3b8a253b482b4990c018a3dfb4f58775d9c 100644 (file)
@@ -20,7 +20,7 @@ execve_merge:
         add    %sp, PTREGS_OFF, %o0
 
        .align  32
-sys_pipe:
+sys_sparc_pipe:
        ba,pt   %xcc, sparc_pipe
         add    %sp, PTREGS_OFF, %o0
 sys_nis_syscall:
index 7d0807586442dda4d837e58cc9ac419c10c6bc20..dccc95df0c7f6ce4a97222e5db40295c70456aaa 100644 (file)
@@ -24,7 +24,7 @@ sys_call_table:
 /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause
 /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice
 /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile
-/*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid
+/*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid
 /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16
 /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl
 /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve
@@ -56,7 +56,7 @@ sys_call_table:
 /*185*/        .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
 /*190*/        .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl
 /*195*/        .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask
-/*200*/        .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir
+/*200*/        .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir
 /*205*/        .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
 /*210*/        .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
 /*215*/        .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
index 9fc78cf354bd1f63e034ad46320ff4ed38fa2ee1..e6007bb370465a98b58b439753fbe4985e7e80c7 100644 (file)
@@ -26,7 +26,7 @@ sys_call_table32:
 /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause
 /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
        .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
-/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
+/*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid
        .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16
 /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
        .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve
@@ -100,7 +100,7 @@ sys_call_table:
 /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
 /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
        .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64
-/*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall
+/*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall
        .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid
 /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl
        .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
index a9f8a814a1f776db822df9654d3349b8e9b112e3..4a8e80cdcfa57a7faff08a2042a6b6fb64f5ae66 100644 (file)
@@ -22,4 +22,3 @@ unifdef-y += unistd_32.h
 unifdef-y += unistd_64.h
 unifdef-y += vm86.h
 unifdef-y += vsyscall.h
-unifdef-y += swab.h
index 7c49917e3d9dbf57933e73a0c51158d94a67ee5a..b13a7a88f3ebdeee563075dab2664b46ebcc5383 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_X86_BYTEORDER_H
 #define _ASM_X86_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/little_endian.h>
 
 #endif /* _ASM_X86_BYTEORDER_H */
index 83e69f4a37f03bafb39869169d6286210c7c95df..06bbcbd66e9c508285020b65c6d411afd2bfe59b 100644 (file)
@@ -341,6 +341,25 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
 
 #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
 
+static inline int is_new_memtype_allowed(unsigned long flags,
+                                               unsigned long new_flags)
+{
+       /*
+        * Certain new memtypes are not allowed with certain
+        * requested memtype:
+        * - request is uncached, return cannot be write-back
+        * - request is write-combine, return cannot be write-back
+        */
+       if ((flags == _PAGE_CACHE_UC_MINUS &&
+            new_flags == _PAGE_CACHE_WB) ||
+           (flags == _PAGE_CACHE_WC &&
+            new_flags == _PAGE_CACHE_WB)) {
+               return 0;
+       }
+
+       return 1;
+}
+
 #ifndef __ASSEMBLY__
 /* Indicate that x86 has its own track and untrack pfn vma functions */
 #define __HAVE_PFNMAP_TRACKING
index d6f0490a7391eaeebb218337ba06c650b44b8ee8..46469029e9d3d6a70b0092230271a4dbf2fcfebc 100644 (file)
@@ -1203,7 +1203,6 @@ nmi_stack_correct:
        pushl %eax
        CFI_ADJUST_CFA_OFFSET 4
        SAVE_ALL
-       TRACE_IRQS_OFF
        xorl %edx,%edx          # zero error code
        movl %esp,%eax          # pt_regs pointer
        call do_nmi
@@ -1244,7 +1243,6 @@ nmi_espfix_stack:
        pushl %eax
        CFI_ADJUST_CFA_OFFSET 4
        SAVE_ALL
-       TRACE_IRQS_OFF
        FIXUP_ESPFIX_STACK              # %eax == %esp
        xorl %edx,%edx                  # zero error code
        call do_nmi
index d44395ff34c34f99d91726b975961503c6f7380b..e2e86a08f31d29a52fb116ba8d3befcc2424d8ae 100644 (file)
@@ -88,7 +88,7 @@ ENTRY(sys_call_table)
        .long sys_uselib
        .long sys_swapon
        .long sys_reboot
-       .long old_readdir
+       .long sys_old_readdir
        .long old_mmap          /* 90 */
        .long sys_munmap
        .long sys_truncate
index 85cbd3cd3723698ed51707d01fa75d8000f81477..8b08fb955274148454a2acaa538c78215322e655 100644 (file)
@@ -601,12 +601,13 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot)
  * Reserved non RAM regions only and after successful reserve_memtype,
  * this func also keeps identity mapping (if any) in sync with this new prot.
  */
-static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot)
+static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
+                               int strict_prot)
 {
        int is_ram = 0;
        int id_sz, ret;
        unsigned long flags;
-       unsigned long want_flags = (pgprot_val(vma_prot) & _PAGE_CACHE_MASK);
+       unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK);
 
        is_ram = pagerange_is_ram(paddr, paddr + size);
 
@@ -625,15 +626,24 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_prot)
                return ret;
 
        if (flags != want_flags) {
-               free_memtype(paddr, paddr + size);
-               printk(KERN_ERR
-               "%s:%d map pfn expected mapping type %s for %Lx-%Lx, got %s\n",
-                       current->comm, current->pid,
-                       cattr_name(want_flags),
-                       (unsigned long long)paddr,
-                       (unsigned long long)(paddr + size),
-                       cattr_name(flags));
-               return -EINVAL;
+               if (strict_prot || !is_new_memtype_allowed(want_flags, flags)) {
+                       free_memtype(paddr, paddr + size);
+                       printk(KERN_ERR "%s:%d map pfn expected mapping type %s"
+                               " for %Lx-%Lx, got %s\n",
+                               current->comm, current->pid,
+                               cattr_name(want_flags),
+                               (unsigned long long)paddr,
+                               (unsigned long long)(paddr + size),
+                               cattr_name(flags));
+                       return -EINVAL;
+               }
+               /*
+                * We allow returning different type than the one requested in
+                * non strict case.
+                */
+               *vma_prot = __pgprot((pgprot_val(*vma_prot) &
+                                     (~_PAGE_CACHE_MASK)) |
+                                    flags);
        }
 
        /* Need to keep identity mapping in sync */
@@ -689,6 +699,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma)
        unsigned long vma_start = vma->vm_start;
        unsigned long vma_end = vma->vm_end;
        unsigned long vma_size = vma_end - vma_start;
+       pgprot_t pgprot;
 
        if (!pat_enabled)
                return 0;
@@ -702,7 +713,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma)
                        WARN_ON_ONCE(1);
                        return -EINVAL;
                }
-               return reserve_pfn_range(paddr, vma_size, __pgprot(prot));
+               pgprot = __pgprot(prot);
+               return reserve_pfn_range(paddr, vma_size, &pgprot, 1);
        }
 
        /* reserve entire vma page by page, using pfn and prot from pte */
@@ -710,7 +722,8 @@ int track_pfn_vma_copy(struct vm_area_struct *vma)
                if (follow_phys(vma, vma_start + i, 0, &prot, &paddr))
                        continue;
 
-               retval = reserve_pfn_range(paddr, PAGE_SIZE, __pgprot(prot));
+               pgprot = __pgprot(prot);
+               retval = reserve_pfn_range(paddr, PAGE_SIZE, &pgprot, 1);
                if (retval)
                        goto cleanup_ret;
        }
@@ -741,7 +754,7 @@ cleanup_ret:
  * Note that this function can be called with caller trying to map only a
  * subrange/page inside the vma.
  */
-int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot,
+int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot,
                        unsigned long pfn, unsigned long size)
 {
        int retval = 0;
@@ -758,14 +771,14 @@ int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot,
        if (is_linear_pfn_mapping(vma)) {
                /* reserve the whole chunk starting from vm_pgoff */
                paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT;
-               return reserve_pfn_range(paddr, vma_size, prot);
+               return reserve_pfn_range(paddr, vma_size, prot, 0);
        }
 
        /* reserve page by page using pfn and size */
        base_paddr = (resource_size_t)pfn << PAGE_SHIFT;
        for (i = 0; i < size; i += PAGE_SIZE) {
                paddr = base_paddr + i;
-               retval = reserve_pfn_range(paddr, PAGE_SIZE, prot);
+               retval = reserve_pfn_range(paddr, PAGE_SIZE, prot, 0);
                if (retval)
                        goto cleanup_ret;
        }
index f884740da3182acc6e4e7c3a3e7839439f099010..5ead808dd70c3ec34dbd34da39600851b9c30619 100644 (file)
@@ -314,17 +314,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
                return retval;
 
        if (flags != new_flags) {
-               /*
-                * Do not fallback to certain memory types with certain
-                * requested type:
-                * - request is uncached, return cannot be write-back
-                * - request is uncached, return cannot be write-combine
-                * - request is write-combine, return cannot be write-back
-                */
-               if ((flags == _PAGE_CACHE_UC_MINUS &&
-                    (new_flags == _PAGE_CACHE_WB)) ||
-                   (flags == _PAGE_CACHE_WC &&
-                    new_flags == _PAGE_CACHE_WB)) {
+               if (!is_new_memtype_allowed(flags, new_flags)) {
                        free_memtype(addr, addr+len);
                        return -EINVAL;
                }
index 58c02a454130c659c2f8c5c3afdc8de682445cf5..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,3 +1 @@
 include include/asm-generic/Kbuild.asm
-
-unifdef-y += swab.h
index 329b94591ca404dde4d7458be14e14ebd91282e1..54eb6315349cd1040379eafa4cd234f53f6bf77e 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _XTENSA_BYTEORDER_H
 #define _XTENSA_BYTEORDER_H
 
-#include <asm/swab.h>
-
 #ifdef __XTENSA_EL__
 #include <linux/byteorder/little_endian.h>
 #elif defined(__XTENSA_EB__)
index 1a7be96d627b3224eaf5bf34ec8da4059ef61f6d..503a908afc80f131e70538de4e525745384fca7e 100644 (file)
@@ -698,6 +698,15 @@ config PATA_IXP4XX_CF
 
          If unsure, say N.
 
+config PATA_OCTEON_CF
+       tristate "OCTEON Boot Bus Compact Flash support"
+       depends on CPU_CAVIUM_OCTEON
+       help
+         This option enables a polled compact flash driver for use with
+         compact flash cards attached to the OCTEON boot bus.
+
+         If unsure, say N.
+
 config PATA_SCC
        tristate "Toshiba's Cell Reference Set IDE support"
        depends on PCI && PPC_CELLEB
index 674965fa326dafa621311ed92dfcc91d80380296..7f1ecf99528cfa21bf2a5f8229b9d6ac57bf38c5 100644 (file)
@@ -69,6 +69,7 @@ obj-$(CONFIG_PATA_IXP4XX_CF)  += pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_SCC)         += pata_scc.o
 obj-$(CONFIG_PATA_SCH)         += pata_sch.o
 obj-$(CONFIG_PATA_BF54X)       += pata_bf54x.o
+obj-$(CONFIG_PATA_OCTEON_CF)   += pata_octeon_cf.o
 obj-$(CONFIG_PATA_PLATFORM)    += pata_platform.o
 obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
 obj-$(CONFIG_PATA_ICSIDE)      += pata_icside.o
index 71218d76d75e482df1a3f43237b936467fb04675..88c242856dae999861f6864e9d70e064035a82b0 100644 (file)
@@ -3029,33 +3029,33 @@ int sata_set_spd(struct ata_link *link)
  */
 
 static const struct ata_timing ata_timing[] = {
-/*     { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 960,   0 }, */
-       { XFER_PIO_0,     70, 290, 240, 600, 165, 150, 600,   0 },
-       { XFER_PIO_1,     50, 290,  93, 383, 125, 100, 383,   0 },
-       { XFER_PIO_2,     30, 290,  40, 330, 100,  90, 240,   0 },
-       { XFER_PIO_3,     30,  80,  70, 180,  80,  70, 180,   0 },
-       { XFER_PIO_4,     25,  70,  25, 120,  70,  25, 120,   0 },
-       { XFER_PIO_5,     15,  65,  25, 100,  65,  25, 100,   0 },
-       { XFER_PIO_6,     10,  55,  20,  80,  55,  20,  80,   0 },
-
-       { XFER_SW_DMA_0, 120,   0,   0,   0, 480, 480, 960,   0 },
-       { XFER_SW_DMA_1,  90,   0,   0,   0, 240, 240, 480,   0 },
-       { XFER_SW_DMA_2,  60,   0,   0,   0, 120, 120, 240,   0 },
-
-       { XFER_MW_DMA_0,  60,   0,   0,   0, 215, 215, 480,   0 },
-       { XFER_MW_DMA_1,  45,   0,   0,   0,  80,  50, 150,   0 },
-       { XFER_MW_DMA_2,  25,   0,   0,   0,  70,  25, 120,   0 },
-       { XFER_MW_DMA_3,  25,   0,   0,   0,  65,  25, 100,   0 },
-       { XFER_MW_DMA_4,  25,   0,   0,   0,  55,  20,  80,   0 },
-
-/*     { XFER_UDMA_SLOW,  0,   0,   0,   0,   0,   0,   0, 150 }, */
-       { XFER_UDMA_0,     0,   0,   0,   0,   0,   0,   0, 120 },
-       { XFER_UDMA_1,     0,   0,   0,   0,   0,   0,   0,  80 },
-       { XFER_UDMA_2,     0,   0,   0,   0,   0,   0,   0,  60 },
-       { XFER_UDMA_3,     0,   0,   0,   0,   0,   0,   0,  45 },
-       { XFER_UDMA_4,     0,   0,   0,   0,   0,   0,   0,  30 },
-       { XFER_UDMA_5,     0,   0,   0,   0,   0,   0,   0,  20 },
-       { XFER_UDMA_6,     0,   0,   0,   0,   0,   0,   0,  15 },
+/*     { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 0,  960,   0 }, */
+       { XFER_PIO_0,     70, 290, 240, 600, 165, 150, 0,  600,   0 },
+       { XFER_PIO_1,     50, 290,  93, 383, 125, 100, 0,  383,   0 },
+       { XFER_PIO_2,     30, 290,  40, 330, 100,  90, 0,  240,   0 },
+       { XFER_PIO_3,     30,  80,  70, 180,  80,  70, 0,  180,   0 },
+       { XFER_PIO_4,     25,  70,  25, 120,  70,  25, 0,  120,   0 },
+       { XFER_PIO_5,     15,  65,  25, 100,  65,  25, 0,  100,   0 },
+       { XFER_PIO_6,     10,  55,  20,  80,  55,  20, 0,   80,   0 },
+
+       { XFER_SW_DMA_0, 120,   0,   0,   0, 480, 480, 50, 960,   0 },
+       { XFER_SW_DMA_1,  90,   0,   0,   0, 240, 240, 30, 480,   0 },
+       { XFER_SW_DMA_2,  60,   0,   0,   0, 120, 120, 20, 240,   0 },
+
+       { XFER_MW_DMA_0,  60,   0,   0,   0, 215, 215, 20, 480,   0 },
+       { XFER_MW_DMA_1,  45,   0,   0,   0,  80,  50, 5,  150,   0 },
+       { XFER_MW_DMA_2,  25,   0,   0,   0,  70,  25, 5,  120,   0 },
+       { XFER_MW_DMA_3,  25,   0,   0,   0,  65,  25, 5,  100,   0 },
+       { XFER_MW_DMA_4,  25,   0,   0,   0,  55,  20, 5,   80,   0 },
+
+/*     { XFER_UDMA_SLOW,  0,   0,   0,   0,   0,   0, 0,    0, 150 }, */
+       { XFER_UDMA_0,     0,   0,   0,   0,   0,   0, 0,    0, 120 },
+       { XFER_UDMA_1,     0,   0,   0,   0,   0,   0, 0,    0,  80 },
+       { XFER_UDMA_2,     0,   0,   0,   0,   0,   0, 0,    0,  60 },
+       { XFER_UDMA_3,     0,   0,   0,   0,   0,   0, 0,    0,  45 },
+       { XFER_UDMA_4,     0,   0,   0,   0,   0,   0, 0,    0,  30 },
+       { XFER_UDMA_5,     0,   0,   0,   0,   0,   0, 0,    0,  20 },
+       { XFER_UDMA_6,     0,   0,   0,   0,   0,   0, 0,    0,  15 },
 
        { 0xFF }
 };
@@ -3065,14 +3065,15 @@ static const struct ata_timing ata_timing[] = {
 
 static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT)
 {
-       q->setup   = EZ(t->setup   * 1000,  T);
-       q->act8b   = EZ(t->act8b   * 1000,  T);
-       q->rec8b   = EZ(t->rec8b   * 1000,  T);
-       q->cyc8b   = EZ(t->cyc8b   * 1000,  T);
-       q->active  = EZ(t->active  * 1000,  T);
-       q->recover = EZ(t->recover * 1000,  T);
-       q->cycle   = EZ(t->cycle   * 1000,  T);
-       q->udma    = EZ(t->udma    * 1000, UT);
+       q->setup        = EZ(t->setup      * 1000,  T);
+       q->act8b        = EZ(t->act8b      * 1000,  T);
+       q->rec8b        = EZ(t->rec8b      * 1000,  T);
+       q->cyc8b        = EZ(t->cyc8b      * 1000,  T);
+       q->active       = EZ(t->active     * 1000,  T);
+       q->recover      = EZ(t->recover    * 1000,  T);
+       q->dmack_hold   = EZ(t->dmack_hold * 1000,  T);
+       q->cycle        = EZ(t->cycle      * 1000,  T);
+       q->udma         = EZ(t->udma       * 1000, UT);
 }
 
 void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b,
@@ -3084,6 +3085,7 @@ void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b,
        if (what & ATA_TIMING_CYC8B  ) m->cyc8b   = max(a->cyc8b,   b->cyc8b);
        if (what & ATA_TIMING_ACTIVE ) m->active  = max(a->active,  b->active);
        if (what & ATA_TIMING_RECOVER) m->recover = max(a->recover, b->recover);
+       if (what & ATA_TIMING_DMACK_HOLD) m->dmack_hold = max(a->dmack_hold, b->dmack_hold);
        if (what & ATA_TIMING_CYCLE  ) m->cycle   = max(a->cycle,   b->cycle);
        if (what & ATA_TIMING_UDMA   ) m->udma    = max(a->udma,    b->udma);
 }
@@ -6638,7 +6640,6 @@ EXPORT_SYMBOL_GPL(ata_dev_pair);
 EXPORT_SYMBOL_GPL(ata_port_disable);
 EXPORT_SYMBOL_GPL(ata_ratelimit);
 EXPORT_SYMBOL_GPL(ata_wait_register);
-EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
 EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
 EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
 EXPORT_SYMBOL_GPL(ata_scsi_slave_destroy);
index 9e92107691f2ff0f606e5272347d7a98afe2516b..a1a6e6298c33a4dc622a9c03aba181f70477a4e8 100644 (file)
@@ -423,9 +423,9 @@ int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
  *     RETURNS:
  *     Zero on success, negative errno on error.
  */
-static int ata_get_identity(struct scsi_device *sdev, void __user *arg)
+static int ata_get_identity(struct ata_port *ap, struct scsi_device *sdev,
+                           void __user *arg)
 {
-       struct ata_port *ap = ata_shost_to_port(sdev->host);
        struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
        u16 __user *dst = arg;
        char buf[40];
@@ -645,7 +645,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
        return rc;
 }
 
-int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg)
+int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev,
+                    int cmd, void __user *arg)
 {
        int val = -EINVAL, rc = -EINVAL;
 
@@ -663,7 +664,7 @@ int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg)
                return 0;
 
        case HDIO_GET_IDENTITY:
-               return ata_get_identity(scsidev, arg);
+               return ata_get_identity(ap, scsidev, arg);
 
        case HDIO_DRIVE_CMD:
                if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
@@ -682,6 +683,14 @@ int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg)
 
        return rc;
 }
+EXPORT_SYMBOL_GPL(ata_sas_scsi_ioctl);
+
+int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg)
+{
+       return ata_sas_scsi_ioctl(ata_shost_to_port(scsidev->host),
+                               scsidev, cmd, arg);
+}
+EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
 
 /**
  *     ata_scsi_qc_new - acquire new ata_queued_cmd reference
index 0eae9b4535564ce8a64be5428faf9382683cf985..5a4aad123c4259236677470a202f0d46ca279766 100644 (file)
@@ -1013,9 +1013,12 @@ next_sg:
                qc->cursg_ofs = 0;
        }
 
-       /* consumed can be larger than count only for the last transfer */
-       WARN_ON_ONCE(qc->cursg && count != consumed);
-
+       /*
+        * There used to be a  WARN_ON_ONCE(qc->cursg && count != consumed);
+        * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN
+        * check correctly as it doesn't know if it is the last request being
+        * made. Somebody should implement a proper sanity check.
+        */
        if (bytes)
                goto next_sg;
        return 0;
index a7999c19f0c92bc4185a4ae532ec5395c3eb3253..eb99dbe78081087a79f8e3d578b494b29f9dfa76 100644 (file)
@@ -41,7 +41,7 @@ static int ali_atapi_dma = 0;
 module_param_named(atapi_dma, ali_atapi_dma, int, 0644);
 MODULE_PARM_DESC(atapi_dma, "Enable ATAPI DMA (0=disable, 1=enable)");
 
-static struct pci_dev *isa_bridge;
+static struct pci_dev *ali_isa_bridge;
 
 /*
  *     Cable special cases
@@ -346,13 +346,13 @@ static void ali_c2_c3_postreset(struct ata_link *link, unsigned int *classes)
        int port_bit = 4 << link->ap->port_no;
 
        /* If our bridge is an ALI 1533 then do the extra work */
-       if (isa_bridge) {
+       if (ali_isa_bridge) {
                /* Tristate and re-enable the bus signals */
-               pci_read_config_byte(isa_bridge, 0x58, &r);
+               pci_read_config_byte(ali_isa_bridge, 0x58, &r);
                r &= ~port_bit;
-               pci_write_config_byte(isa_bridge, 0x58, r);
+               pci_write_config_byte(ali_isa_bridge, 0x58, r);
                r |= port_bit;
-               pci_write_config_byte(isa_bridge, 0x58, r);
+               pci_write_config_byte(ali_isa_bridge, 0x58, r);
        }
        ata_sff_postreset(link, classes);
 }
@@ -467,14 +467,14 @@ static void ali_init_chipset(struct pci_dev *pdev)
                pci_write_config_byte(pdev, 0x53, tmp);
        }
        north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
-       if (north && north->vendor == PCI_VENDOR_ID_AL && isa_bridge) {
+       if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
                /* Configure the ALi bridge logic. For non ALi rely on BIOS.
                   Set the south bridge enable bit */
-               pci_read_config_byte(isa_bridge, 0x79, &tmp);
+               pci_read_config_byte(ali_isa_bridge, 0x79, &tmp);
                if (pdev->revision == 0xC2)
-                       pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04);
+                       pci_write_config_byte(ali_isa_bridge, 0x79, tmp | 0x04);
                else if (pdev->revision > 0xC2 && pdev->revision < 0xC5)
-                       pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02);
+                       pci_write_config_byte(ali_isa_bridge, 0x79, tmp | 0x02);
        }
        pci_dev_put(north);
        ata_pci_bmdma_clear_simplex(pdev);
@@ -571,9 +571,9 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        ali_init_chipset(pdev);
 
-       if (isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) {
+       if (ali_isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) {
                /* Are we paired with a UDMA capable chip */
-               pci_read_config_byte(isa_bridge, 0x5E, &tmp);
+               pci_read_config_byte(ali_isa_bridge, 0x5E, &tmp);
                if ((tmp & 0x1E) == 0x12)
                        ppi[0] = &info_20_udma;
        }
@@ -617,11 +617,11 @@ static struct pci_driver ali_pci_driver = {
 static int __init ali_init(void)
 {
        int ret;
-       isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
+       ali_isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
 
        ret = pci_register_driver(&ali_pci_driver);
        if (ret < 0)
-               pci_dev_put(isa_bridge);
+               pci_dev_put(ali_isa_bridge);
        return ret;
 }
 
@@ -629,7 +629,7 @@ static int __init ali_init(void)
 static void __exit ali_exit(void)
 {
        pci_unregister_driver(&ali_pci_driver);
-       pci_dev_put(isa_bridge);
+       pci_dev_put(ali_isa_bridge);
 }
 
 
index 0e2cde8f9973af6d3088a5f5bef439c7d7dfec57..506adde8ebb379397f03f4d1c8467be85417fc51 100644 (file)
@@ -32,21 +32,6 @@ enum {
        ATIIXP_IDE_UDMA_MODE    = 0x56
 };
 
-static int atiixp_pre_reset(struct ata_link *link, unsigned long deadline)
-{
-       struct ata_port *ap = link->ap;
-       static const struct pci_bits atiixp_enable_bits[] = {
-               { 0x48, 1, 0x01, 0x00 },
-               { 0x48, 1, 0x08, 0x00 }
-       };
-       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-
-       if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
-               return -ENOENT;
-
-       return ata_sff_prereset(link, deadline);
-}
-
 static int atiixp_cable_detect(struct ata_port *ap)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -229,10 +214,9 @@ static struct ata_port_operations atiixp_port_ops = {
        .cable_detect   = atiixp_cable_detect,
        .set_piomode    = atiixp_set_piomode,
        .set_dmamode    = atiixp_set_dmamode,
-       .prereset       = atiixp_pre_reset,
 };
 
-static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
+static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
        static const struct ata_port_info info = {
                .flags = ATA_FLAG_SLAVE_POSS,
@@ -241,8 +225,18 @@ static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                .udma_mask = 0x3F,
                .port_ops = &atiixp_port_ops
        };
-       const struct ata_port_info *ppi[] = { &info, NULL };
-       return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL);
+       static const struct pci_bits atiixp_enable_bits[] = {
+               { 0x48, 1, 0x01, 0x00 },
+               { 0x48, 1, 0x08, 0x00 }
+       };
+       const struct ata_port_info *ppi[] = { &info, &info };
+       int i;
+
+       for (i = 0; i < 2; i++)
+               if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
+                       ppi[i] = &ata_dummy_port_info;
+
+       return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL);
 }
 
 static const struct pci_device_id atiixp[] = {
index f828a29d77567e27ff539845e3e51745344007dd..f1bb2f9fecbf347b50bb5d76253b6c6bb67e31b9 100644 (file)
@@ -80,7 +80,7 @@
 
 
 #define DRV_NAME "pata_it821x"
-#define DRV_VERSION "0.4.0"
+#define DRV_VERSION "0.4.2"
 
 struct it821x_dev
 {
@@ -494,8 +494,6 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
  *     special. In our case we need to lock the sector count to avoid
  *     blowing the brains out of the firmware with large LBA48 requests
  *
- *     FIXME: When FUA appears we need to block FUA too. And SMART and
- *     basically we need to filter commands for this chip.
  */
 
 static void it821x_dev_config(struct ata_device *adev)
@@ -887,6 +885,13 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                .port_ops = &it821x_passthru_port_ops
        };
        static const struct ata_port_info info_rdc = {
+               .flags = ATA_FLAG_SLAVE_POSS,
+               .pio_mask = 0x1f,
+               .mwdma_mask = 0x07,
+               .udma_mask = ATA_UDMA6,
+               .port_ops = &it821x_rdc_port_ops
+       };
+       static const struct ata_port_info info_rdc_11 = {
                .flags = ATA_FLAG_SLAVE_POSS,
                .pio_mask = 0x1f,
                .mwdma_mask = 0x07,
@@ -903,7 +908,11 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                return rc;
                
        if (pdev->vendor == PCI_VENDOR_ID_RDC) {
-               ppi[0] = &info_rdc;
+               /* Deal with Vortex86SX */
+               if (pdev->revision == 0x11)
+                       ppi[0] = &info_rdc_11;
+               else
+                       ppi[0] = &info_rdc;
        } else {
                /* Force the card into bypass mode if so requested */
                if (it8212_noraid) {
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
new file mode 100644 (file)
index 0000000..0fe4ef3
--- /dev/null
@@ -0,0 +1,965 @@
+/*
+ * Driver for the Octeon bootbus compact flash.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2005 - 2009 Cavium Networks
+ * Copyright (C) 2008 Wind River Systems
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/libata.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/workqueue.h>
+#include <scsi/scsi_host.h>
+
+#include <asm/octeon/octeon.h>
+
+/*
+ * The Octeon bootbus compact flash interface is connected in at least
+ * 3 different configurations on various evaluation boards:
+ *
+ * -- 8  bits no irq, no DMA
+ * -- 16 bits no irq, no DMA
+ * -- 16 bits True IDE mode with DMA, but no irq.
+ *
+ * In the last case the DMA engine can generate an interrupt when the
+ * transfer is complete.  For the first two cases only PIO is supported.
+ *
+ */
+
+#define DRV_NAME       "pata_octeon_cf"
+#define DRV_VERSION    "2.1"
+
+
+struct octeon_cf_port {
+       struct workqueue_struct *wq;
+       struct delayed_work delayed_finish;
+       struct ata_port *ap;
+       int dma_finished;
+};
+
+static struct scsi_host_template octeon_cf_sht = {
+       ATA_PIO_SHT(DRV_NAME),
+};
+
+/**
+ * Convert nanosecond based time to setting used in the
+ * boot bus timing register, based on timing multiple
+ */
+static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs)
+{
+       unsigned int val;
+
+       /*
+        * Compute # of eclock periods to get desired duration in
+        * nanoseconds.
+        */
+       val = DIV_ROUND_UP(nsecs * (octeon_get_clock_rate() / 1000000),
+                         1000 * tim_mult);
+
+       return val;
+}
+
+static void octeon_cf_set_boot_reg_cfg(int cs)
+{
+       union cvmx_mio_boot_reg_cfgx reg_cfg;
+       reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(cs));
+       reg_cfg.s.dmack = 0;    /* Don't assert DMACK on access */
+       reg_cfg.s.tim_mult = 2; /* Timing mutiplier 2x */
+       reg_cfg.s.rd_dly = 0;   /* Sample on falling edge of BOOT_OE */
+       reg_cfg.s.sam = 0;      /* Don't combine write and output enable */
+       reg_cfg.s.we_ext = 0;   /* No write enable extension */
+       reg_cfg.s.oe_ext = 0;   /* No read enable extension */
+       reg_cfg.s.en = 1;       /* Enable this region */
+       reg_cfg.s.orbit = 0;    /* Don't combine with previous region */
+       reg_cfg.s.ale = 0;      /* Don't do address multiplexing */
+       cvmx_write_csr(CVMX_MIO_BOOT_REG_CFGX(cs), reg_cfg.u64);
+}
+
+/**
+ * Called after libata determines the needed PIO mode. This
+ * function programs the Octeon bootbus regions to support the
+ * timing requirements of the PIO mode.
+ *
+ * @ap:     ATA port information
+ * @dev:    ATA device
+ */
+static void octeon_cf_set_piomode(struct ata_port *ap, struct ata_device *dev)
+{
+       struct octeon_cf_data *ocd = ap->dev->platform_data;
+       union cvmx_mio_boot_reg_timx reg_tim;
+       int cs = ocd->base_region;
+       int T;
+       struct ata_timing timing;
+
+       int use_iordy;
+       int trh;
+       int pause;
+       /* These names are timing parameters from the ATA spec */
+       int t1;
+       int t2;
+       int t2i;
+
+       T = (int)(2000000000000LL / octeon_get_clock_rate());
+
+       if (ata_timing_compute(dev, dev->pio_mode, &timing, T, T))
+               BUG();
+
+       t1 = timing.setup;
+       if (t1)
+               t1--;
+       t2 = timing.active;
+       if (t2)
+               t2--;
+       t2i = timing.act8b;
+       if (t2i)
+               t2i--;
+
+       trh = ns_to_tim_reg(2, 20);
+       if (trh)
+               trh--;
+
+       pause = timing.cycle - timing.active - timing.setup - trh;
+       if (pause)
+               pause--;
+
+       octeon_cf_set_boot_reg_cfg(cs);
+       if (ocd->dma_engine >= 0)
+               /* True IDE mode, program both chip selects.  */
+               octeon_cf_set_boot_reg_cfg(cs + 1);
+
+
+       use_iordy = ata_pio_need_iordy(dev);
+
+       reg_tim.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_TIMX(cs));
+       /* Disable page mode */
+       reg_tim.s.pagem = 0;
+       /* Enable dynamic timing */
+       reg_tim.s.waitm = use_iordy;
+       /* Pages are disabled */
+       reg_tim.s.pages = 0;
+       /* We don't use multiplexed address mode */
+       reg_tim.s.ale = 0;
+       /* Not used */
+       reg_tim.s.page = 0;
+       /* Time after IORDY to coninue to assert the data */
+       reg_tim.s.wait = 0;
+       /* Time to wait to complete the cycle. */
+       reg_tim.s.pause = pause;
+       /* How long to hold after a write to de-assert CE. */
+       reg_tim.s.wr_hld = trh;
+       /* How long to wait after a read to de-assert CE. */
+       reg_tim.s.rd_hld = trh;
+       /* How long write enable is asserted */
+       reg_tim.s.we = t2;
+       /* How long read enable is asserted */
+       reg_tim.s.oe = t2;
+       /* Time after CE that read/write starts */
+       reg_tim.s.ce = ns_to_tim_reg(2, 5);
+       /* Time before CE that address is valid */
+       reg_tim.s.adr = 0;
+
+       /* Program the bootbus region timing for the data port chip select. */
+       cvmx_write_csr(CVMX_MIO_BOOT_REG_TIMX(cs), reg_tim.u64);
+       if (ocd->dma_engine >= 0)
+               /* True IDE mode, program both chip selects.  */
+               cvmx_write_csr(CVMX_MIO_BOOT_REG_TIMX(cs + 1), reg_tim.u64);
+}
+
+static void octeon_cf_set_dmamode(struct ata_port *ap, struct ata_device *dev)
+{
+       struct octeon_cf_data *ocd = dev->link->ap->dev->platform_data;
+       union cvmx_mio_boot_dma_timx dma_tim;
+       unsigned int oe_a;
+       unsigned int oe_n;
+       unsigned int dma_ackh;
+       unsigned int dma_arq;
+       unsigned int pause;
+       unsigned int T0, Tkr, Td;
+       unsigned int tim_mult;
+
+       const struct ata_timing *timing;
+
+       timing = ata_timing_find_mode(dev->dma_mode);
+       T0      = timing->cycle;
+       Td      = timing->active;
+       Tkr     = timing->recover;
+       dma_ackh = timing->dmack_hold;
+
+       dma_tim.u64 = 0;
+       /* dma_tim.s.tim_mult = 0 --> 4x */
+       tim_mult = 4;
+
+       /* not spec'ed, value in eclocks, not affected by tim_mult */
+       dma_arq = 8;
+       pause = 25 - dma_arq * 1000 /
+               (octeon_get_clock_rate() / 1000000); /* Tz */
+
+       oe_a = Td;
+       /* Tkr from cf spec, lengthened to meet T0 */
+       oe_n = max(T0 - oe_a, Tkr);
+
+       dma_tim.s.dmack_pi = 1;
+
+       dma_tim.s.oe_n = ns_to_tim_reg(tim_mult, oe_n);
+       dma_tim.s.oe_a = ns_to_tim_reg(tim_mult, oe_a);
+
+       /*
+        * This is tI, C.F. spec. says 0, but Sony CF card requires
+        * more, we use 20 nS.
+        */
+       dma_tim.s.dmack_s = ns_to_tim_reg(tim_mult, 20);;
+       dma_tim.s.dmack_h = ns_to_tim_reg(tim_mult, dma_ackh);
+
+       dma_tim.s.dmarq = dma_arq;
+       dma_tim.s.pause = ns_to_tim_reg(tim_mult, pause);
+
+       dma_tim.s.rd_dly = 0;   /* Sample right on edge */
+
+       /*  writes only */
+       dma_tim.s.we_n = ns_to_tim_reg(tim_mult, oe_n);
+       dma_tim.s.we_a = ns_to_tim_reg(tim_mult, oe_a);
+
+       pr_debug("ns to ticks (mult %d) of %d is: %d\n", tim_mult, 60,
+                ns_to_tim_reg(tim_mult, 60));
+       pr_debug("oe_n: %d, oe_a: %d, dmack_s: %d, dmack_h: "
+                "%d, dmarq: %d, pause: %d\n",
+                dma_tim.s.oe_n, dma_tim.s.oe_a, dma_tim.s.dmack_s,
+                dma_tim.s.dmack_h, dma_tim.s.dmarq, dma_tim.s.pause);
+
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_TIMX(ocd->dma_engine),
+                      dma_tim.u64);
+
+}
+
+/**
+ * Handle an 8 bit I/O request.
+ *
+ * @dev:        Device to access
+ * @buffer:     Data buffer
+ * @buflen:     Length of the buffer.
+ * @rw:         True to write.
+ */
+static unsigned int octeon_cf_data_xfer8(struct ata_device *dev,
+                                        unsigned char *buffer,
+                                        unsigned int buflen,
+                                        int rw)
+{
+       struct ata_port *ap             = dev->link->ap;
+       void __iomem *data_addr         = ap->ioaddr.data_addr;
+       unsigned long words;
+       int count;
+
+       words = buflen;
+       if (rw) {
+               count = 16;
+               while (words--) {
+                       iowrite8(*buffer, data_addr);
+                       buffer++;
+                       /*
+                        * Every 16 writes do a read so the bootbus
+                        * FIFO doesn't fill up.
+                        */
+                       if (--count == 0) {
+                               ioread8(ap->ioaddr.altstatus_addr);
+                               count = 16;
+                       }
+               }
+       } else {
+               ioread8_rep(data_addr, buffer, words);
+       }
+       return buflen;
+}
+
+/**
+ * Handle a 16 bit I/O request.
+ *
+ * @dev:        Device to access
+ * @buffer:     Data buffer
+ * @buflen:     Length of the buffer.
+ * @rw:         True to write.
+ */
+static unsigned int octeon_cf_data_xfer16(struct ata_device *dev,
+                                         unsigned char *buffer,
+                                         unsigned int buflen,
+                                         int rw)
+{
+       struct ata_port *ap             = dev->link->ap;
+       void __iomem *data_addr         = ap->ioaddr.data_addr;
+       unsigned long words;
+       int count;
+
+       words = buflen / 2;
+       if (rw) {
+               count = 16;
+               while (words--) {
+                       iowrite16(*(uint16_t *)buffer, data_addr);
+                       buffer += sizeof(uint16_t);
+                       /*
+                        * Every 16 writes do a read so the bootbus
+                        * FIFO doesn't fill up.
+                        */
+                       if (--count == 0) {
+                               ioread8(ap->ioaddr.altstatus_addr);
+                               count = 16;
+                       }
+               }
+       } else {
+               while (words--) {
+                       *(uint16_t *)buffer = ioread16(data_addr);
+                       buffer += sizeof(uint16_t);
+               }
+       }
+       /* Transfer trailing 1 byte, if any. */
+       if (unlikely(buflen & 0x01)) {
+               __le16 align_buf[1] = { 0 };
+
+               if (rw == READ) {
+                       align_buf[0] = cpu_to_le16(ioread16(data_addr));
+                       memcpy(buffer, align_buf, 1);
+               } else {
+                       memcpy(align_buf, buffer, 1);
+                       iowrite16(le16_to_cpu(align_buf[0]), data_addr);
+               }
+               words++;
+       }
+       return buflen;
+}
+
+/**
+ * Read the taskfile for 16bit non-True IDE only.
+ */
+static void octeon_cf_tf_read16(struct ata_port *ap, struct ata_taskfile *tf)
+{
+       u16 blob;
+       /* The base of the registers is at ioaddr.data_addr. */
+       void __iomem *base = ap->ioaddr.data_addr;
+
+       blob = __raw_readw(base + 0xc);
+       tf->feature = blob >> 8;
+
+       blob = __raw_readw(base + 2);
+       tf->nsect = blob & 0xff;
+       tf->lbal = blob >> 8;
+
+       blob = __raw_readw(base + 4);
+       tf->lbam = blob & 0xff;
+       tf->lbah = blob >> 8;
+
+       blob = __raw_readw(base + 6);
+       tf->device = blob & 0xff;
+       tf->command = blob >> 8;
+
+       if (tf->flags & ATA_TFLAG_LBA48) {
+               if (likely(ap->ioaddr.ctl_addr)) {
+                       iowrite8(tf->ctl | ATA_HOB, ap->ioaddr.ctl_addr);
+
+                       blob = __raw_readw(base + 0xc);
+                       tf->hob_feature = blob >> 8;
+
+                       blob = __raw_readw(base + 2);
+                       tf->hob_nsect = blob & 0xff;
+                       tf->hob_lbal = blob >> 8;
+
+                       blob = __raw_readw(base + 4);
+                       tf->hob_lbam = blob & 0xff;
+                       tf->hob_lbah = blob >> 8;
+
+                       iowrite8(tf->ctl, ap->ioaddr.ctl_addr);
+                       ap->last_ctl = tf->ctl;
+               } else {
+                       WARN_ON(1);
+               }
+       }
+}
+
+static u8 octeon_cf_check_status16(struct ata_port *ap)
+{
+       u16 blob;
+       void __iomem *base = ap->ioaddr.data_addr;
+
+       blob = __raw_readw(base + 6);
+       return blob >> 8;
+}
+
+static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes,
+                                unsigned long deadline)
+{
+       struct ata_port *ap = link->ap;
+       void __iomem *base = ap->ioaddr.data_addr;
+       int rc;
+       u8 err;
+
+       DPRINTK("about to softreset\n");
+       __raw_writew(ap->ctl, base + 0xe);
+       udelay(20);
+       __raw_writew(ap->ctl | ATA_SRST, base + 0xe);
+       udelay(20);
+       __raw_writew(ap->ctl, base + 0xe);
+
+       rc = ata_sff_wait_after_reset(link, 1, deadline);
+       if (rc) {
+               ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc);
+               return rc;
+       }
+
+       /* determine by signature whether we have ATA or ATAPI devices */
+       classes[0] = ata_sff_dev_classify(&link->device[0], 1, &err);
+       DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]);
+       return 0;
+}
+
+/**
+ * Load the taskfile for 16bit non-True IDE only.  The device_addr is
+ * not loaded, we do this as part of octeon_cf_exec_command16.
+ */
+static void octeon_cf_tf_load16(struct ata_port *ap,
+                               const struct ata_taskfile *tf)
+{
+       unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
+       /* The base of the registers is at ioaddr.data_addr. */
+       void __iomem *base = ap->ioaddr.data_addr;
+
+       if (tf->ctl != ap->last_ctl) {
+               iowrite8(tf->ctl, ap->ioaddr.ctl_addr);
+               ap->last_ctl = tf->ctl;
+               ata_wait_idle(ap);
+       }
+       if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) {
+               __raw_writew(tf->hob_feature << 8, base + 0xc);
+               __raw_writew(tf->hob_nsect | tf->hob_lbal << 8, base + 2);
+               __raw_writew(tf->hob_lbam | tf->hob_lbah << 8, base + 4);
+               VPRINTK("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n",
+                       tf->hob_feature,
+                       tf->hob_nsect,
+                       tf->hob_lbal,
+                       tf->hob_lbam,
+                       tf->hob_lbah);
+       }
+       if (is_addr) {
+               __raw_writew(tf->feature << 8, base + 0xc);
+               __raw_writew(tf->nsect | tf->lbal << 8, base + 2);
+               __raw_writew(tf->lbam | tf->lbah << 8, base + 4);
+               VPRINTK("feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n",
+                       tf->feature,
+                       tf->nsect,
+                       tf->lbal,
+                       tf->lbam,
+                       tf->lbah);
+       }
+       ata_wait_idle(ap);
+}
+
+
+static void octeon_cf_dev_select(struct ata_port *ap, unsigned int device)
+{
+/*  There is only one device, do nothing. */
+       return;
+}
+
+/*
+ * Issue ATA command to host controller.  The device_addr is also sent
+ * as it must be written in a combined write with the command.
+ */
+static void octeon_cf_exec_command16(struct ata_port *ap,
+                               const struct ata_taskfile *tf)
+{
+       /* The base of the registers is at ioaddr.data_addr. */
+       void __iomem *base = ap->ioaddr.data_addr;
+       u16 blob;
+
+       if (tf->flags & ATA_TFLAG_DEVICE) {
+               VPRINTK("device 0x%X\n", tf->device);
+               blob = tf->device;
+       } else {
+               blob = 0;
+       }
+
+       DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
+       blob |= (tf->command << 8);
+       __raw_writew(blob, base + 6);
+
+
+       ata_wait_idle(ap);
+}
+
+static u8 octeon_cf_irq_on(struct ata_port *ap)
+{
+       return 0;
+}
+
+static void octeon_cf_irq_clear(struct ata_port *ap)
+{
+       return;
+}
+
+static void octeon_cf_dma_setup(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct octeon_cf_port *cf_port;
+
+       cf_port = (struct octeon_cf_port *)ap->private_data;
+       DPRINTK("ENTER\n");
+       /* issue r/w command */
+       qc->cursg = qc->sg;
+       cf_port->dma_finished = 0;
+       ap->ops->sff_exec_command(ap, &qc->tf);
+       DPRINTK("EXIT\n");
+}
+
+/**
+ * Start a DMA transfer that was already setup
+ *
+ * @qc:     Information about the DMA
+ */
+static void octeon_cf_dma_start(struct ata_queued_cmd *qc)
+{
+       struct octeon_cf_data *ocd = qc->ap->dev->platform_data;
+       union cvmx_mio_boot_dma_cfgx mio_boot_dma_cfg;
+       union cvmx_mio_boot_dma_intx mio_boot_dma_int;
+       struct scatterlist *sg;
+
+       VPRINTK("%d scatterlists\n", qc->n_elem);
+
+       /* Get the scatter list entry we need to DMA into */
+       sg = qc->cursg;
+       BUG_ON(!sg);
+
+       /*
+        * Clear the DMA complete status.
+        */
+       mio_boot_dma_int.u64 = 0;
+       mio_boot_dma_int.s.done = 1;
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine),
+                      mio_boot_dma_int.u64);
+
+       /* Enable the interrupt.  */
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_INT_ENX(ocd->dma_engine),
+                      mio_boot_dma_int.u64);
+
+       /* Set the direction of the DMA */
+       mio_boot_dma_cfg.u64 = 0;
+       mio_boot_dma_cfg.s.en = 1;
+       mio_boot_dma_cfg.s.rw = ((qc->tf.flags & ATA_TFLAG_WRITE) != 0);
+
+       /*
+        * Don't stop the DMA if the device deasserts DMARQ. Many
+        * compact flashes deassert DMARQ for a short time between
+        * sectors. Instead of stopping and restarting the DMA, we'll
+        * let the hardware do it. If the DMA is really stopped early
+        * due to an error condition, a later timeout will force us to
+        * stop.
+        */
+       mio_boot_dma_cfg.s.clr = 0;
+
+       /* Size is specified in 16bit words and minus one notation */
+       mio_boot_dma_cfg.s.size = sg_dma_len(sg) / 2 - 1;
+
+       /* We need to swap the high and low bytes of every 16 bits */
+       mio_boot_dma_cfg.s.swap8 = 1;
+
+       mio_boot_dma_cfg.s.adr = sg_dma_address(sg);
+
+       VPRINTK("%s %d bytes address=%p\n",
+               (mio_boot_dma_cfg.s.rw) ? "write" : "read", sg->length,
+               (void *)(unsigned long)mio_boot_dma_cfg.s.adr);
+
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine),
+                      mio_boot_dma_cfg.u64);
+}
+
+/**
+ *
+ *     LOCKING:
+ *     spin_lock_irqsave(host lock)
+ *
+ */
+static unsigned int octeon_cf_dma_finished(struct ata_port *ap,
+                                       struct ata_queued_cmd *qc)
+{
+       struct ata_eh_info *ehi = &ap->link.eh_info;
+       struct octeon_cf_data *ocd = ap->dev->platform_data;
+       union cvmx_mio_boot_dma_cfgx dma_cfg;
+       union cvmx_mio_boot_dma_intx dma_int;
+       struct octeon_cf_port *cf_port;
+       u8 status;
+
+       VPRINTK("ata%u: protocol %d task_state %d\n",
+               ap->print_id, qc->tf.protocol, ap->hsm_task_state);
+
+
+       if (ap->hsm_task_state != HSM_ST_LAST)
+               return 0;
+
+       cf_port = (struct octeon_cf_port *)ap->private_data;
+
+       dma_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine));
+       if (dma_cfg.s.size != 0xfffff) {
+               /* Error, the transfer was not complete.  */
+               qc->err_mask |= AC_ERR_HOST_BUS;
+               ap->hsm_task_state = HSM_ST_ERR;
+       }
+
+       /* Stop and clear the dma engine.  */
+       dma_cfg.u64 = 0;
+       dma_cfg.s.size = -1;
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine), dma_cfg.u64);
+
+       /* Disable the interrupt.  */
+       dma_int.u64 = 0;
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_INT_ENX(ocd->dma_engine), dma_int.u64);
+
+       /* Clear the DMA complete status */
+       dma_int.s.done = 1;
+       cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine), dma_int.u64);
+
+       status = ap->ops->sff_check_status(ap);
+
+       ata_sff_hsm_move(ap, qc, status, 0);
+
+       if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA))
+               ata_ehi_push_desc(ehi, "DMA stat 0x%x", status);
+
+       return 1;
+}
+
+/*
+ * Check if any queued commands have more DMAs, if so start the next
+ * transfer, else do end of transfer handling.
+ */
+static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
+{
+       struct ata_host *host = dev_instance;
+       struct octeon_cf_port *cf_port;
+       int i;
+       unsigned int handled = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&host->lock, flags);
+
+       DPRINTK("ENTER\n");
+       for (i = 0; i < host->n_ports; i++) {
+               u8 status;
+               struct ata_port *ap;
+               struct ata_queued_cmd *qc;
+               union cvmx_mio_boot_dma_intx dma_int;
+               union cvmx_mio_boot_dma_cfgx dma_cfg;
+               struct octeon_cf_data *ocd;
+
+               ap = host->ports[i];
+               ocd = ap->dev->platform_data;
+               if (!ap || (ap->flags & ATA_FLAG_DISABLED))
+                       continue;
+
+               ocd = ap->dev->platform_data;
+               cf_port = (struct octeon_cf_port *)ap->private_data;
+               dma_int.u64 =
+                       cvmx_read_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine));
+               dma_cfg.u64 =
+                       cvmx_read_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine));
+
+               qc = ata_qc_from_tag(ap, ap->link.active_tag);
+
+               if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
+                   (qc->flags & ATA_QCFLAG_ACTIVE)) {
+                       if (dma_int.s.done && !dma_cfg.s.en) {
+                               if (!sg_is_last(qc->cursg)) {
+                                       qc->cursg = sg_next(qc->cursg);
+                                       handled = 1;
+                                       octeon_cf_dma_start(qc);
+                                       continue;
+                               } else {
+                                       cf_port->dma_finished = 1;
+                               }
+                       }
+                       if (!cf_port->dma_finished)
+                               continue;
+                       status = ioread8(ap->ioaddr.altstatus_addr);
+                       if (status & (ATA_BUSY | ATA_DRQ)) {
+                               /*
+                                * We are busy, try to handle it
+                                * later.  This is the DMA finished
+                                * interrupt, and it could take a
+                                * little while for the card to be
+                                * ready for more commands.
+                                */
+                               /* Clear DMA irq. */
+                               dma_int.u64 = 0;
+                               dma_int.s.done = 1;
+                               cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine),
+                                              dma_int.u64);
+
+                               queue_delayed_work(cf_port->wq,
+                                                  &cf_port->delayed_finish, 1);
+                               handled = 1;
+                       } else {
+                               handled |= octeon_cf_dma_finished(ap, qc);
+                       }
+               }
+       }
+       spin_unlock_irqrestore(&host->lock, flags);
+       DPRINTK("EXIT\n");
+       return IRQ_RETVAL(handled);
+}
+
+static void octeon_cf_delayed_finish(struct work_struct *work)
+{
+       struct octeon_cf_port *cf_port = container_of(work,
+                                                     struct octeon_cf_port,
+                                                     delayed_finish.work);
+       struct ata_port *ap = cf_port->ap;
+       struct ata_host *host = ap->host;
+       struct ata_queued_cmd *qc;
+       unsigned long flags;
+       u8 status;
+
+       spin_lock_irqsave(&host->lock, flags);
+
+       /*
+        * If the port is not waiting for completion, it must have
+        * handled it previously.  The hsm_task_state is
+        * protected by host->lock.
+        */
+       if (ap->hsm_task_state != HSM_ST_LAST || !cf_port->dma_finished)
+               goto out;
+
+       status = ioread8(ap->ioaddr.altstatus_addr);
+       if (status & (ATA_BUSY | ATA_DRQ)) {
+               /* Still busy, try again. */
+               queue_delayed_work(cf_port->wq,
+                                  &cf_port->delayed_finish, 1);
+               goto out;
+       }
+       qc = ata_qc_from_tag(ap, ap->link.active_tag);
+       if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
+           (qc->flags & ATA_QCFLAG_ACTIVE))
+               octeon_cf_dma_finished(ap, qc);
+out:
+       spin_unlock_irqrestore(&host->lock, flags);
+}
+
+static void octeon_cf_dev_config(struct ata_device *dev)
+{
+       /*
+        * A maximum of 2^20 - 1 16 bit transfers are possible with
+        * the bootbus DMA.  So we need to throttle max_sectors to
+        * (2^12 - 1 == 4095) to assure that this can never happen.
+        */
+       dev->max_sectors = min(dev->max_sectors, 4095U);
+}
+
+/*
+ * Trap if driver tries to do standard bmdma commands.  They are not
+ * supported.
+ */
+static void unreachable_qc(struct ata_queued_cmd *qc)
+{
+       BUG();
+}
+
+static u8 unreachable_port(struct ata_port *ap)
+{
+       BUG();
+}
+
+/*
+ * We don't do ATAPI DMA so return 0.
+ */
+static int octeon_cf_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+       return 0;
+}
+
+static unsigned int octeon_cf_qc_issue(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+
+       switch (qc->tf.protocol) {
+       case ATA_PROT_DMA:
+               WARN_ON(qc->tf.flags & ATA_TFLAG_POLLING);
+
+               ap->ops->sff_tf_load(ap, &qc->tf);  /* load tf registers */
+               octeon_cf_dma_setup(qc);            /* set up dma */
+               octeon_cf_dma_start(qc);            /* initiate dma */
+               ap->hsm_task_state = HSM_ST_LAST;
+               break;
+
+       case ATAPI_PROT_DMA:
+               dev_err(ap->dev, "Error, ATAPI not supported\n");
+               BUG();
+
+       default:
+               return ata_sff_qc_issue(qc);
+       }
+
+       return 0;
+}
+
+static struct ata_port_operations octeon_cf_ops = {
+       .inherits               = &ata_sff_port_ops,
+       .check_atapi_dma        = octeon_cf_check_atapi_dma,
+       .qc_prep                = ata_noop_qc_prep,
+       .qc_issue               = octeon_cf_qc_issue,
+       .sff_dev_select         = octeon_cf_dev_select,
+       .sff_irq_on             = octeon_cf_irq_on,
+       .sff_irq_clear          = octeon_cf_irq_clear,
+       .bmdma_setup            = unreachable_qc,
+       .bmdma_start            = unreachable_qc,
+       .bmdma_stop             = unreachable_qc,
+       .bmdma_status           = unreachable_port,
+       .cable_detect           = ata_cable_40wire,
+       .set_piomode            = octeon_cf_set_piomode,
+       .set_dmamode            = octeon_cf_set_dmamode,
+       .dev_config             = octeon_cf_dev_config,
+};
+
+static int __devinit octeon_cf_probe(struct platform_device *pdev)
+{
+       struct resource *res_cs0, *res_cs1;
+
+       void __iomem *cs0;
+       void __iomem *cs1 = NULL;
+       struct ata_host *host;
+       struct ata_port *ap;
+       struct octeon_cf_data *ocd;
+       int irq = 0;
+       irq_handler_t irq_handler = NULL;
+       void __iomem *base;
+       struct octeon_cf_port *cf_port;
+
+       res_cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+       if (!res_cs0)
+               return -EINVAL;
+
+       ocd = pdev->dev.platform_data;
+
+       cs0 = devm_ioremap_nocache(&pdev->dev, res_cs0->start,
+                                  res_cs0->end - res_cs0->start + 1);
+
+       if (!cs0)
+               return -ENOMEM;
+
+       /* Determine from availability of DMA if True IDE mode or not */
+       if (ocd->dma_engine >= 0) {
+               res_cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+               if (!res_cs1)
+                       return -EINVAL;
+
+               cs1 = devm_ioremap_nocache(&pdev->dev, res_cs1->start,
+                                          res_cs0->end - res_cs1->start + 1);
+
+               if (!cs1)
+                       return -ENOMEM;
+       }
+
+       cf_port = kzalloc(sizeof(*cf_port), GFP_KERNEL);
+       if (!cf_port)
+               return -ENOMEM;
+
+       /* allocate host */
+       host = ata_host_alloc(&pdev->dev, 1);
+       if (!host)
+               goto free_cf_port;
+
+       ap = host->ports[0];
+       ap->private_data = cf_port;
+       cf_port->ap = ap;
+       ap->ops = &octeon_cf_ops;
+       ap->pio_mask = 0x7f; /* Support PIO 0-6 */
+       ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY
+                 | ATA_FLAG_NO_ATAPI | ATA_FLAG_PIO_POLLING;
+
+       base = cs0 + ocd->base_region_bias;
+       if (!ocd->is16bit) {
+               ap->ioaddr.cmd_addr     = base;
+               ata_sff_std_ports(&ap->ioaddr);
+
+               ap->ioaddr.altstatus_addr = base + 0xe;
+               ap->ioaddr.ctl_addr     = base + 0xe;
+               octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer8;
+       } else if (cs1) {
+               /* Presence of cs1 indicates True IDE mode.  */
+               ap->ioaddr.cmd_addr     = base + (ATA_REG_CMD << 1) + 1;
+               ap->ioaddr.data_addr    = base + (ATA_REG_DATA << 1);
+               ap->ioaddr.error_addr   = base + (ATA_REG_ERR << 1) + 1;
+               ap->ioaddr.feature_addr = base + (ATA_REG_FEATURE << 1) + 1;
+               ap->ioaddr.nsect_addr   = base + (ATA_REG_NSECT << 1) + 1;
+               ap->ioaddr.lbal_addr    = base + (ATA_REG_LBAL << 1) + 1;
+               ap->ioaddr.lbam_addr    = base + (ATA_REG_LBAM << 1) + 1;
+               ap->ioaddr.lbah_addr    = base + (ATA_REG_LBAH << 1) + 1;
+               ap->ioaddr.device_addr  = base + (ATA_REG_DEVICE << 1) + 1;
+               ap->ioaddr.status_addr  = base + (ATA_REG_STATUS << 1) + 1;
+               ap->ioaddr.command_addr = base + (ATA_REG_CMD << 1) + 1;
+               ap->ioaddr.altstatus_addr = cs1 + (6 << 1) + 1;
+               ap->ioaddr.ctl_addr     = cs1 + (6 << 1) + 1;
+               octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer16;
+
+               ap->mwdma_mask  = 0x1f; /* Support MWDMA 0-4 */
+               irq = platform_get_irq(pdev, 0);
+               irq_handler = octeon_cf_interrupt;
+
+               /* True IDE mode needs delayed work to poll for not-busy.  */
+               cf_port->wq = create_singlethread_workqueue(DRV_NAME);
+               if (!cf_port->wq)
+                       goto free_cf_port;
+               INIT_DELAYED_WORK(&cf_port->delayed_finish,
+                                 octeon_cf_delayed_finish);
+
+       } else {
+               /* 16 bit but not True IDE */
+               octeon_cf_ops.sff_data_xfer     = octeon_cf_data_xfer16;
+               octeon_cf_ops.softreset         = octeon_cf_softreset16;
+               octeon_cf_ops.sff_check_status  = octeon_cf_check_status16;
+               octeon_cf_ops.sff_tf_read       = octeon_cf_tf_read16;
+               octeon_cf_ops.sff_tf_load       = octeon_cf_tf_load16;
+               octeon_cf_ops.sff_exec_command  = octeon_cf_exec_command16;
+
+               ap->ioaddr.data_addr    = base + ATA_REG_DATA;
+               ap->ioaddr.nsect_addr   = base + ATA_REG_NSECT;
+               ap->ioaddr.lbal_addr    = base + ATA_REG_LBAL;
+               ap->ioaddr.ctl_addr     = base + 0xe;
+               ap->ioaddr.altstatus_addr = base + 0xe;
+       }
+
+       ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr);
+
+
+       dev_info(&pdev->dev, "version " DRV_VERSION" %d bit%s.\n",
+                (ocd->is16bit) ? 16 : 8,
+                (cs1) ? ", True IDE" : "");
+
+
+       return ata_host_activate(host, irq, irq_handler, 0, &octeon_cf_sht);
+
+free_cf_port:
+       kfree(cf_port);
+       return -ENOMEM;
+}
+
+static struct platform_driver octeon_cf_driver = {
+       .probe          = octeon_cf_probe,
+       .driver         = {
+               .name   = DRV_NAME,
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init octeon_cf_init(void)
+{
+       return platform_driver_register(&octeon_cf_driver);
+}
+
+
+MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>");
+MODULE_DESCRIPTION("low-level driver for Cavium OCTEON Compact Flash PATA");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
+MODULE_ALIAS("platform:" DRV_NAME);
+
+module_init(octeon_cf_init);
index 1a56db92ff7ac685bfab920508d6fcc2bc0124a1..55bc88c1707bfab1fdcb7f63e961a05e004d57dc 100644 (file)
@@ -1288,7 +1288,7 @@ static const struct ata_port_info sata_fsl_port_info[] = {
 static int sata_fsl_probe(struct of_device *ofdev,
                        const struct of_device_id *match)
 {
-       int retval = 0;
+       int retval = -ENXIO;
        void __iomem *hcr_base = NULL;
        void __iomem *ssr_base = NULL;
        void __iomem *csr_base = NULL;
index c18935f0bda215d5987c4324fa8374a4f3efa1e1..5c62da9cd491e34c2c0b1034dd4783b72ec1fdb7 100644 (file)
@@ -92,6 +92,8 @@ static const struct pci_device_id svia_pci_tbl[] = {
        { PCI_VDEVICE(VIA, 0x5372), vt6420 },
        { PCI_VDEVICE(VIA, 0x7372), vt6420 },
        { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */
+       { PCI_VDEVICE(VIA, 0x9000), vt8251 },
+       { PCI_VDEVICE(VIA, 0x9040), vt8251 },
 
        { }     /* terminate list */
 };
index 7bcc1d8bc96724add86213f7f85ec01ed48a8314..34f80fa6fed16d379733e3db018f765831e09778 100644 (file)
@@ -406,6 +406,7 @@ static int nbd_do_it(struct nbd_device *lo)
        ret = sysfs_create_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr);
        if (ret) {
                printk(KERN_ERR "nbd: sysfs_create_file failed!");
+               lo->pid = 0;
                return ret;
        }
 
@@ -413,6 +414,7 @@ static int nbd_do_it(struct nbd_device *lo)
                nbd_end_request(req);
 
        sysfs_remove_file(&disk_to_dev(lo->disk)->kobj, &pid_attr.attr);
+       lo->pid = 0;
        return 0;
 }
 
@@ -648,6 +650,8 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
                set_capacity(lo->disk, lo->bytesize >> 9);
                return 0;
        case NBD_DO_IT:
+               if (lo->pid)
+                       return -EBUSY;
                if (!lo->file)
                        return -EINVAL;
                thread = kthread_create(nbd_thread, lo, lo->disk->disk_name);
index 936466f62afd3ad72d4bb4e017f8b9d05a533f5a..bccc42bb9212d7f37086ac86160521f96bc6fea6 100644 (file)
@@ -141,7 +141,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
 
        start_sector = req->sector * priv->blocking_factor;
        sectors = req->nr_sectors * priv->blocking_factor;
-       dev_dbg(&dev->sbd.core, "%s:%u: %s %lu sectors starting at %lu\n",
+       dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n",
                __func__, __LINE__, op, sectors, start_sector);
 
        if (write) {
@@ -178,7 +178,7 @@ static int ps3disk_submit_flush_request(struct ps3_storage_device *dev,
                                              LV1_STORAGE_ATA_HDDOUT, 0, 0, 0,
                                              0, &dev->tag);
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n",
                        __func__, __LINE__, res);
                end_request(req, 0);
                return 0;
@@ -238,11 +238,11 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
 
        if (tag != dev->tag)
                dev_err(&dev->sbd.core,
-                       "%s:%u: tag mismatch, got %lx, expected %lx\n",
+                       "%s:%u: tag mismatch, got %llx, expected %llx\n",
                        __func__, __LINE__, tag, dev->tag);
 
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
                        __func__, __LINE__, res, status);
                return IRQ_HANDLED;
        }
@@ -269,7 +269,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
                op = read ? "read" : "write";
        }
        if (status) {
-               dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__,
+               dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__,
                        __LINE__, op, status);
                error = -EIO;
        } else {
@@ -297,7 +297,7 @@ static int ps3disk_sync_cache(struct ps3_storage_device *dev)
 
        res = ps3stor_send_command(dev, LV1_STORAGE_ATA_HDDOUT, 0, 0, 0, 0);
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n",
                        __func__, __LINE__, res);
                return -EIO;
        }
@@ -388,7 +388,7 @@ static int ps3disk_identify(struct ps3_storage_device *dev)
                                   sizeof(ata_cmnd), ata_cmnd.buffer,
                                   ata_cmnd.arglen);
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: identify disk failed 0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: identify disk failed 0x%llx\n",
                        __func__, __LINE__, res);
                return -EIO;
        }
@@ -426,7 +426,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
 
        if (dev->blk_size < 512) {
                dev_err(&dev->sbd.core,
-                       "%s:%u: cannot handle block size %lu\n", __func__,
+                       "%s:%u: cannot handle block size %llu\n", __func__,
                        __LINE__, dev->blk_size);
                return -EINVAL;
        }
@@ -512,7 +512,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
                     dev->regions[dev->region_idx].size*priv->blocking_factor);
 
        dev_info(&dev->sbd.core,
-                "%s is a %s (%lu MiB total, %lu MiB for OtherOS)\n",
+                "%s is a %s (%llu MiB total, %lu MiB for OtherOS)\n",
                 gendisk->disk_name, priv->model, priv->raw_capacity >> 11,
                 get_capacity(gendisk) >> 11);
 
index 29e1dfafb7c6bd813844b82f1e903f88e5d34d99..381d686fc1a3cdacba8a5ac38424440ea8dff925 100644 (file)
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = {
        { .compatible = "xlnx,opb-sysace-1.00.b", },
        { .compatible = "xlnx,opb-sysace-1.00.c", },
        { .compatible = "xlnx,xps-sysace-1.00.a", },
+       { .compatible = "xlnx,sysace", },
        {},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
index 977dfb1096a0c16120f1bc205ba45f4ccd80c4c1..f6094ae0ef334f622ec80f48bd559cae243ebcae 100644 (file)
@@ -103,7 +103,7 @@ static ssize_t
 bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct bsr_dev *bsr_dev = dev_get_drvdata(dev);
-       return sprintf(buf, "%lu\n", bsr_dev->bsr_len);
+       return sprintf(buf, "%llu\n", bsr_dev->bsr_len);
 }
 
 static struct device_attribute bsr_dev_attrs[] = {
index 5a8a4c28c867fb67dd811afc0e728b2b2edf9cbc..94e7e3c8c05ad3f0720aaae3d6df588eebd2d50b 100644 (file)
@@ -318,7 +318,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
        } /* else count == 0 */
 
        tty->driver_data = hp;
-       tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */
 
        hp->tty = tty;
 
@@ -764,13 +763,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data,
                        return ERR_PTR(err);
        }
 
-       hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
+       hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
                        GFP_KERNEL);
        if (!hp)
                return ERR_PTR(-ENOMEM);
 
-       memset(hp, 0x00, sizeof(*hp));
-
        hp->vtermno = vtermno;
        hp->data = data;
        hp->ops = ops;
@@ -876,8 +873,11 @@ static int hvc_init(void)
                goto stop_thread;
        }
 
-       /* FIXME: This mb() seems completely random.  Remove it. */
-       mb();
+       /*
+        * Make sure tty is fully registered before allowing it to be
+        * found by hvc_console_device.
+        */
+       smp_mb();
        hvc_driver = drv;
        return 0;
 
index d09e5688d4497242d4bcc6dcad23abc1a4f96202..2623e177e8d61d501fe1c39dd57d3768bfcad481 100644 (file)
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
 
 void notifier_del_irq(struct hvc_struct *hp, int irq)
 {
-       if (!irq)
+       if (!hp->irq_requested)
                return;
        free_irq(irq, hp);
        hp->irq_requested = 0;
index 79b6f461be75fd829df6fd74ade8de84ab410a20..afbe45676d71c8f064e5102b0e8460dbde0119a3 100644 (file)
@@ -44,7 +44,7 @@ static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev,
        u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors,
                                             write);
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__,
+               dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__,
                        __LINE__, write ? "write" : "read", res);
                return -EIO;
        }
@@ -59,7 +59,7 @@ static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev,
 
        max_sectors = dev->bounce_size / dev->blk_size;
        if (sectors > max_sectors) {
-               dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %lu\n",
+               dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %llu\n",
                        __func__, __LINE__, max_sectors);
                sectors = max_sectors;
        }
@@ -144,7 +144,7 @@ static ssize_t ps3flash_read(struct file *file, char __user *buf, size_t count,
                        goto fail;
                }
 
-               n = min(remaining, sectors_read*dev->blk_size-offset);
+               n = min_t(u64, remaining, sectors_read*dev->blk_size-offset);
                dev_dbg(&dev->sbd.core,
                        "%s:%u: copy %lu bytes from 0x%p to user 0x%p\n",
                        __func__, __LINE__, n, dev->bounce_buf+offset, buf);
@@ -225,7 +225,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,
                if (end_read_sector >= start_read_sector) {
                        /* Merge head and tail */
                        dev_dbg(&dev->sbd.core,
-                               "Merged head and tail: %lu sectors at %lu\n",
+                               "Merged head and tail: %llu sectors at %llu\n",
                                chunk_sectors, start_write_sector);
                        res = ps3flash_read_sectors(dev, start_write_sector,
                                                    chunk_sectors, 0);
@@ -235,7 +235,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,
                        if (head) {
                                /* Read head */
                                dev_dbg(&dev->sbd.core,
-                                       "head: %lu sectors at %lu\n", head,
+                                       "head: %llu sectors at %llu\n", head,
                                        start_write_sector);
                                res = ps3flash_read_sectors(dev,
                                                            start_write_sector,
@@ -247,7 +247,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,
                            start_write_sector+chunk_sectors) {
                                /* Read tail */
                                dev_dbg(&dev->sbd.core,
-                                       "tail: %lu sectors at %lu\n", tail,
+                                       "tail: %llu sectors at %llu\n", tail,
                                        start_read_sector);
                                sec_off = start_read_sector-start_write_sector;
                                res = ps3flash_read_sectors(dev,
@@ -258,7 +258,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,
                        }
                }
 
-               n = min(remaining, dev->bounce_size-offset);
+               n = min_t(u64, remaining, dev->bounce_size-offset);
                dev_dbg(&dev->sbd.core,
                        "%s:%u: copy %lu bytes from user 0x%p to 0x%p\n",
                        __func__, __LINE__, n, buf, dev->bounce_buf+offset);
@@ -299,11 +299,11 @@ static irqreturn_t ps3flash_interrupt(int irq, void *data)
 
        if (tag != dev->tag)
                dev_err(&dev->sbd.core,
-                       "%s:%u: tag mismatch, got %lx, expected %lx\n",
+                       "%s:%u: tag mismatch, got %llx, expected %llx\n",
                        __func__, __LINE__, tag, dev->tag);
 
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
                        __func__, __LINE__, res, status);
        } else {
                dev->lv1_status = status;
index 53544e21f191a7d0779bbded3287040663ac209d..f329f459817cb41bb4cb1ffb0c2ac6b08278ea3c 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: synclink_gt.c,v 4.50 2007/07/25 19:29:25 paulkf Exp $
- *
  * Device driver for Microgate SyncLink GT serial adapters.
  *
  * written by Paul Fulghum for Microgate Corporation
@@ -91,7 +89,6 @@
  * module identification
  */
 static char *driver_name     = "SyncLink GT";
-static char *driver_version  = "$Revision: 4.50 $";
 static char *tty_driver_name = "synclink_gt";
 static char *tty_dev_prefix  = "ttySLG";
 MODULE_LICENSE("GPL");
@@ -1309,7 +1306,7 @@ static int read_proc(char *page, char **start, off_t off, int count,
        off_t   begin = 0;
        struct slgt_info *info;
 
-       len += sprintf(page, "synclink_gt driver:%s\n", driver_version);
+       len += sprintf(page, "synclink_gt driver\n");
 
        info = slgt_device_list;
        while( info ) {
@@ -2441,7 +2438,7 @@ static void program_hw(struct slgt_info *info)
        info->ri_chkcount = 0;
        info->dsr_chkcount = 0;
 
-       slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR);
+       slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR | IRQ_RI);
        get_signals(info);
 
        if (info->netcount ||
@@ -3576,7 +3573,7 @@ static void slgt_cleanup(void)
        struct slgt_info *info;
        struct slgt_info *tmp;
 
-       printk("unload %s %s\n", driver_name, driver_version);
+       printk(KERN_INFO "unload %s\n", driver_name);
 
        if (serial_driver) {
                for (info=slgt_device_list ; info != NULL ; info=info->next_device)
@@ -3619,7 +3616,7 @@ static int __init slgt_init(void)
 {
        int rc;
 
-       printk("%s %s\n", driver_name, driver_version);
+       printk(KERN_INFO "%s\n", driver_name);
 
        serial_driver = alloc_tty_driver(MAX_DEVICES);
        if (!serial_driver) {
@@ -3650,9 +3647,8 @@ static int __init slgt_init(void)
                goto error;
        }
 
-       printk("%s %s, tty major#%d\n",
-               driver_name, driver_version,
-               serial_driver->major);
+       printk(KERN_INFO "%s, tty major#%d\n",
+              driver_name, serial_driver->major);
 
        slgt_device_count = 0;
        if ((rc = pci_register_driver(&pci_driver)) < 0) {
index d41b9f6f7903d297976114553527ce51f7e44e3e..33a9351c896dfbaff7dbf9afb5515d998bbb943e 100644 (file)
@@ -473,6 +473,12 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
        unsigned long flags;
 
        spin_lock_irqsave(&sysrq_key_table_lock, flags);
+       /*
+        * Raise the apparent loglevel to maximum so that the sysrq header
+        * is shown to provide the user with positive feedback.  We do not
+        * simply emit this at KERN_EMERG as that would change message
+        * routing in the consumers of /proc/kmsg.
+        */
        orig_log_level = console_loglevel;
        console_loglevel = 7;
        printk(KERN_INFO "SysRq : ");
index a408c8e487ec006147078f2f7d22b6bce88925bb..6f4c7d0a53bf36bc6ff28afeadca4720704e459f 100644 (file)
@@ -1057,7 +1057,7 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
        if (retval)
                return retval;
 
-       ld = tty_ldisc_ref(tty);
+       ld = tty_ldisc_ref_wait(tty);
        switch (arg) {
        case TCIFLUSH:
                if (ld && ld->ops->flush_buffer)
index 8b24d784db93e6bfda3e9b28440c10caab8173fa..3e7f4e06386e7e31d4844e5861c4faedb0c76711 100644 (file)
@@ -217,8 +217,10 @@ static int __devinit max7301_probe(struct spi_device *spi)
        int i, ret;
 
        pdata = spi->dev.platform_data;
-       if (!pdata || !pdata->base)
-               return -ENODEV;
+       if (!pdata || !pdata->base) {
+               dev_dbg(&spi->dev, "incorrect or missing platform data\n");
+               return -EINVAL;
+       }
 
        /*
         * bits_per_word cannot be configured in platform data
index 55ae9a41897aafe0db3da8d2fde1e7a7aec174d9..f7868243af899a46e69f3cb52064bb06d85bab86 100644 (file)
@@ -267,8 +267,10 @@ static int __devinit max732x_probe(struct i2c_client *client,
        int ret, nr_port;
 
        pdata = client->dev.platform_data;
-       if (pdata == NULL)
-               return -ENODEV;
+       if (pdata == NULL) {
+               dev_dbg(&client->dev, "no platform data\n");
+               return -EINVAL;
+       }
 
        chip = kzalloc(sizeof(struct max732x_chip), GFP_KERNEL);
        if (chip == NULL)
index 89c1d222e9d10b89b8acc56dbfff0b1933f1a2c3..f6fae0e50e654731e2fc235b6d562e2a669b3627 100644 (file)
@@ -310,8 +310,10 @@ static int mcp23s08_probe(struct spi_device *spi)
        unsigned                        base;
 
        pdata = spi->dev.platform_data;
-       if (!pdata || !gpio_is_valid(pdata->base))
-               return -ENODEV;
+       if (!pdata || !gpio_is_valid(pdata->base)) {
+               dev_dbg(&spi->dev, "invalid or missing platform data\n");
+               return -EINVAL;
+       }
 
        for (addr = 0; addr < 4; addr++) {
                if (!pdata->chip[addr].is_present)
index 37f35388a2aeb7094b559bfde1a851159e9ae59f..8dc0164bd51e036af7ae4986644957cf6a4c8b94 100644 (file)
@@ -202,8 +202,10 @@ static int __devinit pca953x_probe(struct i2c_client *client,
        int ret;
 
        pdata = client->dev.platform_data;
-       if (pdata == NULL)
-               return -ENODEV;
+       if (pdata == NULL) {
+               dev_dbg(&client->dev, "no platform data\n");
+               return -EINVAL;
+       }
 
        chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
        if (chip == NULL)
index 4bc2070dd4a1010b498d63b96926e0cdbec69111..9525724be731d400f781a36e2354c76b8c5ff699 100644 (file)
@@ -188,8 +188,10 @@ static int pcf857x_probe(struct i2c_client *client,
        int                             status;
 
        pdata = client->dev.platform_data;
-       if (!pdata)
-               return -ENODEV;
+       if (!pdata) {
+               dev_dbg(&client->dev, "no platform data\n");
+               return -EINVAL;
+       }
 
        /* Allocate, initialize, and register this gpio_chip. */
        gpio = kzalloc(sizeof *gpio, GFP_KERNEL);
@@ -248,8 +250,10 @@ static int pcf857x_probe(struct i2c_client *client,
                else
                        status = i2c_read_le16(client);
 
-       } else
-               status = -ENODEV;
+       } else {
+               dev_dbg(&client->dev, "unsupported number of gpios\n");
+               status = -EINVAL;
+       }
 
        if (status < 0)
                goto fail;
index d8a982b71296520fd0344e9670e1f88b4b342b7d..964c5eb1fada4266795056abbad038ac23463dd7 100644 (file)
@@ -36,7 +36,7 @@
 /*
  * Detailed mode info for 800x600@60Hz
  */
-static struct drm_display_mode std_mode[] = {
+static struct drm_display_mode std_modes[] = {
        { DRM_MODE("800x600", DRM_MODE_TYPE_DEFAULT, 40000, 800, 840,
                   968, 1056, 0, 600, 601, 605, 628, 0,
                   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
@@ -60,15 +60,18 @@ static struct drm_display_mode std_mode[] = {
  * changes have occurred.
  *
  * FIXME: take into account monitor limits
+ *
+ * RETURNS:
+ * Number of modes found on @connector.
  */
-void drm_helper_probe_single_connector_modes(struct drm_connector *connector,
-                                            uint32_t maxX, uint32_t maxY)
+int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
+                                           uint32_t maxX, uint32_t maxY)
 {
        struct drm_device *dev = connector->dev;
        struct drm_display_mode *mode, *t;
        struct drm_connector_helper_funcs *connector_funcs =
                connector->helper_private;
-       int ret;
+       int count = 0;
 
        DRM_DEBUG("%s\n", drm_get_connector_name(connector));
        /* set all modes to the unverified state */
@@ -81,14 +84,14 @@ void drm_helper_probe_single_connector_modes(struct drm_connector *connector,
                DRM_DEBUG("%s is disconnected\n",
                          drm_get_connector_name(connector));
                /* TODO set EDID to NULL */
-               return;
+               return 0;
        }
 
-       ret = (*connector_funcs->get_modes)(connector);
+       count = (*connector_funcs->get_modes)(connector);
+       if (!count)
+               return 0;
 
-       if (ret) {
-               drm_mode_connector_list_update(connector);
-       }
+       drm_mode_connector_list_update(connector);
 
        if (maxX && maxY)
                drm_mode_validate_size(dev, &connector->modes, maxX,
@@ -102,25 +105,8 @@ void drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
        drm_mode_prune_invalid(dev, &connector->modes, true);
 
-       if (list_empty(&connector->modes)) {
-               struct drm_display_mode *stdmode;
-
-               DRM_DEBUG("No valid modes on %s\n",
-                         drm_get_connector_name(connector));
-
-               /* Should we do this here ???
-                * When no valid EDID modes are available we end up
-                * here and bailed in the past, now we add a standard
-                * 640x480@60Hz mode and carry on.
-                */
-               stdmode = drm_mode_duplicate(dev, &std_mode[0]);
-               drm_mode_probed_add(connector, stdmode);
-               drm_mode_list_concat(&connector->probed_modes,
-                                    &connector->modes);
-
-               DRM_DEBUG("Adding standard 640x480 @ 60Hz to %s\n",
-                         drm_get_connector_name(connector));
-       }
+       if (list_empty(&connector->modes))
+               return 0;
 
        drm_mode_sort(&connector->modes);
 
@@ -131,20 +117,58 @@ void drm_helper_probe_single_connector_modes(struct drm_connector *connector,
                drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
                drm_mode_debug_printmodeline(mode);
        }
+
+       return count;
 }
 EXPORT_SYMBOL(drm_helper_probe_single_connector_modes);
 
-void drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX,
+int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX,
                                      uint32_t maxY)
 {
        struct drm_connector *connector;
+       int count = 0;
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-               drm_helper_probe_single_connector_modes(connector, maxX, maxY);
+               count += drm_helper_probe_single_connector_modes(connector,
+                                                                maxX, maxY);
        }
+
+       return count;
 }
 EXPORT_SYMBOL(drm_helper_probe_connector_modes);
 
+static void drm_helper_add_std_modes(struct drm_device *dev,
+                                    struct drm_connector *connector)
+{
+       struct drm_display_mode *mode, *t;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(std_modes); i++) {
+               struct drm_display_mode *stdmode;
+
+               /*
+                * When no valid EDID modes are available we end up
+                * here and bailed in the past, now we add some standard
+                * modes and move on.
+                */
+               stdmode = drm_mode_duplicate(dev, &std_modes[i]);
+               drm_mode_probed_add(connector, stdmode);
+               drm_mode_list_concat(&connector->probed_modes,
+                                    &connector->modes);
+
+               DRM_DEBUG("Adding mode %s to %s\n", stdmode->name,
+                         drm_get_connector_name(connector));
+       }
+       drm_mode_sort(&connector->modes);
+
+       DRM_DEBUG("Added std modes on %s\n", drm_get_connector_name(connector));
+       list_for_each_entry_safe(mode, t, &connector->modes, head) {
+               mode->vrefresh = drm_mode_vrefresh(mode);
+
+               drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
+               drm_mode_debug_printmodeline(mode);
+       }
+}
 
 /**
  * drm_helper_crtc_in_use - check if a given CRTC is in a mode_config
@@ -237,6 +261,8 @@ static void drm_enable_connectors(struct drm_device *dev, bool *enabled)
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
                enabled[i] = drm_connector_enabled(connector, true);
+               DRM_DEBUG("connector %d enabled? %s\n", connector->base.id,
+                         enabled[i] ? "yes" : "no");
                any_enabled |= enabled[i];
                i++;
        }
@@ -265,11 +291,17 @@ static bool drm_target_preferred(struct drm_device *dev,
                        continue;
                }
 
+               DRM_DEBUG("looking for preferred mode on connector %d\n",
+                         connector->base.id);
+
                modes[i] = drm_has_preferred_mode(connector, width, height);
-               if (!modes[i]) {
+               /* No preferred modes, pick one off the list */
+               if (!modes[i] && !list_empty(&connector->modes)) {
                        list_for_each_entry(modes[i], &connector->modes, head)
                                break;
                }
+               DRM_DEBUG("found mode %s\n", modes[i] ? modes[i]->name :
+                         "none");
                i++;
        }
        return true;
@@ -369,6 +401,8 @@ static void drm_setup_crtcs(struct drm_device *dev)
        int width, height;
        int i, ret;
 
+       DRM_DEBUG("\n");
+
        width = dev->mode_config.max_width;
        height = dev->mode_config.max_height;
 
@@ -390,6 +424,8 @@ static void drm_setup_crtcs(struct drm_device *dev)
        if (!ret)
                DRM_ERROR("Unable to find initial modes\n");
 
+       DRM_DEBUG("picking CRTCs for %dx%d config\n", width, height);
+
        drm_pick_crtcs(dev, crtcs, modes, 0, width, height);
 
        i = 0;
@@ -403,6 +439,8 @@ static void drm_setup_crtcs(struct drm_device *dev)
                }
 
                if (mode && crtc) {
+                       DRM_DEBUG("desired mode %s set on crtc %d\n",
+                                 mode->name, crtc->base.id);
                        crtc->desired_mode = mode;
                        connector->encoder->crtc = crtc;
                } else
@@ -442,6 +480,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
        int saved_x, saved_y;
        struct drm_encoder *encoder;
        bool ret = true;
+       bool depth_changed, bpp_changed;
 
        adjusted_mode = drm_mode_duplicate(dev, mode);
 
@@ -450,6 +489,15 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
        if (!crtc->enabled)
                return true;
 
+       if (old_fb && crtc->fb) {
+               depth_changed = (old_fb->depth != crtc->fb->depth);
+               bpp_changed = (old_fb->bits_per_pixel !=
+                              crtc->fb->bits_per_pixel);
+       } else {
+               depth_changed = true;
+               bpp_changed = true;
+       }
+
        saved_mode = crtc->mode;
        saved_x = crtc->x;
        saved_y = crtc->y;
@@ -462,7 +510,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
        crtc->y = y;
 
        if (drm_mode_equal(&saved_mode, &crtc->mode)) {
-               if (saved_x != crtc->x || saved_y != crtc->y) {
+               if (saved_x != crtc->x || saved_y != crtc->y ||
+                   depth_changed || bpp_changed) {
                        crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y,
                                                  old_fb);
                        goto done;
@@ -568,8 +617,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
        struct drm_encoder **save_encoders, *new_encoder;
        struct drm_framebuffer *old_fb;
        bool save_enabled;
-       bool changed = false;
-       bool flip_or_move = false;
+       bool mode_changed = false;
+       bool fb_changed = false;
        struct drm_connector *connector;
        int count = 0, ro, fail = 0;
        struct drm_crtc_helper_funcs *crtc_funcs;
@@ -597,7 +646,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
        /* save previous config */
        save_enabled = set->crtc->enabled;
 
-       /* this is meant to be num_connector not num_crtc */
+       /*
+        * We do mode_config.num_connectors here since we'll look at the
+        * CRTC and encoder associated with each connector later.
+        */
        save_crtcs = kzalloc(dev->mode_config.num_connector *
                             sizeof(struct drm_crtc *), GFP_KERNEL);
        if (!save_crtcs)
@@ -613,21 +665,25 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
        /* We should be able to check here if the fb has the same properties
         * and then just flip_or_move it */
        if (set->crtc->fb != set->fb) {
-               /* if we have no fb then its a change not a flip */
+               /* If we have no fb then treat it as a full mode set */
                if (set->crtc->fb == NULL)
-                       changed = true;
+                       mode_changed = true;
+               else if ((set->fb->bits_per_pixel !=
+                        set->crtc->fb->bits_per_pixel) ||
+                        set->fb->depth != set->crtc->fb->depth)
+                       fb_changed = true;
                else
-                       flip_or_move = true;
+                       fb_changed = true;
        }
 
        if (set->x != set->crtc->x || set->y != set->crtc->y)
-               flip_or_move = true;
+               fb_changed = true;
 
        if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
                DRM_DEBUG("modes are different\n");
                drm_mode_debug_printmodeline(&set->crtc->mode);
                drm_mode_debug_printmodeline(set->mode);
-               changed = true;
+               mode_changed = true;
        }
 
        /* a) traverse passed in connector list and get encoders for them */
@@ -650,7 +706,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
                }
 
                if (new_encoder != connector->encoder) {
-                       changed = true;
+                       mode_changed = true;
                        connector->encoder = new_encoder;
                }
        }
@@ -677,16 +733,16 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
                                new_crtc = set->crtc;
                }
                if (new_crtc != connector->encoder->crtc) {
-                       changed = true;
+                       mode_changed = true;
                        connector->encoder->crtc = new_crtc;
                }
        }
 
        /* mode_set_base is not a required function */
-       if (flip_or_move && !crtc_funcs->mode_set_base)
-               changed = true;
+       if (fb_changed && !crtc_funcs->mode_set_base)
+               mode_changed = true;
 
-       if (changed) {
+       if (mode_changed) {
                old_fb = set->crtc->fb;
                set->crtc->fb = set->fb;
                set->crtc->enabled = (set->mode != NULL);
@@ -705,7 +761,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
                        set->crtc->desired_mode = set->mode;
                }
                drm_helper_disable_unused_functions(dev);
-       } else if (flip_or_move) {
+       } else if (fb_changed) {
                old_fb = set->crtc->fb;
                if (set->crtc->fb != set->fb)
                        set->crtc->fb = set->fb;
@@ -764,10 +820,31 @@ bool drm_helper_plugged_event(struct drm_device *dev)
  */
 bool drm_helper_initial_config(struct drm_device *dev, bool can_grow)
 {
-       int ret = false;
+       struct drm_connector *connector;
+       int count = 0;
 
-       drm_helper_plugged_event(dev);
-       return ret;
+       count = drm_helper_probe_connector_modes(dev,
+                                                dev->mode_config.max_width,
+                                                dev->mode_config.max_height);
+
+       /*
+        * None of the available connectors had any modes, so add some
+        * and try to light them up anyway
+        */
+       if (!count) {
+               DRM_ERROR("connectors have no modes, using standard modes\n");
+               list_for_each_entry(connector,
+                                   &dev->mode_config.connector_list,
+                                   head)
+                       drm_helper_add_std_modes(dev, connector);
+       }
+
+       drm_setup_crtcs(dev);
+
+       /* alert the driver fb layer */
+       dev->mode_config.funcs->fb_changed(dev);
+
+       return 0;
 }
 EXPORT_SYMBOL(drm_helper_initial_config);
 
index 724e505873cf19e77c6710968a1a8ba6888cedd2..477caa1b1e4b0a77edf417d649000d6b3036d053 100644 (file)
@@ -267,7 +267,8 @@ EXPORT_SYMBOL(drm_irq_install);
  */
 int drm_irq_uninstall(struct drm_device * dev)
 {
-       int irq_enabled;
+       unsigned long irqflags;
+       int irq_enabled, i;
 
        if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
                return -EINVAL;
@@ -277,6 +278,16 @@ int drm_irq_uninstall(struct drm_device * dev)
        dev->irq_enabled = 0;
        mutex_unlock(&dev->struct_mutex);
 
+       /*
+        * Wake up any waiters so they don't hang.
+        */
+       spin_lock_irqsave(&dev->vbl_lock, irqflags);
+       for (i = 0; i < dev->num_crtcs; i++) {
+               DRM_WAKEUP(&dev->vbl_queue[i]);
+               dev->vblank_enabled[i] = 0;
+       }
+       spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
+
        if (!irq_enabled)
                return -EINVAL;
 
@@ -652,8 +663,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
                          vblwait->request.sequence, crtc);
                dev->last_vblank_wait[crtc] = vblwait->request.sequence;
                DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
-                           ((drm_vblank_count(dev, crtc)
-                             - vblwait->request.sequence) <= (1 << 23)));
+                           (((drm_vblank_count(dev, crtc) -
+                              vblwait->request.sequence) <= (1 << 23)) ||
+                            !dev->irq_enabled));
 
                if (ret != -EINTR) {
                        struct timeval now;
index 62a4bf7b49df4f637bd8c89977bcbde07178b48a..bbadf1c041426ca73e9fd1bf0e749c0050dbde92 100644 (file)
@@ -177,6 +177,14 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
        drm_i915_private_t *dev_priv = dev->dev_private;
        struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
 
+       master_priv->sarea = drm_getsarea(dev);
+       if (master_priv->sarea) {
+               master_priv->sarea_priv = (drm_i915_sarea_t *)
+                       ((u8 *)master_priv->sarea->handle + init->sarea_priv_offset);
+       } else {
+               DRM_DEBUG("sarea not found assuming DRI2 userspace\n");
+       }
+
        if (init->ring_size != 0) {
                if (dev_priv->ring.ring_obj != NULL) {
                        i915_dma_cleanup(dev);
@@ -1152,6 +1160,8 @@ int i915_driver_unload(struct drm_device *dev)
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                intel_modeset_cleanup(dev);
 
+               i915_gem_free_all_phys_object(dev);
+
                mutex_lock(&dev->struct_mutex);
                i915_gem_cleanup_ringbuffer(dev);
                mutex_unlock(&dev->struct_mutex);
index 563de18063fdca4063349d32778bd772f5679c10..e1351825200712078b8fe2bf65d238d57435e7b5 100644 (file)
@@ -72,6 +72,18 @@ enum pipe {
 #define WATCH_INACTIVE 0
 #define WATCH_PWRITE   0
 
+#define I915_GEM_PHYS_CURSOR_0 1
+#define I915_GEM_PHYS_CURSOR_1 2
+#define I915_GEM_PHYS_OVERLAY_REGS 3
+#define I915_MAX_PHYS_OBJECT (I915_GEM_PHYS_OVERLAY_REGS)
+
+struct drm_i915_gem_phys_object {
+       int id;
+       struct page **page_list;
+       drm_dma_handle_t *handle;
+       struct drm_gem_object *cur_obj;
+};
+
 typedef struct _drm_i915_ring_buffer {
        int tail_mask;
        unsigned long Size;
@@ -358,6 +370,9 @@ typedef struct drm_i915_private {
                uint32_t bit_6_swizzle_x;
                /** Bit 6 swizzling required for Y tiling */
                uint32_t bit_6_swizzle_y;
+
+               /* storage for physical objects */
+               struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT];
        } mm;
 } drm_i915_private_t;
 
@@ -436,6 +451,9 @@ struct drm_i915_gem_object {
        /** User space pin count and filp owning the pin */
        uint32_t user_pin_count;
        struct drm_file *pin_filp;
+
+       /** for phy allocated objects */
+       struct drm_i915_gem_phys_object *phys_obj;
 };
 
 /**
@@ -598,6 +616,11 @@ int i915_gem_do_init(struct drm_device *dev, unsigned long start,
 int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
 int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
                                      int write);
+int i915_gem_attach_phys_object(struct drm_device *dev,
+                               struct drm_gem_object *obj, int id);
+void i915_gem_detach_phys_object(struct drm_device *dev,
+                                struct drm_gem_object *obj);
+void i915_gem_free_all_phys_object(struct drm_device *dev);
 
 /* i915_gem_tiling.c */
 void i915_gem_detect_bit_6_swizzle(struct drm_device *dev);
index 1384d6686555b4418d5e3be9a1dbf3fc41f4438f..96316fd4723322f7ac277e3747abdc806ab3a98e 100644 (file)
@@ -55,6 +55,9 @@ static int i915_gem_object_bind_to_gtt(struct drm_gem_object *obj,
 static void i915_gem_object_get_fence_reg(struct drm_gem_object *obj);
 static void i915_gem_clear_fence_reg(struct drm_gem_object *obj);
 static int i915_gem_evict_something(struct drm_device *dev);
+static int i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
+                               struct drm_i915_gem_pwrite *args,
+                               struct drm_file *file_priv);
 
 int i915_gem_do_init(struct drm_device *dev, unsigned long start,
                     unsigned long end)
@@ -386,8 +389,10 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
         * pread/pwrite currently are reading and writing from the CPU
         * perspective, requiring manual detiling by the client.
         */
-       if (obj_priv->tiling_mode == I915_TILING_NONE &&
-           dev->gtt_total != 0)
+       if (obj_priv->phys_obj)
+               ret = i915_gem_phys_pwrite(dev, obj, args, file_priv);
+       else if (obj_priv->tiling_mode == I915_TILING_NONE &&
+                dev->gtt_total != 0)
                ret = i915_gem_gtt_pwrite(dev, obj, args, file_priv);
        else
                ret = i915_gem_shmem_pwrite(dev, obj, args, file_priv);
@@ -2858,6 +2863,9 @@ void i915_gem_free_object(struct drm_gem_object *obj)
        while (obj_priv->pin_count > 0)
                i915_gem_object_unpin(obj);
 
+       if (obj_priv->phys_obj)
+               i915_gem_detach_phys_object(dev, obj);
+
        i915_gem_object_unbind(obj);
 
        list = &obj->map_list;
@@ -3293,3 +3301,180 @@ i915_gem_load(struct drm_device *dev)
 
        i915_gem_detect_bit_6_swizzle(dev);
 }
+
+/*
+ * Create a physically contiguous memory object for this object
+ * e.g. for cursor + overlay regs
+ */
+int i915_gem_init_phys_object(struct drm_device *dev,
+                             int id, int size)
+{
+       drm_i915_private_t *dev_priv = dev->dev_private;
+       struct drm_i915_gem_phys_object *phys_obj;
+       int ret;
+
+       if (dev_priv->mm.phys_objs[id - 1] || !size)
+               return 0;
+
+       phys_obj = drm_calloc(1, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER);
+       if (!phys_obj)
+               return -ENOMEM;
+
+       phys_obj->id = id;
+
+       phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff);
+       if (!phys_obj->handle) {
+               ret = -ENOMEM;
+               goto kfree_obj;
+       }
+#ifdef CONFIG_X86
+       set_memory_wc((unsigned long)phys_obj->handle->vaddr, phys_obj->handle->size / PAGE_SIZE);
+#endif
+
+       dev_priv->mm.phys_objs[id - 1] = phys_obj;
+
+       return 0;
+kfree_obj:
+       drm_free(phys_obj, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER);
+       return ret;
+}
+
+void i915_gem_free_phys_object(struct drm_device *dev, int id)
+{
+       drm_i915_private_t *dev_priv = dev->dev_private;
+       struct drm_i915_gem_phys_object *phys_obj;
+
+       if (!dev_priv->mm.phys_objs[id - 1])
+               return;
+
+       phys_obj = dev_priv->mm.phys_objs[id - 1];
+       if (phys_obj->cur_obj) {
+               i915_gem_detach_phys_object(dev, phys_obj->cur_obj);
+       }
+
+#ifdef CONFIG_X86
+       set_memory_wb((unsigned long)phys_obj->handle->vaddr, phys_obj->handle->size / PAGE_SIZE);
+#endif
+       drm_pci_free(dev, phys_obj->handle);
+       kfree(phys_obj);
+       dev_priv->mm.phys_objs[id - 1] = NULL;
+}
+
+void i915_gem_free_all_phys_object(struct drm_device *dev)
+{
+       int i;
+
+       for (i = 0; i < I915_MAX_PHYS_OBJECT; i++)
+               i915_gem_free_phys_object(dev, i);
+}
+
+void i915_gem_detach_phys_object(struct drm_device *dev,
+                                struct drm_gem_object *obj)
+{
+       struct drm_i915_gem_object *obj_priv;
+       int i;
+       int ret;
+       int page_count;
+
+       obj_priv = obj->driver_private;
+       if (!obj_priv->phys_obj)
+               return;
+
+       ret = i915_gem_object_get_page_list(obj);
+       if (ret)
+               goto out;
+
+       page_count = obj->size / PAGE_SIZE;
+
+       for (i = 0; i < page_count; i++) {
+               char *dst = kmap_atomic(obj_priv->page_list[i], KM_USER0);
+               char *src = obj_priv->phys_obj->handle->vaddr + (i * PAGE_SIZE);
+
+               memcpy(dst, src, PAGE_SIZE);
+               kunmap_atomic(dst, KM_USER0);
+       }
+       drm_clflush_pages(obj_priv->page_list, page_count);
+       drm_agp_chipset_flush(dev);
+out:
+       obj_priv->phys_obj->cur_obj = NULL;
+       obj_priv->phys_obj = NULL;
+}
+
+int
+i915_gem_attach_phys_object(struct drm_device *dev,
+                           struct drm_gem_object *obj, int id)
+{
+       drm_i915_private_t *dev_priv = dev->dev_private;
+       struct drm_i915_gem_object *obj_priv;
+       int ret = 0;
+       int page_count;
+       int i;
+
+       if (id > I915_MAX_PHYS_OBJECT)
+               return -EINVAL;
+
+       obj_priv = obj->driver_private;
+
+       if (obj_priv->phys_obj) {
+               if (obj_priv->phys_obj->id == id)
+                       return 0;
+               i915_gem_detach_phys_object(dev, obj);
+       }
+
+
+       /* create a new object */
+       if (!dev_priv->mm.phys_objs[id - 1]) {
+               ret = i915_gem_init_phys_object(dev, id,
+                                               obj->size);
+               if (ret) {
+                       DRM_ERROR("failed to init phys object %d size: %d\n", id, obj->size);
+                       goto out;
+               }
+       }
+
+       /* bind to the object */
+       obj_priv->phys_obj = dev_priv->mm.phys_objs[id - 1];
+       obj_priv->phys_obj->cur_obj = obj;
+
+       ret = i915_gem_object_get_page_list(obj);
+       if (ret) {
+               DRM_ERROR("failed to get page list\n");
+               goto out;
+       }
+
+       page_count = obj->size / PAGE_SIZE;
+
+       for (i = 0; i < page_count; i++) {
+               char *src = kmap_atomic(obj_priv->page_list[i], KM_USER0);
+               char *dst = obj_priv->phys_obj->handle->vaddr + (i * PAGE_SIZE);
+
+               memcpy(dst, src, PAGE_SIZE);
+               kunmap_atomic(src, KM_USER0);
+       }
+
+       return 0;
+out:
+       return ret;
+}
+
+static int
+i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
+                    struct drm_i915_gem_pwrite *args,
+                    struct drm_file *file_priv)
+{
+       struct drm_i915_gem_object *obj_priv = obj->driver_private;
+       void *obj_addr;
+       int ret;
+       char __user *user_data;
+
+       user_data = (char __user *) (uintptr_t) args->data_ptr;
+       obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset;
+
+       DRM_ERROR("obj_addr %p, %lld\n", obj_addr, args->size);
+       ret = copy_from_user(obj_addr, user_data, args->size);
+       if (ret)
+               return -EFAULT;
+
+       drm_agp_chipset_flush(dev);
+       return 0;
+}
index 0cadafbef411ba094d020d1323f66f136ba0d1bd..6290219de6c8e832aa4209d761f7d2be0317211b 100644 (file)
@@ -411,6 +411,12 @@ int i915_enable_vblank(struct drm_device *dev, int pipe)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        unsigned long irqflags;
+       int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
+       u32 pipeconf;
+
+       pipeconf = I915_READ(pipeconf_reg);
+       if (!(pipeconf & PIPEACONF_ENABLE))
+               return -EINVAL;
 
        spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
        if (IS_I965G(dev))
index 8ccb9c3ab86837c1af77f7ace82648bee7ec7f0b..31c3732b7a690aa7d813f4ecad46a071a7ef684f 100644 (file)
@@ -401,6 +401,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
        I915_WRITE(dspstride, crtc->fb->pitch);
 
        dspcntr = I915_READ(dspcntr_reg);
+       /* Mask out pixel format bits in case we change it */
+       dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
        switch (crtc->fb->bits_per_pixel) {
        case 8:
                dspcntr |= DISPPLANE_8BPP;
@@ -1014,21 +1016,25 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
 
        if (bo->size < width * height * 4) {
                DRM_ERROR("buffer is to small\n");
-               drm_gem_object_unreference(bo);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto fail;
        }
 
-       if (dev_priv->cursor_needs_physical) {
-               addr = dev->agp->base + obj_priv->gtt_offset;
-       } else {
+       /* we only need to pin inside GTT if cursor is non-phy */
+       if (!dev_priv->cursor_needs_physical) {
+               ret = i915_gem_object_pin(bo, PAGE_SIZE);
+               if (ret) {
+                       DRM_ERROR("failed to pin cursor bo\n");
+                       goto fail;
+               }
                addr = obj_priv->gtt_offset;
-       }
-
-       ret = i915_gem_object_pin(bo, PAGE_SIZE);
-       if (ret) {
-               DRM_ERROR("failed to pin cursor bo\n");
-               drm_gem_object_unreference(bo);
-               return ret;
+       } else {
+               ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1);
+               if (ret) {
+                       DRM_ERROR("failed to attach phys object\n");
+                       goto fail;
+               }
+               addr = obj_priv->phys_obj->handle->busaddr;
        }
 
        temp = 0;
@@ -1041,14 +1047,25 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
        I915_WRITE(base, addr);
 
        if (intel_crtc->cursor_bo) {
-               i915_gem_object_unpin(intel_crtc->cursor_bo);
+               if (dev_priv->cursor_needs_physical) {
+                       if (intel_crtc->cursor_bo != bo)
+                               i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
+               } else
+                       i915_gem_object_unpin(intel_crtc->cursor_bo);
+               mutex_lock(&dev->struct_mutex);
                drm_gem_object_unreference(intel_crtc->cursor_bo);
+               mutex_unlock(&dev->struct_mutex);
        }
 
        intel_crtc->cursor_addr = addr;
        intel_crtc->cursor_bo = bo;
 
        return 0;
+fail:
+       mutex_lock(&dev->struct_mutex);
+       drm_gem_object_unreference(bo);
+       mutex_unlock(&dev->struct_mutex);
+       return ret;
 }
 
 static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
index ccecfaf6307b79b97f3c7ab98817020eec804cef..2fafdcc108fe5161cef9e16862fdad2c8c6fd550 100644 (file)
@@ -456,6 +456,13 @@ void intel_lvds_init(struct drm_device *dev)
                dev_priv->panel_fixed_mode =
                        drm_mode_duplicate(dev, dev_priv->vbt_mode);
                mutex_unlock(&dev->mode_config.mutex);
+               if (dev_priv->panel_fixed_mode) {
+                       dev_priv->panel_fixed_mode->type |=
+                               DRM_MODE_TYPE_PREFERRED;
+                       drm_mode_probed_add(connector,
+                                           dev_priv->panel_fixed_mode);
+                       goto out;
+               }
        }
 
        /*
index 4b33bc82cc2418e9785b798c6b4e66e7830ba7af..b84bf066879b6c177bde4efd79aa2bde480faa60 100644 (file)
@@ -189,6 +189,16 @@ config SENSORS_ADT7473
          This driver can also be built as a module. If so, the module
          will be called adt7473.
 
+config SENSORS_ADT7475
+       tristate "Analog Devices ADT7475"
+       depends on I2C && EXPERIMENTAL
+       help
+         If you say yes here you get support for the Analog Devices
+         ADT7475 hardware monitoring chips.
+
+         This driver can also be build as a module.  If so, the module
+         will be called adt7475.
+
 config SENSORS_K8TEMP
        tristate "AMD Athlon64/FX or Opteron temperature sensor"
        depends on X86 && PCI && EXPERIMENTAL
@@ -861,6 +871,8 @@ config SENSORS_HDAPS
 config SENSORS_LIS3LV02D
        tristate "STMicroeletronics LIS3LV02Dx three-axis digital accelerometer"
        depends on ACPI && INPUT
+       select NEW_LEDS
+       select LEDS_CLASS
        default n
        help
          This driver provides support for the LIS3LV02Dx accelerometer. In
@@ -872,10 +884,16 @@ config SENSORS_LIS3LV02D
          /sys/devices/platform/lis3lv02d.
 
          This driver also provides an absolute input class device, allowing
-         the laptop to act as a pinball machine-esque joystick.
+         the laptop to act as a pinball machine-esque joystick. On HP laptops,
+         if the led infrastructure is activated, support for a led indicating
+         disk protection will be provided as hp:red:hddprotection.
 
-         This driver can also be built as a module.  If so, the module
-         will be called lis3lv02d.
+         This driver can also be built as modules.  If so, the core module
+         will be called lis3lv02d and a specific module for HP laptops will be
+         called hp_accel.
+
+         Say Y here if you have an applicable laptop and want to experience
+         the awesome power of lis3lv02d.
 
 config SENSORS_APPLESMC
        tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
index 19cb1ace3eb49a0a1e64e8ecc3cd8d6e729b0c1c..2e80f37f39eb4e03676b21ae20ec6e0db1b6a0ed 100644 (file)
@@ -28,6 +28,8 @@ obj-$(CONFIG_SENSORS_ADS7828) += ads7828.o
 obj-$(CONFIG_SENSORS_ADT7462)  += adt7462.o
 obj-$(CONFIG_SENSORS_ADT7470)  += adt7470.o
 obj-$(CONFIG_SENSORS_ADT7473)  += adt7473.o
+obj-$(CONFIG_SENSORS_ADT7475)  += adt7475.o
+
 obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o
 obj-$(CONFIG_SENSORS_AMS)      += ams/
 obj-$(CONFIG_SENSORS_ATXP1)    += atxp1.o
index 70bb854086dff42890369b6ab67347c013d93d68..e52b38806d034f4ac835bf626907d933f368a3de 100644 (file)
@@ -279,7 +279,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "OTES1 Fan",          36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0011, "AT8 32X(ATI RD580-ULI M1575)", {
+       { 0x0011, "AT8 32X", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 20, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -402,7 +402,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0016, "AW9D-MAX       (Intel i975-ICH7)", {
+       { 0x0016, "AW9D-MAX", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -482,7 +482,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0019, NULL /* Unknown, need DMI string */, {
+       { 0x0019, "IN9 32X MAX", {
                { "CPU Core",            7, 0, 10, 1, 0 },
                { "DDR2",               13, 0, 20, 1, 0 },
                { "DDR2 VTT",           14, 0, 10, 1, 0 },
@@ -509,7 +509,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 FAN",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x001A, "IP35 Pro(Intel P35-ICH9R)", {
+       { 0x001A, "IP35 Pro", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -1128,6 +1128,7 @@ static int __init abituguru3_dmi_detect(void)
 {
        const char *board_vendor, *board_name;
        int i, err = (force) ? 1 : -ENODEV;
+       size_t sublen;
 
        board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
        if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/"))
@@ -1137,9 +1138,20 @@ static int __init abituguru3_dmi_detect(void)
        if (!board_name)
                return err;
 
+       /* At the moment, we don't care about the part of the vendor
+        * DMI string contained in brackets. Truncate the string at
+        * the first occurrence of a bracket. Trim any trailing space
+        * from the substring.
+        */
+       sublen = strcspn(board_name, "(");
+       while (sublen > 0 && board_name[sublen - 1] == ' ')
+               sublen--;
+
        for (i = 0; abituguru3_motherboards[i].id; i++) {
                const char *dmi_name = abituguru3_motherboards[i].dmi_name;
-               if (dmi_name && !strcmp(dmi_name, board_name))
+               if (!dmi_name || strlen(dmi_name) != sublen)
+                       continue;
+               if (!strncasecmp(board_name, dmi_name, sublen))
                        break;
        }
 
@@ -1153,7 +1165,7 @@ static int __init abituguru3_dmi_detect(void)
 
 static inline int abituguru3_dmi_detect(void)
 {
-       return -ENODEV;
+       return 1;
 }
 
 #endif /* CONFIG_DMI */
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
new file mode 100644 (file)
index 0000000..d39877a
--- /dev/null
@@ -0,0 +1,1221 @@
+/*
+ * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives
+ * Copyright (C) 2007-2008, Advanced Micro Devices, Inc.
+ * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
+ * Copyright (C) 2008 Hans de Goede <hdegoede@redhat.com>
+
+ * Derived from the lm83 driver by Jean Delvare
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/err.h>
+
+/* Indexes for the sysfs hooks */
+
+#define INPUT          0
+#define MIN            1
+#define MAX            2
+#define CONTROL                3
+#define OFFSET         3
+#define AUTOMIN                4
+#define THERM          5
+#define HYSTERSIS      6
+
+/* These are unique identifiers for the sysfs functions - unlike the
+   numbers above, these are not also indexes into an array
+*/
+
+#define ALARM          9
+#define FAULT          10
+
+/* 7475 Common Registers */
+
+#define REG_VOLTAGE_BASE       0x21
+#define REG_TEMP_BASE          0x25
+#define REG_TACH_BASE          0x28
+#define REG_PWM_BASE           0x30
+#define REG_PWM_MAX_BASE       0x38
+
+#define REG_DEVID              0x3D
+#define REG_VENDID             0x3E
+
+#define REG_STATUS1            0x41
+#define REG_STATUS2            0x42
+
+#define REG_VOLTAGE_MIN_BASE   0x46
+#define REG_VOLTAGE_MAX_BASE   0x47
+
+#define REG_TEMP_MIN_BASE      0x4E
+#define REG_TEMP_MAX_BASE      0x4F
+
+#define REG_TACH_MIN_BASE      0x54
+
+#define REG_PWM_CONFIG_BASE    0x5C
+
+#define REG_TEMP_TRANGE_BASE   0x5F
+
+#define REG_PWM_MIN_BASE       0x64
+
+#define REG_TEMP_TMIN_BASE     0x67
+#define REG_TEMP_THERM_BASE    0x6A
+
+#define REG_REMOTE1_HYSTERSIS  0x6D
+#define REG_REMOTE2_HYSTERSIS  0x6E
+
+#define REG_TEMP_OFFSET_BASE   0x70
+
+#define REG_EXTEND1            0x76
+#define REG_EXTEND2            0x77
+#define REG_CONFIG5            0x7C
+
+#define CONFIG5_TWOSCOMP       0x01
+#define CONFIG5_TEMPOFFSET     0x02
+
+/* ADT7475 Settings */
+
+#define ADT7475_VOLTAGE_COUNT  2
+#define ADT7475_TEMP_COUNT     3
+#define ADT7475_TACH_COUNT     4
+#define ADT7475_PWM_COUNT      3
+
+/* Macro to read the registers */
+
+#define adt7475_read(reg) i2c_smbus_read_byte_data(client, (reg))
+
+/* Macros to easily index the registers */
+
+#define TACH_REG(idx) (REG_TACH_BASE + ((idx) * 2))
+#define TACH_MIN_REG(idx) (REG_TACH_MIN_BASE + ((idx) * 2))
+
+#define PWM_REG(idx) (REG_PWM_BASE + (idx))
+#define PWM_MAX_REG(idx) (REG_PWM_MAX_BASE + (idx))
+#define PWM_MIN_REG(idx) (REG_PWM_MIN_BASE + (idx))
+#define PWM_CONFIG_REG(idx) (REG_PWM_CONFIG_BASE + (idx))
+
+#define VOLTAGE_REG(idx) (REG_VOLTAGE_BASE + (idx))
+#define VOLTAGE_MIN_REG(idx) (REG_VOLTAGE_MIN_BASE + ((idx) * 2))
+#define VOLTAGE_MAX_REG(idx) (REG_VOLTAGE_MAX_BASE + ((idx) * 2))
+
+#define TEMP_REG(idx) (REG_TEMP_BASE + (idx))
+#define TEMP_MIN_REG(idx) (REG_TEMP_MIN_BASE + ((idx) * 2))
+#define TEMP_MAX_REG(idx) (REG_TEMP_MAX_BASE + ((idx) * 2))
+#define TEMP_TMIN_REG(idx) (REG_TEMP_TMIN_BASE + (idx))
+#define TEMP_THERM_REG(idx) (REG_TEMP_THERM_BASE + (idx))
+#define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx))
+#define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx))
+
+static unsigned short normal_i2c[] = { 0x2e, I2C_CLIENT_END };
+
+I2C_CLIENT_INSMOD_1(adt7475);
+
+static const struct i2c_device_id adt7475_id[] = {
+       { "adt7475", adt7475 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, adt7475_id);
+
+struct adt7475_data {
+       struct device *hwmon_dev;
+       struct mutex lock;
+
+       unsigned long measure_updated;
+       unsigned long limits_updated;
+       char valid;
+
+       u8 config5;
+       u16 alarms;
+       u16 voltage[3][3];
+       u16 temp[7][3];
+       u16 tach[2][4];
+       u8 pwm[4][3];
+       u8 range[3];
+       u8 pwmctl[3];
+       u8 pwmchan[3];
+};
+
+static struct i2c_driver adt7475_driver;
+static struct adt7475_data *adt7475_update_device(struct device *dev);
+static void adt7475_read_hystersis(struct i2c_client *client);
+static void adt7475_read_pwm(struct i2c_client *client, int index);
+
+/* Given a temp value, convert it to register value */
+
+static inline u16 temp2reg(struct adt7475_data *data, long val)
+{
+       u16 ret;
+
+       if (!(data->config5 & CONFIG5_TWOSCOMP)) {
+               val = SENSORS_LIMIT(val, -64000, 191000);
+               ret = (val + 64500) / 1000;
+       } else {
+               val = SENSORS_LIMIT(val, -128000, 127000);
+               if (val < -500)
+                       ret = (256500 + val) / 1000;
+               else
+                       ret = (val + 500) / 1000;
+       }
+
+       return ret << 2;
+}
+
+/* Given a register value, convert it to a real temp value */
+
+static inline int reg2temp(struct adt7475_data *data, u16 reg)
+{
+       if (data->config5 & CONFIG5_TWOSCOMP) {
+               if (reg >= 512)
+                       return (reg - 1024) * 250;
+               else
+                       return reg * 250;
+       } else
+               return (reg - 256) * 250;
+}
+
+static inline int tach2rpm(u16 tach)
+{
+       if (tach == 0 || tach == 0xFFFF)
+               return 0;
+
+       return (90000 * 60) / tach;
+}
+
+static inline u16 rpm2tach(unsigned long rpm)
+{
+       if (rpm == 0)
+               return 0;
+
+       return SENSORS_LIMIT((90000 * 60) / rpm, 1, 0xFFFF);
+}
+
+static inline int reg2vcc(u16 reg)
+{
+       return (4296 * reg) / 1000;
+}
+
+static inline int reg2vccp(u16 reg)
+{
+       return (2929 * reg) / 1000;
+}
+
+static inline u16 vcc2reg(long vcc)
+{
+       vcc = SENSORS_LIMIT(vcc, 0, 4396);
+       return (vcc * 1000) / 4296;
+}
+
+static inline u16 vccp2reg(long vcc)
+{
+       vcc = SENSORS_LIMIT(vcc, 0, 2998);
+       return (vcc * 1000) / 2929;
+}
+
+static u16 adt7475_read_word(struct i2c_client *client, int reg)
+{
+       u16 val;
+
+       val = i2c_smbus_read_byte_data(client, reg);
+       val |= (i2c_smbus_read_byte_data(client, reg + 1) << 8);
+
+       return val;
+}
+
+static void adt7475_write_word(struct i2c_client *client, int reg, u16 val)
+{
+       i2c_smbus_write_byte_data(client, reg + 1, val >> 8);
+       i2c_smbus_write_byte_data(client, reg, val & 0xFF);
+}
+
+/* Find the nearest value in a table - used for pwm frequency and
+   auto temp range */
+static int find_nearest(long val, const int *array, int size)
+{
+       int i;
+
+       if (val < array[0])
+               return 0;
+
+       if (val > array[size - 1])
+               return size - 1;
+
+       for (i = 0; i < size - 1; i++) {
+               int a, b;
+
+               if (val > array[i + 1])
+                       continue;
+
+               a = val - array[i];
+               b = array[i + 1] - val;
+
+               return (a <= b) ? i : i + 1;
+       }
+
+       return 0;
+}
+
+static ssize_t show_voltage(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       unsigned short val;
+
+       switch (sattr->nr) {
+       case ALARM:
+               return sprintf(buf, "%d\n",
+                              (data->alarms >> (sattr->index + 1)) & 1);
+       default:
+               val = data->voltage[sattr->nr][sattr->index];
+               return sprintf(buf, "%d\n",
+                              sattr->index ==
+                              0 ? reg2vccp(val) : reg2vcc(val));
+       }
+}
+
+static ssize_t set_voltage(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       unsigned char reg;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+
+       data->voltage[sattr->nr][sattr->index] =
+               sattr->index ? vcc2reg(val) : vccp2reg(val);
+
+       if (sattr->nr == MIN)
+               reg = VOLTAGE_MIN_REG(sattr->index);
+       else
+               reg = VOLTAGE_MAX_REG(sattr->index);
+
+       i2c_smbus_write_byte_data(client, reg,
+                                 data->voltage[sattr->nr][sattr->index] >> 2);
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
+                        char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       int out;
+
+       switch (sattr->nr) {
+       case HYSTERSIS:
+               mutex_lock(&data->lock);
+               out = data->temp[sattr->nr][sattr->index];
+               if (sattr->index != 1)
+                       out = (out >> 4) & 0xF;
+               else
+                       out = (out & 0xF);
+               /* Show the value as an absolute number tied to
+                * THERM */
+               out = reg2temp(data, data->temp[THERM][sattr->index]) -
+                       out * 1000;
+               mutex_unlock(&data->lock);
+               break;
+
+       case OFFSET:
+               /* Offset is always 2's complement, regardless of the
+                * setting in CONFIG5 */
+               mutex_lock(&data->lock);
+               out = (s8)data->temp[sattr->nr][sattr->index];
+               if (data->config5 & CONFIG5_TEMPOFFSET)
+                       out *= 1000;
+               else
+                       out *= 500;
+               mutex_unlock(&data->lock);
+               break;
+
+       case ALARM:
+               out = (data->alarms >> (sattr->index + 4)) & 1;
+               break;
+
+       case FAULT:
+               /* Note - only for remote1 and remote2 */
+               out = data->alarms & (sattr->index ? 0x8000 : 0x4000);
+               out = out ? 0 : 1;
+               break;
+
+       default:
+               /* All other temp values are in the configured format */
+               out = reg2temp(data, data->temp[sattr->nr][sattr->index]);
+       }
+
+       return sprintf(buf, "%d\n", out);
+}
+
+static ssize_t set_temp(struct device *dev, struct device_attribute *attr,
+                       const char *buf, size_t count)
+{
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       unsigned char reg = 0;
+       u8 out;
+       int temp;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+
+       /* We need the config register in all cases for temp <-> reg conv. */
+       data->config5 = adt7475_read(REG_CONFIG5);
+
+       switch (sattr->nr) {
+       case OFFSET:
+               if (data->config5 & CONFIG5_TEMPOFFSET) {
+                       val = SENSORS_LIMIT(val, -63000, 127000);
+                       out = data->temp[OFFSET][sattr->index] = val / 1000;
+               } else {
+                       val = SENSORS_LIMIT(val, -63000, 64000);
+                       out = data->temp[OFFSET][sattr->index] = val / 500;
+               }
+               break;
+
+       case HYSTERSIS:
+               /* The value will be given as an absolute value, turn it
+                  into an offset based on THERM */
+
+               /* Read fresh THERM and HYSTERSIS values from the chip */
+               data->temp[THERM][sattr->index] =
+                       adt7475_read(TEMP_THERM_REG(sattr->index)) << 2;
+               adt7475_read_hystersis(client);
+
+               temp = reg2temp(data, data->temp[THERM][sattr->index]);
+               val = SENSORS_LIMIT(val, temp - 15000, temp);
+               val = (temp - val) / 1000;
+
+               if (sattr->index != 1) {
+                       data->temp[HYSTERSIS][sattr->index] &= 0xF0;
+                       data->temp[HYSTERSIS][sattr->index] |= (val & 0xF) << 4;
+               } else {
+                       data->temp[HYSTERSIS][sattr->index] &= 0x0F;
+                       data->temp[HYSTERSIS][sattr->index] |= (val & 0xF);
+               }
+
+               out = data->temp[HYSTERSIS][sattr->index];
+               break;
+
+       default:
+               data->temp[sattr->nr][sattr->index] = temp2reg(data, val);
+
+               /* We maintain an extra 2 digits of precision for simplicity
+                * - shift those back off before writing the value */
+               out = (u8) (data->temp[sattr->nr][sattr->index] >> 2);
+       }
+
+       switch (sattr->nr) {
+       case MIN:
+               reg = TEMP_MIN_REG(sattr->index);
+               break;
+       case MAX:
+               reg = TEMP_MAX_REG(sattr->index);
+               break;
+       case OFFSET:
+               reg = TEMP_OFFSET_REG(sattr->index);
+               break;
+       case AUTOMIN:
+               reg = TEMP_TMIN_REG(sattr->index);
+               break;
+       case THERM:
+               reg = TEMP_THERM_REG(sattr->index);
+               break;
+       case HYSTERSIS:
+               if (sattr->index != 2)
+                       reg = REG_REMOTE1_HYSTERSIS;
+               else
+                       reg = REG_REMOTE2_HYSTERSIS;
+
+               break;
+       }
+
+       i2c_smbus_write_byte_data(client, reg, out);
+
+       mutex_unlock(&data->lock);
+       return count;
+}
+
+/* Table of autorange values - the user will write the value in millidegrees,
+   and we'll convert it */
+static const int autorange_table[] = {
+       2000, 2500, 3330, 4000, 5000, 6670, 8000,
+       10000, 13330, 16000, 20000, 26670, 32000, 40000,
+       53330, 80000
+};
+
+static ssize_t show_point2(struct device *dev, struct device_attribute *attr,
+                          char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       int out, val;
+
+       mutex_lock(&data->lock);
+       out = (data->range[sattr->index] >> 4) & 0x0F;
+       val = reg2temp(data, data->temp[AUTOMIN][sattr->index]);
+       mutex_unlock(&data->lock);
+
+       return sprintf(buf, "%d\n", val + autorange_table[out]);
+}
+
+static ssize_t set_point2(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       int temp;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+
+       /* Get a fresh copy of the needed registers */
+       data->config5 = adt7475_read(REG_CONFIG5);
+       data->temp[AUTOMIN][sattr->index] =
+               adt7475_read(TEMP_TMIN_REG(sattr->index)) << 2;
+       data->range[sattr->index] =
+               adt7475_read(TEMP_TRANGE_REG(sattr->index));
+
+       /* The user will write an absolute value, so subtract the start point
+          to figure the range */
+       temp = reg2temp(data, data->temp[AUTOMIN][sattr->index]);
+       val = SENSORS_LIMIT(val, temp + autorange_table[0],
+               temp + autorange_table[ARRAY_SIZE(autorange_table) - 1]);
+       val -= temp;
+
+       /* Find the nearest table entry to what the user wrote */
+       val = find_nearest(val, autorange_table, ARRAY_SIZE(autorange_table));
+
+       data->range[sattr->index] &= ~0xF0;
+       data->range[sattr->index] |= val << 4;
+
+       i2c_smbus_write_byte_data(client, TEMP_TRANGE_REG(sattr->index),
+                                 data->range[sattr->index]);
+
+       mutex_unlock(&data->lock);
+       return count;
+}
+
+static ssize_t show_tach(struct device *dev, struct device_attribute *attr,
+                        char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       int out;
+
+       if (sattr->nr == ALARM)
+               out = (data->alarms >> (sattr->index + 10)) & 1;
+       else
+               out = tach2rpm(data->tach[sattr->nr][sattr->index]);
+
+       return sprintf(buf, "%d\n", out);
+}
+
+static ssize_t set_tach(struct device *dev, struct device_attribute *attr,
+                       const char *buf, size_t count)
+{
+
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       unsigned long val;
+
+       if (strict_strtoul(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+
+       data->tach[MIN][sattr->index] = rpm2tach(val);
+
+       adt7475_write_word(client, TACH_MIN_REG(sattr->index),
+                          data->tach[MIN][sattr->index]);
+
+       mutex_unlock(&data->lock);
+       return count;
+}
+
+static ssize_t show_pwm(struct device *dev, struct device_attribute *attr,
+                       char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+
+       return sprintf(buf, "%d\n", data->pwm[sattr->nr][sattr->index]);
+}
+
+static ssize_t show_pwmchan(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+
+       return sprintf(buf, "%d\n", data->pwmchan[sattr->index]);
+}
+
+static ssize_t show_pwmctrl(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+
+       return sprintf(buf, "%d\n", data->pwmctl[sattr->index]);
+}
+
+static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
+                      const char *buf, size_t count)
+{
+
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       unsigned char reg = 0;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+
+       switch (sattr->nr) {
+       case INPUT:
+               /* Get a fresh value for CONTROL */
+               data->pwm[CONTROL][sattr->index] =
+                       adt7475_read(PWM_CONFIG_REG(sattr->index));
+
+               /* If we are not in manual mode, then we shouldn't allow
+                * the user to set the pwm speed */
+               if (((data->pwm[CONTROL][sattr->index] >> 5) & 7) != 7) {
+                       mutex_unlock(&data->lock);
+                       return count;
+               }
+
+               reg = PWM_REG(sattr->index);
+               break;
+
+       case MIN:
+               reg = PWM_MIN_REG(sattr->index);
+               break;
+
+       case MAX:
+               reg = PWM_MAX_REG(sattr->index);
+               break;
+       }
+
+       data->pwm[sattr->nr][sattr->index] = SENSORS_LIMIT(val, 0, 0xFF);
+       i2c_smbus_write_byte_data(client, reg,
+                                 data->pwm[sattr->nr][sattr->index]);
+
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+/* Called by set_pwmctrl and set_pwmchan */
+
+static int hw_set_pwm(struct i2c_client *client, int index,
+                     unsigned int pwmctl, unsigned int pwmchan)
+{
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       long val = 0;
+
+       switch (pwmctl) {
+       case 0:
+               val = 0x03;     /* Run at full speed */
+               break;
+       case 1:
+               val = 0x07;     /* Manual mode */
+               break;
+       case 2:
+               switch (pwmchan) {
+               case 1:
+                       /* Remote1 controls PWM */
+                       val = 0x00;
+                       break;
+               case 2:
+                       /* local controls PWM */
+                       val = 0x01;
+                       break;
+               case 4:
+                       /* remote2 controls PWM */
+                       val = 0x02;
+                       break;
+               case 6:
+                       /* local/remote2 control PWM */
+                       val = 0x05;
+                       break;
+               case 7:
+                       /* All three control PWM */
+                       val = 0x06;
+                       break;
+               default:
+                       return -EINVAL;
+               }
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       data->pwmctl[index] = pwmctl;
+       data->pwmchan[index] = pwmchan;
+
+       data->pwm[CONTROL][index] &= ~0xE0;
+       data->pwm[CONTROL][index] |= (val & 7) << 5;
+
+       i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index),
+                                 data->pwm[CONTROL][index]);
+
+       return 0;
+}
+
+static ssize_t set_pwmchan(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       int r;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+       /* Read Modify Write PWM values */
+       adt7475_read_pwm(client, sattr->index);
+       r = hw_set_pwm(client, sattr->index, data->pwmctl[sattr->index], val);
+       if (r)
+               count = r;
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+static ssize_t set_pwmctrl(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       int r;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       mutex_lock(&data->lock);
+       /* Read Modify Write PWM values */
+       adt7475_read_pwm(client, sattr->index);
+       r = hw_set_pwm(client, sattr->index, val, data->pwmchan[sattr->index]);
+       if (r)
+               count = r;
+       mutex_unlock(&data->lock);
+
+       return count;
+}
+
+/* List of frequencies for the PWM */
+static const int pwmfreq_table[] = {
+       11, 14, 22, 29, 35, 44, 58, 88
+};
+
+static ssize_t show_pwmfreq(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct adt7475_data *data = adt7475_update_device(dev);
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+
+       return sprintf(buf, "%d\n",
+                      pwmfreq_table[data->range[sattr->index] & 7]);
+}
+
+static ssize_t set_pwmfreq(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+       struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       int out;
+       long val;
+
+       if (strict_strtol(buf, 10, &val))
+               return -EINVAL;
+
+       out = find_nearest(val, pwmfreq_table, ARRAY_SIZE(pwmfreq_table));
+
+       mutex_lock(&data->lock);
+
+       data->range[sattr->index] =
+               adt7475_read(TEMP_TRANGE_REG(sattr->index));
+       data->range[sattr->index] &= ~7;
+       data->range[sattr->index] |= out;
+
+       i2c_smbus_write_byte_data(client, TEMP_TRANGE_REG(sattr->index),
+                                 data->range[sattr->index]);
+
+       mutex_unlock(&data->lock);
+       return count;
+}
+
+static SENSOR_DEVICE_ATTR_2(in1_input, S_IRUGO, show_voltage, NULL, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(in1_max, S_IRUGO | S_IWUSR, show_voltage,
+                           set_voltage, MAX, 0);
+static SENSOR_DEVICE_ATTR_2(in1_min, S_IRUGO | S_IWUSR, show_voltage,
+                           set_voltage, MIN, 0);
+static SENSOR_DEVICE_ATTR_2(in1_alarm, S_IRUGO, show_voltage, NULL, ALARM, 0);
+static SENSOR_DEVICE_ATTR_2(in2_input, S_IRUGO, show_voltage, NULL, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(in2_max, S_IRUGO | S_IWUSR, show_voltage,
+                           set_voltage, MAX, 1);
+static SENSOR_DEVICE_ATTR_2(in2_min, S_IRUGO | S_IWUSR, show_voltage,
+                           set_voltage, MIN, 1);
+static SENSOR_DEVICE_ATTR_2(in2_alarm, S_IRUGO, show_voltage, NULL, ALARM, 1);
+static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_alarm, S_IRUGO, show_temp, NULL, ALARM, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_fault, S_IRUGO, show_temp, NULL, FAULT, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_max, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MAX, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_min, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MIN, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_offset, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, OFFSET, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_auto_point1_temp, S_IRUGO | S_IWUSR,
+                           show_temp, set_temp, AUTOMIN, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_auto_point2_temp, S_IRUGO | S_IWUSR,
+                           show_point2, set_point2, 0, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_crit, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           THERM, 0);
+static SENSOR_DEVICE_ATTR_2(temp1_crit_hyst, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, HYSTERSIS, 0);
+static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_alarm, S_IRUGO, show_temp, NULL, ALARM, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_max, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MAX, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_min, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MIN, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_offset, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, OFFSET, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_auto_point1_temp, S_IRUGO | S_IWUSR,
+                           show_temp, set_temp, AUTOMIN, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_auto_point2_temp, S_IRUGO | S_IWUSR,
+                           show_point2, set_point2, 0, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_crit, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           THERM, 1);
+static SENSOR_DEVICE_ATTR_2(temp2_crit_hyst, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, HYSTERSIS, 1);
+static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, INPUT, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_alarm, S_IRUGO, show_temp, NULL, ALARM, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_fault, S_IRUGO, show_temp, NULL, FAULT, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_max, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MAX, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_min, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           MIN, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_offset, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, OFFSET, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_auto_point1_temp, S_IRUGO | S_IWUSR,
+                           show_temp, set_temp, AUTOMIN, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_auto_point2_temp, S_IRUGO | S_IWUSR,
+                           show_point2, set_point2, 0, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_crit, S_IRUGO | S_IWUSR, show_temp, set_temp,
+                           THERM, 2);
+static SENSOR_DEVICE_ATTR_2(temp3_crit_hyst, S_IRUGO | S_IWUSR, show_temp,
+                           set_temp, HYSTERSIS, 2);
+static SENSOR_DEVICE_ATTR_2(fan1_input, S_IRUGO, show_tach, NULL, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(fan1_min, S_IRUGO | S_IWUSR, show_tach, set_tach,
+                           MIN, 0);
+static SENSOR_DEVICE_ATTR_2(fan1_alarm, S_IRUGO, show_tach, NULL, ALARM, 0);
+static SENSOR_DEVICE_ATTR_2(fan2_input, S_IRUGO, show_tach, NULL, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(fan2_min, S_IRUGO | S_IWUSR, show_tach, set_tach,
+                           MIN, 1);
+static SENSOR_DEVICE_ATTR_2(fan2_alarm, S_IRUGO, show_tach, NULL, ALARM, 1);
+static SENSOR_DEVICE_ATTR_2(fan3_input, S_IRUGO, show_tach, NULL, INPUT, 2);
+static SENSOR_DEVICE_ATTR_2(fan3_min, S_IRUGO | S_IWUSR, show_tach, set_tach,
+                           MIN, 2);
+static SENSOR_DEVICE_ATTR_2(fan3_alarm, S_IRUGO, show_tach, NULL, ALARM, 2);
+static SENSOR_DEVICE_ATTR_2(fan4_input, S_IRUGO, show_tach, NULL, INPUT, 3);
+static SENSOR_DEVICE_ATTR_2(fan4_min, S_IRUGO | S_IWUSR, show_tach, set_tach,
+                           MIN, 3);
+static SENSOR_DEVICE_ATTR_2(fan4_alarm, S_IRUGO, show_tach, NULL, ALARM, 3);
+static SENSOR_DEVICE_ATTR_2(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT,
+                           0);
+static SENSOR_DEVICE_ATTR_2(pwm1_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
+                           set_pwmfreq, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
+                           set_pwmctrl, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_channel_temp, S_IRUGO | S_IWUSR,
+                           show_pwmchan, set_pwmchan, INPUT, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MIN, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MAX, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT,
+                           1);
+static SENSOR_DEVICE_ATTR_2(pwm2_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
+                           set_pwmfreq, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
+                           set_pwmctrl, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_channel_temp, S_IRUGO | S_IWUSR,
+                           show_pwmchan, set_pwmchan, INPUT, 1);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MIN, 1);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MAX, 1);
+static SENSOR_DEVICE_ATTR_2(pwm3, S_IRUGO | S_IWUSR, show_pwm, set_pwm, INPUT,
+                           2);
+static SENSOR_DEVICE_ATTR_2(pwm3_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
+                           set_pwmfreq, INPUT, 2);
+static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
+                           set_pwmctrl, INPUT, 2);
+static SENSOR_DEVICE_ATTR_2(pwm3_auto_channel_temp, S_IRUGO | S_IWUSR,
+                           show_pwmchan, set_pwmchan, INPUT, 2);
+static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MIN, 2);
+static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR, show_pwm,
+                           set_pwm, MAX, 2);
+
+static struct attribute *adt7475_attrs[] = {
+       &sensor_dev_attr_in1_input.dev_attr.attr,
+       &sensor_dev_attr_in1_max.dev_attr.attr,
+       &sensor_dev_attr_in1_min.dev_attr.attr,
+       &sensor_dev_attr_in1_alarm.dev_attr.attr,
+       &sensor_dev_attr_in2_input.dev_attr.attr,
+       &sensor_dev_attr_in2_max.dev_attr.attr,
+       &sensor_dev_attr_in2_min.dev_attr.attr,
+       &sensor_dev_attr_in2_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp1_input.dev_attr.attr,
+       &sensor_dev_attr_temp1_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp1_fault.dev_attr.attr,
+       &sensor_dev_attr_temp1_max.dev_attr.attr,
+       &sensor_dev_attr_temp1_min.dev_attr.attr,
+       &sensor_dev_attr_temp1_offset.dev_attr.attr,
+       &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_temp1_crit.dev_attr.attr,
+       &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr,
+       &sensor_dev_attr_temp2_input.dev_attr.attr,
+       &sensor_dev_attr_temp2_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp2_max.dev_attr.attr,
+       &sensor_dev_attr_temp2_min.dev_attr.attr,
+       &sensor_dev_attr_temp2_offset.dev_attr.attr,
+       &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_temp2_crit.dev_attr.attr,
+       &sensor_dev_attr_temp2_crit_hyst.dev_attr.attr,
+       &sensor_dev_attr_temp3_input.dev_attr.attr,
+       &sensor_dev_attr_temp3_fault.dev_attr.attr,
+       &sensor_dev_attr_temp3_alarm.dev_attr.attr,
+       &sensor_dev_attr_temp3_max.dev_attr.attr,
+       &sensor_dev_attr_temp3_min.dev_attr.attr,
+       &sensor_dev_attr_temp3_offset.dev_attr.attr,
+       &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr,
+       &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr,
+       &sensor_dev_attr_temp3_crit.dev_attr.attr,
+       &sensor_dev_attr_temp3_crit_hyst.dev_attr.attr,
+       &sensor_dev_attr_fan1_input.dev_attr.attr,
+       &sensor_dev_attr_fan1_min.dev_attr.attr,
+       &sensor_dev_attr_fan1_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan2_input.dev_attr.attr,
+       &sensor_dev_attr_fan2_min.dev_attr.attr,
+       &sensor_dev_attr_fan2_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan3_input.dev_attr.attr,
+       &sensor_dev_attr_fan3_min.dev_attr.attr,
+       &sensor_dev_attr_fan3_alarm.dev_attr.attr,
+       &sensor_dev_attr_fan4_input.dev_attr.attr,
+       &sensor_dev_attr_fan4_min.dev_attr.attr,
+       &sensor_dev_attr_fan4_alarm.dev_attr.attr,
+       &sensor_dev_attr_pwm1.dev_attr.attr,
+       &sensor_dev_attr_pwm1_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm1_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_channel_temp.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm2.dev_attr.attr,
+       &sensor_dev_attr_pwm2_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm2_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_channel_temp.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm3.dev_attr.attr,
+       &sensor_dev_attr_pwm3_freq.dev_attr.attr,
+       &sensor_dev_attr_pwm3_enable.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_channel_temp.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
+       &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
+       NULL,
+};
+
+struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs };
+
+static int adt7475_detect(struct i2c_client *client, int kind,
+                         struct i2c_board_info *info)
+{
+       struct i2c_adapter *adapter = client->adapter;
+
+       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+               return -ENODEV;
+
+       if (kind <= 0) {
+               if (adt7475_read(REG_VENDID) != 0x41 ||
+                   adt7475_read(REG_DEVID) != 0x75) {
+                       dev_err(&adapter->dev,
+                               "Couldn't detect a adt7475 part at 0x%02x\n",
+                               (unsigned int)client->addr);
+                       return -ENODEV;
+               }
+       }
+
+       strlcpy(info->type, adt7475_id[0].name, I2C_NAME_SIZE);
+
+       return 0;
+}
+
+static int adt7475_probe(struct i2c_client *client,
+                        const struct i2c_device_id *id)
+{
+       struct adt7475_data *data;
+       int i, ret = 0;
+
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
+       if (data == NULL)
+               return -ENOMEM;
+
+       mutex_init(&data->lock);
+       i2c_set_clientdata(client, data);
+
+       /* Call adt7475_read_pwm for all pwm's as this will reprogram any
+          pwm's which are disabled to manual mode with 0% duty cycle */
+       for (i = 0; i < ADT7475_PWM_COUNT; i++)
+               adt7475_read_pwm(client, i);
+
+       ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group);
+       if (ret)
+               goto efree;
+
+       data->hwmon_dev = hwmon_device_register(&client->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               ret = PTR_ERR(data->hwmon_dev);
+               goto eremove;
+       }
+
+       return 0;
+
+eremove:
+       sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group);
+efree:
+       kfree(data);
+       return ret;
+}
+
+static int adt7475_remove(struct i2c_client *client)
+{
+       struct adt7475_data *data = i2c_get_clientdata(client);
+
+       hwmon_device_unregister(data->hwmon_dev);
+       sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group);
+       kfree(data);
+
+       return 0;
+}
+
+static struct i2c_driver adt7475_driver = {
+       .class          = I2C_CLASS_HWMON,
+       .driver = {
+               .name   = "adt7475",
+       },
+       .probe          = adt7475_probe,
+       .remove         = adt7475_remove,
+       .id_table       = adt7475_id,
+       .detect         = adt7475_detect,
+       .address_data   = &addr_data,
+};
+
+static void adt7475_read_hystersis(struct i2c_client *client)
+{
+       struct adt7475_data *data = i2c_get_clientdata(client);
+
+       data->temp[HYSTERSIS][0] = (u16) adt7475_read(REG_REMOTE1_HYSTERSIS);
+       data->temp[HYSTERSIS][1] = data->temp[HYSTERSIS][0];
+       data->temp[HYSTERSIS][2] = (u16) adt7475_read(REG_REMOTE2_HYSTERSIS);
+}
+
+static void adt7475_read_pwm(struct i2c_client *client, int index)
+{
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       unsigned int v;
+
+       data->pwm[CONTROL][index] = adt7475_read(PWM_CONFIG_REG(index));
+
+       /* Figure out the internal value for pwmctrl and pwmchan
+          based on the current settings */
+       v = (data->pwm[CONTROL][index] >> 5) & 7;
+
+       if (v == 3)
+               data->pwmctl[index] = 0;
+       else if (v == 7)
+               data->pwmctl[index] = 1;
+       else if (v == 4) {
+               /* The fan is disabled - we don't want to
+                  support that, so change to manual mode and
+                  set the duty cycle to 0 instead
+               */
+               data->pwm[INPUT][index] = 0;
+               data->pwm[CONTROL][index] &= ~0xE0;
+               data->pwm[CONTROL][index] |= (7 << 5);
+
+               i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index),
+                                         data->pwm[INPUT][index]);
+
+               i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index),
+                                         data->pwm[CONTROL][index]);
+
+               data->pwmctl[index] = 1;
+       } else {
+               data->pwmctl[index] = 2;
+
+               switch (v) {
+               case 0:
+                       data->pwmchan[index] = 1;
+                       break;
+               case 1:
+                       data->pwmchan[index] = 2;
+                       break;
+               case 2:
+                       data->pwmchan[index] = 4;
+                       break;
+               case 5:
+                       data->pwmchan[index] = 6;
+                       break;
+               case 6:
+                       data->pwmchan[index] = 7;
+                       break;
+               }
+       }
+}
+
+static struct adt7475_data *adt7475_update_device(struct device *dev)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+       struct adt7475_data *data = i2c_get_clientdata(client);
+       u8 ext;
+       int i;
+
+       mutex_lock(&data->lock);
+
+       /* Measurement values update every 2 seconds */
+       if (time_after(jiffies, data->measure_updated + HZ * 2) ||
+           !data->valid) {
+               data->alarms = adt7475_read(REG_STATUS2) << 8;
+               data->alarms |= adt7475_read(REG_STATUS1);
+
+               ext = adt7475_read(REG_EXTEND1);
+               for (i = 0; i < ADT7475_VOLTAGE_COUNT; i++)
+                       data->voltage[INPUT][i] =
+                               (adt7475_read(VOLTAGE_REG(i)) << 2) |
+                               ((ext >> ((i + 1) * 2)) & 3);
+
+               ext = adt7475_read(REG_EXTEND2);
+               for (i = 0; i < ADT7475_TEMP_COUNT; i++)
+                       data->temp[INPUT][i] =
+                               (adt7475_read(TEMP_REG(i)) << 2) |
+                               ((ext >> ((i + 1) * 2)) & 3);
+
+               for (i = 0; i < ADT7475_TACH_COUNT; i++)
+                       data->tach[INPUT][i] =
+                               adt7475_read_word(client, TACH_REG(i));
+
+               /* Updated by hw when in auto mode */
+               for (i = 0; i < ADT7475_PWM_COUNT; i++)
+                       data->pwm[INPUT][i] = adt7475_read(PWM_REG(i));
+
+               data->measure_updated = jiffies;
+       }
+
+       /* Limits and settings, should never change update every 60 seconds */
+       if (time_after(jiffies, data->limits_updated + HZ * 2) ||
+           !data->valid) {
+               data->config5 = adt7475_read(REG_CONFIG5);
+
+               for (i = 0; i < ADT7475_VOLTAGE_COUNT; i++) {
+                       /* Adjust values so they match the input precision */
+                       data->voltage[MIN][i] =
+                               adt7475_read(VOLTAGE_MIN_REG(i)) << 2;
+                       data->voltage[MAX][i] =
+                               adt7475_read(VOLTAGE_MAX_REG(i)) << 2;
+               }
+
+               for (i = 0; i < ADT7475_TEMP_COUNT; i++) {
+                       /* Adjust values so they match the input precision */
+                       data->temp[MIN][i] =
+                               adt7475_read(TEMP_MIN_REG(i)) << 2;
+                       data->temp[MAX][i] =
+                               adt7475_read(TEMP_MAX_REG(i)) << 2;
+                       data->temp[AUTOMIN][i] =
+                               adt7475_read(TEMP_TMIN_REG(i)) << 2;
+                       data->temp[THERM][i] =
+                               adt7475_read(TEMP_THERM_REG(i)) << 2;
+                       data->temp[OFFSET][i] =
+                               adt7475_read(TEMP_OFFSET_REG(i));
+               }
+               adt7475_read_hystersis(client);
+
+               for (i = 0; i < ADT7475_TACH_COUNT; i++)
+                       data->tach[MIN][i] =
+                               adt7475_read_word(client, TACH_MIN_REG(i));
+
+               for (i = 0; i < ADT7475_PWM_COUNT; i++) {
+                       data->pwm[MAX][i] = adt7475_read(PWM_MAX_REG(i));
+                       data->pwm[MIN][i] = adt7475_read(PWM_MIN_REG(i));
+                       /* Set the channel and control information */
+                       adt7475_read_pwm(client, i);
+               }
+
+               data->range[0] = adt7475_read(TEMP_TRANGE_REG(0));
+               data->range[1] = adt7475_read(TEMP_TRANGE_REG(1));
+               data->range[2] = adt7475_read(TEMP_TRANGE_REG(2));
+
+               data->limits_updated = jiffies;
+               data->valid = 1;
+       }
+
+       mutex_unlock(&data->lock);
+
+       return data;
+}
+
+static int __init sensors_adt7475_init(void)
+{
+       return i2c_add_driver(&adt7475_driver);
+}
+
+static void __exit sensors_adt7475_exit(void)
+{
+       i2c_del_driver(&adt7475_driver);
+}
+
+MODULE_AUTHOR("Advanced Micro Devices, Inc");
+MODULE_DESCRIPTION("adt7475 driver");
+MODULE_LICENSE("GPL");
+
+module_init(sensors_adt7475_init);
+module_exit(sensors_adt7475_exit);
index dca47a591baf325eabce346ae115ed747efd7c53..e301862365889e1e2750d1514807a45d6489644b 100644 (file)
@@ -590,6 +590,11 @@ static ssize_t applesmc_light_show(struct device *dev,
        }
 
        ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length);
+       /* newer macbooks report a single 10-bit bigendian value */
+       if (data_length == 10) {
+               left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2;
+               goto out;
+       }
        left = buffer[2];
        if (ret)
                goto out;
index bf8d40580577d081e0ebafb95a22eab9b2d9c2ea..03705240000f7755e9773d6ec0492a3a2a27f63b 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2007-2008 Yan Burman
  *  Copyright (C) 2008 Eric Piel
- *  Copyright (C) 2008 Pavel Machek
+ *  Copyright (C) 2008-2009 Pavel Machek
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -36,6 +36,7 @@
 #include <linux/freezer.h>
 #include <linux/version.h>
 #include <linux/uaccess.h>
+#include <linux/leds.h>
 #include <acpi/acpi_drivers.h>
 #include <asm/atomic.h>
 #include "lis3lv02d.h"
 #define DRIVER_NAME     "lis3lv02d"
 #define ACPI_MDPS_CLASS "accelerometer"
 
+/* Delayed LEDs infrastructure ------------------------------------ */
+
+/* Special LED class that can defer work */
+struct delayed_led_classdev {
+       struct led_classdev led_classdev;
+       struct work_struct work;
+       enum led_brightness new_brightness;
+
+       unsigned int led;               /* For driver */
+       void (*set_brightness)(struct delayed_led_classdev *data, enum led_brightness value);
+};
+
+static inline void delayed_set_status_worker(struct work_struct *work)
+{
+       struct delayed_led_classdev *data =
+                       container_of(work, struct delayed_led_classdev, work);
+
+       data->set_brightness(data, data->new_brightness);
+}
+
+static inline void delayed_sysfs_set(struct led_classdev *led_cdev,
+                             enum led_brightness brightness)
+{
+       struct delayed_led_classdev *data = container_of(led_cdev,
+                            struct delayed_led_classdev, led_classdev);
+       data->new_brightness = brightness;
+       schedule_work(&data->work);
+}
+
+/* HP-specific accelerometer driver ------------------------------------ */
 
 /* For automatic insertion of the module */
 static struct acpi_device_id lis3lv02d_device_ids[] = {
@@ -154,10 +185,33 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = {
  */
 };
 
+static void hpled_set(struct delayed_led_classdev *led_cdev, enum led_brightness value)
+{
+       acpi_handle handle = adev.device->handle;
+       unsigned long long ret; /* Not used when writing */
+       union acpi_object in_obj[1];
+       struct acpi_object_list args = { 1, in_obj };
+
+       in_obj[0].type          = ACPI_TYPE_INTEGER;
+       in_obj[0].integer.value = !!value;
+
+       acpi_evaluate_integer(handle, "ALED", &args, &ret);
+}
+
+static struct delayed_led_classdev hpled_led = {
+       .led_classdev = {
+               .name                   = "hp::hddprotect",
+               .default_trigger        = "none",
+               .brightness_set         = delayed_sysfs_set,
+               .flags                  = LED_CORE_SUSPENDRESUME,
+       },
+       .set_brightness = hpled_set,
+};
 
 static int lis3lv02d_add(struct acpi_device *device)
 {
        u8 val;
+       int ret;
 
        if (!device)
                return -EINVAL;
@@ -183,7 +237,19 @@ static int lis3lv02d_add(struct acpi_device *device)
                adev.ac = lis3lv02d_axis_normal;
        }
 
-       return lis3lv02d_init_device(&adev);
+       INIT_WORK(&hpled_led.work, delayed_set_status_worker);
+       ret = led_classdev_register(NULL, &hpled_led.led_classdev);
+       if (ret)
+               return ret;
+
+       ret = lis3lv02d_init_device(&adev);
+       if (ret) {
+               flush_work(&hpled_led.work);
+               led_classdev_unregister(&hpled_led.led_classdev);
+               return ret;
+       }
+
+       return ret;
 }
 
 static int lis3lv02d_remove(struct acpi_device *device, int type)
@@ -194,6 +260,9 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
        lis3lv02d_joystick_disable();
        lis3lv02d_poweroff(device->handle);
 
+       flush_work(&hpled_led.work);
+       led_classdev_unregister(&hpled_led.led_classdev);
+
        return lis3lv02d_remove_fs();
 }
 
@@ -256,7 +325,7 @@ static void __exit lis3lv02d_exit_module(void)
        acpi_bus_unregister_driver(&lis3lv02d_driver);
 }
 
-MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS");
+MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED.");
 MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek");
 MODULE_LICENSE("GPL");
 
index bd2bde0ef95e4c4b411bc1682c2c0243be55c22f..1fe99511184111a68a38e151e96e03c9491f59ad 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <asm/processor.h>
 
 #define TEMP_FROM_REG(val)     (((((val) >> 16) & 0xff) - 49) * 1000)
 #define REG_TEMP       0xe4
@@ -47,6 +48,8 @@ struct k8temp_data {
        /* registers values */
        u8 sensorsp;            /* sensor presence bits - SEL_CORE & SEL_PLACE */
        u32 temp[2][2];         /* core, place */
+       u8 swap_core_select;    /* meaning of SEL_CORE is inverted */
+       u32 temp_offset;
 };
 
 static struct k8temp_data *k8temp_update_device(struct device *dev)
@@ -114,10 +117,15 @@ static ssize_t show_temp(struct device *dev,
            to_sensor_dev_attr_2(devattr);
        int core = attr->nr;
        int place = attr->index;
+       int temp;
        struct k8temp_data *data = k8temp_update_device(dev);
 
-       return sprintf(buf, "%d\n",
-                      TEMP_FROM_REG(data->temp[core][place]));
+       if (data->swap_core_select)
+               core = core ? 0 : 1;
+
+       temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset;
+
+       return sprintf(buf, "%d\n", temp);
 }
 
 /* core, place */
@@ -141,20 +149,49 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
        int err;
        u8 scfg;
        u32 temp;
+       u8 model, stepping;
        struct k8temp_data *data;
-       u32 cpuid = cpuid_eax(1);
-
-       /* this feature should be available since SH-C0 core */
-       if ((cpuid == 0xf40) || (cpuid == 0xf50) || (cpuid == 0xf51)) {
-               err = -ENODEV;
-               goto exit;
-       }
 
        if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
 
+       model = boot_cpu_data.x86_model;
+       stepping = boot_cpu_data.x86_mask;
+
+       switch (boot_cpu_data.x86) {
+       case 0xf:
+               /* feature available since SH-C0, exclude older revisions */
+               if (((model == 4) && (stepping == 0)) ||
+                   ((model == 5) && (stepping <= 1))) {
+                       err = -ENODEV;
+                       goto exit_free;
+               }
+
+               /*
+                * AMD NPT family 0fh, i.e. RevF and RevG:
+                * meaning of SEL_CORE bit is inverted
+                */
+               if (model >= 0x40) {
+                       data->swap_core_select = 1;
+                       dev_warn(&pdev->dev, "Temperature readouts might be "
+                                "wrong - check erratum #141\n");
+               }
+
+               if ((model >= 0x69) &&
+                   !(model == 0xc1 || model == 0x6c || model == 0x7c)) {
+                       /*
+                        * RevG desktop CPUs (i.e. no socket S1G1 parts)
+                        * need additional offset, otherwise reported
+                        * temperature is below ambient temperature
+                        */
+                       data->temp_offset = 21000;
+               }
+
+               break;
+       }
+
        pci_read_config_byte(pdev, REG_TEMP, &scfg);
        scfg &= ~(SEL_PLACE | SEL_CORE);                /* Select sensor 0, core0 */
        pci_write_config_byte(pdev, REG_TEMP, scfg);
index 59c3d23f5bdccdf54e0dbc7d5099e136ad7768e8..b9bef04b7be4fffb9eace1743621e98f7d0d47eb 100644 (file)
@@ -139,15 +139,4 @@ config SENSORS_TSL2550
          This driver can also be built as a module.  If so, the module
          will be called tsl2550.
 
-config MCU_MPC8349EMITX
-       tristate "MPC8349E-mITX MCU driver"
-       depends on I2C && PPC_83xx
-       select GENERIC_GPIO
-       select ARCH_REQUIRE_GPIOLIB
-       help
-         Say Y here to enable soft power-off functionality on the Freescale
-         boards with the MPC8349E-mITX-compatible MCU chips. This driver will
-         also register MCU GPIOs with the generic GPIO API, so you'll able
-         to use MCU pins as GPIOs.
-
 endmenu
index 83accaaf8164bfcc81397da82e363ee25e20434d..00fcb5193ac2c2fbe814193cfce09d114abe3631 100644 (file)
@@ -19,7 +19,6 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
 obj-$(CONFIG_PCF8575)          += pcf8575.o
 obj-$(CONFIG_SENSORS_PCF8591)  += pcf8591.o
 obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
-obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
index 3f9503867e6b48da6f8c1e0718399693b5f9020b..b1c6f68d98ced4b48388d7d90268f1cfff91498f 100644 (file)
@@ -701,11 +701,6 @@ config BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
        depends on SOC_AU1200 && BLK_DEV_IDE_AU1XXX
 endchoice
 
-config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
-       int "Maximum transfer size (KB) per request (up to 128)"
-       default "128"
-       depends on BLK_DEV_IDE_AU1XXX
-
 config BLK_DEV_IDE_TX4938
        tristate "TX4938 internal IDE support"
        depends on SOC_TX4938
index 4088a622873e15f896578df77750c9da951ab771..806760d24cefd263e4ab8202a3659053be40f3f9 100644 (file)
@@ -633,7 +633,7 @@ static void ide_disk_setup(ide_drive_t *drive)
        printk(KERN_INFO "%s: max request size: %dKiB\n", drive->name,
                q->max_sectors / 2);
 
-       if (ata_id_is_ssd(id) || ata_id_is_cfa(id))
+       if (ata_id_is_ssd(id))
                queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
 
        /* calculate drive capacity, and select LBA if possible */
index e728cfe7273f2a84a15a83e497b98d9faab05211..753b92ebe0ae5e72416d78cf3fe4baf0a94aabd6 100644 (file)
@@ -493,7 +493,7 @@ static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long ti
        stat = tp_ops->read_status(hwif);
 
        if (stat & ATA_BUSY) {
-               local_irq_save(flags);
+               local_save_flags(flags);
                local_irq_enable_in_hardirq();
                timeout += jiffies;
                while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) {
index 4b3bf6a06b70ef1be71134295af5ce749072750d..60538d9c84ee17005c4ca1f48a086bdda7be5702 100644 (file)
@@ -186,12 +186,10 @@ void ide_complete_pm_request(ide_drive_t *drive, struct request *rq)
               blk_pm_suspend_request(rq) ? "suspend" : "resume");
 #endif
        spin_lock_irqsave(q->queue_lock, flags);
-       if (blk_pm_suspend_request(rq)) {
+       if (blk_pm_suspend_request(rq))
                blk_stop_queue(q);
-       } else {
+       else
                drive->dev_flags &= ~IDE_DFLAG_BLOCKED;
-               blk_start_queue(q);
-       }
        spin_unlock_irqrestore(q->queue_lock, flags);
 
        drive->hwif->rq = NULL;
@@ -219,6 +217,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
                 * point.
                 */
                ide_hwif_t *hwif = drive->hwif;
+               struct request_queue *q = drive->queue;
+               unsigned long flags;
                int rc;
 #ifdef DEBUG_PM
                printk("%s: Wakeup request inited, waiting for !BSY...\n", drive->name);
@@ -231,5 +231,9 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
                rc = ide_wait_not_busy(hwif, 100000);
                if (rc)
                        printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
+
+               spin_lock_irqsave(q->queue_lock, flags);
+               blk_start_queue(q);
+               spin_unlock_irqrestore(q->queue_lock, flags);
        }
 }
index 0ccbb4459fb913faf89370422071cf01d3c17e9a..312127ea443afa6027c413fb6f8c5fb598afcbbe 100644 (file)
@@ -796,7 +796,7 @@ static int ide_probe_port(ide_hwif_t *hwif)
        if (irqd)
                disable_irq(hwif->irq);
 
-       local_irq_save(flags);
+       local_save_flags(flags);
        local_irq_enable_in_hardirq();
 
        if (ide_port_wait_ready(hwif) == -EBUSY)
index 0be27ac1f07767854fb9bf98b4caa7723d3e68c0..e1c4f5437396b076bf09f55f32eed07e9ef6b9f4 100644 (file)
@@ -68,6 +68,8 @@
 
 #define DRV_NAME "it821x"
 
+#define QUIRK_VORTEX86 1
+
 struct it821x_dev
 {
        unsigned int smart:1,           /* Are we in smart raid mode */
@@ -79,6 +81,7 @@ struct it821x_dev
        u16     pio[2];                 /* Cached PIO values */
        u16     mwdma[2];               /* Cached MWDMA values */
        u16     udma[2];                /* Cached UDMA values (per drive) */
+       u16     quirks;
 };
 
 #define ATA_66         0
@@ -557,8 +560,7 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
         *      this is necessary.
         */
 
-       pci_read_config_byte(dev, 0x08, &conf);
-       if (conf == 0x10) {
+       if (dev->revision == 0x10) {
                idev->timing10 = 1;
                hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
                if (idev->smart == 0)
@@ -577,6 +579,12 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
 
        hwif->ultra_mask = ATA_UDMA6;
        hwif->mwdma_mask = ATA_MWDMA2;
+
+       /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */
+       if (idev->quirks & QUIRK_VORTEX86) {
+               if (dev->revision == 0x11)
+                       hwif->ultra_mask = 0;
+       }
 }
 
 static void it8212_disable_raid(struct pci_dev *dev)
@@ -649,6 +657,8 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic
                return -ENOMEM;
        }
 
+       itdevs->quirks = id->driver_data;
+
        rc = ide_pci_init_one(dev, &it821x_chipset, itdevs);
        if (rc)
                kfree(itdevs);
@@ -668,6 +678,7 @@ static void __devexit it821x_remove(struct pci_dev *dev)
 static const struct pci_device_id it821x_pci_tbl[] = {
        { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 },
        { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 },
+       { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 },
        { 0, },
 };
 
index 48cc748c50438030d2b0e8492fa609fdd3523185..6297956507c00fb7e3222070989f25cce9ba2000 100644 (file)
@@ -310,10 +310,6 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = {
        .dma_ops        = &sl82c105_dma_ops,
        .host_flags     = IDE_HFLAG_IO_32BIT |
                          IDE_HFLAG_UNMASK_IRQS |
-/* FIXME: check for Compatibility mode in generic IDE PCI code */
-#if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT)
-                         IDE_HFLAG_FORCE_LEGACY_IRQS |
-#endif
                          IDE_HFLAG_SERIALIZE_DMA |
                          IDE_HFLAG_NO_AUTODMA,
        .pio_mask       = ATA_PIO5,
index b4ef218072cd1629737fb35b4cad89505037fffb..d9095345f7ca989c02c9fe663636c5ffe5987d7d 100644 (file)
@@ -202,7 +202,6 @@ static const struct ide_tp_ops tx4938ide_tp_ops = {
        .exec_command           = ide_exec_command,
        .read_status            = ide_read_status,
        .read_altstatus         = ide_read_altstatus,
-       .read_sff_dma_status    = ide_read_sff_dma_status,
 
        .set_irq                = ide_set_irq,
 
index fecc0e03c3fc96c523025e1d63b3b158546ebb25..703c3eeb20a86dad977333548e7ae2915daa3c9f 100644 (file)
@@ -432,8 +432,6 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
        if (via_clock < 20000 || via_clock > 50000) {
                printk(KERN_WARNING DRV_NAME ": User given PCI clock speed "
                        "impossible (%d), using 33 MHz instead.\n", via_clock);
-               printk(KERN_WARNING DRV_NAME ": Use ide0=ata66 if you want "
-                       "to assume 80-wire cable.\n");
                via_clock = 33333;
        }
 
index 3b77b674cbf61a4caba20fc0fb42daa49f55eda9..c7b8a506af65acac50014f0f189bac7ba5ff0069 100644 (file)
@@ -955,7 +955,7 @@ void ehca_poll_eqs(unsigned long data)
                        struct ehca_eq *eq = &shca->eq;
                        int max = 3;
                        volatile u64 q_ofs, q_ofs2;
-                       u64 flags;
+                       unsigned long flags;
                        spin_lock_irqsave(&eq->spinlock, flags);
                        q_ofs = eq->ipz_queue.current_q_offset;
                        spin_unlock_irqrestore(&eq->spinlock, flags);
index dcefe1fceb5ca9feb00f64aba343204e96e1bf14..61588bd273bd7b3d93f35b6f63eb5ac024c60aa5 100644 (file)
@@ -543,14 +543,21 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 {
        static int mlx4_ib_version_printed;
        struct mlx4_ib_dev *ibdev;
+       int num_ports = 0;
        int i;
 
-
        if (!mlx4_ib_version_printed) {
                printk(KERN_INFO "%s", mlx4_ib_version);
                ++mlx4_ib_version_printed;
        }
 
+       mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
+               num_ports++;
+
+       /* No point in registering a device with no ports... */
+       if (num_ports == 0)
+               return NULL;
+
        ibdev = (struct mlx4_ib_dev *) ib_alloc_device(sizeof *ibdev);
        if (!ibdev) {
                dev_err(&dev->pdev->dev, "Device struct alloc failed\n");
@@ -574,9 +581,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
        ibdev->ib_dev.owner             = THIS_MODULE;
        ibdev->ib_dev.node_type         = RDMA_NODE_IB_CA;
        ibdev->ib_dev.local_dma_lkey    = dev->caps.reserved_lkey;
-       ibdev->num_ports = 0;
-       mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
-               ibdev->num_ports++;
+       ibdev->num_ports                = num_ports;
        ibdev->ib_dev.phys_port_cnt     = ibdev->num_ports;
        ibdev->ib_dev.num_comp_vectors  = dev->caps.num_comp_vectors;
        ibdev->ib_dev.dma_device        = &dev->pdev->dev;
index 6ba57e91d7ab742288208649cd707a845e672572..a01b4488208b20c97a8b0317ecc0b3777a3d5577 100644 (file)
@@ -778,12 +778,13 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
        unsigned long flags;
        struct list_head *hte;
        struct nes_cm_node *cm_node;
+       __be32 tmp_addr = cpu_to_be32(loc_addr);
 
        /* get a handle on the hte */
        hte = &cm_core->connected_nodes;
 
        nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
-                 &loc_addr, loc_port, cm_core, hte);
+                 &tmp_addr, loc_port, cm_core, hte);
 
        /* walk list and find cm_node associated with this session ID */
        spin_lock_irqsave(&cm_core->ht_lock, flags);
@@ -816,6 +817,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
 {
        unsigned long flags;
        struct nes_cm_listener *listen_node;
+       __be32 tmp_addr = cpu_to_be32(dst_addr);
 
        /* walk list and find cm_node associated with this session ID */
        spin_lock_irqsave(&cm_core->listen_list_lock, flags);
@@ -833,7 +835,7 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
        spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
 
        nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
-                 &dst_addr, dst_port);
+                 &tmp_addr, dst_port);
 
        /* no listener */
        return NULL;
@@ -2059,6 +2061,7 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
        struct tcphdr *tcph;
        struct nes_cm_info nfo;
        int skb_handled = 1;
+       __be32 tmp_daddr, tmp_saddr;
 
        if (!skb)
                return 0;
@@ -2074,8 +2077,11 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
        nfo.rem_addr = ntohl(iph->saddr);
        nfo.rem_port = ntohs(tcph->source);
 
+       tmp_daddr = cpu_to_be32(iph->daddr);
+       tmp_saddr = cpu_to_be32(iph->saddr);
+
        nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n",
-                 &iph->daddr, tcph->dest, &iph->saddr, tcph->source);
+                 &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source);
 
        do {
                cm_node = find_node(cm_core,
index aa9b7348c7285a026a7e8831b1ad97f2ed7a00eb..6f3bc1b6bf22b960c170faf55cfa7e740e01fedf 100644 (file)
@@ -655,6 +655,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
        struct nes_adapter *nesadapter = nesdev->nesadapter;
        int arp_index;
        int err = 0;
+       __be32 tmp_addr;
 
        for (arp_index = 0; (u32) arp_index < nesadapter->arp_table_size; arp_index++) {
                if (nesadapter->arp_table[arp_index].ip_addr == ip_addr)
@@ -682,8 +683,9 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
 
        /* DELETE or RESOLVE */
        if (arp_index == nesadapter->arp_table_size) {
+               tmp_addr = cpu_to_be32(ip_addr);
                nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
-                         &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
+                         &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
                return -1;
        }
 
index 19e06bc38b39e88c877aa9d29e49c85bfde9c84e..dce0443f9d693d0396766b657d313169ef652245 100644 (file)
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
                neigh = *to_ipoib_neigh(skb->dst->neighbour);
 
-               if (neigh->ah)
-                       if (unlikely((memcmp(&neigh->dgid.raw,
-                                           skb->dst->neighbour->ha + 4,
-                                           sizeof(union ib_gid))) ||
-                                        (neigh->dev != dev))) {
-                               spin_lock_irqsave(&priv->lock, flags);
-                               /*
-                                * It's safe to call ipoib_put_ah() inside
-                                * priv->lock here, because we know that
-                                * path->ah will always hold one more reference,
-                                * so ipoib_put_ah() will never do more than
-                                * decrement the ref count.
-                                */
+               if (unlikely((memcmp(&neigh->dgid.raw,
+                                    skb->dst->neighbour->ha + 4,
+                                    sizeof(union ib_gid))) ||
+                            (neigh->dev != dev))) {
+                       spin_lock_irqsave(&priv->lock, flags);
+                       /*
+                        * It's safe to call ipoib_put_ah() inside
+                        * priv->lock here, because we know that
+                        * path->ah will always hold one more reference,
+                        * so ipoib_put_ah() will never do more than
+                        * decrement the ref count.
+                        */
+                       if (neigh->ah)
                                ipoib_put_ah(neigh->ah);
-                               list_del(&neigh->list);
-                               ipoib_neigh_free(dev, neigh);
-                               spin_unlock_irqrestore(&priv->lock, flags);
-                               ipoib_path_lookup(skb, dev);
-                               return NETDEV_TX_OK;
-                       }
+                       list_del(&neigh->list);
+                       ipoib_neigh_free(dev, neigh);
+                       spin_unlock_irqrestore(&priv->lock, flags);
+                       ipoib_path_lookup(skb, dev);
+                       return NETDEV_TX_OK;
+               }
 
                if (ipoib_cm_get(neigh)) {
                        if (ipoib_cm_up(neigh)) {
index a2eb3b9789ebabb08f69f3b0421128900db22bd6..59d02e0b8df168aa8698e56008bdfc5f518282bb 100644 (file)
@@ -529,6 +529,9 @@ void ipoib_mcast_join_task(struct work_struct *work)
        if (!priv->broadcast) {
                struct ipoib_mcast *broadcast;
 
+               if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
+                       return;
+
                broadcast = ipoib_mcast_alloc(dev, 1);
                if (!broadcast) {
                        ipoib_warn(priv, "failed to allocate broadcast group\n");
index 77dedba829e6c5549ab495b8c2f23f2a0c782839..b411c51842daa7c938e917c2828d2174aad97b7d 100644 (file)
@@ -1,6 +1,6 @@
 config INFINIBAND_ISER
        tristate "iSCSI Extensions for RDMA (iSER)"
-       depends on SCSI && INET
+       depends on SCSI && INET && INFINIBAND_ADDR_TRANS
        select SCSI_ISCSI_ATTRS
        ---help---
          Support for the iSCSI Extensions for RDMA (iSER) Protocol
index a4a1ae2146300b0f87ba8dc6526d46d5db16606a..742713611bc5c1fb10a5a6a898c5437411668615 100644 (file)
@@ -119,13 +119,6 @@ config LEDS_GPIO
          outputs. To be useful the particular board must have LEDs
          and they must be connected to the GPIO lines.
 
-config LEDS_HP_DISK
-       tristate "LED Support for disk protection LED on HP notebooks"
-       depends on LEDS_CLASS && ACPI
-       help
-         This option enable support for disk protection LED, found on
-         newer HP notebooks.
-
 config LEDS_CLEVO_MAIL
        tristate "Mail LED on Clevo notebook (EXPERIMENTAL)"
        depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI && EXPERIMENTAL
index bc247cb02e8269857d71b4fca63de1d99801e22b..9d76f0f160a43323101ead59a16db80d0865ce14 100644 (file)
@@ -23,7 +23,6 @@ obj-$(CONFIG_LEDS_HP6XX)              += leds-hp6xx.o
 obj-$(CONFIG_LEDS_FSG)                 += leds-fsg.o
 obj-$(CONFIG_LEDS_PCA955X)             += leds-pca955x.o
 obj-$(CONFIG_LEDS_DA903X)              += leds-da903x.o
-obj-$(CONFIG_LEDS_HP_DISK)             += leds-hp-disk.o
 obj-$(CONFIG_LEDS_WM8350)              += leds-wm8350.o
 
 # LED Triggers
diff --git a/drivers/leds/leds-hp-disk.c b/drivers/leds/leds-hp-disk.c
deleted file mode 100644 (file)
index d786adc..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *  leds-hp-disk.c - driver for HP "hard disk protection" LED
- *
- *  Copyright (C) 2008 Pavel Machek
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/kthread.h>
-#include <linux/leds.h>
-#include <acpi/acpi_drivers.h>
-
-#define DRIVER_NAME     "leds-hp-disk"
-#define ACPI_MDPS_CLASS "led"
-
-/* For automatic insertion of the module */
-static struct acpi_device_id hpled_device_ids[] = {
-       {"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */
-       {"", 0},
-};
-MODULE_DEVICE_TABLE(acpi, hpled_device_ids);
-
-struct acpi_hpled {
-       struct acpi_device      *device;   /* The ACPI device */
-};
-
-static struct acpi_hpled adev;
-
-static acpi_status hpled_acpi_write(acpi_handle handle, int reg)
-{
-       unsigned long long ret; /* Not used when writing */
-       union acpi_object in_obj[1];
-       struct acpi_object_list args = { 1, in_obj };
-
-       in_obj[0].type          = ACPI_TYPE_INTEGER;
-       in_obj[0].integer.value = reg;
-
-       return acpi_evaluate_integer(handle, "ALED", &args, &ret);
-}
-
-static void hpled_set(struct led_classdev *led_cdev,
-                              enum led_brightness value)
-{
-       hpled_acpi_write(adev.device->handle, !!value);
-}
-
-static struct led_classdev hpled_led = {
-       .name                   = "hp:red:hddprotection",
-       .default_trigger        = "heartbeat",
-       .brightness_set         = hpled_set,
-       .flags                  = LED_CORE_SUSPENDRESUME,
-};
-
-static int hpled_add(struct acpi_device *device)
-{
-       int ret;
-
-       if (!device)
-               return -EINVAL;
-
-       adev.device = device;
-       strcpy(acpi_device_name(device), DRIVER_NAME);
-       strcpy(acpi_device_class(device), ACPI_MDPS_CLASS);
-       device->driver_data = &adev;
-
-       ret = led_classdev_register(NULL, &hpled_led);
-       return ret;
-}
-
-static int hpled_remove(struct acpi_device *device, int type)
-{
-       if (!device)
-               return -EINVAL;
-
-       led_classdev_unregister(&hpled_led);
-       return 0;
-}
-
-
-
-static struct acpi_driver leds_hp_driver = {
-       .name  = DRIVER_NAME,
-       .class = ACPI_MDPS_CLASS,
-       .ids   = hpled_device_ids,
-       .ops = {
-               .add     = hpled_add,
-               .remove  = hpled_remove,
-       }
-};
-
-static int __init hpled_init_module(void)
-{
-       int ret;
-
-       if (acpi_disabled)
-               return -ENODEV;
-
-       ret = acpi_bus_register_driver(&leds_hp_driver);
-       if (ret < 0)
-               return ret;
-
-       printk(KERN_INFO DRIVER_NAME " driver loaded.\n");
-
-       return 0;
-}
-
-static void __exit hpled_exit_module(void)
-{
-       acpi_bus_unregister_driver(&leds_hp_driver);
-}
-
-MODULE_DESCRIPTION("Driver for HP disk protection LED");
-MODULE_AUTHOR("Pavel Machek <pavel@suse.cz>");
-MODULE_LICENSE("GPL");
-
-module_init(hpled_init_module);
-module_exit(hpled_exit_module);
index 10b6ef7587256902ee8f7a469679fe0ed92b806e..11c0f461320eb71390026dfaaae1ceb40b42d86a 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Message independent structures and definitions
  *  Creation Date:  July 27, 2000
  *
- *    mpi.h Version:  01.05.13
+ *    mpi.h Version:  01.05.16
  *
  *  Version History
  *  ---------------
@@ -79,6 +79,9 @@
  *  03-27-06  01.05.11  Bumped MPI_HEADER_VERSION_UNIT.
  *  10-11-06  01.05.12  Bumped MPI_HEADER_VERSION_UNIT.
  *  05-24-07  01.05.13  Bumped MPI_HEADER_VERSION_UNIT.
+ *  08-07-07  01.05.14  Bumped MPI_HEADER_VERSION_UNIT.
+ *  01-15-08  01.05.15  Bumped MPI_HEADER_VERSION_UNIT.
+ *  03-28-08  01.05.16  Bumped MPI_HEADER_VERSION_UNIT.
  *  --------------------------------------------------------------------------
  */
 
 /* Note: The major versions of 0xe0 through 0xff are reserved */
 
 /* versioning for this MPI header set */
-#define MPI_HEADER_VERSION_UNIT             (0x10)
+#define MPI_HEADER_VERSION_UNIT             (0x13)
 #define MPI_HEADER_VERSION_DEV              (0x00)
 #define MPI_HEADER_VERSION_UNIT_MASK        (0xFF00)
 #define MPI_HEADER_VERSION_UNIT_SHIFT       (8)
index b2db3330c5910c9f10278da6cd6111355df85ae4..013c7d88194845e170077ea3cc4f2607f3363a4b 100644 (file)
@@ -6,7 +6,7 @@
  *          Title:  MPI Config message, structures, and Pages
  *  Creation Date:  July 27, 2000
  *
- *    mpi_cnfg.h Version:  01.05.15
+ *    mpi_cnfg.h Version:  01.05.18
  *
  *  Version History
  *  ---------------
  *                      Expander Page 0 Flags field.
  *                      Fixed define for
  *                      MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED.
+ *  08-07-07  01.05.16  Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT
+ *                      define.
+ *                      Added BIOS Page 4 structure.
+ *                      Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID
+ *                      Physcial Disk Page 1.
+ *  01-15-07  01.05.17  Added additional bit defines for ExtFlags field of
+ *                      Manufacturing Page 4.
+ *                      Added Solid State Drives Supported bit to IOC Page 6
+ *                      Capabilities Flags.
+ *                      Added new value for AccessStatus field of SAS Device
+ *                      Page 0 (_SATA_NEEDS_INITIALIZATION).
+ *  03-28-08  01.05.18  Defined new bits in Manufacturing Page 4 ExtFlags field
+ *                      to control coercion size and the mixing of SAS and SATA
+ *                      SSD drives.
  *  --------------------------------------------------------------------------
  */
 
@@ -686,6 +700,14 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
 #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA                 (0x01)
 
 /* defines for the ExtFlags field */
+#define MPI_MANPAGE4_EXTFLAGS_MASK_COERCION_SIZE        (0x0180)
+#define MPI_MANPAGE4_EXTFLAGS_SHIFT_COERCION_SIZE       (7)
+#define MPI_MANPAGE4_EXTFLAGS_1GB_COERCION_SIZE         (0)
+#define MPI_MANPAGE4_EXTFLAGS_128MB_COERCION_SIZE       (1)
+
+#define MPI_MANPAGE4_EXTFLAGS_NO_MIX_SSD_SAS_SATA       (0x0040)
+#define MPI_MANPAGE4_EXTFLAGS_MIX_SSD_AND_NON_SSD       (0x0020)
+#define MPI_MANPAGE4_EXTFLAGS_DUAL_PORT_SUPPORT         (0x0010)
 #define MPI_MANPAGE4_EXTFLAGS_HIDE_NON_IR_METADATA      (0x0008)
 #define MPI_MANPAGE4_EXTFLAGS_SAS_CACHE_DISABLE         (0x0004)
 #define MPI_MANPAGE4_EXTFLAGS_SATA_CACHE_DISABLE        (0x0002)
@@ -1159,6 +1181,8 @@ typedef struct _CONFIG_PAGE_IOC_6
 
 /* IOC Page 6 Capabilities Flags */
 
+#define MPI_IOCPAGE6_CAP_FLAGS_SSD_SUPPORT              (0x00000020)
+#define MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT  (0x00000010)
 #define MPI_IOCPAGE6_CAP_FLAGS_DISABLE_SMART_POLLING    (0x00000008)
 
 #define MPI_IOCPAGE6_CAP_FLAGS_MASK_METADATA_SIZE       (0x00000006)
@@ -1428,6 +1452,15 @@ typedef struct _CONFIG_PAGE_BIOS_2
 #define MPI_BIOSPAGE2_FORM_SAS_WWN                      (0x05)
 #define MPI_BIOSPAGE2_FORM_ENCLOSURE_SLOT               (0x06)
 
+typedef struct _CONFIG_PAGE_BIOS_4
+{
+    CONFIG_PAGE_HEADER      Header;                     /* 00h */
+    U64                     ReassignmentBaseWWID;       /* 04h */
+} CONFIG_PAGE_BIOS_4, MPI_POINTER PTR_CONFIG_PAGE_BIOS_4,
+  BIOSPage4_t, MPI_POINTER pBIOSPage4_t;
+
+#define MPI_BIOSPAGE4_PAGEVERSION                       (0x00)
+
 
 /****************************************************************************
 *   SCSI Port Config Pages
@@ -2419,6 +2452,15 @@ typedef struct _RAID_PHYS_DISK1_PATH
 #define MPI_RAID_PHYSDISK1_FLAG_BROKEN          (0x0002)
 #define MPI_RAID_PHYSDISK1_FLAG_INVALID         (0x0001)
 
+
+/*
+ * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
+ * one and check Header.PageLength or NumPhysDiskPaths at runtime.
+ */
+#ifndef MPI_RAID_PHYS_DISK1_PATH_MAX
+#define MPI_RAID_PHYS_DISK1_PATH_MAX    (1)
+#endif
+
 typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
 {
     CONFIG_PAGE_HEADER              Header;             /* 00h */
@@ -2426,7 +2468,7 @@ typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
     U8                              PhysDiskNum;        /* 05h */
     U16                             Reserved2;          /* 06h */
     U32                             Reserved1;          /* 08h */
-    RAID_PHYS_DISK1_PATH            Path[1];            /* 0Ch */
+    RAID_PHYS_DISK1_PATH            Path[MPI_RAID_PHYS_DISK1_PATH_MAX];/* 0Ch */
 } CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1,
   RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t;
 
@@ -2844,6 +2886,7 @@ typedef struct _CONFIG_PAGE_SAS_DEVICE_0
 #define MPI_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED            (0x01)
 #define MPI_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED      (0x02)
 #define MPI_SAS_DEVICE0_ASTATUS_SATA_AFFILIATION_CONFLICT   (0x03)
+#define MPI_SAS_DEVICE0_ASTATUS_SATA_NEEDS_INITIALIZATION   (0x04)
 /* specific values for SATA Init failures */
 #define MPI_SAS_DEVICE0_ASTATUS_SIF_UNKNOWN                 (0x10)
 #define MPI_SAS_DEVICE0_ASTATUS_SIF_AFFILIATION_CONFLICT    (0x11)
index 627acfbb86231fc7ea07fb6b95d2b5e83629382f..7d663ce76f8c90fdeaa193f88381e7afb37cf602 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2004 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_fc.h
index 3f15fcfe4a2ea96e1c4ea4bd8d08beaeb26266a7..693e4b511354fb0b227d28c1b517d428667d39f6 100644 (file)
@@ -3,28 +3,28 @@
  MPI Header File Change History
  ==============================
 
- Copyright (c) 2000-2007 LSI Corporation.
+ Copyright (c) 2000-2008 LSI Corporation.
 
  ---------------------------------------
- Header Set Release Version:    01.05.16
- Header Set Release Date:       05-24-07
+ Header Set Release Version:    01.05.19
+ Header Set Release Date:       03-28-08
  ---------------------------------------
 
  Filename               Current version     Prior version
  ----------             ---------------     -------------
- mpi.h                  01.05.13            01.05.12
- mpi_ioc.h              01.05.14            01.05.13
- mpi_cnfg.h             01.05.15            01.05.14
+ mpi.h                  01.05.16            01.05.15
+ mpi_ioc.h              01.05.16            01.05.15
+ mpi_cnfg.h             01.05.18            01.05.17
  mpi_init.h             01.05.09            01.05.09
  mpi_targ.h             01.05.06            01.05.06
  mpi_fc.h               01.05.01            01.05.01
  mpi_lan.h              01.05.01            01.05.01
- mpi_raid.h             01.05.03            01.05.03
+ mpi_raid.h             01.05.05            01.05.05
  mpi_tool.h             01.05.03            01.05.03
  mpi_inb.h              01.05.01            01.05.01
- mpi_sas.h              01.05.04            01.05.04
+ mpi_sas.h              01.05.05            01.05.05
  mpi_type.h             01.05.02            01.05.02
- mpi_history.txt        01.05.14            01.05.14
+ mpi_history.txt        01.05.19            01.05.18
 
 
  *  Date      Version   Description
@@ -96,6 +96,9 @@ mpi.h
  *  03-27-06  01.05.11  Bumped MPI_HEADER_VERSION_UNIT.
  *  10-11-06  01.05.12  Bumped MPI_HEADER_VERSION_UNIT.
  *  05-24-07  01.05.13  Bumped MPI_HEADER_VERSION_UNIT.
+ *  08-07-07  01.05.14  Bumped MPI_HEADER_VERSION_UNIT.
+ *  01-15-08  01.05.15  Bumped MPI_HEADER_VERSION_UNIT.
+ *  03-28-08  01.05.16  Bumped MPI_HEADER_VERSION_UNIT.
  *  --------------------------------------------------------------------------
 
 mpi_ioc.h
@@ -127,7 +130,7 @@ mpi_ioc.h
  *  08-08-01  01.02.01  Original release for v1.2 work.
  *                      New format for FWVersion and ProductId in
  *                      MSG_IOC_FACTS_REPLY and MPI_FW_HEADER.
- *  08-31-01  01.02.02  Added event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
+ *  08-31-01  01.02.02  Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
  *                      related structure and defines.
  *                      Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED.
  *                      Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE.
@@ -187,7 +190,7 @@ mpi_ioc.h
  *  10-11-06  01.05.12  Added MPI_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED.
  *                      Added MaxInitiators field to PortFacts reply.
  *                      Added SAS Device Status Change ReasonCode for
- *                      asynchronous notification.
+ *                      asynchronous notificaiton.
  *                      Added MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE and event
  *                      data structure.
  *                      Added new ImageType values for FWDownload and FWUpload
@@ -199,6 +202,16 @@ mpi_ioc.h
  *                      added _MULTI_PORT_DOMAIN.
  *  05-24-07  01.05.14  Added Common Boot Block type to FWDownload Request.
  *                      Added Common Boot Block type to FWUpload Request.
+ *  08-07-07  01.05.15  Added MPI_EVENT_SAS_INIT_RC_REMOVED define.
+ *                      Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and
+ *                      MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data.
+ *                      Added SASAddress field to SAS Initiator Device Table
+ *                      Overflow event data structure.
+ *  03-28-08  01.05.16  Added two new ReasonCode values to SAS Device Status
+ *                      Change Event data to indicate completion of internally
+ *                      generated task management.
+ *                      Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define.
+ *                      Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define.
  *  --------------------------------------------------------------------------
 
 mpi_cnfg.h
@@ -213,7 +226,7 @@ mpi_cnfg.h
  *                      Added _RESPONSE_ID_MASK definition to SCSI_PORT_1
  *                      page and updated the page version.
  *                      Added Information field and _INFO_PARAMS_NEGOTIATED
- *                      definition to SCSI_DEVICE_0 page.
+ *                      definitionto SCSI_DEVICE_0 page.
  *  06-22-00  01.00.03  Removed batch controls from LAN_0 page and updated the
  *                      page version.
  *                      Added BucketsRemaining to LAN_1 page, redefined the
@@ -496,6 +509,20 @@ mpi_cnfg.h
  *                      Expander Page 0 Flags field.
  *                      Fixed define for
  *                      MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED.
+ *  08-07-07  01.05.16  Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT
+ *                      define.
+ *                      Added BIOS Page 4 structure.
+ *                      Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID
+ *                      Physcial Disk Page 1.
+ *  01-15-07  01.05.17  Added additional bit defines for ExtFlags field of
+ *                      Manufacturing Page 4.
+ *                      Added Solid State Drives Supported bit to IOC Page 6
+ *                      Capabilities Flags.
+ *                      Added new value for AccessStatus field of SAS Device
+ *                      Page 0 (_SATA_NEEDS_INITIALIZATION).
+ *  03-28-08  01.05.18  Defined new bits in Manufacturing Page 4 ExtFlags field
+ *                      to control coercion size and the mixing of SAS and SATA
+ *                      SSD drives.
  *  --------------------------------------------------------------------------
 
 mpi_init.h
@@ -661,6 +688,9 @@ mpi_raid.h
  *                      _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
  *  02-28-07  01.05.03  Added new RAID Action, Device FW Update Mode, and
  *                      associated defines.
+ *  08-07-07  01.05.04  Added Disable Full Rebuild bit to the ActionDataWord
+ *                      for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME.
+ *  01-15-08  01.05.05  Added define for MPI_RAID_ACTION_SET_VOLUME_NAME.
  *  --------------------------------------------------------------------------
 
 mpi_tool.h
@@ -694,6 +724,10 @@ mpi_sas.h
  *                      reply.
  *  10-11-06  01.05.04  Fixed the name of a define for Operation field of SAS IO
  *                      Unit Control request.
+ *  01-15-08  01.05.05  Added support for MPI_SAS_OP_SET_IOC_PARAMETER,
+ *                      including adding IOCParameter and IOCParameter value
+ *                      fields to SAS IO Unit Control Request.
+ *                      Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define.
  *  --------------------------------------------------------------------------
 
 mpi_type.h
@@ -709,20 +743,20 @@ mpi_type.h
 
 mpi_history.txt         Parts list history
 
-Filename    01.05.15   01.05.15
-----------  --------   --------
-mpi.h       01.05.12   01.05.13
-mpi_ioc.h   01.05.13   01.05.14
-mpi_cnfg.h  01.05.14   01.05.15
-mpi_init.h  01.05.09   01.05.09
-mpi_targ.h  01.05.06   01.05.06
-mpi_fc.h    01.05.01   01.05.01
-mpi_lan.h   01.05.01   01.05.01
-mpi_raid.h  01.05.03   01.05.03
-mpi_tool.h  01.05.03   01.05.03
-mpi_inb.h   01.05.01   01.05.01
-mpi_sas.h   01.05.04   01.05.04
-mpi_type.h  01.05.02   01.05.02
+Filename    01.05.19   01.05.18   01.05.17   01.05.16   01.05.15
+----------  --------   --------   --------   --------   --------
+mpi.h       01.05.16   01.05.15   01.05.14   01.05.13   01.05.12
+mpi_ioc.h   01.05.16   01.05.15   01.05.15   01.05.14   01.05.13
+mpi_cnfg.h  01.05.18   01.05.17   01.05.16   01.05.15   01.05.14
+mpi_init.h  01.05.09   01.05.09   01.05.09   01.05.09   01.05.09
+mpi_targ.h  01.05.06   01.05.06   01.05.06   01.05.06   01.05.06
+mpi_fc.h    01.05.01   01.05.01   01.05.01   01.05.01   01.05.01
+mpi_lan.h   01.05.01   01.05.01   01.05.01   01.05.01   01.05.01
+mpi_raid.h  01.05.05   01.05.05   01.05.04   01.05.03   01.05.03
+mpi_tool.h  01.05.03   01.05.03   01.05.03   01.05.03   01.05.03
+mpi_inb.h   01.05.01   01.05.01   01.05.01   01.05.01   01.05.01
+mpi_sas.h   01.05.05   01.05.05   01.05.04   01.05.04   01.05.04
+mpi_type.h  01.05.02   01.05.02   01.05.02   01.05.02   01.05.02
 
 Filename    01.05.14   01.05.13   01.05.12   01.05.11   01.05.10   01.05.09
 ----------  --------   --------   --------   --------   --------   --------
index a9e3693601a7e57daeea38128256020328490b27..4295d062caa747b3822aac1a07807bc9266d0292 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2007 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_init.h
index 5cbb6bd048e146ae2e508661edfe9272b82ae31c..8faa4fab7b89d89df0cacab602fd7e00d49ffdff 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2000-2007 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_ioc.h
  *          Title:  MPI IOC, Port, Event, FW Download, and FW Upload messages
  *  Creation Date:  August 11, 2000
  *
- *    mpi_ioc.h Version:  01.05.14
+ *    mpi_ioc.h Version:  01.05.16
  *
  *  Version History
  *  ---------------
  *                      added _MULTI_PORT_DOMAIN.
  *  05-24-07  01.05.14  Added Common Boot Block type to FWDownload Request.
  *                      Added Common Boot Block type to FWUpload Request.
+ *  08-07-07  01.05.15  Added MPI_EVENT_SAS_INIT_RC_REMOVED define.
+ *                      Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and
+ *                      MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data.
+ *                      Added SASAddress field to SAS Initiator Device Table
+ *                      Overflow event data structure.
+ *  03-28-08  01.05.16  Added two new ReasonCode values to SAS Device Status
+ *                      Change Event data to indicate completion of internally
+ *                      generated task management.
+ *                      Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define.
+ *                      Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define.
  *  --------------------------------------------------------------------------
  */
 
@@ -612,6 +622,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
 #define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL   (0x0B)
 #define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL       (0x0C)
 #define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION        (0x0D)
+#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET   (0x0E)
+#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL  (0x0F)
 
 
 /* SCSI Event data for Queue Full event */
@@ -708,6 +720,8 @@ typedef struct _MPI_EVENT_DATA_IR2
 #define MPI_EVENT_IR2_RC_PD_REMOVED                 (0x05)
 #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED       (0x06)
 #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR       (0x07)
+#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED            (0x08)
+#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED          (0x09)
 
 /* defines for logical disk states */
 #define MPI_LD_STATE_OPTIMAL                        (0x00)
@@ -867,6 +881,7 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR
 #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE          (0x00000800)
 #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS            (0x00001000)
 #define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN           (0x00002000)
+#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE           (0x00004000)
 
 /* SAS SMP Error Event data */
 
@@ -902,6 +917,8 @@ typedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE
 
 /* defines for the ReasonCode field of the SAS Initiator Device Status Change event */
 #define MPI_EVENT_SAS_INIT_RC_ADDED                 (0x01)
+#define MPI_EVENT_SAS_INIT_RC_REMOVED               (0x02)
+#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE          (0x03)
 
 /* SAS Initiator Device Table Overflow Event data */
 
@@ -910,6 +927,7 @@ typedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW
     U8                      MaxInit;                    /* 00h */
     U8                      CurrentInit;                /* 01h */
     U16                     Reserved1;                  /* 02h */
+    U64                     SASAddress;                 /* 04h */
 } EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
   MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
   MpiEventDataSasInitTableOverflow_t,
index 03253b53b7855d8b7a7d279bf677653ab5d3ab16..f41fcb69b359912e6d0e39e0aabffa0999e2a608 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2004 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_lan.h
index e4dafcefeecde600d951ea8e95445e875f489352..face6e7acc728109f79827d88094463d7892ce86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2001 LSI Corporation. All rights reserved.
+ *  Copyright (c) 2000-2008 LSI Corporation. All rights reserved.
  *
  *  NAME:           fc_log.h
  *  SUMMARY:        MPI IocLogInfo definitions for the SYMFC9xx chips
index af9da03e95e571f7677f5092d6dd7e123eedd59a..691620dbedd20ddfbac3b75aaa3fb8f109241f41 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *                                                                         *
- *  Copyright 2003 LSI Corporation.  All rights reserved.            *
+ *  Copyright (c) 2000-2008 LSI Corporation.  All rights reserved.         *
  *                                                                         *
  * Description                                                             *
  * ------------                                                            *
@@ -73,6 +73,8 @@
 #define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO          (0x00070004)
 #define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO_REQ      (0x00070005)
 
+#define IOP_LOGINFO_CODE_LOG_TIMESTAMP_EVENT                 (0x00080000)
+
 /****************************************************************************/
 /* PL LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = PL            */
 /****************************************************************************/
@@ -92,7 +94,7 @@
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_OPEN_TIMEOUT_EXP       (0x0000000C)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_UNUSED_0D              (0x0000000D)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_DVTBLE_ACCSS_FAIL      (0x0000000E)
-#define PL_LOGINFO_SUB CODE_OPEN_FAIL_BAD_DEST               (0x00000011)
+#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_BAD_DEST               (0x00000011)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RATE_NOT_SUPP          (0x00000012)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_PROT_NOT_SUPP          (0x00000013)
 #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON0      (0x00000014)
 
 #define PL_LOGINFO_SUB_CODE_INVALID_SGL                      (0x00000200)
 #define PL_LOGINFO_SUB_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH    (0x00000300)
-#define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR                 (0x00000400) /* Bits 0-3 encode Transport Status Register (offset 0x08) */
-                                                                          /* Bit 0 is Status Bit 0: FrameXferErr */
-                                                                          /* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */
-                                                                          /* Bit 3 is Status Bit 18 WriteDataLengthGTDataLengthErr */
+#define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR                 (0x00000400)
+/* Bits 0-3 encode Transport Status Register (offset 0x08) */
+/* Bit 0 is Status Bit 0: FrameXferErr */
+/* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */
+/* Bit 3 is Status Bit 18 WriteDataLenghtGTDataLengthErr */
 
 #define PL_LOGINFO_SUB_CODE_TX_FM_CONNECTED_LOW              (0x00000500)
 #define PL_LOGINFO_SUB_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET      (0x00000600)
 #define PL_LOGINFO_SUB_CODE_DISCOVERY_REMOTE_SEP_RESET       (0x00000E01)
 #define PL_LOGINFO_SUB_CODE_SECOND_OPEN                      (0x00000F00)
 #define PL_LOGINFO_SUB_CODE_DSCVRY_SATA_INIT_TIMEOUT         (0x00001000)
+#define PL_LOGINFO_SUB_CODE_BREAK_ON_SATA_CONNECTION         (0x00002000)
+/* not currently used in mainline */
+#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK              (0x00003000)
+#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK_AIP          (0x00004000)
+#define PL_LOGINFO_SUB_CODE_BREAK_ON_INCOMPLETE_BREAK_RCVD   (0x00005000)
 
 #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_FRAME_FAILURE          (0x00200000) /* Can't get SMP Frame */
 #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_READ_ERROR             (0x00200010) /* Error occured on SMP Read */
 #define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED               (0x00010014)
 /* Activation failed trying to import the volume */
 #define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED      (0x00010015)
+/* Activation failed trying to import the volume */
+#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_PHYS_DISKS       (0x00010016)
 
 /* Phys Disk failed, too many phys disks */
 #define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS              (0x00010020)
 /* Compatibility Error : IME size limited to < 2TB */
 #define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D)
 
+/* Device Firmware Update: DFU can only be started once */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DFU_IN_PROGRESS            (0x00010050)
+/* Device Firmware Update: Volume must be Optimal/Active/non-Quiesced */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DEVICE_IN_INVALID_STATE    (0x00010051)
+/* Device Firmware Update: DFU Timeout cannot be zero */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_INVALID_TIMEOUT            (0x00010052)
+/* Device Firmware Update: CREATE TIMER FAILED */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_NO_TIMERS                  (0x00010053)
+/* Device Firmware Update: Failed to read SAS_IO_UNIT_PG_1 */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_READING_CFG_PAGE           (0x00010054)
+/* Device Firmware Update: Invalid SAS_IO_UNIT_PG_1 value(s) */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_PORT_IO_TIMEOUTS_REQUIRED  (0x00010055)
+/* Device Firmware Update: Unable to allocate memory for page */
+#define IR_LOGINFO_DEV_FW_UPDATE_ERR_ALLOC_CFG_PAGE             (0x00010056)
+
 
 /****************************************************************************/
 /* Defines for convenience                                                  */
index 2856108421d71fa1b88d73a45e7f38765cf012d8..add60cc85be136148f7f2649e198026cf415d336 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2001-2007 LSI Corporation.
+ *  Copyright (c) 2001-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_raid.h
  *          Title:  MPI RAID message and structures
  *  Creation Date:  February 27, 2001
  *
- *    mpi_raid.h Version:  01.05.03
+ *    mpi_raid.h Version:  01.05.05
  *
  *  Version History
  *  ---------------
@@ -34,6 +34,9 @@
  *                      _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
  *  02-28-07  01.05.03  Added new RAID Action, Device FW Update Mode, and
  *                      associated defines.
+ *  08-07-07  01.05.04  Added Disable Full Rebuild bit to the ActionDataWord
+ *                      for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME.
+ *  01-15-08  01.05.05  Added define for MPI_RAID_ACTION_SET_VOLUME_NAME.
  *  --------------------------------------------------------------------------
  */
 
@@ -93,6 +96,7 @@ typedef struct _MSG_RAID_ACTION
 #define MPI_RAID_ACTION_SET_RESYNC_RATE             (0x13)
 #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE         (0x14)
 #define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE       (0x15)
+#define MPI_RAID_ACTION_SET_VOLUME_NAME             (0x16)
 
 /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
 #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC           (0x00000001)
@@ -105,6 +109,9 @@ typedef struct _MSG_RAID_ACTION
 #define MPI_RAID_ACTION_ADATA_KEEP_LBA0             (0x00000000)
 #define MPI_RAID_ACTION_ADATA_ZERO_LBA0             (0x00000002)
 
+/* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */
+#define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD  (0x00000001)
+
 /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
 #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL        (0x00000001)
 
index 33fca83cefc24f86286712979c4102d4ea71a3cc..ab410036bbfccc9514fad1a58b3437d26a89afb0 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2004-2006 LSI Corporation.
+ *  Copyright (c) 2004-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_sas.h
  *          Title:  MPI Serial Attached SCSI structures and definitions
  *  Creation Date:  August 19, 2004
  *
- *    mpi_sas.h Version:  01.05.04
+ *    mpi_sas.h Version:  01.05.05
  *
  *  Version History
  *  ---------------
  *                      reply.
  *  10-11-06  01.05.04  Fixed the name of a define for Operation field of SAS IO
  *                      Unit Control request.
+ *  01-15-08  01.05.05  Added support for MPI_SAS_OP_SET_IOC_PARAMETER,
+ *                      including adding IOCParameter and IOCParameter value
+ *                      fields to SAS IO Unit Control Request.
+ *                      Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define.
  *  --------------------------------------------------------------------------
  */
 
@@ -60,6 +64,8 @@
  * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
  * data and SAS IO Unit Configuration pages.
  */
+#define MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC    (0xF0000000)
+
 #define MPI_SAS_DEVICE_INFO_SEP                 (0x00004000)
 #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE        (0x00002000)
 #define MPI_SAS_DEVICE_INFO_LSI_DEVICE          (0x00001000)
@@ -216,7 +222,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
     U8                      ChainOffset;        /* 02h */
     U8                      Function;           /* 03h */
     U16                     DevHandle;          /* 04h */
-    U8                      Reserved3;          /* 06h */
+    U8                      IOCParameter;       /* 06h */
     U8                      MsgFlags;           /* 07h */
     U32                     MsgContext;         /* 08h */
     U8                      TargetID;           /* 0Ch */
@@ -225,7 +231,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
     U8                      PrimFlags;          /* 0Fh */
     U32                     Primitive;          /* 10h */
     U64                     SASAddress;         /* 14h */
-    U32                     Reserved4;          /* 1Ch */
+    U32                     IOCParameterValue;  /* 1Ch */
 } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
   SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
 
@@ -241,6 +247,8 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
 #define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL  (0x0C)
 #define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE       (0x0D)  /* obsolete name */
 #define MPI_SAS_OP_REMOVE_DEVICE                (0x0D)
+#define MPI_SAS_OP_SET_IOC_PARAMETER            (0x0E)
+#define MPI_SAS_OP_PRODUCT_SPECIFIC_MIN         (0x80)
 
 /* values for the PrimFlags field */
 #define MPI_SAS_PRIMFLAGS_SINGLE                (0x08)
@@ -256,7 +264,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
     U8                      MsgLength;          /* 02h */
     U8                      Function;           /* 03h */
     U16                     DevHandle;          /* 04h */
-    U8                      Reserved3;          /* 06h */
+    U8                      IOCParameter;       /* 06h */
     U8                      MsgFlags;           /* 07h */
     U32                     MsgContext;         /* 08h */
     U16                     Reserved4;          /* 0Ch */
index ff8c37d3fdcb8e6a4fd660dddcaa70942cbb5186..c3dea7f6909d8d9053cb8251fbcdef5554b65ad1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2000-2004 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_targ.h
index 8834ae6ce0f2b7cd66691729032829c5147f0f8d..53cd715aa7e4c4933f1dc8d63e30ee4fc41b4311 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2001-2005 LSI Corporation.
+ *  Copyright (c) 2001-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_tool.h
index 08dad9c1e4465e9bd3db4c03fe4c16bfeb0df621..888b26dbc41345dd08fd461c13b80b96f8dd7a52 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2000-2004 LSI Corporation.
+ *  Copyright (c) 2000-2008 LSI Corporation.
  *
  *
  *           Name:  mpi_type.h
  *          Title:  MPI Basic type definitions
  *  Creation Date:  June 6, 2000
  *
- *    mpi_type.h Version:  01.05.01
+ *    mpi_type.h Version:  01.05.02
  *
  *  Version History
  *  ---------------
index c4e8b9aa3827b3c46b1c2f8cc80c9a98ba834449..96ac88317b8ecbadd702a3934c883b579e50aa49 100644 (file)
@@ -79,9 +79,22 @@ MODULE_VERSION(my_VERSION);
 /*
  *  cmd line parameters
  */
-static int mpt_msi_enable = -1;
-module_param(mpt_msi_enable, int, 0);
-MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)");
+
+static int mpt_msi_enable_spi;
+module_param(mpt_msi_enable_spi, int, 0);
+MODULE_PARM_DESC(mpt_msi_enable_spi, " Enable MSI Support for SPI \
+               controllers (default=0)");
+
+static int mpt_msi_enable_fc;
+module_param(mpt_msi_enable_fc, int, 0);
+MODULE_PARM_DESC(mpt_msi_enable_fc, " Enable MSI Support for FC \
+               controllers (default=0)");
+
+static int mpt_msi_enable_sas;
+module_param(mpt_msi_enable_sas, int, 1);
+MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \
+               controllers (default=1)");
+
 
 static int mpt_channel_mapping;
 module_param(mpt_channel_mapping, int, 0);
@@ -91,7 +104,17 @@ static int mpt_debug_level;
 static int mpt_set_debug_level(const char *val, struct kernel_param *kp);
 module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
                  &mpt_debug_level, 0600);
-MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)");
+MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \
+       - (default=0)");
+
+int mpt_fwfault_debug;
+EXPORT_SYMBOL(mpt_fwfault_debug);
+module_param_call(mpt_fwfault_debug, param_set_int, param_get_int,
+         &mpt_fwfault_debug, 0600);
+MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault"
+       " and halt Firmware on fault - (default=0)");
+
+
 
 #ifdef MFCNT
 static int mfcounter = 0;
@@ -1751,16 +1774,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
                ioc->bus_type = SAS;
        }
 
-       if (mpt_msi_enable == -1) {
-               /* Enable on SAS, disable on FC and SPI */
-               if (ioc->bus_type == SAS)
-                       ioc->msi_enable = 1;
-               else
-                       ioc->msi_enable = 0;
-       } else
-               /* follow flag: 0 - disable; 1 - enable */
-               ioc->msi_enable = mpt_msi_enable;
 
+       switch (ioc->bus_type) {
+
+       case SAS:
+               ioc->msi_enable = mpt_msi_enable_sas;
+               break;
+
+       case SPI:
+               ioc->msi_enable = mpt_msi_enable_spi;
+               break;
+
+       case FC:
+               ioc->msi_enable = mpt_msi_enable_fc;
+               break;
+
+       default:
+               ioc->msi_enable = 0;
+               break;
+       }
        if (ioc->errata_flag_1064)
                pci_disable_io_access(pdev);
 
@@ -6313,6 +6345,33 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
        *size = y;
 }
 
+
+/**
+ *     mpt_halt_firmware - Halts the firmware if it is operational and panic
+ *     the kernel
+ *     @ioc: Pointer to MPT_ADAPTER structure
+ *
+ **/
+void
+mpt_halt_firmware(MPT_ADAPTER *ioc)
+{
+       u32      ioc_raw_state;
+
+       ioc_raw_state = mpt_GetIocState(ioc, 0);
+
+       if ((ioc_raw_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
+               printk(MYIOC_s_ERR_FMT "IOC is in FAULT state (%04xh)!!!\n",
+                       ioc->name, ioc_raw_state & MPI_DOORBELL_DATA_MASK);
+               panic("%s: IOC Fault (%04xh)!!!\n", ioc->name,
+                       ioc_raw_state & MPI_DOORBELL_DATA_MASK);
+       } else {
+               CHIPREG_WRITE32(&ioc->chip->Doorbell, 0xC0FFEE00);
+               panic("%s: Firmware is halted due to command timeout\n",
+                       ioc->name);
+       }
+}
+EXPORT_SYMBOL(mpt_halt_firmware);
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *     Reset Handling
@@ -6345,6 +6404,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
        printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name);
        printk("MF count 0x%x !\n", ioc->mfcnt);
 #endif
+       if (mpt_fwfault_debug)
+               mpt_halt_firmware(ioc);
 
        /* Reset the adapter. Prevent more than 1 call to
         * mpt_do_ioc_recovery at any instant in time.
index dff048cfa101d78d09a878f1845d3480e88b5388..b3e981d2a506fd6aeabd27795e7b492eb466344a 100644 (file)
@@ -922,11 +922,14 @@ extern void        mpt_free_fw_memory(MPT_ADAPTER *ioc);
 extern int      mpt_findImVolumes(MPT_ADAPTER *ioc);
 extern int      mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
 extern int      mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk);
+extern void     mpt_halt_firmware(MPT_ADAPTER *ioc);
+
 
 /*
  *  Public data decl's...
  */
 extern struct list_head          ioc_list;
+extern int mpt_fwfault_debug;
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 #endif         /* } __KERNEL__ */
index ee090413e598e4254cad01d211e465e46e081f48..e62c6bc4ad33ec83407a002a1549a5edd49cdc90 100644 (file)
@@ -1846,6 +1846,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
        if (hd->timeouts < -1)
                hd->timeouts++;
 
+       if (mpt_fwfault_debug)
+               mpt_halt_firmware(ioc);
+
        /* Most important!  Set TaskMsgContext to SCpnt's MsgContext!
         * (the IO to be ABORT'd)
         *
index 074b11ffbf41330efc0c74ea81f5b45656775586..e7ab0035d3054fdfd159b48c9e548150758b986b 100644 (file)
@@ -649,7 +649,7 @@ static inline int __init unprotect_pm_master(void)
        return e;
 }
 
-static void __init clocks_init(void)
+static void __init clocks_init(struct device *dev)
 {
        int e = 0;
        struct clk *osc;
@@ -658,9 +658,9 @@ static void __init clocks_init(void)
 
 #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
        if (cpu_is_omap2430())
-               osc = clk_get(NULL, "osc_ck");
+               osc = clk_get(dev, "osc_ck");
        else
-               osc = clk_get(NULL, "osc_sys_ck");
+               osc = clk_get(dev, "osc_sys_ck");
 
        if (IS_ERR(osc)) {
                printk(KERN_WARNING "Skipping twl4030 internal clock init and "
@@ -776,7 +776,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
        inuse = true;
 
        /* setup clock framework */
-       clocks_init();
+       clocks_init(&client->dev);
 
        /* Maybe init the T2 Interrupt subsystem */
        if (client->irq
index 73b7fb8de47a32e0e38b8abe048ede7333fbe832..82fb9958f22f7bc7b6bcfb03e31d7c66de7beb57 100644 (file)
@@ -899,7 +899,7 @@ xpc_update_partition_info_sn2(struct xpc_partition *part, u8 remote_rp_version,
        dev_dbg(xpc_part, "  remote_vars_pa = 0x%016lx\n",
                part_sn2->remote_vars_pa);
 
-       part->last_heartbeat = remote_vars->heartbeat;
+       part->last_heartbeat = remote_vars->heartbeat - 1;
        dev_dbg(xpc_part, "  last_heartbeat = 0x%016lx\n",
                part->last_heartbeat);
 
index e3131ea629cd14752c18b6511142c7b7966757bc..dfe92264e8252978d5719dc81f5b08dfff6d5f25 100644 (file)
@@ -132,7 +132,7 @@ void ehea_dump(void *adr, int len, char *msg)
        int x;
        unsigned char *deb = adr;
        for (x = 0; x < len; x += 16) {
-               printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg,
+               printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg,
                          deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
                deb += 16;
        }
@@ -883,7 +883,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
 
        while (eqe) {
                qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
-               ehea_error("QP aff_err: entry=0x%lx, token=0x%x",
+               ehea_error("QP aff_err: entry=0x%llx, token=0x%x",
                           eqe->entry, qp_token);
 
                qp = port->port_res[qp_token].qp;
@@ -1159,7 +1159,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
                netif_stop_queue(port->netdev);
                break;
        default:
-               ehea_error("unknown event code %x, eqe=0x%lX", ec, eqe);
+               ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe);
                break;
        }
 }
@@ -1971,7 +1971,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
                }
 
                if (dev->mc_count > port->adapter->max_mc_mac) {
-                       ehea_info("Mcast registration limit reached (0x%lx). "
+                       ehea_info("Mcast registration limit reached (0x%llx). "
                                  "Use ALLMULTI!",
                                  port->adapter->max_mc_mac);
                        goto out;
index 225c692b5d9928997dac0fc3f6bb41175bbca8e4..49d766ebbcf4e630d91cf8c245e50e96322be360 100644 (file)
@@ -168,7 +168,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
                                             cq->fw_handle, rpage, 1);
                if (hret < H_SUCCESS) {
                        ehea_error("register_rpage_cq failed ehea_cq=%p "
-                                  "hret=%lx counter=%i act_pages=%i",
+                                  "hret=%llx counter=%i act_pages=%i",
                                   cq, hret, counter, cq->attr.nr_pages);
                        goto out_kill_hwq;
                }
@@ -178,13 +178,13 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
 
                        if ((hret != H_SUCCESS) || (vpage)) {
                                ehea_error("registration of pages not "
-                                          "complete hret=%lx\n", hret);
+                                          "complete hret=%llx\n", hret);
                                goto out_kill_hwq;
                        }
                } else {
                        if (hret != H_PAGE_REGISTERED) {
                                ehea_error("CQ: registration of page failed "
-                                          "hret=%lx\n", hret);
+                                          "hret=%llx\n", hret);
                                goto out_kill_hwq;
                        }
                }
@@ -986,15 +986,15 @@ void print_error_data(u64 *data)
                length = EHEA_PAGESIZE;
 
        if (type == 0x8) /* Queue Pair */
-               ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, "
-                          "port=%lX", resource, data[6], data[12], data[22]);
+               ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
+                          "port=%llX", resource, data[6], data[12], data[22]);
 
        if (type == 0x4) /* Completion Queue */
-               ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource,
+               ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
                           data[6]);
 
        if (type == 0x3) /* Event Queue */
-               ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource,
+               ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
                           data[6]);
 
        ehea_dump(data, length, "error data");
@@ -1016,11 +1016,11 @@ void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle)
                                rblock);
 
        if (ret == H_R_STATE)
-               ehea_error("No error data is available: %lX.", res_handle);
+               ehea_error("No error data is available: %llX.", res_handle);
        else if (ret == H_SUCCESS)
                print_error_data(rblock);
        else
-               ehea_error("Error data could not be fetched: %lX", res_handle);
+               ehea_error("Error data could not be fetched: %llX", res_handle);
 
        kfree(rblock);
 }
index ca3bb9f7321b310ea4a26951aa71ba2c4ee95c4c..dfa6348ac1dcbdad7e556de869149b6a81f154a6 100644 (file)
@@ -602,7 +602,7 @@ static int ibmveth_open(struct net_device *netdev)
 
        if(lpar_rc != H_SUCCESS) {
                ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
-               ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n",
+               ibmveth_error_printk("buffer TCE:0x%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n",
                                     adapter->buffer_list_dma,
                                     adapter->filter_list_dma,
                                     rxq_desc.desc,
@@ -1378,13 +1378,13 @@ static int ibmveth_show(struct seq_file *seq, void *v)
        seq_printf(seq, "Firmware MAC:    %pM\n", firmware_mac);
 
        seq_printf(seq, "\nAdapter Statistics:\n");
-       seq_printf(seq, "  TX:  vio_map_single failres:      %ld\n", adapter->tx_map_failed);
-       seq_printf(seq, "       send failures:               %ld\n", adapter->tx_send_failed);
-       seq_printf(seq, "  RX:  replenish task cycles:       %ld\n", adapter->replenish_task_cycles);
-       seq_printf(seq, "       alloc_skb_failures:          %ld\n", adapter->replenish_no_mem);
-       seq_printf(seq, "       add buffer failures:         %ld\n", adapter->replenish_add_buff_failure);
-       seq_printf(seq, "       invalid buffers:             %ld\n", adapter->rx_invalid_buffer);
-       seq_printf(seq, "       no buffers:                  %ld\n", adapter->rx_no_buffer);
+       seq_printf(seq, "  TX:  vio_map_single failres:      %lld\n", adapter->tx_map_failed);
+       seq_printf(seq, "       send failures:               %lld\n", adapter->tx_send_failed);
+       seq_printf(seq, "  RX:  replenish task cycles:       %lld\n", adapter->replenish_task_cycles);
+       seq_printf(seq, "       alloc_skb_failures:          %lld\n", adapter->replenish_no_mem);
+       seq_printf(seq, "       add buffer failures:         %lld\n", adapter->replenish_add_buff_failure);
+       seq_printf(seq, "       invalid buffers:             %lld\n", adapter->rx_invalid_buffer);
+       seq_printf(seq, "       no buffers:                  %lld\n", adapter->rx_no_buffer);
 
        return 0;
 }
index c7457f97259d9ad9d60226b76f22d45108206d60..cb793c2bade2bd5a525e97ef7a5a216c84e18720 100644 (file)
@@ -429,7 +429,7 @@ SIMPLE_PORT_ATTR(promiscuous);
 SIMPLE_PORT_ATTR(num_mcast);
 CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map);
 CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map);
-CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr);
+CUSTOM_PORT_ATTR(mac_addr, "0x%llX\n", port->mac_addr);
 
 #define GET_PORT_ATTR(_name)   (&veth_port_attr_##_name.attr)
 static struct attribute *veth_port_default_attrs[] = {
index 710c79e7a2db244b567b485db51abf0978f04253..6ef2490d5c3e11e3327d88c5ddcfd7a3a2328826 100644 (file)
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
        int i;
 
        if (msi_x) {
-               nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs,
-                          num_possible_cpus() + 1);
+               nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
+                            num_possible_cpus() + 1);
                entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
                if (!entries)
                        goto no_msi;
index 5b7a574ce571ecef42892f787931ad18ed2f2614..d0349e7d73ea9d873a4ce23afe6ae6e262e55fdb 100644 (file)
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac,
        rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
        ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno));
 
-       printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n",
+       printk(KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n",
                macrx, *chan->status);
 
        printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n",
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(const struct pasemi_mac *mac,
 
        cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno));
 
-       printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\
-               "tx status 0x%016lx\n", mactx, *chan->status);
+       printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, "\
+               "tx status 0x%016llx\n", mactx, *chan->status);
 
        printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta);
 }
index d17dc5214c9af483ab83c712926f5c0b82c210e8..0d0fa91c025130fa96637d70a89b2cc101b89233 100644 (file)
@@ -1297,6 +1297,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
        /* setup */
        spin_lock_irq(&serial->serial_lock);
        tty->driver_data = serial;
+       tty_kref_put(serial->tty);
        serial->tty = tty_kref_get(tty);
        spin_unlock_irq(&serial->serial_lock);
 
@@ -2043,9 +2044,8 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial)
                return -2;
        }
 
-       spin_lock(&serial->serial_lock);
+       /* All callers to put_rxbuf_data hold serial_lock */
        tty = tty_kref_get(serial->tty);
-       spin_unlock(&serial->serial_lock);
 
        /* Push data to tty */
        if (tty) {
@@ -2053,8 +2053,10 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial)
                        serial->curr_rx_urb_offset;
                D1("data to push to tty");
                while (write_length_remaining) {
-                       if (test_bit(TTY_THROTTLED, &tty->flags))
+                       if (test_bit(TTY_THROTTLED, &tty->flags)) {
+                               tty_kref_put(tty);
                                return -1;
+                       }
                        curr_write_len =  tty_insert_flip_string
                                (tty, urb->transfer_buffer +
                                 serial->curr_rx_urb_offset,
index e1b0ad6e918f0bec0a843888e4de826d1cccf825..fa65a2b2ae2e44737edb5d4e19daf767e331bd9c 100644 (file)
@@ -66,4 +66,23 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
 }
 EXPORT_SYMBOL(of_register_i2c_devices);
 
+static int of_dev_node_match(struct device *dev, void *data)
+{
+        return dev_archdata_get_node(&dev->archdata) == data;
+}
+
+/* must call put_device() when done with returned i2c_client device */
+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
+{
+       struct device *dev;
+
+       dev = bus_find_device(&i2c_bus_type, NULL, node,
+                                        of_dev_node_match);
+       if (!dev)
+               return NULL;
+
+       return to_i2c_client(dev);
+}
+EXPORT_SYMBOL(of_find_i2c_device_by_node);
+
 MODULE_LICENSE("GPL");
index 1e93c837514f11fdf065ce80703ba57651276a2f..4fa3bb2ddfe4541a534ff75275a0948132d5f4d8 100644 (file)
@@ -405,7 +405,6 @@ static void __init superio_serial_init(void)
        serial_port.type        = PORT_16550A;
        serial_port.uartclk     = 115200*16;
        serial_port.fifosize    = 16;
-       spin_lock_init(&serial_port.lock);
 
        /* serial port #1 */
        serial_port.iobase      = sio_dev.sp1_base;
index 235fb7a5a8a50455fcbf27a64ff8b84f6e418882..3dfecb20d5e7949953e7fefa2796af4b48bef88f 100644 (file)
@@ -438,7 +438,8 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn)
                        continue;
 
                for (i = 0; i < drhd->devices_cnt; i++)
-                       if (drhd->devices[i]->bus->number == bus &&
+                       if (drhd->devices[i] &&
+                           drhd->devices[i]->bus->number == bus &&
                            drhd->devices[i]->devfn == devfn)
                                return drhd->iommu;
 
index c12f6c7906980fba382d4b42fcc9d02305248c18..e491fdedf705279c98898e3d647bcf12d596b596 100644 (file)
@@ -1260,15 +1260,14 @@ void pci_pm_init(struct pci_dev *dev)
        /* find PCI PM capability in list */
        pm = pci_find_capability(dev, PCI_CAP_ID_PM);
        if (!pm)
-               goto Exit;
-
+               return;
        /* Check device's ability to generate PME# */
        pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc);
 
        if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
                dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n",
                        pmc & PCI_PM_CAP_VER_MASK);
-               goto Exit;
+               return;
        }
 
        dev->pm_cap = pm;
@@ -1307,9 +1306,6 @@ void pci_pm_init(struct pci_dev *dev)
        } else {
                dev->pme_support = 0;
        }
-
- Exit:
-       pci_update_current_state(dev, PCI_D0);
 }
 
 /**
index 645d7a60e412ce3d970044ca89a823db3e21007c..ec22284eed307ccf565eb83df55f960876f57cd4 100644 (file)
 #include <asm/uaccess.h>
 #include "pci.h"
 
-asmlinkage long
-sys_pciconfig_read(unsigned long bus, unsigned long dfn,
-                  unsigned long off, unsigned long len,
-                  void __user *buf)
+SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
+               unsigned long, off, unsigned long, len, void __user *, buf)
 {
        struct pci_dev *dev;
        u8 byte;
@@ -86,10 +84,8 @@ error:
        return err;
 }
 
-asmlinkage long
-sys_pciconfig_write(unsigned long bus, unsigned long dfn,
-                   unsigned long off, unsigned long len,
-                   void __user *buf)
+SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
+               unsigned long, off, unsigned long, len, void __user *, buf)
 {
        struct pci_dev *dev;
        u8 byte;
index a34284b1482a52ab5f2282fe3c7263049f6e3a4c..d187ba4c5e0e3b19cabb2a316a9f0a8184379697 100644 (file)
@@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(struct of_device *ofdev,
                goto fail3;
        }
 
-       dev_info(device, "at mem 0x%lx io 0x%lx irq %d\n",
+       dev_info(device, "at mem 0x%lx io 0x%llx irq %d\n",
                 cf->mem_phys, io.start, cf->irq);
 
        cf->active = 1;
index 204158cf7a55eda807715b4c59f0512f2a1f96bb..fe96793e3f080e155abfae2ef804b211f3c0e166 100644 (file)
@@ -732,7 +732,7 @@ static u64 pm_signal_group_to_ps3_lv1_signal_group(u64 group)
        case 8:
                return pm_translate_signal_group_number_on_island8(subgroup);
        default:
-               dev_dbg(sbd_core(), "%s:%u: island not found: %lu\n", __func__,
+               dev_dbg(sbd_core(), "%s:%u: island not found: %llu\n", __func__,
                        __LINE__, group);
                BUG();
                break;
@@ -765,7 +765,7 @@ static int __ps3_set_signal(u64 lv1_signal_group, u64 bus_select,
                                 signal_select, attr1, attr2, attr3);
        if (ret)
                dev_err(sbd_core(),
-                       "%s:%u: error:%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
+                       "%s:%u: error:%d 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx\n",
                        __func__, __LINE__, ret, lv1_signal_group, bus_select,
                        signal_select, attr1, attr2, attr3);
 
@@ -908,7 +908,7 @@ void ps3_disable_pm(u32 cpu)
 
        lpm_priv->tb_count = tmp;
 
-       dev_dbg(sbd_core(), "%s:%u: tb_count %lu (%lxh)\n", __func__, __LINE__,
+       dev_dbg(sbd_core(), "%s:%u: tb_count %llu (%llxh)\n", __func__, __LINE__,
                lpm_priv->tb_count, lpm_priv->tb_count);
 }
 EXPORT_SYMBOL_GPL(ps3_disable_pm);
@@ -938,7 +938,7 @@ int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
        if (offset >= lpm_priv->tb_count)
                return 0;
 
-       count = min(count, lpm_priv->tb_count - offset);
+       count = min_t(u64, count, lpm_priv->tb_count - offset);
 
        while (*bytes_copied < count) {
                const unsigned long request = count - *bytes_copied;
@@ -993,7 +993,7 @@ int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
        if (offset >= lpm_priv->tb_count)
                return 0;
 
-       count = min(count, lpm_priv->tb_count - offset);
+       count = min_t(u64, count, lpm_priv->tb_count - offset);
 
        while (*bytes_copied < count) {
                const unsigned long request = count - *bytes_copied;
@@ -1013,7 +1013,7 @@ int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
                result = copy_to_user(buf, lpm_priv->tb_cache, tmp);
 
                if (result) {
-                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%p\n",
+                       dev_dbg(sbd_core(), "%s:%u: 0x%llx bytes at 0x%p\n",
                                __func__, __LINE__, tmp, buf);
                        dev_err(sbd_core(), "%s:%u: copy_to_user failed: %d\n",
                                __func__, __LINE__, result);
@@ -1148,8 +1148,8 @@ int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
        lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT;
        lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT;
 
-       dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%lx, outlet_id 0x%lx, "
-               "tb_size 0x%lx\n", __func__, __LINE__, lpm_priv->lpm_id,
+       dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%llx, outlet_id 0x%llx, "
+               "tb_size 0x%llx\n", __func__, __LINE__, lpm_priv->lpm_id,
                lpm_priv->outlet_id, tb_size);
 
        return 0;
index 90c097a7a47ab5fc7a41b298f3beb968dbadd359..e4ad5ba5d0a3da7b4014c003f7582d9146323a44 100644 (file)
@@ -114,7 +114,7 @@ struct ports_bmp {
 static void __maybe_unused _dump_ports_bmp(
        const struct ports_bmp *bmp, const char *func, int line)
 {
-       pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status);
+       pr_debug("%s:%d: ports_bmp: %016llxh\n", func, line, bmp->status);
 }
 
 #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__)
@@ -159,11 +159,13 @@ int ps3_vuart_get_triggers(struct ps3_system_bus_device *dev,
        struct vuart_triggers *trig)
 {
        int result;
-       unsigned long size;
-       unsigned long val;
+       u64 size;
+       u64 val;
+       u64 tx;
 
        result = lv1_get_virtual_uart_param(dev->port_number,
-               PARAM_TX_TRIGGER, &trig->tx);
+               PARAM_TX_TRIGGER, &tx);
+       trig->tx = tx;
 
        if (result) {
                dev_dbg(&dev->core, "%s:%d: tx_trigger failed: %s\n",
@@ -201,7 +203,7 @@ int ps3_vuart_set_triggers(struct ps3_system_bus_device *dev, unsigned int tx,
        unsigned int rx)
 {
        int result;
-       unsigned long size;
+       u64 size;
 
        result = lv1_set_virtual_uart_param(dev->port_number,
                PARAM_TX_TRIGGER, tx);
@@ -248,7 +250,7 @@ static int ps3_vuart_get_rx_bytes_waiting(struct ps3_system_bus_device *dev,
                dev_dbg(&dev->core, "%s:%d: rx_bytes failed: %s\n",
                        __func__, __LINE__, ps3_result(result));
 
-       dev_dbg(&dev->core, "%s:%d: %lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: %llxh\n", __func__, __LINE__,
                *bytes_waiting);
        return result;
 }
@@ -295,7 +297,7 @@ static int ps3_vuart_get_interrupt_status(struct ps3_system_bus_device *dev,
 
        *status = tmp & priv->interrupt_mask;
 
-       dev_dbg(&dev->core, "%s:%d: m %lxh, s %lxh, m&s %lxh\n",
+       dev_dbg(&dev->core, "%s:%d: m %llxh, s %llxh, m&s %lxh\n",
                __func__, __LINE__, priv->interrupt_mask, tmp, *status);
 
        return result;
@@ -363,7 +365,7 @@ int ps3_vuart_disable_interrupt_disconnect(struct ps3_system_bus_device *dev)
  */
 
 static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
-       const void *buf, unsigned int bytes, unsigned long *bytes_written)
+       const void *buf, unsigned int bytes, u64 *bytes_written)
 {
        int result;
        struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -379,7 +381,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
 
        priv->stats.bytes_written += *bytes_written;
 
-       dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: wrote %llxh/%xh=>%lxh\n", __func__, __LINE__,
                *bytes_written, bytes, priv->stats.bytes_written);
 
        return result;
@@ -393,7 +395,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
  */
 
 static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
-       unsigned int bytes, unsigned long *bytes_read)
+       unsigned int bytes, u64 *bytes_read)
 {
        int result;
        struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -411,7 +413,7 @@ static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
 
        priv->stats.bytes_read += *bytes_read;
 
-       dev_dbg(&dev->core, "%s:%d: read %lxh/%xh=>%lxh\n", __func__, __LINE__,
+       dev_dbg(&dev->core, "%s:%d: read %llxh/%xh=>%lxh\n", __func__, __LINE__,
                *bytes_read, bytes, priv->stats.bytes_read);
 
        return result;
@@ -500,7 +502,7 @@ int ps3_vuart_write(struct ps3_system_bus_device *dev, const void *buf,
        spin_lock_irqsave(&priv->tx_list.lock, flags);
 
        if (list_empty(&priv->tx_list.head)) {
-               unsigned long bytes_written;
+               u64 bytes_written;
 
                result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written);
 
@@ -592,7 +594,7 @@ static int ps3_vuart_queue_rx_bytes(struct ps3_system_bus_device *dev,
        list_add_tail(&lb->link, &priv->rx_list.head);
        priv->rx_list.bytes_held += bytes;
 
-       dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %lxh bytes\n",
+       dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %llxh bytes\n",
                __func__, __LINE__, lb->dbg_number, bytes);
 
        *bytes_queued = bytes;
@@ -745,7 +747,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
 
        list_for_each_entry_safe(lb, n, &priv->tx_list.head, link) {
 
-               unsigned long bytes_written;
+               u64 bytes_written;
 
                result = ps3_vuart_raw_write(dev, lb->head, lb->tail - lb->head,
                        &bytes_written);
@@ -762,7 +764,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
                if (bytes_written < lb->tail - lb->head) {
                        lb->head += bytes_written;
                        dev_dbg(&dev->core,
-                               "%s:%d cleared buf_%lu, %lxh bytes\n",
+                               "%s:%d cleared buf_%lu, %llxh bytes\n",
                                __func__, __LINE__, lb->dbg_number,
                                bytes_written);
                        goto port_full;
index 55955f16ad919ad7fb6d5aeadbb4334733fa1e71..18066d55539764abd94c9b157f4392c303236083 100644 (file)
@@ -70,7 +70,7 @@ static int ps3stor_probe_access(struct ps3_storage_device *dev)
                         __func__, __LINE__, n);
        dev->region_idx = __ffs(dev->accessible_regions);
        dev_info(&dev->sbd.core,
-                "First accessible region has index %u start %lu size %lu\n",
+                "First accessible region has index %u start %llu size %llu\n",
                 dev->region_idx, dev->regions[dev->region_idx].start,
                 dev->regions[dev->region_idx].size);
 
@@ -220,7 +220,7 @@ u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
        const char *op = write ? "write" : "read";
        int res;
 
-       dev_dbg(&dev->sbd.core, "%s:%u: %s %lu sectors starting at %lu\n",
+       dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n",
                __func__, __LINE__, op, sectors, start_sector);
 
        init_completion(&dev->done);
@@ -238,7 +238,7 @@ u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
 
        wait_for_completion(&dev->done);
        if (dev->lv1_status) {
-               dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__,
+               dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__,
                        __LINE__, op, dev->lv1_status);
                return dev->lv1_status;
        }
@@ -268,7 +268,7 @@ u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd, u64 arg1,
 {
        int res;
 
-       dev_dbg(&dev->sbd.core, "%s:%u: send device command 0x%lx\n", __func__,
+       dev_dbg(&dev->sbd.core, "%s:%u: send device command 0x%llx\n", __func__,
                __LINE__, cmd);
 
        init_completion(&dev->done);
@@ -277,19 +277,19 @@ u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd, u64 arg1,
                                              arg2, arg3, arg4, &dev->tag);
        if (res) {
                dev_err(&dev->sbd.core,
-                       "%s:%u: send_device_command 0x%lx failed %d\n",
+                       "%s:%u: send_device_command 0x%llx failed %d\n",
                        __func__, __LINE__, cmd, res);
                return -1;
        }
 
        wait_for_completion(&dev->done);
        if (dev->lv1_status) {
-               dev_dbg(&dev->sbd.core, "%s:%u: command 0x%lx failed 0x%lx\n",
+               dev_dbg(&dev->sbd.core, "%s:%u: command 0x%llx failed 0x%llx\n",
                        __func__, __LINE__, cmd, dev->lv1_status);
                return dev->lv1_status;
        }
 
-       dev_dbg(&dev->sbd.core, "%s:%u: command 0x%lx completed\n", __func__,
+       dev_dbg(&dev->sbd.core, "%s:%u: command 0x%llx completed\n", __func__,
                __LINE__, cmd);
 
        return 0;
index cc7eb8767b82b869a5f8862b20a222b819378e86..bd56a033bfd06b9ff5babaa175bdcc0f7a54f373 100644 (file)
@@ -27,6 +27,8 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 
+#include <mach/hardware.h>
+
 #define TIMER_FREQ             CLOCK_TICK_RATE
 #define RTC_DEF_DIVIDER                (32768 - 1)
 #define RTC_DEF_TRIM           0
index 8ce5f74ee45b3b09fe357fb353b5fe607f8bec4e..ad35f76c46b7f1a2ee84f7b12e883b50e5e299cf 100644 (file)
@@ -120,7 +120,7 @@ static int twl4030_rtc_write_u8(u8 data, u8 reg)
 static unsigned char rtc_irq_bits;
 
 /*
- * Enable timer and/or alarm interrupts.
+ * Enable 1/second update and/or alarm interrupts.
  */
 static int set_rtc_irq_bit(unsigned char bit)
 {
@@ -128,6 +128,7 @@ static int set_rtc_irq_bit(unsigned char bit)
        int ret;
 
        val = rtc_irq_bits | bit;
+       val &= ~BIT_RTC_INTERRUPTS_REG_EVERY_M;
        ret = twl4030_rtc_write_u8(val, REG_RTC_INTERRUPTS_REG);
        if (ret == 0)
                rtc_irq_bits = val;
@@ -136,7 +137,7 @@ static int set_rtc_irq_bit(unsigned char bit)
 }
 
 /*
- * Disable timer and/or alarm interrupts.
+ * Disable update and/or alarm interrupts.
  */
 static int mask_rtc_irq_bit(unsigned char bit)
 {
@@ -151,7 +152,7 @@ static int mask_rtc_irq_bit(unsigned char bit)
        return ret;
 }
 
-static inline int twl4030_rtc_alarm_irq_set_state(int enabled)
+static int twl4030_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
 {
        int ret;
 
@@ -163,7 +164,7 @@ static inline int twl4030_rtc_alarm_irq_set_state(int enabled)
        return ret;
 }
 
-static inline int twl4030_rtc_irq_set_state(int enabled)
+static int twl4030_rtc_update_irq_enable(struct device *dev, unsigned enabled)
 {
        int ret;
 
@@ -292,7 +293,7 @@ static int twl4030_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
        unsigned char alarm_data[ALL_TIME_REGS + 1];
        int ret;
 
-       ret = twl4030_rtc_alarm_irq_set_state(0);
+       ret = twl4030_rtc_alarm_irq_enable(dev, 0);
        if (ret)
                goto out;
 
@@ -312,35 +313,11 @@ static int twl4030_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
        }
 
        if (alm->enabled)
-               ret = twl4030_rtc_alarm_irq_set_state(1);
+               ret = twl4030_rtc_alarm_irq_enable(dev, 1);
 out:
        return ret;
 }
 
-#ifdef CONFIG_RTC_INTF_DEV
-
-static int twl4030_rtc_ioctl(struct device *dev, unsigned int cmd,
-                            unsigned long arg)
-{
-       switch (cmd) {
-       case RTC_AIE_OFF:
-               return twl4030_rtc_alarm_irq_set_state(0);
-       case RTC_AIE_ON:
-               return twl4030_rtc_alarm_irq_set_state(1);
-       case RTC_UIE_OFF:
-               return twl4030_rtc_irq_set_state(0);
-       case RTC_UIE_ON:
-               return twl4030_rtc_irq_set_state(1);
-
-       default:
-               return -ENOIOCTLCMD;
-       }
-}
-
-#else
-#define        twl4030_rtc_ioctl       NULL
-#endif
-
 static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc)
 {
        unsigned long events = 0;
@@ -400,11 +377,12 @@ out:
 }
 
 static struct rtc_class_ops twl4030_rtc_ops = {
-       .ioctl          = twl4030_rtc_ioctl,
        .read_time      = twl4030_rtc_read_time,
        .set_time       = twl4030_rtc_set_time,
        .read_alarm     = twl4030_rtc_read_alarm,
        .set_alarm      = twl4030_rtc_set_alarm,
+       .alarm_irq_enable = twl4030_rtc_alarm_irq_enable,
+       .update_irq_enable = twl4030_rtc_update_irq_enable,
 };
 
 /*----------------------------------------------------------------------*/
@@ -422,7 +400,7 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev)
        rtc = rtc_device_register(pdev->name,
                                  &pdev->dev, &twl4030_rtc_ops, THIS_MODULE);
        if (IS_ERR(rtc)) {
-               ret = -EINVAL;
+               ret = PTR_ERR(rtc);
                dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
                        PTR_ERR(rtc));
                goto out0;
@@ -432,7 +410,6 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, rtc);
 
        ret = twl4030_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
-
        if (ret < 0)
                goto out1;
 
@@ -475,7 +452,6 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev)
 
        return ret;
 
-
 out2:
        free_irq(irq, rtc);
 out1:
@@ -506,8 +482,9 @@ static int __devexit twl4030_rtc_remove(struct platform_device *pdev)
 
 static void twl4030_rtc_shutdown(struct platform_device *pdev)
 {
-       mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-                        BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+       /* mask timer interrupts, but leave alarm interrupts on to enable
+          power-on when alarm is triggered */
+       mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
 }
 
 #ifdef CONFIG_PM
index ee0739b217b6ed653ba969a75403d3d55f16f8d4..91ef669d98f64583e94fb9d57c4e855679cc680b 100644 (file)
@@ -933,7 +933,7 @@ static void ibmvfc_get_host_speed(struct Scsi_Host *shost)
                        fc_host_speed(shost) = FC_PORTSPEED_16GBIT;
                        break;
                default:
-                       ibmvfc_log(vhost, 3, "Unknown port speed: %ld Gbit\n",
+                       ibmvfc_log(vhost, 3, "Unknown port speed: %lld Gbit\n",
                                   vhost->login_buf->resp.link_speed / 100);
                        fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
                        break;
@@ -2149,8 +2149,8 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
 {
        const char *desc = ibmvfc_get_ae_desc(crq->event);
 
-       ibmvfc_log(vhost, 3, "%s event received. scsi_id: %lx, wwpn: %lx,"
-                  " node_name: %lx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name);
+       ibmvfc_log(vhost, 3, "%s event received. scsi_id: %llx, wwpn: %llx,"
+                  " node_name: %llx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name);
 
        switch (crq->event) {
        case IBMVFC_AE_LINK_UP:
@@ -2184,7 +2184,7 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
                ibmvfc_link_down(vhost, IBMVFC_HALTED);
                break;
        default:
-               dev_err(vhost->dev, "Unknown async event received: %ld\n", crq->event);
+               dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event);
                break;
        };
 }
@@ -2261,13 +2261,13 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost)
         * actually sent
         */
        if (unlikely(!ibmvfc_valid_event(&vhost->pool, evt))) {
-               dev_err(vhost->dev, "Returned correlation_token 0x%08lx is invalid!\n",
+               dev_err(vhost->dev, "Returned correlation_token 0x%08llx is invalid!\n",
                        crq->ioba);
                return;
        }
 
        if (unlikely(atomic_read(&evt->free))) {
-               dev_err(vhost->dev, "Received duplicate correlation_token 0x%08lx!\n",
+               dev_err(vhost->dev, "Received duplicate correlation_token 0x%08llx!\n",
                        crq->ioba);
                return;
        }
@@ -3259,7 +3259,7 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, u64 scsi_id)
 
        tgt = mempool_alloc(vhost->tgt_pool, GFP_KERNEL);
        if (!tgt) {
-               dev_err(vhost->dev, "Target allocation failure for scsi id %08lx\n",
+               dev_err(vhost->dev, "Target allocation failure for scsi id %08llx\n",
                        scsi_id);
                return -ENOMEM;
        }
index babdf3db59df9f92d332a5fb32f9b8e43ab370e4..87dafd0f8d4416b48e27bf08b3673d391a670abe 100644 (file)
@@ -691,13 +691,13 @@ struct ibmvfc_host {
 #define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0)
 
 #define tgt_dbg(t, fmt, ...)                   \
-       DBG_CMD(dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__))
+       DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__))
 
 #define tgt_info(t, fmt, ...)          \
-       dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
+       dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
 
 #define tgt_err(t, fmt, ...)           \
-       dev_err((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
+       dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
 
 #define ibmvfc_dbg(vhost, ...) \
        DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__))
index 5c541f7850f931094e5deea7f4ad4c458ff9a285..74d07d137daeb75b038071f6fe9a279b927243e1 100644 (file)
@@ -1061,7 +1061,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
        }
 
        sdev_printk(KERN_INFO, cmd->device,
-                    "aborting command. lun 0x%lx, tag 0x%lx\n",
+                    "aborting command. lun 0x%llx, tag 0x%llx\n",
                    (((u64) lun) << 48), (u64) found_evt);
 
        wait_for_completion(&evt->comp);
@@ -1082,7 +1082,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
        if (rsp_rc) {
                if (printk_ratelimit())
                        sdev_printk(KERN_WARNING, cmd->device,
-                                   "abort code %d for task tag 0x%lx\n",
+                                   "abort code %d for task tag 0x%llx\n",
                                    rsp_rc, tsk_mgmt->task_tag);
                return FAILED;
        }
@@ -1102,12 +1102,12 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
 
        if (found_evt == NULL) {
                spin_unlock_irqrestore(hostdata->host->host_lock, flags);
-               sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n",
+               sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%llx completed\n",
                            tsk_mgmt->task_tag);
                return SUCCESS;
        }
 
-       sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\n",
+       sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n",
                    tsk_mgmt->task_tag);
 
        cmd->result = (DID_ABORT << 16);
@@ -1182,7 +1182,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
                return FAILED;
        }
 
-       sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\n",
+       sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%llx\n",
                    (((u64) lun) << 48));
 
        wait_for_completion(&evt->comp);
@@ -1203,7 +1203,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
        if (rsp_rc) {
                if (printk_ratelimit())
                        sdev_printk(KERN_WARNING, cmd->device,
-                                   "reset code %d for task tag 0x%lx\n",
+                                   "reset code %d for task tag 0x%llx\n",
                                    rsp_rc, tsk_mgmt->task_tag);
                return FAILED;
        }
index 841f460edbc40f41571ac83f4db08207b04e33e4..07829009a8bec0110ff397f34ddc8dceba65f800 100644 (file)
@@ -4912,7 +4912,7 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
        if (res && ipr_is_gata(res)) {
                if (cmd == HDIO_GET_IDENTITY)
                        return -ENOTTY;
-               return ata_scsi_ioctl(sdev, cmd, arg);
+               return ata_sas_scsi_ioctl(res->sata_port->ap, sdev, cmd, arg);
        }
 
        return -EINVAL;
index a745f91d292846ad5302bb21a500814222ca61cf..e7705d3532c99bbe703099afe0af5181ec1cd049 100644 (file)
@@ -177,7 +177,6 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
                           struct iscsi_segment *segment, int recv,
                           unsigned copied)
 {
-       static unsigned char padbuf[ISCSI_PAD_LEN];
        struct scatterlist sg;
        unsigned int pad;
 
@@ -233,7 +232,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn,
                        debug_tcp("consume %d pad bytes\n", pad);
                        segment->total_size += pad;
                        segment->size = pad;
-                       segment->data = padbuf;
+                       segment->data = segment->padbuf;
                        return 0;
                }
        }
index 744838780ada207964f5b8ffbc4749d6c098ae57..1c558d3bce18c4817623078944e86557eb3adb9f 100644 (file)
@@ -717,7 +717,7 @@ int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
        struct domain_device *dev = sdev_to_domain_dev(sdev);
 
        if (dev_is_sata(dev))
-               return ata_scsi_ioctl(sdev, cmd, arg);
+               return ata_sas_scsi_ioctl(dev->sata_dev.ap, sdev, cmd, arg);
 
        return -EINVAL;
 }
index ce48e2d0193c64e379a5cfd1cfe5ab14f2a9a29a..ca0dd33497ec2f7f70640e65d8fa75c99abbffb5 100644 (file)
@@ -290,11 +290,11 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data)
 
        if (tag != dev->tag)
                dev_err(&dev->sbd.core,
-                       "%s:%u: tag mismatch, got %lx, expected %lx\n",
+                       "%s:%u: tag mismatch, got %llx, expected %llx\n",
                        __func__, __LINE__, tag, dev->tag);
 
        if (res) {
-               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n",
+               dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
                        __func__, __LINE__, res, status);
                return IRQ_HANDLED;
        }
@@ -364,7 +364,7 @@ static int __devinit ps3rom_probe(struct ps3_system_bus_device *_dev)
 
        if (dev->blk_size != CD_FRAMESIZE) {
                dev_err(&dev->sbd.core,
-                       "%s:%u: cannot handle block size %lu\n", __func__,
+                       "%s:%u: cannot handle block size %llu\n", __func__,
                        __LINE__, dev->blk_size);
                return -EINVAL;
        }
index 2d4f32b4df5c831caccd46e0f73c8d2a8b750942..9ad4d0968e5c87b38045c60e08cd6f244aa0ff5b 100644 (file)
@@ -1258,35 +1258,48 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 {
        int     rval;
        unsigned long flags = 0;
-       int cnt;
+       int cnt, que;
        struct qla_hw_data *ha = vha->hw;
-       struct req_que *req = ha->req_q_map[0];
-       struct rsp_que *rsp = ha->rsp_q_map[0];
+       struct req_que *req;
+       struct rsp_que *rsp;
+       struct scsi_qla_host *vp;
        struct mid_init_cb_24xx *mid_init_cb =
            (struct mid_init_cb_24xx *) ha->init_cb;
 
        spin_lock_irqsave(&ha->hardware_lock, flags);
 
        /* Clear outstanding commands array. */
-       for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++)
-               req->outstanding_cmds[cnt] = NULL;
+       for (que = 0; que < ha->max_queues; que++) {
+               req = ha->req_q_map[que];
+               if (!req)
+                       continue;
+               for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++)
+                       req->outstanding_cmds[cnt] = NULL;
 
-       req->current_outstanding_cmd = 0;
+               req->current_outstanding_cmd = 0;
 
-       /* Clear RSCN queue. */
-       vha->rscn_in_ptr = 0;
-       vha->rscn_out_ptr = 0;
+               /* Initialize firmware. */
+               req->ring_ptr  = req->ring;
+               req->ring_index    = 0;
+               req->cnt      = req->length;
+       }
 
-       /* Initialize firmware. */
-       req->ring_ptr  = req->ring;
-       req->ring_index    = 0;
-       req->cnt      = req->length;
-       rsp->ring_ptr = rsp->ring;
-       rsp->ring_index    = 0;
+       for (que = 0; que < ha->max_queues; que++) {
+               rsp = ha->rsp_q_map[que];
+               if (!rsp)
+                       continue;
+               rsp->ring_ptr = rsp->ring;
+               rsp->ring_index    = 0;
 
-       /* Initialize response queue entries */
-       qla2x00_init_response_q_entries(rsp);
+               /* Initialize response queue entries */
+               qla2x00_init_response_q_entries(rsp);
+       }
 
+       /* Clear RSCN queue. */
+       list_for_each_entry(vp, &ha->vp_list, list) {
+               vp->rscn_in_ptr = 0;
+               vp->rscn_out_ptr = 0;
+       }
        ha->isp_ops->config_rings(vha);
 
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
@@ -3212,8 +3225,8 @@ qla2x00_loop_resync(scsi_qla_host_t *vha)
        int rval = QLA_SUCCESS;
        uint32_t wait_time;
        struct qla_hw_data *ha = vha->hw;
-       struct req_que *req = ha->req_q_map[0];
-       struct rsp_que *rsp = ha->rsp_q_map[0];
+       struct req_que *req = ha->req_q_map[vha->req_ques[0]];
+       struct rsp_que *rsp = req->rsp;
 
        atomic_set(&vha->loop_state, LOOP_UPDATE);
        clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
@@ -3492,6 +3505,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
                }
                req = ha->req_q_map[i];
                if (req) {
+               /* Clear outstanding commands array. */
                        req->options &= ~BIT_0;
                        ret = qla25xx_init_req_que(base_vha, req, req->options);
                        if (ret != QLA_SUCCESS)
@@ -3500,7 +3514,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
                                                req->id));
                        else
                                DEBUG2_17(printk(KERN_WARNING
-                                       "%s Rsp que:%d inited\n", __func__,
+                                       "%s Req que:%d inited\n", __func__,
                                                req->id));
                }
        }
@@ -4151,8 +4165,8 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha)
        uint16_t mb[MAILBOX_REGISTER_COUNT];
        struct qla_hw_data *ha = vha->hw;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
-       struct req_que *req = ha->req_q_map[0];
-       struct rsp_que *rsp = ha->rsp_q_map[0];
+       struct req_que *req = ha->req_q_map[vha->req_ques[0]];
+       struct rsp_que *rsp = req->rsp;
 
        if (!vha->vp_idx)
                return -EINVAL;
index 886323130fcc65fa1c91fb35d4510482cfc9b2a0..f53179c46423adb449c2480aa205bcd2b868c17a 100644 (file)
@@ -629,6 +629,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options,
        req->ring_index = 0;
        req->cnt = req->length;
        req->id = que_id;
+       req->max_q_depth = ha->req_q_map[0]->max_q_depth;
        mutex_unlock(&ha->vport_lock);
 
        ret = qla25xx_init_req_que(base_vha, req, options);
index 4a71f522f9259308a9d3d08f3d9f54ac9fada1be..cf32653fe01a2317aee14dae3856c2aee8017953 100644 (file)
@@ -1158,8 +1158,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
        struct req_que *req;
 
        spin_lock_irqsave(&ha->hardware_lock, flags);
-       for (que = 0; que < QLA_MAX_HOST_QUES; que++) {
-               req = ha->req_q_map[vha->req_ques[que]];
+       for (que = 0; que < ha->max_queues; que++) {
+               req = ha->req_q_map[que];
                if (!req)
                        continue;
                for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
@@ -1193,7 +1193,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
        scsi_qla_host_t *vha = shost_priv(sdev->host);
        struct qla_hw_data *ha = vha->hw;
        struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
-       struct req_que *req = ha->req_q_map[0];
+       struct req_que *req = ha->req_q_map[vha->req_ques[0]];
 
        if (sdev->tagged_supported)
                scsi_activate_tcq(sdev, req->max_q_depth);
@@ -1998,7 +1998,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        return 0;
 
 probe_failed:
-       qla2x00_free_que(ha, req, rsp);
        qla2x00_free_device(base_vha);
 
        scsi_host_put(base_vha->host);
index 42e72a2c1f98b5521167a0b746a8a46a58f6e2aa..cbcd3f681b62103d3871dd5816b918f30880b7a6 100644 (file)
@@ -1095,7 +1095,8 @@ EXPORT_SYMBOL(__starget_for_each_device);
  * Description: Looks up the scsi_device with the specified @lun for a given
  * @starget.  The returned scsi_device does not have an additional
  * reference.  You must hold the host's host_lock over this call and
- * any access to the returned scsi_device.
+ * any access to the returned scsi_device. A scsi_device in state
+ * SDEV_DEL is skipped.
  *
  * Note:  The only reason why drivers should use this is because
  * they need to access the device list in irq context.  Otherwise you
@@ -1107,6 +1108,8 @@ struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget,
        struct scsi_device *sdev;
 
        list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
+               if (sdev->sdev_state == SDEV_DEL)
+                       continue;
                if (sdev->lun ==lun)
                        return sdev;
        }
index 4969e4ec75ea9f7b985c6c979763d8eae40bcb93..099b5455bbce287f60ef888566913616f13e9908 100644 (file)
@@ -224,6 +224,7 @@ static struct {
        {"SGI", "TP9100", "*", BLIST_REPORTLUN2},
        {"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
        {"IBM", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
+       {"SUN", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
        {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
        {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN},
        {"SONY", "TSL", NULL, BLIST_FORCELUN},          /* DDS3 & DDS4 autoloaders */
index 1889a63ebc2293cdcaa2b1f403f41ea142caf6af..0d934bfbdd9b2ded293260968927a7de5e776f88 100644 (file)
@@ -2839,6 +2839,8 @@ int __init early_serial_setup(struct uart_port *port)
        p->flags        = port->flags;
        p->mapbase      = port->mapbase;
        p->private_data = port->private_data;
+       p->type         = port->type;
+       p->line         = port->line;
 
        set_io_from_upio(p);
        if (port->serial_in)
index c088146b7513d1c0109b8ddd579ef5052d2fbe18..2a3671233b15ac1b45d183b5a7e4b1f545cf281c 100644 (file)
@@ -602,6 +602,10 @@ static int pci_netmos_init(struct pci_dev *dev)
        /* subdevice 0x00PS means <P> parallel, <S> serial */
        unsigned int num_serial = dev->subsystem_device & 0xf;
 
+       if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
+                       dev->subsystem_device == 0x0299)
+               return 0;
+
        if (num_serial == 0)
                return -ENODEV;
        return num_serial;
@@ -3096,6 +3100,10 @@ static struct pci_device_id serial_pci_tbl[] = {
                0,
                pbn_b0_8_115200 },
 
+       {       PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
+               PCI_VENDOR_ID_IBM, 0x0299,
+               0, 0, pbn_b0_bt_2_115200 },
+
        /*
         * These entries match devices with class COMMUNICATION_SERIAL,
         * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
index fde7f9ccf57e7c4d69a182d82011a8c561630f43..bbcfc26a3b6d4f306b97ca025793b482ed124f03 100644 (file)
@@ -270,6 +270,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
        {       "RSS0250",              0       },
        /* SupraExpress 28.8 Data/Fax PnP modem */
        {       "SUP1310",              0       },
+       /* SupraExpress 336i PnP Voice Modem */
+       {       "SUP1381",              0       },
        /* SupraExpress 33.6 Data/Fax PnP modem */
        {       "SUP1421",              0       },
        /* SupraExpress 33.6 Data/Fax PnP modem */
index d5efd6c77904aef0dbb74641820b8937890f4ae5..89362d733d6230331c6bead3c8bbce3ef9d28563 100644 (file)
@@ -579,7 +579,7 @@ static void atmel_tx_dma(struct uart_port *port)
        /* disable PDC transmit */
        UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);
 
-       if (!uart_circ_empty(xmit)) {
+       if (!uart_circ_empty(xmit) && !uart_tx_stopped(port)) {
                dma_sync_single_for_device(port->dev,
                                           pdc->dma_addr,
                                           pdc->dma_size,
index a821e3a3d664e93f18fa6dcb8e7e561ce4fc6076..14f8fa9135be49c664f64d80c9633bf1d405f85c 100644 (file)
@@ -163,6 +163,7 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
        { .type = "serial", .compatible = "ns16450",  .data = (void *)PORT_16450, },
        { .type = "serial", .compatible = "ns16550",  .data = (void *)PORT_16550, },
        { .type = "serial", .compatible = "ns16750",  .data = (void *)PORT_16750, },
+       { .type = "serial", .compatible = "ns16850",  .data = (void *)PORT_16850, },
 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
        { .type = "serial", .compatible = "ibm,qpace-nwp-serial",
                                        .data = (void *)PORT_NWPSERIAL, },
index 22e30d21225e7482a26615a40f33221a3c3a620b..1bb8f1b45767f2de4c7095123c47595a31b4474f 100644 (file)
@@ -187,7 +187,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
        status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) |
                 ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT));
        while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) {
-               ch = serial_in(sport, PNX8XXX_FIFO);
+               ch = serial_in(sport, PNX8XXX_FIFO) & 0xff;
 
                sport->port.icount.rx++;
 
@@ -198,9 +198,16 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
                 * out of the main execution path
                 */
                if (status & (FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE |
-                                       PNX8XXX_UART_FIFO_RXPAR) |
+                                       PNX8XXX_UART_FIFO_RXPAR |
+                                       PNX8XXX_UART_FIFO_RXBRK) |
                              ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) {
-                       if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR))
+                       if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXBRK)) {
+                               status &= ~(FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) |
+                                       FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR));
+                               sport->port.icount.brk++;
+                               if (uart_handle_break(&sport->port))
+                                       goto ignore_char;
+                       } else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR))
                                sport->port.icount.parity++;
                        else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE))
                                sport->port.icount.frame++;
@@ -284,14 +291,8 @@ static irqreturn_t pnx8xxx_int(int irq, void *dev_id)
        /* Get the interrupts */
        status  = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN);
 
-       /* Break signal received */
-       if (status & PNX8XXX_UART_INT_BREAK) {
-               sport->port.icount.brk++;
-               uart_handle_break(&sport->port);
-       }
-
-       /* Byte received */
-       if (status & PNX8XXX_UART_INT_RX)
+       /* Byte or break signal received */
+       if (status & (PNX8XXX_UART_INT_RX | PNX8XXX_UART_INT_BREAK))
                pnx8xxx_rx_chars(sport);
 
        /* TX holding register empty - transmit a byte */
index 5e39bac9c51b639087a92a87be0296dfe52ee916..56ff3e6864ea748cc88be68621f0ea1239efa10d 100644 (file)
@@ -670,8 +670,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
        dev_dbg(controller, "new message %p submitted for %s\n",
                        msg, spi->dev.bus_id);
 
-       if (unlikely(list_empty(&msg->transfers)
-                       || !spi->max_speed_hz))
+       if (unlikely(list_empty(&msg->transfers)))
                return -EINVAL;
 
        if (as->stopping)
index 68d6f4988fb52a7aca99f5315697d6cb4ca6cf91..fe7e5f35e5d0393ccd04bac2993413ee2d26bf1a 100644 (file)
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+
+#include <linux/of_platform.h>
+#include <linux/of_device.h>
+#include <linux/of_spi.h>
+
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 #include <linux/io.h>
 
-#include <syslib/virtex_devices.h>
-
 #define XILINX_SPI_NAME "xilinx_spi"
 
 /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
@@ -144,23 +147,14 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi,
                struct spi_transfer *t)
 {
        u8 bits_per_word;
-       u32 hz;
-       struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
 
        bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word;
-       hz = (t) ? t->speed_hz : spi->max_speed_hz;
        if (bits_per_word != 8) {
                dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
                        __func__, bits_per_word);
                return -EINVAL;
        }
 
-       if (hz && xspi->speed_hz > hz) {
-               dev_err(&spi->dev, "%s, unsupported clock rate %uHz\n",
-                       __func__, hz);
-               return -EINVAL;
-       }
-
        return 0;
 }
 
@@ -304,32 +298,38 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int __init xilinx_spi_probe(struct platform_device *dev)
+static int __init xilinx_spi_of_probe(struct of_device *ofdev,
+                                       const struct of_device_id *match)
 {
-       int ret = 0;
        struct spi_master *master;
        struct xilinx_spi *xspi;
-       struct xspi_platform_data *pdata;
-       struct resource *r;
+       struct resource r_irq_struct;
+       struct resource r_mem_struct;
+
+       struct resource *r_irq = &r_irq_struct;
+       struct resource *r_mem = &r_mem_struct;
+       int rc = 0;
+       const u32 *prop;
+       int len;
 
        /* Get resources(memory, IRQ) associated with the device */
-       master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi));
+       master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi));
 
        if (master == NULL) {
                return -ENOMEM;
        }
 
-       platform_set_drvdata(dev, master);
-       pdata = dev->dev.platform_data;
+       dev_set_drvdata(&ofdev->dev, master);
 
-       if (pdata == NULL) {
-               ret = -ENODEV;
+       rc = of_address_to_resource(ofdev->node, 0, r_mem);
+       if (rc) {
+               dev_warn(&ofdev->dev, "invalid address\n");
                goto put_master;
        }
 
-       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       if (r == NULL) {
-               ret = -ENODEV;
+       rc = of_irq_to_resource(ofdev->node, 0, r_irq);
+       if (rc == NO_IRQ) {
+               dev_warn(&ofdev->dev, "no IRQ found\n");
                goto put_master;
        }
 
@@ -341,47 +341,57 @@ static int __init xilinx_spi_probe(struct platform_device *dev)
        xspi->bitbang.master->setup = xilinx_spi_setup;
        init_completion(&xspi->done);
 
-       if (!request_mem_region(r->start,
-                       r->end - r->start + 1, XILINX_SPI_NAME)) {
-               ret = -ENXIO;
+       xspi->irq = r_irq->start;
+
+       if (!request_mem_region(r_mem->start,
+                       r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
+               rc = -ENXIO;
+               dev_warn(&ofdev->dev, "memory request failure\n");
                goto put_master;
        }
 
-       xspi->regs = ioremap(r->start, r->end - r->start + 1);
+       xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
        if (xspi->regs == NULL) {
-               ret = -ENOMEM;
+               rc = -ENOMEM;
+               dev_warn(&ofdev->dev, "ioremap failure\n");
                goto put_master;
        }
+       xspi->irq = r_irq->start;
 
-       ret = platform_get_irq(dev, 0);
-       if (ret < 0) {
-               ret = -ENXIO;
-               goto unmap_io;
-       }
-       xspi->irq = ret;
+       /* dynamic bus assignment */
+       master->bus_num = -1;
 
-       master->bus_num = pdata->bus_num;
-       master->num_chipselect = pdata->num_chipselect;
-       xspi->speed_hz = pdata->speed_hz;
+       /* number of slave select bits is required */
+       prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len);
+       if (!prop || len < sizeof(*prop)) {
+               dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n");
+               goto put_master;
+       }
+       master->num_chipselect = *prop;
 
        /* SPI controller initializations */
        xspi_init_hw(xspi->regs);
 
        /* Register for SPI Interrupt */
-       ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
-       if (ret != 0)
+       rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
+       if (rc != 0) {
+               dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq);
                goto unmap_io;
+       }
 
-       ret = spi_bitbang_start(&xspi->bitbang);
-       if (ret != 0) {
-               dev_err(&dev->dev, "spi_bitbang_start FAILED\n");
+       rc = spi_bitbang_start(&xspi->bitbang);
+       if (rc != 0) {
+               dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n");
                goto free_irq;
        }
 
-       dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
-                       r->start, (u32)xspi->regs, xspi->irq);
+       dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
+                       (unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq);
 
-       return ret;
+       /* Add any subnodes on the SPI bus */
+       of_register_spi_devices(master, ofdev->node);
+
+       return rc;
 
 free_irq:
        free_irq(xspi->irq, xspi);
@@ -389,21 +399,21 @@ unmap_io:
        iounmap(xspi->regs);
 put_master:
        spi_master_put(master);
-       return ret;
+       return rc;
 }
 
-static int __devexit xilinx_spi_remove(struct platform_device *dev)
+static int __devexit xilinx_spi_remove(struct of_device *ofdev)
 {
        struct xilinx_spi *xspi;
        struct spi_master *master;
 
-       master = platform_get_drvdata(dev);
+       master = platform_get_drvdata(ofdev);
        xspi = spi_master_get_devdata(master);
 
        spi_bitbang_stop(&xspi->bitbang);
        free_irq(xspi->irq, xspi);
        iounmap(xspi->regs);
-       platform_set_drvdata(dev, 0);
+       dev_set_drvdata(&ofdev->dev, 0);
        spi_master_put(xspi->bitbang.master);
 
        return 0;
@@ -412,27 +422,42 @@ static int __devexit xilinx_spi_remove(struct platform_device *dev)
 /* work with hotplug and coldplug */
 MODULE_ALIAS("platform:" XILINX_SPI_NAME);
 
-static struct platform_driver xilinx_spi_driver = {
-       .probe  = xilinx_spi_probe,
-       .remove = __devexit_p(xilinx_spi_remove),
+static int __exit xilinx_spi_of_remove(struct of_device *op)
+{
+       return xilinx_spi_remove(op);
+}
+
+static struct of_device_id xilinx_spi_of_match[] = {
+       { .compatible = "xlnx,xps-spi-2.00.a", },
+       { .compatible = "xlnx,xps-spi-2.00.b", },
+       {}
+};
+
+MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
+
+static struct of_platform_driver xilinx_spi_of_driver = {
+       .owner = THIS_MODULE,
+       .name = "xilinx-xps-spi",
+       .match_table = xilinx_spi_of_match,
+       .probe = xilinx_spi_of_probe,
+       .remove = __exit_p(xilinx_spi_of_remove),
        .driver = {
-               .name = XILINX_SPI_NAME,
+               .name = "xilinx-xps-spi",
                .owner = THIS_MODULE,
        },
 };
 
 static int __init xilinx_spi_init(void)
 {
-       return platform_driver_register(&xilinx_spi_driver);
+       return of_register_platform_driver(&xilinx_spi_of_driver);
 }
 module_init(xilinx_spi_init);
 
 static void __exit xilinx_spi_exit(void)
 {
-       platform_driver_unregister(&xilinx_spi_driver);
+       of_unregister_platform_driver(&xilinx_spi_of_driver);
 }
 module_exit(xilinx_spi_exit);
-
 MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
 MODULE_DESCRIPTION("Xilinx SPI driver");
 MODULE_LICENSE("GPL");
index d5d0e40b1e2d158d7be86388f0aeaeb2106a39f1..94d5ee263c208d9f09968f7fc03ba068f26cd1de 100644 (file)
@@ -1554,7 +1554,7 @@ static int usb_configure_device_otg(struct usb_device *udev)
                 * (Includes HNP test device.)
                 */
                if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
-                       err = usb_port_suspend(udev);
+                       err = usb_port_suspend(udev, PMSG_SUSPEND);
                        if (err < 0)
                                dev_dbg(&udev->dev, "HNP fail, %d\n", err);
                }
index ef6cfa5a447feba817ffd8a8a819a8451db1918e..c70a8f667d85aa007e9260a24c92c9cf94d118c8 100644 (file)
@@ -2030,7 +2030,7 @@ static void ftdi_process_read(struct work_struct *work)
                        spin_unlock_irqrestore(&priv->rx_lock, flags);
                        dbg("%s - deferring remainder until unthrottled",
                                        __func__);
-                       return;
+                       goto out;
                }
                spin_unlock_irqrestore(&priv->rx_lock, flags);
                /* if the port is closed stop trying to read */
index 7644ed2495644b1fe75a2fa97608113c79e5f42d..37e60b1d2ed953ff963820e8f386985d973b5fa7 100644 (file)
@@ -335,7 +335,20 @@ static int bfin_bf54x_fb_check_var(struct fb_var_screeninfo *var,
                                   struct fb_info *info)
 {
 
-       if (var->bits_per_pixel != LCD_BPP) {
+       switch (var->bits_per_pixel) {
+       case 24:/* TRUECOLOUR, 16m */
+               var->red.offset = 16;
+               var->green.offset = 8;
+               var->blue.offset = 0;
+               var->red.length = var->green.length = var->blue.length = 8;
+               var->transp.offset = 0;
+               var->transp.length = 0;
+               var->transp.msb_right = 0;
+               var->red.msb_right = 0;
+               var->green.msb_right = 0;
+               var->blue.msb_right = 0;
+               break;
+       default:
                pr_debug("%s: depth not supported: %u BPP\n", __func__,
                         var->bits_per_pixel);
                return -EINVAL;
index a9b3ada05d99918f4d79a94132a0719e063816cb..2a423d3a2a8eb8fe80436b6b2100fef8a39ad9f1 100644 (file)
@@ -254,7 +254,20 @@ static int bfin_t350mcqb_fb_check_var(struct fb_var_screeninfo *var,
                                   struct fb_info *info)
 {
 
-       if (var->bits_per_pixel != LCD_BPP) {
+       switch (var->bits_per_pixel) {
+       case 24:/* TRUECOLOUR, 16m */
+               var->red.offset = 0;
+               var->green.offset = 8;
+               var->blue.offset = 16;
+               var->red.length = var->green.length = var->blue.length = 8;
+               var->transp.offset = 0;
+               var->transp.length = 0;
+               var->transp.msb_right = 0;
+               var->red.msb_right = 0;
+               var->green.msb_right = 0;
+               var->blue.msb_right = 0;
+               break;
+       default:
                pr_debug("%s: depth not supported: %u BPP\n", __func__,
                         var->bits_per_pixel);
                return -EINVAL;
index 38ac805db97d4bcb5cdca4866f0fd3cfb430dce3..87f826e4c958c8c19c5c6b8d9471f21c5481f0df 100644 (file)
@@ -1006,7 +1006,7 @@ static int ps3fb_xdr_settings(u64 xdr_lpar, struct device *dev)
                        __func__, status);
                return -ENXIO;
        }
-       dev_dbg(dev, "video:%p ioif:%lx lpar:%lx size:%lx\n",
+       dev_dbg(dev, "video:%p ioif:%lx lpar:%llx size:%lx\n",
                ps3fb_videomemory.address, GPU_IOIF, xdr_lpar,
                ps3fb_videomemory.size);
 
@@ -1133,7 +1133,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
                        __func__, status);
                goto err;
        }
-       dev_dbg(&dev->core, "ddr:lpar:0x%lx\n", ddr_lpar);
+       dev_dbg(&dev->core, "ddr:lpar:0x%llx\n", ddr_lpar);
 
        status = lv1_gpu_context_allocate(ps3fb.memory_handle, 0,
                                          &ps3fb.context_handle,
index d6f89d3c15e80f0ebd15699e62959712fad4b7bc..8fa77e233944474a7f4e850b7aa74f80da915c05 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1270,7 +1270,7 @@ static void io_destroy(struct kioctx *ioctx)
  *     pointer is passed for ctxp.  Will fail with -ENOSYS if not
  *     implemented.
  */
-asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp)
+SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
 {
        struct kioctx *ioctx = NULL;
        unsigned long ctx;
@@ -1308,7 +1308,7 @@ out:
  *     implemented.  May fail with -EFAULT if the context pointed to
  *     is invalid.
  */
-asmlinkage long sys_io_destroy(aio_context_t ctx)
+SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
 {
        struct kioctx *ioctx = lookup_ioctx(ctx);
        if (likely(NULL != ioctx)) {
@@ -1662,8 +1662,8 @@ out_put_req:
  *     are available to queue any iocbs.  Will return 0 if nr is 0.  Will
  *     fail with -ENOSYS if not implemented.
  */
-asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr,
-                             struct iocb __user * __user *iocbpp)
+SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr,
+               struct iocb __user * __user *, iocbpp)
 {
        struct kioctx *ctx;
        long ret = 0;
@@ -1737,8 +1737,8 @@ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb,
  *     invalid.  May fail with -EAGAIN if the iocb specified was not
  *     cancelled.  Will fail with -ENOSYS if not implemented.
  */
-asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
-                             struct io_event __user *result)
+SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
+               struct io_event __user *, result)
 {
        int (*cancel)(struct kiocb *iocb, struct io_event *res);
        struct kioctx *ctx;
@@ -1799,11 +1799,11 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
  *     will be updated if not NULL and the operation blocks.  Will fail
  *     with -ENOSYS if not implemented.
  */
-asmlinkage long sys_io_getevents(aio_context_t ctx_id,
-                                long min_nr,
-                                long nr,
-                                struct io_event __user *events,
-                                struct timespec __user *timeout)
+SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id,
+               long, min_nr,
+               long, nr,
+               struct io_event __user *, events,
+               struct timespec __user *, timeout)
 {
        struct kioctx *ioctx = lookup_ioctx(ctx_id);
        long ret = -EINVAL;
index 78049ea208db6b7e30c0dabe8679af1094fe4bb8..b320b103fa132dadf345168a80fff04bd41be8b3 100644 (file)
 
 #define BTRFS_IOCTL_MAGIC 0x94
 #define BTRFS_VOL_NAME_MAX 255
-#define BTRFS_PATH_NAME_MAX 3072
+#define BTRFS_PATH_NAME_MAX 4087
 
+/* this should be 4k */
 struct btrfs_ioctl_vol_args {
        __s64 fd;
        char name[BTRFS_PATH_NAME_MAX + 1];
 };
 
+struct btrfs_ioctl_clone_range_args {
+  __s64 src_fd;
+  __u64 src_offset, src_length;
+  __u64 dest_offset;
+};
+
 #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
                                   struct btrfs_ioctl_vol_args)
 #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -52,11 +59,6 @@ struct btrfs_ioctl_vol_args {
                                   struct btrfs_ioctl_vol_args)
 #define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \
                                   struct btrfs_ioctl_vol_args)
-struct btrfs_ioctl_clone_range_args {
-  __s64 src_fd;
-  __u64 src_offset, src_length;
-  __u64 dest_offset;
-};
 
 #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \
                                  struct btrfs_ioctl_clone_range_args)
index 0a14b495532fcc901d3c3baaa29cb4753d327d7f..db9fb3bc1e333c5255a92537a9891d4f8716f899 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/namei.h>
 #include <linux/miscdevice.h>
 #include <linux/version.h>
+#include <linux/magic.h>
 #include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"
@@ -51,7 +52,6 @@
 #include "export.h"
 #include "compression.h"
 
-#define BTRFS_SUPER_MAGIC 0x9123683E
 
 static struct super_operations btrfs_super_ops;
 
@@ -582,7 +582,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
 {
        struct btrfs_ioctl_vol_args *vol;
        struct btrfs_fs_devices *fs_devices;
-       int ret = 0;
+       int ret = -ENOTTY;
        int len;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -594,6 +594,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
                goto out;
        }
        len = strnlen(vol->name, BTRFS_PATH_NAME_MAX);
+
        switch (cmd) {
        case BTRFS_IOC_SCAN_DEV:
                ret = btrfs_scan_one_device(vol->name, FMODE_READ,
index b187b537888e5516309990c2f5a1b1d1c9e6ee00..3451e1cca2b5c77ccdfdc3f5cab713f4a02721d2 100644 (file)
@@ -220,6 +220,7 @@ loop:
                                tail->bi_next = old_head;
                        else
                                device->pending_bio_tail = tail;
+                       device->running_pending = 0;
 
                        spin_unlock(&device->io_lock);
                        btrfs_requeue_work(&device->work);
index b6e8b8632e2f973718dda48d0247e961569105df..b58208f1640a00eecbb0c760469a15b8fe31f6c3 100644 (file)
@@ -3243,7 +3243,7 @@ void block_sync_page(struct page *page)
  * Use of bdflush() is deprecated and will be removed in a future kernel.
  * The `pdflush' kernel threads fully replace bdflush daemons and this call.
  */
-asmlinkage long sys_bdflush(int func, long data)
+SYSCALL_DEFINE2(bdflush, int, func, long, data)
 {
        static int msg_count;
 
index 30f2faa22f5ca4b67f82ad8d7f7fc5e61ed06a44..65a070e705ab1d8112ae6085c8d3e7d7c6202c90 100644 (file)
@@ -1709,7 +1709,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
 }
 
 #ifdef HAVE_SET_RESTORE_SIGMASK
-asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
+static long do_compat_pselect(int n, compat_ulong_t __user *inp,
        compat_ulong_t __user *outp, compat_ulong_t __user *exp,
        struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask,
        compat_size_t sigsetsize)
@@ -1775,8 +1775,8 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
                                (compat_size_t __user *)(sig+sizeof(up))))
                        return -EFAULT;
        }
-       return compat_sys_pselect7(n, inp, outp, exp, tsp, compat_ptr(up),
-                                       sigsetsize);
+       return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(up),
+                                sigsetsize);
 }
 
 asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
index 4547f66884a07f62c4cde29c118ee808360dba38..937df0fb0da5aefbb1a69b94c6a06afbe1747439 100644 (file)
@@ -2092,7 +2092,7 @@ Elong:
  *             return NULL;
  *     }
  */
-asmlinkage long sys_getcwd(char __user *buf, unsigned long size)
+SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
 {
        int error;
        struct path pwd, root;
index 180e9fec4ad832763bbf6344ecf74265bc1d144b..a21cabdbd87b174c635b584e548fcfbd3d1d1679 100644 (file)
@@ -145,7 +145,7 @@ out:
 /* And here is where the userspace process can look up the cookie value
  * to retrieve the path.
  */
-asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len)
+SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len)
 {
        unsigned long cookie = (unsigned long)cookie64;
        int err = -EINVAL;
@@ -198,7 +198,13 @@ out:
        mutex_unlock(&dcookie_mutex);
        return err;
 }
-
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_lookup_dcookie(u64 cookie64, long buf, long len)
+{
+       return SYSC_lookup_dcookie(cookie64, (char __user *) buf, (size_t) len);
+}
+SYSCALL_ALIAS(sys_lookup_dcookie, SyS_lookup_dcookie);
+#endif
 
 static int dcookie_init(void)
 {
index 08bf558d04080ffe0a3ced77a5660d4af4e1182f..5de2c2db3aa2381ccc04b02ca440ba56d14cfaba 100644 (file)
@@ -198,7 +198,7 @@ struct file *eventfd_fget(int fd)
        return file;
 }
 
-asmlinkage long sys_eventfd2(unsigned int count, int flags)
+SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
 {
        int fd;
        struct eventfd_ctx *ctx;
@@ -228,8 +228,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
        return fd;
 }
 
-asmlinkage long sys_eventfd(unsigned int count)
+SYSCALL_DEFINE1(eventfd, unsigned int, count)
 {
        return sys_eventfd2(count, 0);
 }
-
index 96355d505347414fc67dd1a7cd21503bdffa3c91..ba2f9ec71192180647967f02fc1c4221c95c4a5a 100644 (file)
@@ -1110,7 +1110,7 @@ retry:
 /*
  * Open an eventpoll file descriptor.
  */
-asmlinkage long sys_epoll_create1(int flags)
+SYSCALL_DEFINE1(epoll_create1, int, flags)
 {
        int error, fd = -1;
        struct eventpoll *ep;
@@ -1150,7 +1150,7 @@ error_return:
        return fd;
 }
 
-asmlinkage long sys_epoll_create(int size)
+SYSCALL_DEFINE1(epoll_create, int, size)
 {
        if (size < 0)
                return -EINVAL;
@@ -1163,8 +1163,8 @@ asmlinkage long sys_epoll_create(int size)
  * the eventpoll file that enables the insertion/removal/change of
  * file descriptors inside the interest set.
  */
-asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
-                             struct epoll_event __user *event)
+SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
+               struct epoll_event __user *, event)
 {
        int error;
        struct file *file, *tfile;
@@ -1261,8 +1261,8 @@ error_return:
  * Implement the event wait interface for the eventpoll file. It is the kernel
  * part of the user space epoll_wait(2).
  */
-asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
-                              int maxevents, int timeout)
+SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
+               int, maxevents, int, timeout)
 {
        int error;
        struct file *file;
@@ -1319,9 +1319,9 @@ error_return:
  * Implement the event wait interface for the eventpoll file. It is the kernel
  * part of the user space epoll_pwait(2).
  */
-asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events,
-               int maxevents, int timeout, const sigset_t __user *sigmask,
-               size_t sigsetsize)
+SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events,
+               int, maxevents, int, timeout, const sigset_t __user *, sigmask,
+               size_t, sigsetsize)
 {
        int error;
        sigset_t ksigmask, sigsaved;
index 71a6efe5d8bd572455c1305a07734af70194d581..0dd60a01f1b4eabcd6ff2717ad2faffe099f8f61 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -99,7 +99,7 @@ static inline void put_binfmt(struct linux_binfmt * fmt)
  *
  * Also note that we take the address to load from from the file itself.
  */
-asmlinkage long sys_uselib(const char __user * library)
+SYSCALL_DEFINE1(uselib, const char __user *, library)
 {
        struct file *file;
        struct nameidata nd;
index 9a0fc400f91cf606bdd9bfc7c9b14e136243a1c7..2999d72153b7c19d91b86fe918089263f299b2b6 100644 (file)
@@ -95,10 +95,13 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
                mark_inode_dirty(dir);
        }
 
-       if (IS_DIRSYNC(dir))
+       if (IS_DIRSYNC(dir)) {
                err = write_one_page(page, 1);
-       else
+               if (!err)
+                       err = ext2_sync_inode(dir);
+       } else {
                unlock_page(page);
+       }
 
        return err;
 }
index cdc1419467247e2bd428d4cbd6c88b3783a20455..bd215cc791da53eb9713063600a56ab3edb1c92a 100644 (file)
@@ -50,7 +50,7 @@ static int get_close_on_exec(unsigned int fd)
        return res;
 }
 
-asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
+SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
 {
        int err = -EBADF;
        struct file * file, *tofree;
@@ -113,7 +113,7 @@ out_unlock:
        return err;
 }
 
-asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
+SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
 {
        if (unlikely(newfd == oldfd)) { /* corner case */
                struct files_struct *files = current->files;
@@ -126,7 +126,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
        return sys_dup3(oldfd, newfd, 0);
 }
 
-asmlinkage long sys_dup(unsigned int fildes)
+SYSCALL_DEFINE1(dup, unsigned int, fildes)
 {
        int ret = -EBADF;
        struct file *file = fget(fildes);
@@ -335,7 +335,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
        return err;
 }
 
-asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
+SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
 {      
        struct file *filp;
        long err = -EBADF;
@@ -358,7 +358,8 @@ out:
 }
 
 #if BITS_PER_LONG == 32
-asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
+SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
+               unsigned long, arg)
 {      
        struct file * filp;
        long err;
index d488dcd7f2bbf0a14a4e23ebe328703b0b5b0d1c..1aa70260e6d1367f6b2db4be2a797123c92c5033 100644 (file)
@@ -179,7 +179,7 @@ static int fs_maxindex(void)
 /*
  * Whee.. Weird sysv syscall. 
  */
-asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2)
+SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
 {
        int retval = -EINVAL;
 
index 20b0a8a24c6bbb61ea6509412ce2c41fea82dfd2..240ec63984cb9f5eb5e25f113a508cb518f73d18 100644 (file)
@@ -542,7 +542,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
        return error;
 }
 
-asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
 {
        struct file *filp;
        int error = -EBADF;
index 1a39ac3709425bf761ae466ad7529703a4c81c7b..c7c0b28d7d2177c7c88d32f3f62856e97cfc7ff5 100644 (file)
@@ -72,7 +72,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio)
 }
 EXPORT_SYMBOL_GPL(set_task_ioprio);
 
-asmlinkage long sys_ioprio_set(int which, int who, int ioprio)
+SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)
 {
        int class = IOPRIO_PRIO_CLASS(ioprio);
        int data = IOPRIO_PRIO_DATA(ioprio);
@@ -188,7 +188,7 @@ int ioprio_best(unsigned short aprio, unsigned short bprio)
                return aprio;
 }
 
-asmlinkage long sys_ioprio_get(int which, int who)
+SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
 {
        struct task_struct *g, *p;
        struct user_struct *user;
@@ -252,4 +252,3 @@ asmlinkage long sys_ioprio_get(int which, int who)
        read_unlock(&tasklist_lock);
        return ret;
 }
-
index 46a2e12f7d422992e5f6e48cbc6fb9f07b225e3b..ec3deea29e37cbd581488087e94053708dd100b1 100644 (file)
@@ -1564,7 +1564,7 @@ EXPORT_SYMBOL(flock_lock_file_wait);
  *     %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other
  *     processes read and write access respectively.
  */
-asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
+SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 {
        struct file *filp;
        struct file_lock *lock;
index f05bed242422eed8172c3a6acdc6b9838428eec4..bbc15c237558f82c7fbe2b661e55ee8fa1b9849d 100644 (file)
@@ -1962,8 +1962,8 @@ static int may_mknod(mode_t mode)
        }
 }
 
-asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode,
-                               unsigned dev)
+SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
+               unsigned, dev)
 {
        int error;
        char *tmp;
@@ -2017,7 +2017,7 @@ out_unlock:
        return error;
 }
 
-asmlinkage long sys_mknod(const char __user *filename, int mode, unsigned dev)
+SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev)
 {
        return sys_mknodat(AT_FDCWD, filename, mode, dev);
 }
@@ -2044,7 +2044,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        return error;
 }
 
-asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode)
+SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
 {
        int error = 0;
        char * tmp;
@@ -2081,7 +2081,7 @@ out_err:
        return error;
 }
 
-asmlinkage long sys_mkdir(const char __user *pathname, int mode)
+SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode)
 {
        return sys_mkdirat(AT_FDCWD, pathname, mode);
 }
@@ -2195,7 +2195,7 @@ exit1:
        return error;
 }
 
-asmlinkage long sys_rmdir(const char __user *pathname)
+SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
 {
        return do_rmdir(AT_FDCWD, pathname);
 }
@@ -2291,7 +2291,7 @@ slashes:
        goto exit2;
 }
 
-asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag)
+SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 {
        if ((flag & ~AT_REMOVEDIR) != 0)
                return -EINVAL;
@@ -2302,7 +2302,7 @@ asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag)
        return do_unlinkat(dfd, pathname);
 }
 
-asmlinkage long sys_unlink(const char __user *pathname)
+SYSCALL_DEFINE1(unlink, const char __user *, pathname)
 {
        return do_unlinkat(AT_FDCWD, pathname);
 }
@@ -2328,8 +2328,8 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
        return error;
 }
 
-asmlinkage long sys_symlinkat(const char __user *oldname,
-                             int newdfd, const char __user *newname)
+SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+               int, newdfd, const char __user *, newname)
 {
        int error;
        char *from;
@@ -2370,7 +2370,7 @@ out_putname:
        return error;
 }
 
-asmlinkage long sys_symlink(const char __user *oldname, const char __user *newname)
+SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname)
 {
        return sys_symlinkat(oldname, AT_FDCWD, newname);
 }
@@ -2422,9 +2422,8 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
  * with linux 2.0, and to avoid hard-linking to directories
  * and other special files.  --ADM
  */
-asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
-                          int newdfd, const char __user *newname,
-                          int flags)
+SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+               int, newdfd, const char __user *, newname, int, flags)
 {
        struct dentry *new_dentry;
        struct nameidata nd;
@@ -2473,7 +2472,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_link(const char __user *oldname, const char __user *newname)
+SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
 {
        return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
@@ -2624,8 +2623,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        return error;
 }
 
-asmlinkage long sys_renameat(int olddfd, const char __user *oldname,
-                            int newdfd, const char __user *newname)
+SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
+               int, newdfd, const char __user *, newname)
 {
        struct dentry *old_dir, *new_dir;
        struct dentry *old_dentry, *new_dentry;
@@ -2718,7 +2717,7 @@ exit:
        return error;
 }
 
-asmlinkage long sys_rename(const char __user *oldname, const char __user *newname)
+SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname)
 {
        return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname);
 }
index a40685d800a84395db6c585bc55bb01b3e20ce0e..228d8c4bfd18a1925fd57ac3880e2e47031470d2 100644 (file)
@@ -1128,7 +1128,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
  * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
  */
 
-asmlinkage long sys_umount(char __user * name, int flags)
+SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
 {
        struct path path;
        int retval;
@@ -1160,7 +1160,7 @@ out:
 /*
  *     The 2.0 compatible umount. No flags.
  */
-asmlinkage long sys_oldumount(char __user * name)
+SYSCALL_DEFINE1(oldumount, char __user *, name)
 {
        return sys_umount(name, 0);
 }
@@ -2045,9 +2045,8 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
        return new_ns;
 }
 
-asmlinkage long sys_mount(char __user * dev_name, char __user * dir_name,
-                         char __user * type, unsigned long flags,
-                         void __user * data)
+SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
+               char __user *, type, unsigned long, flags, void __user *, data)
 {
        int retval;
        unsigned long data_page;
@@ -2172,8 +2171,8 @@ static void chroot_fs_refs(struct path *old_root, struct path *new_root)
  *    though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
  *    first.
  */
-asmlinkage long sys_pivot_root(const char __user * new_root,
-                              const char __user * put_old)
+SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+               const char __user *, put_old)
 {
        struct vfsmount *tmp;
        struct path new, old, parent_path, root_parent, root;
index b27451909dff0d17b2f148adad84f964214bac83..8f9a20556f798931ee906c4e3a08660e55778f60 100644 (file)
@@ -86,8 +86,8 @@ static struct {
        },
 };
 
-long
-asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res)
+SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg,
+               void __user *, res)
 {
        struct file *file;
        void __user *p = &arg->u;
index 81b8644b0136cdb84fa9f254f329f7104fe4e7d3..d53a1838d6e8e68e27293206367a7a9654bce1a4 100644 (file)
@@ -576,7 +576,7 @@ static const struct inotify_operations inotify_user_ops = {
        .destroy_watch  = free_inotify_user_watch,
 };
 
-asmlinkage long sys_inotify_init1(int flags)
+SYSCALL_DEFINE1(inotify_init1, int, flags)
 {
        struct inotify_device *dev;
        struct inotify_handle *ih;
@@ -655,12 +655,13 @@ out_put_fd:
        return ret;
 }
 
-asmlinkage long sys_inotify_init(void)
+SYSCALL_DEFINE0(inotify_init)
 {
        return sys_inotify_init1(0);
 }
 
-asmlinkage long sys_inotify_add_watch(int fd, const char __user *pathname, u32 mask)
+SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
+               u32, mask)
 {
        struct inode *inode;
        struct inotify_device *dev;
@@ -704,7 +705,7 @@ fput_and_out:
        return ret;
 }
 
-asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd)
+SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
 {
        struct file *filp;
        struct inotify_device *dev;
index d882fd2351d625fef025292c07403bbf89da57d3..a3a78ceb2a2bf8c52a3b16cb7e5ca5648f710b15 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -122,7 +122,7 @@ static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf)
        return 0;
 }
 
-asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * buf)
+SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf)
 {
        struct path path;
        int error;
@@ -138,8 +138,7 @@ asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * b
        return error;
 }
 
-
-asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct statfs64 __user *buf)
+SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf)
 {
        struct path path;
        long error;
@@ -157,8 +156,7 @@ asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct stat
        return error;
 }
 
-
-asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf)
+SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf)
 {
        struct file * file;
        struct statfs tmp;
@@ -176,7 +174,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user *buf)
+SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf)
 {
        struct file * file;
        struct statfs64 tmp;
@@ -289,7 +287,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_truncate(const char __user * path, unsigned long length)
+SYSCALL_DEFINE2(truncate, const char __user *, path, unsigned long, length)
 {
        /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */
        return do_sys_truncate(path, (long)length);
@@ -341,7 +339,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length)
+SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
 {
        long ret = do_sys_ftruncate(fd, length, 1);
        /* avoid REGPARM breakage on x86: */
@@ -351,21 +349,35 @@ asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length)
 
 /* LFS versions of truncate are only needed on 32 bit machines */
 #if BITS_PER_LONG == 32
-asmlinkage long sys_truncate64(const char __user * path, loff_t length)
+SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length)
 {
        return do_sys_truncate(path, length);
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_truncate64(long path, loff_t length)
+{
+       return SYSC_truncate64((const char __user *) path, length);
+}
+SYSCALL_ALIAS(sys_truncate64, SyS_truncate64);
+#endif
 
-asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length)
+SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length)
 {
        long ret = do_sys_ftruncate(fd, length, 0);
        /* avoid REGPARM breakage on x86: */
        asmlinkage_protect(2, ret, fd, length);
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_ftruncate64(long fd, loff_t length)
+{
+       return SYSC_ftruncate64((unsigned int) fd, length);
+}
+SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64);
 #endif
+#endif /* BITS_PER_LONG == 32 */
 
-asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len)
+SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len)
 {
        struct file *file;
        struct inode *inode;
@@ -422,13 +434,20 @@ out_fput:
 out:
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_fallocate(long fd, long mode, loff_t offset, loff_t len)
+{
+       return SYSC_fallocate((int)fd, (int)mode, offset, len);
+}
+SYSCALL_ALIAS(sys_fallocate, SyS_fallocate);
+#endif
 
 /*
  * access() needs to use the real uid/gid, not the effective uid/gid.
  * We do this by temporarily clearing all FS-related capabilities and
  * switching the fsuid/fsgid around to the real ones.
  */
-asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
+SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
 {
        const struct cred *old_cred;
        struct cred *override_cred;
@@ -498,12 +517,12 @@ out:
        return res;
 }
 
-asmlinkage long sys_access(const char __user *filename, int mode)
+SYSCALL_DEFINE2(access, const char __user *, filename, int, mode)
 {
        return sys_faccessat(AT_FDCWD, filename, mode);
 }
 
-asmlinkage long sys_chdir(const char __user * filename)
+SYSCALL_DEFINE1(chdir, const char __user *, filename)
 {
        struct path path;
        int error;
@@ -524,7 +543,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_fchdir(unsigned int fd)
+SYSCALL_DEFINE1(fchdir, unsigned int, fd)
 {
        struct file *file;
        struct inode *inode;
@@ -550,7 +569,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_chroot(const char __user * filename)
+SYSCALL_DEFINE1(chroot, const char __user *, filename)
 {
        struct path path;
        int error;
@@ -575,7 +594,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
+SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
 {
        struct inode * inode;
        struct dentry * dentry;
@@ -609,8 +628,7 @@ out:
        return err;
 }
 
-asmlinkage long sys_fchmodat(int dfd, const char __user *filename,
-                            mode_t mode)
+SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode)
 {
        struct path path;
        struct inode *inode;
@@ -639,7 +657,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_chmod(const char __user *filename, mode_t mode)
+SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode)
 {
        return sys_fchmodat(AT_FDCWD, filename, mode);
 }
@@ -669,7 +687,7 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
        return error;
 }
 
-asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group)
+SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
 {
        struct path path;
        int error;
@@ -688,8 +706,8 @@ out:
        return error;
 }
 
-asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
-                            gid_t group, int flag)
+SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
+               gid_t, group, int, flag)
 {
        struct path path;
        int error = -EINVAL;
@@ -713,7 +731,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group)
+SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
 {
        struct path path;
        int error;
@@ -732,8 +750,7 @@ out:
        return error;
 }
 
-
-asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group)
+SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
 {
        struct file * file;
        int error = -EBADF;
@@ -1029,7 +1046,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
        return fd;
 }
 
-asmlinkage long sys_open(const char __user *filename, int flags, int mode)
+SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode)
 {
        long ret;
 
@@ -1042,8 +1059,8 @@ asmlinkage long sys_open(const char __user *filename, int flags, int mode)
        return ret;
 }
 
-asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
-                          int mode)
+SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
+               int, mode)
 {
        long ret;
 
@@ -1062,7 +1079,7 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
  * For backward compatibility?  Maybe this should be moved
  * into arch/i386 instead?
  */
-asmlinkage long sys_creat(const char __user * pathname, int mode)
+SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode)
 {
        return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
@@ -1098,7 +1115,7 @@ EXPORT_SYMBOL(filp_close);
  * releasing the fd. This ensures that one clone task can't release
  * an fd while another clone is opening it.
  */
-asmlinkage long sys_close(unsigned int fd)
+SYSCALL_DEFINE1(close, unsigned int, fd)
 {
        struct file * filp;
        struct files_struct *files = current->files;
@@ -1131,14 +1148,13 @@ out_unlock:
        spin_unlock(&files->file_lock);
        return -EBADF;
 }
-
 EXPORT_SYMBOL(sys_close);
 
 /*
  * This routine simulates a hangup on the tty, to arrange that users
  * are given clean terminals at login time.
  */
-asmlinkage long sys_vhangup(void)
+SYSCALL_DEFINE0(vhangup)
 {
        if (capable(CAP_SYS_TTY_CONFIG)) {
                tty_vhangup_self();
index 891697112f6620c9d25f4c080f2654962b45d1b9..3a48ba5179d55000e4d6b26f5a1eb7bfb5a5891d 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1043,7 +1043,7 @@ int do_pipe(int *fd)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-asmlinkage long __weak sys_pipe2(int __user *fildes, int flags)
+SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
 {
        int fd[2];
        int error;
@@ -1059,7 +1059,7 @@ asmlinkage long __weak sys_pipe2(int __user *fildes, int flags)
        return error;
 }
 
-asmlinkage long __weak sys_pipe(int __user *fildes)
+SYSCALL_DEFINE1(pipe, int __user *, fildes)
 {
        return sys_pipe2(fildes, 0);
 }
index 4a8c94f05f76b29cce8c0b811e09a33a6ea3a2da..d76ada914f9898f7b8c4c1435469110a35449561 100644 (file)
@@ -371,7 +371,8 @@ static inline struct super_block *quotactl_block(const char __user *special)
  * calls. Maybe we need to add the process quotas etc. in the future,
  * but we probably should use rlimits for that.
  */
-asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr)
+SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
+               qid_t, id, void __user *, addr)
 {
        uint cmds, type;
        struct super_block *sb = NULL;
index 5cc6924eb158f14b47fdc82c96500ef090f4c738..400fe81c973e90cccdb94c814325bc3ce4e39d19 100644 (file)
@@ -147,7 +147,7 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
 }
 EXPORT_SYMBOL(vfs_llseek);
 
-asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
+SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
 {
        off_t retval;
        struct file * file;
@@ -171,9 +171,9 @@ bad:
 }
 
 #ifdef __ARCH_WANT_SYS_LLSEEK
-asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
-                          unsigned long offset_low, loff_t __user * result,
-                          unsigned int origin)
+SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
+               unsigned long, offset_low, loff_t __user *, result,
+               unsigned int, origin)
 {
        int retval;
        struct file * file;
@@ -369,7 +369,7 @@ static inline void file_pos_write(struct file *file, loff_t pos)
        file->f_pos = pos;
 }
 
-asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
+SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -386,7 +386,8 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
        return ret;
 }
 
-asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count)
+SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf,
+               size_t, count)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -403,8 +404,8 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co
        return ret;
 }
 
-asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
-                            size_t count, loff_t pos)
+SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf,
+                       size_t count, loff_t pos)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -423,9 +424,17 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
 
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos)
+{
+       return SYSC_pread64((unsigned int) fd, (char __user *) buf,
+                           (size_t) count, pos);
+}
+SYSCALL_ALIAS(sys_pread64, SyS_pread64);
+#endif
 
-asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf,
-                             size_t count, loff_t pos)
+SYSCALL_DEFINE(pwrite64)(unsigned int fd, const char __user *buf,
+                        size_t count, loff_t pos)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -444,6 +453,14 @@ asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf,
 
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos)
+{
+       return SYSC_pwrite64((unsigned int) fd, (const char __user *) buf,
+                            (size_t) count, pos);
+}
+SYSCALL_ALIAS(sys_pwrite64, SyS_pwrite64);
+#endif
 
 /*
  * Reduce an iovec's length in-place.  Return the resulting number of segments
@@ -672,8 +689,8 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec,
 
 EXPORT_SYMBOL(vfs_writev);
 
-asmlinkage ssize_t
-sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
+SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec,
+               unsigned long, vlen)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -693,8 +710,8 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
        return ret;
 }
 
-asmlinkage ssize_t
-sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
+SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec,
+               unsigned long, vlen)
 {
        struct file *file;
        ssize_t ret = -EBADF;
@@ -812,7 +829,7 @@ out:
        return retval;
 }
 
-asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count)
+SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count)
 {
        loff_t pos;
        off_t off;
@@ -831,7 +848,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, siz
        return do_sendfile(out_fd, in_fd, NULL, count, 0);
 }
 
-asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count)
+SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count)
 {
        loff_t pos;
        ssize_t ret;
index b318d9b5af2e9c5d24a325ece38acac3027a2ef8..7723401f8d8b58d43b780ed1d3ff1e5f38303b0d 100644 (file)
@@ -102,7 +102,8 @@ efault:
        return -EFAULT;
 }
 
-asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count)
+SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
+               struct old_linux_dirent __user *, dirent, unsigned int, count)
 {
        int error;
        struct file * file;
@@ -187,7 +188,8 @@ efault:
        return -EFAULT;
 }
 
-asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count)
+SYSCALL_DEFINE3(getdents, unsigned int, fd,
+               struct linux_dirent __user *, dirent, unsigned int, count)
 {
        struct file * file;
        struct linux_dirent __user * lastdirent;
@@ -268,7 +270,8 @@ efault:
        return -EFAULT;
 }
 
-asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count)
+SYSCALL_DEFINE3(getdents64, unsigned int, fd,
+               struct linux_dirent64 __user *, dirent, unsigned int, count)
 {
        struct file * file;
        struct linux_dirent64 __user * lastdirent;
index 08b91beed80644a3cd35c95a33bdff120b42a4e1..0fe0e1469df31f386845dd443fdfe89a01543d92 100644 (file)
@@ -557,8 +557,8 @@ out_nofds:
        return ret;
 }
 
-asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
-                       fd_set __user *exp, struct timeval __user *tvp)
+SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp,
+               fd_set __user *, exp, struct timeval __user *, tvp)
 {
        struct timespec end_time, *to = NULL;
        struct timeval tv;
@@ -582,9 +582,9 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
 }
 
 #ifdef HAVE_SET_RESTORE_SIGMASK
-asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
-               fd_set __user *exp, struct timespec __user *tsp,
-               const sigset_t __user *sigmask, size_t sigsetsize)
+static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,
+                      fd_set __user *exp, struct timespec __user *tsp,
+                      const sigset_t __user *sigmask, size_t sigsetsize)
 {
        sigset_t ksigmask, sigsaved;
        struct timespec ts, end_time, *to = NULL;
@@ -610,7 +610,7 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
                sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved);
        }
 
-       ret = core_sys_select(n, inp, outp, exp, &end_time);
+       ret = core_sys_select(n, inp, outp, exp, to);
        ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
 
        if (ret == -ERESTARTNOHAND) {
@@ -636,8 +636,9 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
  * which has a pointer to the sigset_t itself followed by a size_t containing
  * the sigset size.
  */
-asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
-       fd_set __user *exp, struct timespec __user *tsp, void __user *sig)
+SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp,
+               fd_set __user *, exp, struct timespec __user *, tsp,
+               void __user *, sig)
 {
        size_t sigsetsize = 0;
        sigset_t __user *up = NULL;
@@ -650,7 +651,7 @@ asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
                        return -EFAULT;
        }
 
-       return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize);
+       return do_pselect(n, inp, outp, exp, tsp, up, sigsetsize);
 }
 #endif /* HAVE_SET_RESTORE_SIGMASK */
 
@@ -854,8 +855,8 @@ static long do_restart_poll(struct restart_block *restart_block)
        return ret;
 }
 
-asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
-                       long timeout_msecs)
+SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
+               long, timeout_msecs)
 {
        struct timespec end_time, *to = NULL;
        int ret;
@@ -889,9 +890,9 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
 }
 
 #ifdef HAVE_SET_RESTORE_SIGMASK
-asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
-       struct timespec __user *tsp, const sigset_t __user *sigmask,
-       size_t sigsetsize)
+SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds,
+               struct timespec __user *, tsp, const sigset_t __user *, sigmask,
+               size_t, sigsetsize)
 {
        sigset_t ksigmask, sigsaved;
        struct timespec ts, end_time, *to = NULL;
index 9c39bc7f843137cf167476797554697ce5834da5..b07565c9438672015aa041e3fb57e4b01ca6e27c 100644 (file)
@@ -205,8 +205,8 @@ static const struct file_operations signalfd_fops = {
        .read           = signalfd_read,
 };
 
-asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask,
-                             size_t sizemask, int flags)
+SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
+               size_t, sizemask, int, flags)
 {
        sigset_t sigmask;
        struct signalfd_ctx *ctx;
@@ -259,8 +259,8 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask,
        return ufd;
 }
 
-asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask,
-                            size_t sizemask)
+SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask,
+               size_t, sizemask)
 {
        return sys_signalfd4(ufd, user_mask, sizemask, 0);
 }
index a54b3e3f10a716cb63ab56311745716a70086d0f..4ed0ba44a966ce053cdf11475333f4bdb0bb73b4 100644 (file)
@@ -1435,8 +1435,8 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov,
  * Currently we punt and implement it as a normal copy, see pipe_to_user().
  *
  */
-asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
-                            unsigned long nr_segs, unsigned int flags)
+SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov,
+               unsigned long, nr_segs, unsigned int, flags)
 {
        struct file *file;
        long error;
@@ -1461,9 +1461,9 @@ asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
        return error;
 }
 
-asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
-                          int fd_out, loff_t __user *off_out,
-                          size_t len, unsigned int flags)
+SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
+               int, fd_out, loff_t __user *, off_out,
+               size_t, len, unsigned int, flags)
 {
        long error;
        struct file *in, *out;
@@ -1685,7 +1685,7 @@ static long do_tee(struct file *in, struct file *out, size_t len,
        return ret;
 }
 
-asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
+SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
 {
        struct file *in;
        int error, fput_in;
index 6840da1bf21e1129b6cbe9436c7937c9cb77e1b4..283daafc568eea04e5c3d8fdb191b2c65263a70d 100644 (file)
@@ -26,7 +26,6 @@
 #define SQUASHFS_CACHED_FRAGMENTS      CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
 #define SQUASHFS_MAJOR                 4
 #define SQUASHFS_MINOR                 0
-#define SQUASHFS_MAGIC                 0x73717368
 #define SQUASHFS_START                 0
 
 /* size of metadata (inode and directory) blocks */
index a0466d7467b25575a3bc7f6143687554ed67bea7..071df5b5b49184a28d354f217b78844002e4053b 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/zlib.h>
+#include <linux/magic.h>
 
 #include "squashfs_fs.h"
 #include "squashfs_fs_sb.h"
index 7e12a6f827954bbd5fcdd7c1be9d02918ccef75a..2db740a0cfb5ab1b1cf9b1bf553d2957484b02e7 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -152,7 +152,7 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
        return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf)
+SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_stat_fd(AT_FDCWD, filename, &stat);
@@ -162,7 +162,8 @@ asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user
 
        return error;
 }
-asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf)
+
+SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_lstat_fd(AT_FDCWD, filename, &stat);
@@ -172,7 +173,8 @@ asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __use
 
        return error;
 }
-asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf)
+
+SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_fstat(fd, &stat);
@@ -235,7 +237,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
        return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf)
+SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_stat_fd(AT_FDCWD, filename, &stat);
@@ -246,7 +248,7 @@ asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf)
        return error;
 }
 
-asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
+SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_lstat_fd(AT_FDCWD, filename, &stat);
@@ -258,8 +260,8 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
 }
 
 #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT)
-asmlinkage long sys_newfstatat(int dfd, char __user *filename,
-                               struct stat __user *statbuf, int flag)
+SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename,
+               struct stat __user *, statbuf, int, flag)
 {
        struct kstat stat;
        int error = -EINVAL;
@@ -280,7 +282,7 @@ out:
 }
 #endif
 
-asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
+SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_fstat(fd, &stat);
@@ -291,8 +293,8 @@ asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
        return error;
 }
 
-asmlinkage long sys_readlinkat(int dfd, const char __user *pathname,
-                               char __user *buf, int bufsiz)
+SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
+               char __user *, buf, int, bufsiz)
 {
        struct path path;
        int error;
@@ -318,8 +320,8 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *pathname,
        return error;
 }
 
-asmlinkage long sys_readlink(const char __user *path, char __user *buf,
-                               int bufsiz)
+SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
+               int, bufsiz)
 {
        return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
 }
@@ -365,7 +367,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
        return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf)
+SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_stat(filename, &stat);
@@ -375,7 +377,8 @@ asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbu
 
        return error;
 }
-asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf)
+
+SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_lstat(filename, &stat);
@@ -385,7 +388,8 @@ asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statb
 
        return error;
 }
-asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
+
+SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf)
 {
        struct kstat stat;
        int error = vfs_fstat(fd, &stat);
@@ -396,8 +400,8 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
        return error;
 }
 
-asmlinkage long sys_fstatat64(int dfd, char __user *filename,
-                              struct stat64 __user *statbuf, int flag)
+SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename,
+               struct stat64 __user *, statbuf, int, flag)
 {
        struct kstat stat;
        int error = -EINVAL;
index ed080c41716757a3c0a71c714c5a7db8ec489287..645e5403f2a0da0b4ed97cd6b6499791c732338d 100644 (file)
@@ -544,7 +544,7 @@ rescan:
        return NULL;
 }
 
-asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf)
+SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf)
 {
         struct super_block *s;
         struct ustat tmp;
index ac02b56548bcb4245da894568e3a175a2746e9f9..a16d53e5fe9d68a5a4f6b000fd1366e9fb91e167 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -36,7 +36,7 @@ static void do_sync(unsigned long wait)
                laptop_sync_completion();
 }
 
-asmlinkage long sys_sync(void)
+SYSCALL_DEFINE0(sync)
 {
        do_sync(1);
        return 0;
@@ -144,12 +144,12 @@ static int do_fsync(unsigned int fd, int datasync)
        return ret;
 }
 
-asmlinkage long sys_fsync(unsigned int fd)
+SYSCALL_DEFINE1(fsync, unsigned int, fd)
 {
        return do_fsync(fd, 0);
 }
 
-asmlinkage long sys_fdatasync(unsigned int fd)
+SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
 {
        return do_fsync(fd, 1);
 }
@@ -201,8 +201,8 @@ asmlinkage long sys_fdatasync(unsigned int fd)
  * already-instantiated disk blocks, there are no guarantees here that the data
  * will be available after a crash.
  */
-asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
-                                       unsigned int flags)
+SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes,
+                               unsigned int flags)
 {
        int ret;
        struct file *file;
@@ -262,14 +262,32 @@ out_put:
 out:
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes,
+                                   long flags)
+{
+       return SYSC_sync_file_range((int) fd, offset, nbytes,
+                                   (unsigned int) flags);
+}
+SYSCALL_ALIAS(sys_sync_file_range, SyS_sync_file_range);
+#endif
 
 /* It would be nice if people remember that not all the world's an i386
    when they introduce new system calls */
-asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
-                                    loff_t offset, loff_t nbytes)
+SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags,
+                                loff_t offset, loff_t nbytes)
 {
        return sys_sync_file_range(fd, offset, nbytes, flags);
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_sync_file_range2(long fd, long flags,
+                                    loff_t offset, loff_t nbytes)
+{
+       return SYSC_sync_file_range2((int) fd, (unsigned int) flags,
+                                    offset, nbytes);
+}
+SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2);
+#endif
 
 /*
  * `endbyte' is inclusive
index 0862f0e49d0cf8b5af985a2ea46991d25b6b9eaf..6a123b8ff3f5605735255f7ccaf084af547743dd 100644 (file)
@@ -177,7 +177,7 @@ static struct file *timerfd_fget(int fd)
        return file;
 }
 
-asmlinkage long sys_timerfd_create(int clockid, int flags)
+SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
 {
        int ufd;
        struct timerfd_ctx *ctx;
@@ -208,9 +208,9 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
        return ufd;
 }
 
-asmlinkage long sys_timerfd_settime(int ufd, int flags,
-                                   const struct itimerspec __user *utmr,
-                                   struct itimerspec __user *otmr)
+SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
+               const struct itimerspec __user *, utmr,
+               struct itimerspec __user *, otmr)
 {
        struct file *file;
        struct timerfd_ctx *ctx;
@@ -265,7 +265,7 @@ asmlinkage long sys_timerfd_settime(int ufd, int flags,
        return 0;
 }
 
-asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr)
+SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr)
 {
        struct file *file;
        struct timerfd_ctx *ctx;
index 6929e3e91d0579d28c6cd4453554a4c559236736..e4c75db5d373cbbc8f98f0bdb8167ff00fbda7fb 100644 (file)
@@ -24,7 +24,7 @@
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
  */
-asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times)
+SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times)
 {
        struct timespec tv[2];
 
@@ -170,7 +170,8 @@ out:
        return error;
 }
 
-asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags)
+SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename,
+               struct timespec __user *, utimes, int, flags)
 {
        struct timespec tstimes[2];
 
@@ -187,7 +188,8 @@ asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __
        return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags);
 }
 
-asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __user *utimes)
+SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename,
+               struct timeval __user *, utimes)
 {
        struct timeval times[2];
        struct timespec tstimes[2];
@@ -214,7 +216,8 @@ asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __u
        return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0);
 }
 
-asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes)
+SYSCALL_DEFINE2(utimes, char __user *, filename,
+               struct timeval __user *, utimes)
 {
        return sys_futimesat(AT_FDCWD, filename, utimes);
 }
index 237804cd6b566572177b60b05d68307b7cc207b2..197c4fcac0323e6de46fed267732c343298d3a07 100644 (file)
@@ -251,9 +251,9 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
        return error;
 }
 
-asmlinkage long
-sys_setxattr(const char __user *pathname, const char __user *name,
-            const void __user *value, size_t size, int flags)
+SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
+               const char __user *, name, const void __user *, value,
+               size_t, size, int, flags)
 {
        struct path path;
        int error;
@@ -270,9 +270,9 @@ sys_setxattr(const char __user *pathname, const char __user *name,
        return error;
 }
 
-asmlinkage long
-sys_lsetxattr(const char __user *pathname, const char __user *name,
-             const void __user *value, size_t size, int flags)
+SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
+               const char __user *, name, const void __user *, value,
+               size_t, size, int, flags)
 {
        struct path path;
        int error;
@@ -289,9 +289,8 @@ sys_lsetxattr(const char __user *pathname, const char __user *name,
        return error;
 }
 
-asmlinkage long
-sys_fsetxattr(int fd, const char __user *name, const void __user *value,
-             size_t size, int flags)
+SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
+               const void __user *,value, size_t, size, int, flags)
 {
        struct file *f;
        struct dentry *dentry;
@@ -349,9 +348,8 @@ getxattr(struct dentry *d, const char __user *name, void __user *value,
        return error;
 }
 
-asmlinkage ssize_t
-sys_getxattr(const char __user *pathname, const char __user *name,
-            void __user *value, size_t size)
+SYSCALL_DEFINE4(getxattr, const char __user *, pathname,
+               const char __user *, name, void __user *, value, size_t, size)
 {
        struct path path;
        ssize_t error;
@@ -364,9 +362,8 @@ sys_getxattr(const char __user *pathname, const char __user *name,
        return error;
 }
 
-asmlinkage ssize_t
-sys_lgetxattr(const char __user *pathname, const char __user *name, void __user *value,
-             size_t size)
+SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,
+               const char __user *, name, void __user *, value, size_t, size)
 {
        struct path path;
        ssize_t error;
@@ -379,8 +376,8 @@ sys_lgetxattr(const char __user *pathname, const char __user *name, void __user
        return error;
 }
 
-asmlinkage ssize_t
-sys_fgetxattr(int fd, const char __user *name, void __user *value, size_t size)
+SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name,
+               void __user *, value, size_t, size)
 {
        struct file *f;
        ssize_t error = -EBADF;
@@ -424,8 +421,8 @@ listxattr(struct dentry *d, char __user *list, size_t size)
        return error;
 }
 
-asmlinkage ssize_t
-sys_listxattr(const char __user *pathname, char __user *list, size_t size)
+SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list,
+               size_t, size)
 {
        struct path path;
        ssize_t error;
@@ -438,8 +435,8 @@ sys_listxattr(const char __user *pathname, char __user *list, size_t size)
        return error;
 }
 
-asmlinkage ssize_t
-sys_llistxattr(const char __user *pathname, char __user *list, size_t size)
+SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,
+               size_t, size)
 {
        struct path path;
        ssize_t error;
@@ -452,8 +449,7 @@ sys_llistxattr(const char __user *pathname, char __user *list, size_t size)
        return error;
 }
 
-asmlinkage ssize_t
-sys_flistxattr(int fd, char __user *list, size_t size)
+SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
 {
        struct file *f;
        ssize_t error = -EBADF;
@@ -485,8 +481,8 @@ removexattr(struct dentry *d, const char __user *name)
        return vfs_removexattr(d, kname);
 }
 
-asmlinkage long
-sys_removexattr(const char __user *pathname, const char __user *name)
+SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
+               const char __user *, name)
 {
        struct path path;
        int error;
@@ -503,8 +499,8 @@ sys_removexattr(const char __user *pathname, const char __user *name)
        return error;
 }
 
-asmlinkage long
-sys_lremovexattr(const char __user *pathname, const char __user *name)
+SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,
+               const char __user *, name)
 {
        struct path path;
        int error;
@@ -521,8 +517,7 @@ sys_lremovexattr(const char __user *pathname, const char __user *name)
        return error;
 }
 
-asmlinkage long
-sys_fremovexattr(int fd, const char __user *name)
+SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
 {
        struct file *f;
        struct dentry *dentry;
index 7b26f5ff969230140e363a082e72c476f35ea51e..1dd528849755149a8e159bd2b7fb31dd72b848c5 100644 (file)
@@ -21,8 +21,6 @@
 extern struct workqueue_struct *xfsdatad_workqueue;
 extern mempool_t *xfs_ioend_pool;
 
-typedef void (*xfs_ioend_func_t)(void *);
-
 /*
  * xfs_ioend struct manages large extent writes for XFS.
  * It can manage several multi-page bio's at once.
index cb329edc925b915ae5e590edeb4840810f811326..d71dc44e21edbe7077bda8d35f9b259aac61522d 100644 (file)
@@ -165,75 +165,6 @@ test_page_region(
        return (mask && (page_private(page) & mask) == mask);
 }
 
-/*
- *     Mapping of multi-page buffers into contiguous virtual space
- */
-
-typedef struct a_list {
-       void            *vm_addr;
-       struct a_list   *next;
-} a_list_t;
-
-static a_list_t                *as_free_head;
-static int             as_list_len;
-static DEFINE_SPINLOCK(as_lock);
-
-/*
- *     Try to batch vunmaps because they are costly.
- */
-STATIC void
-free_address(
-       void            *addr)
-{
-       a_list_t        *aentry;
-
-#ifdef CONFIG_XEN
-       /*
-        * Xen needs to be able to make sure it can get an exclusive
-        * RO mapping of pages it wants to turn into a pagetable.  If
-        * a newly allocated page is also still being vmap()ed by xfs,
-        * it will cause pagetable construction to fail.  This is a
-        * quick workaround to always eagerly unmap pages so that Xen
-        * is happy.
-        */
-       vunmap(addr);
-       return;
-#endif
-
-       aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
-       if (likely(aentry)) {
-               spin_lock(&as_lock);
-               aentry->next = as_free_head;
-               aentry->vm_addr = addr;
-               as_free_head = aentry;
-               as_list_len++;
-               spin_unlock(&as_lock);
-       } else {
-               vunmap(addr);
-       }
-}
-
-STATIC void
-purge_addresses(void)
-{
-       a_list_t        *aentry, *old;
-
-       if (as_free_head == NULL)
-               return;
-
-       spin_lock(&as_lock);
-       aentry = as_free_head;
-       as_free_head = NULL;
-       as_list_len = 0;
-       spin_unlock(&as_lock);
-
-       while ((old = aentry) != NULL) {
-               vunmap(aentry->vm_addr);
-               aentry = aentry->next;
-               kfree(old);
-       }
-}
-
 /*
  *     Internal xfs_buf_t object manipulation
  */
@@ -333,7 +264,7 @@ xfs_buf_free(
                uint            i;
 
                if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1))
-                       free_address(bp->b_addr - bp->b_offset);
+                       vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count);
 
                for (i = 0; i < bp->b_page_count; i++) {
                        struct page     *page = bp->b_pages[i];
@@ -455,10 +386,8 @@ _xfs_buf_map_pages(
                bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset;
                bp->b_flags |= XBF_MAPPED;
        } else if (flags & XBF_MAPPED) {
-               if (as_list_len > 64)
-                       purge_addresses();
-               bp->b_addr = vmap(bp->b_pages, bp->b_page_count,
-                                       VM_MAP, PAGE_KERNEL);
+               bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
+                                       -1, PAGE_KERNEL);
                if (unlikely(bp->b_addr == NULL))
                        return -ENOMEM;
                bp->b_addr += bp->b_offset;
@@ -1743,8 +1672,6 @@ xfsbufd(
                        count++;
                }
 
-               if (as_list_len > 0)
-                       purge_addresses();
                if (count)
                        blk_run_address_space(target->bt_mapping);
 
index 595751f783506540ab08ea88819682dc8a73c647..87b8cbd23d4bc5a9e287dbfbea056d11994612cf 100644 (file)
@@ -126,11 +126,26 @@ xfs_nfs_get_inode(
        if (ino == 0)
                return ERR_PTR(-ESTALE);
 
-       error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0);
-       if (error)
+       /*
+        * The XFS_IGET_BULKSTAT means that an invalid inode number is just
+        * fine and not an indication of a corrupted filesystem.  Because
+        * clients can send any kind of invalid file handle, e.g. after
+        * a restore on the server we have to deal with this case gracefully.
+        */
+       error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT,
+                        XFS_ILOCK_SHARED, &ip, 0);
+       if (error) {
+               /*
+                * EINVAL means the inode cluster doesn't exist anymore.
+                * This implies the filehandle is stale, so we should
+                * translate it here.
+                * We don't use ESTALE directly down the chain to not
+                * confuse applications using bulkstat that expect EINVAL.
+                */
+               if (error == EINVAL)
+                       error = ESTALE;
                return ERR_PTR(-error);
-       if (!ip)
-               return ERR_PTR(-EIO);
+       }
 
        if (ip->i_d.di_gen != generation) {
                xfs_iput_new(ip, XFS_ILOCK_SHARED);
index a4e293b93efaa02bca467142357d17e59e60290a..642f1db4def478598bccd2b94425385620dccf92 100644 (file)
@@ -22,7 +22,6 @@
  * Access Control Lists
  */
 typedef __uint16_t     xfs_acl_perm_t;
-typedef __int32_t      xfs_acl_type_t;
 typedef __int32_t      xfs_acl_tag_t;
 typedef __int32_t      xfs_acl_id_t;
 
index f2e21817a226dac5d12fcdf3d82396cd7e5ee26b..d3b3cf742999ab69bc8f1c60fe0adf230377a592 100644 (file)
@@ -231,7 +231,7 @@ typedef struct xfs_perag
 #define        XFS_FSB_TO_AGNO(mp,fsbno)       \
        ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog))
 #define        XFS_FSB_TO_AGBNO(mp,fsbno)      \
-       ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog)))
+       ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog)))
 #define        XFS_AGB_TO_DADDR(mp,agno,agbno) \
        ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \
                (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno)))
index 79da6b2ea99efa35dee2f72f12785598995daf5a..6c323f8a4cd19cb8b169bcc17446dd62ffb4ea75 100644 (file)
@@ -736,7 +736,7 @@ xfs_attr_shortform_allfit(xfs_dabuf_t *bp, xfs_inode_t *dp)
                        continue;               /* don't copy partial entries */
                if (!(entry->flags & XFS_ATTR_LOCAL))
                        return(0);
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
+               name_loc = xfs_attr_leaf_name_local(leaf, i);
                if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX)
                        return(0);
                if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX)
@@ -823,7 +823,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
                if (!entry->nameidx)
                        continue;
                ASSERT(entry->flags & XFS_ATTR_LOCAL);
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
+               name_loc = xfs_attr_leaf_name_local(leaf, i);
                nargs.name = (char *)name_loc->nameval;
                nargs.namelen = name_loc->namelen;
                nargs.value = (char *)&name_loc->nameval[nargs.namelen];
@@ -1141,14 +1141,14 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex)
         * as part of this transaction (a split operation for example).
         */
        if (entry->flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
+               name_loc = xfs_attr_leaf_name_local(leaf, args->index);
                name_loc->namelen = args->namelen;
                name_loc->valuelen = cpu_to_be16(args->valuelen);
                memcpy((char *)name_loc->nameval, args->name, args->namelen);
                memcpy((char *)&name_loc->nameval[args->namelen], args->value,
                                   be16_to_cpu(name_loc->valuelen));
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, args->index);
                name_rmt->namelen = args->namelen;
                memcpy((char *)name_rmt->name, args->name, args->namelen);
                entry->flags |= XFS_ATTR_INCOMPLETE;
@@ -1159,7 +1159,7 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex)
                args->rmtblkcnt = XFS_B_TO_FSB(mp, args->valuelen);
        }
        xfs_da_log_buf(args->trans, bp,
-            XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index),
+            XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index),
                                   xfs_attr_leaf_entsize(leaf, args->index)));
 
        /*
@@ -1749,10 +1749,10 @@ xfs_attr_leaf_remove(xfs_dabuf_t *bp, xfs_da_args_t *args)
        /*
         * Compress the remaining entries and zero out the removed stuff.
         */
-       memset(XFS_ATTR_LEAF_NAME(leaf, args->index), 0, entsize);
+       memset(xfs_attr_leaf_name(leaf, args->index), 0, entsize);
        be16_add_cpu(&hdr->usedbytes, -entsize);
        xfs_da_log_buf(args->trans, bp,
-            XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index),
+            XFS_DA_LOGRANGE(leaf, xfs_attr_leaf_name(leaf, args->index),
                                   entsize));
 
        tmp = (be16_to_cpu(hdr->count) - args->index)
@@ -1985,7 +1985,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args)
                        continue;
                }
                if (entry->flags & XFS_ATTR_LOCAL) {
-                       name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe);
+                       name_loc = xfs_attr_leaf_name_local(leaf, probe);
                        if (name_loc->namelen != args->namelen)
                                continue;
                        if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0)
@@ -1995,7 +1995,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args)
                        args->index = probe;
                        return(XFS_ERROR(EEXIST));
                } else {
-                       name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe);
+                       name_rmt = xfs_attr_leaf_name_remote(leaf, probe);
                        if (name_rmt->namelen != args->namelen)
                                continue;
                        if (memcmp(args->name, (char *)name_rmt->name,
@@ -2035,7 +2035,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args)
 
        entry = &leaf->entries[args->index];
        if (entry->flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
+               name_loc = xfs_attr_leaf_name_local(leaf, args->index);
                ASSERT(name_loc->namelen == args->namelen);
                ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) == 0);
                valuelen = be16_to_cpu(name_loc->valuelen);
@@ -2050,7 +2050,7 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, xfs_da_args_t *args)
                args->valuelen = valuelen;
                memcpy(args->value, &name_loc->nameval[args->namelen], valuelen);
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, args->index);
                ASSERT(name_rmt->namelen == args->namelen);
                ASSERT(memcmp(args->name, name_rmt->name, args->namelen) == 0);
                valuelen = be32_to_cpu(name_rmt->valuelen);
@@ -2143,7 +2143,7 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s,
                 * off for 6.2, should be revisited later.
                 */
                if (entry_s->flags & XFS_ATTR_INCOMPLETE) { /* skip partials? */
-                       memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp);
+                       memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp);
                        be16_add_cpu(&hdr_s->usedbytes, -tmp);
                        be16_add_cpu(&hdr_s->count, -1);
                        entry_d--;      /* to compensate for ++ in loop hdr */
@@ -2160,11 +2160,11 @@ xfs_attr_leaf_moveents(xfs_attr_leafblock_t *leaf_s, int start_s,
                        entry_d->flags = entry_s->flags;
                        ASSERT(be16_to_cpu(entry_d->nameidx) + tmp
                                                        <= XFS_LBSIZE(mp));
-                       memmove(XFS_ATTR_LEAF_NAME(leaf_d, desti),
-                               XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), tmp);
+                       memmove(xfs_attr_leaf_name(leaf_d, desti),
+                               xfs_attr_leaf_name(leaf_s, start_s + i), tmp);
                        ASSERT(be16_to_cpu(entry_s->nameidx) + tmp
                                                        <= XFS_LBSIZE(mp));
-                       memset(XFS_ATTR_LEAF_NAME(leaf_s, start_s + i), 0, tmp);
+                       memset(xfs_attr_leaf_name(leaf_s, start_s + i), 0, tmp);
                        be16_add_cpu(&hdr_s->usedbytes, -tmp);
                        be16_add_cpu(&hdr_d->usedbytes, tmp);
                        be16_add_cpu(&hdr_s->count, -1);
@@ -2276,12 +2276,12 @@ xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)
 
        ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
        if (leaf->entries[index].flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, index);
-               size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(name_loc->namelen,
+               name_loc = xfs_attr_leaf_name_local(leaf, index);
+               size = xfs_attr_leaf_entsize_local(name_loc->namelen,
                                                   be16_to_cpu(name_loc->valuelen));
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, index);
-               size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(name_rmt->namelen);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, index);
+               size = xfs_attr_leaf_entsize_remote(name_rmt->namelen);
        }
        return(size);
 }
@@ -2297,13 +2297,13 @@ xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local)
 {
        int size;
 
-       size = XFS_ATTR_LEAF_ENTSIZE_LOCAL(namelen, valuelen);
-       if (size < XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(blocksize)) {
+       size = xfs_attr_leaf_entsize_local(namelen, valuelen);
+       if (size < xfs_attr_leaf_entsize_local_max(blocksize)) {
                if (local) {
                        *local = 1;
                }
        } else {
-               size = XFS_ATTR_LEAF_ENTSIZE_REMOTE(namelen);
+               size = xfs_attr_leaf_entsize_remote(namelen);
                if (local) {
                        *local = 0;
                }
@@ -2372,7 +2372,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
 
                if (entry->flags & XFS_ATTR_LOCAL) {
                        xfs_attr_leaf_name_local_t *name_loc =
-                               XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
+                               xfs_attr_leaf_name_local(leaf, i);
 
                        retval = context->put_listent(context,
                                                entry->flags,
@@ -2384,7 +2384,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
                                return retval;
                } else {
                        xfs_attr_leaf_name_remote_t *name_rmt =
-                               XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
+                               xfs_attr_leaf_name_remote(leaf, i);
 
                        int valuelen = be32_to_cpu(name_rmt->valuelen);
 
@@ -2468,11 +2468,11 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args)
 
 #ifdef DEBUG
        if (entry->flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
+               name_loc = xfs_attr_leaf_name_local(leaf, args->index);
                namelen = name_loc->namelen;
                name = (char *)name_loc->nameval;
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, args->index);
                namelen = name_rmt->namelen;
                name = (char *)name_rmt->name;
        }
@@ -2487,7 +2487,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args)
 
        if (args->rmtblkno) {
                ASSERT((entry->flags & XFS_ATTR_LOCAL) == 0);
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, args->index);
                name_rmt->valueblk = cpu_to_be32(args->rmtblkno);
                name_rmt->valuelen = cpu_to_be32(args->valuelen);
                xfs_da_log_buf(args->trans, bp,
@@ -2534,7 +2534,7 @@ xfs_attr_leaf_setflag(xfs_da_args_t *args)
        xfs_da_log_buf(args->trans, bp,
                        XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
        if ((entry->flags & XFS_ATTR_LOCAL) == 0) {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf, args->index);
                name_rmt->valueblk = 0;
                name_rmt->valuelen = 0;
                xfs_da_log_buf(args->trans, bp,
@@ -2607,20 +2607,20 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args)
 
 #ifdef DEBUG
        if (entry1->flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf1, args->index);
+               name_loc = xfs_attr_leaf_name_local(leaf1, args->index);
                namelen1 = name_loc->namelen;
                name1 = (char *)name_loc->nameval;
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index);
                namelen1 = name_rmt->namelen;
                name1 = (char *)name_rmt->name;
        }
        if (entry2->flags & XFS_ATTR_LOCAL) {
-               name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf2, args->index2);
+               name_loc = xfs_attr_leaf_name_local(leaf2, args->index2);
                namelen2 = name_loc->namelen;
                name2 = (char *)name_loc->nameval;
        } else {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2);
+               name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2);
                namelen2 = name_rmt->namelen;
                name2 = (char *)name_rmt->name;
        }
@@ -2637,7 +2637,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args)
                          XFS_DA_LOGRANGE(leaf1, entry1, sizeof(*entry1)));
        if (args->rmtblkno) {
                ASSERT((entry1->flags & XFS_ATTR_LOCAL) == 0);
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf1, args->index);
+               name_rmt = xfs_attr_leaf_name_remote(leaf1, args->index);
                name_rmt->valueblk = cpu_to_be32(args->rmtblkno);
                name_rmt->valuelen = cpu_to_be32(args->valuelen);
                xfs_da_log_buf(args->trans, bp1,
@@ -2648,7 +2648,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args)
        xfs_da_log_buf(args->trans, bp2,
                          XFS_DA_LOGRANGE(leaf2, entry2, sizeof(*entry2)));
        if ((entry2->flags & XFS_ATTR_LOCAL) == 0) {
-               name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf2, args->index2);
+               name_rmt = xfs_attr_leaf_name_remote(leaf2, args->index2);
                name_rmt->valueblk = 0;
                name_rmt->valuelen = 0;
                xfs_da_log_buf(args->trans, bp2,
@@ -2855,7 +2855,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
        for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
                if (be16_to_cpu(entry->nameidx) &&
                    ((entry->flags & XFS_ATTR_LOCAL) == 0)) {
-                       name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
+                       name_rmt = xfs_attr_leaf_name_remote(leaf, i);
                        if (name_rmt->valueblk)
                                count++;
                }
@@ -2883,7 +2883,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
        for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
                if (be16_to_cpu(entry->nameidx) &&
                    ((entry->flags & XFS_ATTR_LOCAL) == 0)) {
-                       name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
+                       name_rmt = xfs_attr_leaf_name_remote(leaf, i);
                        if (name_rmt->valueblk) {
                                lp->valueblk = be32_to_cpu(name_rmt->valueblk);
                                lp->valuelen = XFS_B_TO_FSB(dp->i_mount,
index 83e9af417ca21280492fcfa37a7fd93494429fbb..9c7d22fdcf4d8ea0412d840a109f14c3923d3aab 100644 (file)
@@ -151,8 +151,6 @@ typedef struct xfs_attr_leafblock {
 /*
  * Cast typed pointers for "local" and "remote" name/value structs.
  */
-#define XFS_ATTR_LEAF_NAME_REMOTE(leafp,idx)   \
-       xfs_attr_leaf_name_remote(leafp,idx)
 static inline xfs_attr_leaf_name_remote_t *
 xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
 {
@@ -160,8 +158,6 @@ xfs_attr_leaf_name_remote(xfs_attr_leafblock_t *leafp, int idx)
                &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
 }
 
-#define XFS_ATTR_LEAF_NAME_LOCAL(leafp,idx)    \
-       xfs_attr_leaf_name_local(leafp,idx)
 static inline xfs_attr_leaf_name_local_t *
 xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
 {
@@ -169,8 +165,6 @@ xfs_attr_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
                &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
 }
 
-#define XFS_ATTR_LEAF_NAME(leafp,idx)          \
-       xfs_attr_leaf_name(leafp,idx)
 static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx)
 {
        return &((char *)leafp)[be16_to_cpu(leafp->entries[idx].nameidx)];
@@ -181,24 +175,18 @@ static inline char *xfs_attr_leaf_name(xfs_attr_leafblock_t *leafp, int idx)
  * a "local" name/value structure, a "remote" name/value structure, and
  * a pointer which might be either.
  */
-#define XFS_ATTR_LEAF_ENTSIZE_REMOTE(nlen)     \
-       xfs_attr_leaf_entsize_remote(nlen)
 static inline int xfs_attr_leaf_entsize_remote(int nlen)
 {
        return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \
                XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
 }
 
-#define XFS_ATTR_LEAF_ENTSIZE_LOCAL(nlen,vlen) \
-       xfs_attr_leaf_entsize_local(nlen,vlen)
 static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen)
 {
        return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) +
                XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
 }
 
-#define XFS_ATTR_LEAF_ENTSIZE_LOCAL_MAX(bsize) \
-       xfs_attr_leaf_entsize_local_max(bsize)
 static inline int xfs_attr_leaf_entsize_local_max(int bsize)
 {
        return (((bsize) >> 1) + ((bsize) >> 2));
index bca7b243c31979ff488de535c38f262fa5739ccb..f1e3c907044db190f9dccd1f6dce7453f9932495 100644 (file)
  */
 
 /*
- * masks with n high/low bits set, 32-bit values & 64-bit values
+ * masks with n high/low bits set, 64-bit values
  */
-#define        XFS_MASK32HI(n)         xfs_mask32hi(n)
-static inline __uint32_t xfs_mask32hi(int n)
-{
-       return (__uint32_t)-1 << (32 - (n));
-}
-#define        XFS_MASK64HI(n)         xfs_mask64hi(n)
 static inline __uint64_t xfs_mask64hi(int n)
 {
        return (__uint64_t)-1 << (64 - (n));
 }
-#define        XFS_MASK32LO(n)         xfs_mask32lo(n)
 static inline __uint32_t xfs_mask32lo(int n)
 {
        return ((__uint32_t)1 << (n)) - 1;
 }
-#define        XFS_MASK64LO(n)         xfs_mask64lo(n)
 static inline __uint64_t xfs_mask64lo(int n)
 {
        return ((__uint64_t)1 << (n)) - 1;
index 8f1ec73725d386ca433a44beea72f25ead80d220..ba6b08c2fb0257790c5997e0d3d6367782f6bc5b 100644 (file)
@@ -110,16 +110,16 @@ __xfs_bmbt_get_all(
 
        ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN));
        s->br_startoff = ((xfs_fileoff_t)l0 &
-                          XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
+                          xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
 #if XFS_BIG_BLKNOS
-       s->br_startblock = (((xfs_fsblock_t)l0 & XFS_MASK64LO(9)) << 43) |
+       s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) |
                           (((xfs_fsblock_t)l1) >> 21);
 #else
 #ifdef DEBUG
        {
                xfs_dfsbno_t    b;
 
-               b = (((xfs_dfsbno_t)l0 & XFS_MASK64LO(9)) << 43) |
+               b = (((xfs_dfsbno_t)l0 & xfs_mask64lo(9)) << 43) |
                    (((xfs_dfsbno_t)l1) >> 21);
                ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b));
                s->br_startblock = (xfs_fsblock_t)b;
@@ -128,7 +128,7 @@ __xfs_bmbt_get_all(
        s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21);
 #endif /* DEBUG */
 #endif /* XFS_BIG_BLKNOS */
-       s->br_blockcount = (xfs_filblks_t)(l1 & XFS_MASK64LO(21));
+       s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21));
        /* This is xfs_extent_state() in-line */
        if (ext_flag) {
                ASSERT(s->br_blockcount != 0);  /* saved for DMIG */
@@ -153,7 +153,7 @@ xfs_filblks_t
 xfs_bmbt_get_blockcount(
        xfs_bmbt_rec_host_t     *r)
 {
-       return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21));
+       return (xfs_filblks_t)(r->l1 & xfs_mask64lo(21));
 }
 
 /*
@@ -164,13 +164,13 @@ xfs_bmbt_get_startblock(
        xfs_bmbt_rec_host_t     *r)
 {
 #if XFS_BIG_BLKNOS
-       return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) |
+       return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) |
               (((xfs_fsblock_t)r->l1) >> 21);
 #else
 #ifdef DEBUG
        xfs_dfsbno_t    b;
 
-       b = (((xfs_dfsbno_t)r->l0 & XFS_MASK64LO(9)) << 43) |
+       b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) |
            (((xfs_dfsbno_t)r->l1) >> 21);
        ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b));
        return (xfs_fsblock_t)b;
@@ -188,7 +188,7 @@ xfs_bmbt_get_startoff(
        xfs_bmbt_rec_host_t     *r)
 {
        return ((xfs_fileoff_t)r->l0 &
-                XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
+                xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
 }
 
 xfs_exntst_t
@@ -219,7 +219,7 @@ xfs_filblks_t
 xfs_bmbt_disk_get_blockcount(
        xfs_bmbt_rec_t  *r)
 {
-       return (xfs_filblks_t)(be64_to_cpu(r->l1) & XFS_MASK64LO(21));
+       return (xfs_filblks_t)(be64_to_cpu(r->l1) & xfs_mask64lo(21));
 }
 
 /*
@@ -230,7 +230,7 @@ xfs_bmbt_disk_get_startoff(
        xfs_bmbt_rec_t  *r)
 {
        return ((xfs_fileoff_t)be64_to_cpu(r->l0) &
-                XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
+                xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
 }
 
 
@@ -248,33 +248,33 @@ xfs_bmbt_set_allf(
        int             extent_flag = (state == XFS_EXT_NORM) ? 0 : 1;
 
        ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN);
-       ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0);
-       ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
+       ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
+       ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
 
 #if XFS_BIG_BLKNOS
-       ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0);
+       ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
 
        r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
                ((xfs_bmbt_rec_base_t)startoff << 9) |
                ((xfs_bmbt_rec_base_t)startblock >> 43);
        r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) |
                ((xfs_bmbt_rec_base_t)blockcount &
-               (xfs_bmbt_rec_base_t)XFS_MASK64LO(21));
+               (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
 #else  /* !XFS_BIG_BLKNOS */
        if (ISNULLSTARTBLOCK(startblock)) {
                r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
                        ((xfs_bmbt_rec_base_t)startoff << 9) |
-                        (xfs_bmbt_rec_base_t)XFS_MASK64LO(9);
-               r->l1 = XFS_MASK64HI(11) |
+                        (xfs_bmbt_rec_base_t)xfs_mask64lo(9);
+               r->l1 = xfs_mask64hi(11) |
                          ((xfs_bmbt_rec_base_t)startblock << 21) |
                          ((xfs_bmbt_rec_base_t)blockcount &
-                          (xfs_bmbt_rec_base_t)XFS_MASK64LO(21));
+                          (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
        } else {
                r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
                        ((xfs_bmbt_rec_base_t)startoff << 9);
                r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) |
                         ((xfs_bmbt_rec_base_t)blockcount &
-                        (xfs_bmbt_rec_base_t)XFS_MASK64LO(21));
+                        (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
        }
 #endif /* XFS_BIG_BLKNOS */
 }
@@ -306,11 +306,11 @@ xfs_bmbt_disk_set_allf(
        int                     extent_flag = (state == XFS_EXT_NORM) ? 0 : 1;
 
        ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN);
-       ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0);
-       ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
+       ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
+       ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
 
 #if XFS_BIG_BLKNOS
-       ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0);
+       ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
 
        r->l0 = cpu_to_be64(
                ((xfs_bmbt_rec_base_t)extent_flag << 63) |
@@ -319,17 +319,17 @@ xfs_bmbt_disk_set_allf(
        r->l1 = cpu_to_be64(
                ((xfs_bmbt_rec_base_t)startblock << 21) |
                 ((xfs_bmbt_rec_base_t)blockcount &
-                 (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
+                 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
 #else  /* !XFS_BIG_BLKNOS */
        if (ISNULLSTARTBLOCK(startblock)) {
                r->l0 = cpu_to_be64(
                        ((xfs_bmbt_rec_base_t)extent_flag << 63) |
                         ((xfs_bmbt_rec_base_t)startoff << 9) |
-                         (xfs_bmbt_rec_base_t)XFS_MASK64LO(9));
-               r->l1 = cpu_to_be64(XFS_MASK64HI(11) |
+                         (xfs_bmbt_rec_base_t)xfs_mask64lo(9));
+               r->l1 = cpu_to_be64(xfs_mask64hi(11) |
                          ((xfs_bmbt_rec_base_t)startblock << 21) |
                          ((xfs_bmbt_rec_base_t)blockcount &
-                          (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
+                          (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
        } else {
                r->l0 = cpu_to_be64(
                        ((xfs_bmbt_rec_base_t)extent_flag << 63) |
@@ -337,7 +337,7 @@ xfs_bmbt_disk_set_allf(
                r->l1 = cpu_to_be64(
                        ((xfs_bmbt_rec_base_t)startblock << 21) |
                         ((xfs_bmbt_rec_base_t)blockcount &
-                         (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
+                         (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
        }
 #endif /* XFS_BIG_BLKNOS */
 }
@@ -362,9 +362,9 @@ xfs_bmbt_set_blockcount(
        xfs_bmbt_rec_host_t *r,
        xfs_filblks_t   v)
 {
-       ASSERT((v & XFS_MASK64HI(43)) == 0);
-       r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(43)) |
-                 (xfs_bmbt_rec_base_t)(v & XFS_MASK64LO(21));
+       ASSERT((v & xfs_mask64hi(43)) == 0);
+       r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64hi(43)) |
+                 (xfs_bmbt_rec_base_t)(v & xfs_mask64lo(21));
 }
 
 /*
@@ -376,21 +376,21 @@ xfs_bmbt_set_startblock(
        xfs_fsblock_t   v)
 {
 #if XFS_BIG_BLKNOS
-       ASSERT((v & XFS_MASK64HI(12)) == 0);
-       r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(55)) |
+       ASSERT((v & xfs_mask64hi(12)) == 0);
+       r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) |
                  (xfs_bmbt_rec_base_t)(v >> 43);
-       r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)) |
+       r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) |
                  (xfs_bmbt_rec_base_t)(v << 21);
 #else  /* !XFS_BIG_BLKNOS */
        if (ISNULLSTARTBLOCK(v)) {
-               r->l0 |= (xfs_bmbt_rec_base_t)XFS_MASK64LO(9);
-               r->l1 = (xfs_bmbt_rec_base_t)XFS_MASK64HI(11) |
+               r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9);
+               r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) |
                          ((xfs_bmbt_rec_base_t)v << 21) |
-                         (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21));
+                         (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
        } else {
-               r->l0 &= ~(xfs_bmbt_rec_base_t)XFS_MASK64LO(9);
+               r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9);
                r->l1 = ((xfs_bmbt_rec_base_t)v << 21) |
-                         (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21));
+                         (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
        }
 #endif /* XFS_BIG_BLKNOS */
 }
@@ -403,10 +403,10 @@ xfs_bmbt_set_startoff(
        xfs_bmbt_rec_host_t *r,
        xfs_fileoff_t   v)
 {
-       ASSERT((v & XFS_MASK64HI(9)) == 0);
-       r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) XFS_MASK64HI(1)) |
+       ASSERT((v & xfs_mask64hi(9)) == 0);
+       r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) xfs_mask64hi(1)) |
                ((xfs_bmbt_rec_base_t)v << 9) |
-                 (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(9));
+                 (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64lo(9));
 }
 
 /*
@@ -419,9 +419,9 @@ xfs_bmbt_set_state(
 {
        ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN);
        if (v == XFS_EXT_NORM)
-               r->l0 &= XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN);
+               r->l0 &= xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN);
        else
-               r->l0 |= XFS_MASK64HI(BMBT_EXNTFLAG_BITLEN);
+               r->l0 |= xfs_mask64hi(BMBT_EXNTFLAG_BITLEN);
 }
 
 /*
index 7ed59267420d8e5a661efac5b10190a85066d2f0..2c3ef20f8842d8f608debc1cb75ab62f1bc45f0f 100644 (file)
@@ -730,8 +730,8 @@ xfs_btree_readahead_lblock(
        struct xfs_btree_block  *block)
 {
        int                     rval = 0;
-       xfs_fsblock_t           left = be64_to_cpu(block->bb_u.l.bb_leftsib);
-       xfs_fsblock_t           right = be64_to_cpu(block->bb_u.l.bb_rightsib);
+       xfs_dfsbno_t            left = be64_to_cpu(block->bb_u.l.bb_leftsib);
+       xfs_dfsbno_t            right = be64_to_cpu(block->bb_u.l.bb_rightsib);
 
        if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) {
                xfs_btree_reada_bufl(cur->bc_mp, left, 1);
index e2fa0a1d8e9635b7bff941bb107f4ebb96f05dde..e1f0a06aaf042c945e02f07b872190414122a2b7 100644 (file)
@@ -517,9 +517,9 @@ xfs_dir2_block_getdents(
                /*
                 * If it didn't fit, set the final offset to here & return.
                 */
-               if (filldir(dirent, dep->name, dep->namelen, cook,
+               if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff,
                            ino, DT_UNKNOWN)) {
-                       *offset = cook;
+                       *offset = cook & 0x7fffffff;
                        xfs_da_brelse(NULL, bp);
                        return 0;
                }
@@ -529,7 +529,8 @@ xfs_dir2_block_getdents(
         * Reached the end of the block.
         * Set the offset to a non-existent block 1 and return.
         */
-       *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0);
+       *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) &
+                       0x7fffffff;
        xfs_da_brelse(NULL, bp);
        return 0;
 }
index 93535992cb60e79491b490f07e85a9338dfc0faf..ef805a374eec174c21c77317da7c743ad47b21bf 100644 (file)
@@ -1092,7 +1092,7 @@ xfs_dir2_leaf_getdents(
                 * Won't fit.  Return to caller.
                 */
                if (filldir(dirent, dep->name, dep->namelen,
-                           xfs_dir2_byte_to_dataptr(mp, curoff),
+                           xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff,
                            ino, DT_UNKNOWN))
                        break;
 
@@ -1108,9 +1108,9 @@ xfs_dir2_leaf_getdents(
         * All done.  Set output offset value to current offset.
         */
        if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR))
-               *offset = XFS_DIR2_MAX_DATAPTR;
+               *offset = XFS_DIR2_MAX_DATAPTR & 0x7fffffff;
        else
-               *offset = xfs_dir2_byte_to_dataptr(mp, curoff);
+               *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff;
        kmem_free(map);
        if (bp)
                xfs_da_brelse(NULL, bp);
index b46af0013ec9167d7695273ce037c51029da71bc..a8a8a6efad5b8142dad0689988a35597cbf32554 100644 (file)
@@ -752,8 +752,8 @@ xfs_dir2_sf_getdents(
 #if XFS_BIG_INUMS
                ino += mp->m_inoadd;
 #endif
-               if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) {
-                       *offset = dot_offset;
+               if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) {
+                       *offset = dot_offset & 0x7fffffff;
                        return 0;
                }
        }
@@ -766,8 +766,8 @@ xfs_dir2_sf_getdents(
 #if XFS_BIG_INUMS
                ino += mp->m_inoadd;
 #endif
-               if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) {
-                       *offset = dotdot_offset;
+               if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) {
+                       *offset = dotdot_offset & 0x7fffffff;
                        return 0;
                }
        }
@@ -791,14 +791,15 @@ xfs_dir2_sf_getdents(
 #endif
 
                if (filldir(dirent, sfep->name, sfep->namelen,
-                                           off, ino, DT_UNKNOWN)) {
-                       *offset = off;
+                           off & 0x7fffffff, ino, DT_UNKNOWN)) {
+                       *offset = off & 0x7fffffff;
                        return 0;
                }
                sfep = xfs_dir2_sf_nextentry(sfp, sfep);
        }
 
-       *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0);
+       *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) &
+                       0x7fffffff;
        return 0;
 }
 
index 0f5191644ab2c53580263adbe9e35cb83af233b4..b2f724502f1bfbeed0f38712a72c825fa91b3268 100644 (file)
@@ -45,7 +45,7 @@ typedef __uint32_t            prid_t;         /* project ID */
 typedef __uint32_t             inst_t;         /* an instruction */
 
 typedef __s64                  xfs_off_t;      /* <file offset> type */
-typedef __u64                  xfs_ino_t;      /* <inode> type */
+typedef unsigned long long     xfs_ino_t;      /* <inode> type */
 typedef __s64                  xfs_daddr_t;    /* <disk address> type */
 typedef char *                 xfs_caddr_t;    /* <core address> type */
 typedef __u32                  xfs_dev_t;
@@ -111,8 +111,6 @@ typedef __uint64_t  xfs_fileoff_t;  /* block number in a file */
 typedef __int64_t      xfs_sfiloff_t;  /* signed block number in a file */
 typedef __uint64_t     xfs_filblks_t;  /* number of blocks in a file */
 
-typedef __uint8_t      xfs_arch_t;     /* architecture of an xfs fs */
-
 /*
  * Null values for the types.
  */
index 1f44e7c769955091f65b32d528a531baa7263983..0f8956def738bfbfcb2ba77204a945bde9806979 100644 (file)
@@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm
 header-y += registers.h
 
 unifdef-y += termios.h
-unifdef-y += swab.h
index 1187e51ecd130e3efd428e37a3b1ba7011d3af08..f29b7593e0882c440decdaa880a8425c22f0f590 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_BYTEORDER_H
 #define _ASM_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _ASM_BYTEORDER_H */
index 1870d5e05f1cc03b649a5969dad5f5fd026ec869..70d185534b9de84dc5340862250a5cbc6b441eb5 100644 (file)
@@ -31,6 +31,7 @@ unifdef-y += socket.h
 unifdef-y += sockios.h
 unifdef-y += stat.h
 unifdef-y += statfs.h
+unifdef-y += swab.h
 unifdef-y += termbits.h
 unifdef-y += termios.h
 unifdef-y += types.h
index 72ebe91005a8de190f795e91d77030d921ea86a5..8e6d0ca70aba987b4663db6e512d79236400f183 100644 (file)
@@ -301,7 +301,7 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm,
  * track_pfn_vma_new is called when a _new_ pfn mapping is being established
  * for physical range indicated by pfn and size.
  */
-static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot,
+static inline int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot,
                                        unsigned long pfn, unsigned long size)
 {
        return 0;
@@ -332,7 +332,7 @@ static inline void untrack_pfn_vma(struct vm_area_struct *vma,
 {
 }
 #else
-extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t prot,
+extern int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot,
                                unsigned long pfn, unsigned long size);
 extern int track_pfn_vma_copy(struct vm_area_struct *vma);
 extern void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn,
index 89061c1a67d473f42c039780e0dcfa1506bec640..763e3b060f432542e07a6730a837185853418148 100644 (file)
@@ -42,7 +42,7 @@ static inline unsigned char rtc_is_updating(void)
        return uip;
 }
 
-static inline unsigned int get_rtc_time(struct rtc_time *time)
+static inline unsigned int __get_rtc_time(struct rtc_time *time)
 {
        unsigned char ctrl;
        unsigned long flags;
@@ -108,8 +108,12 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
        return RTC_24H;
 }
 
+#ifndef get_rtc_time
+#define get_rtc_time   __get_rtc_time
+#endif
+
 /* Set the current date and time in the real time clock. */
-static inline int set_rtc_time(struct rtc_time *time)
+static inline int __set_rtc_time(struct rtc_time *time)
 {
        unsigned long flags;
        unsigned char mon, day, hrs, min, sec;
@@ -190,11 +194,15 @@ static inline int set_rtc_time(struct rtc_time *time)
        return 0;
 }
 
+#ifndef set_rtc_time
+#define set_rtc_time   __set_rtc_time
+#endif
+
 static inline unsigned int get_rtc_ss(void)
 {
        struct rtc_time h;
 
-       get_rtc_time(&h);
+       __get_rtc_time(&h);
        return h.tm_sec;
 }
 
index 27b108a86b397ccc26509f3b9d8e0d99d0091fbf..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,2 +1 @@
 include include/asm-generic/Kbuild.asm
-unifdef-y += swab.h
index 61ff9cfd8451c7c60b4fa0f997599a29d50547d9..21855d8b028b5ddd62dd2600ff4ef5e3ab92fb9e 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _ASM_M32R_BYTEORDER_H
 #define _ASM_M32R_BYTEORDER_H
 
-#include <asm/swab.h>
-
 #if defined(__LITTLE_ENDIAN__)
 #  include <linux/byteorder/little_endian.h>
 #else
index 52fd96b4142a47b1541a7d9a5f6549581d6c8377..1a922fad76f753aa66e8d212828935861892865a 100644 (file)
@@ -1,3 +1,2 @@
 include include/asm-generic/Kbuild.asm
 header-y += cachectl.h
-unifdef-y += swab.h
index 300866523b8622062bbb42839762c7c9fd7457d7..31b260a88803b97afecd337a9bbe509f48f2d51e 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _M68K_BYTEORDER_H
 #define _M68K_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/big_endian.h>
 
 #endif /* _M68K_BYTEORDER_H */
index 27b108a86b397ccc26509f3b9d8e0d99d0091fbf..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,2 +1 @@
 include include/asm-generic/Kbuild.asm
-unifdef-y += swab.h
index 45b18ded19e6308eafebe198673ae7feb6b122eb..5dd0bdd9feee115d55a832b62f00abb94e782438 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _ASM_BYTEORDER_H
 #define _ASM_BYTEORDER_H
 
-#include <asm/swab.h>
 #include <linux/byteorder/little_endian.h>
 
 #endif /* _ASM_BYTEORDER_H */
index 0acb07f31fa43b6559214611b866f4d8a9d3bd12..47809ac94bc38c8d19387c416e4864934e40e1d7 100644 (file)
@@ -395,7 +395,7 @@ struct drm_connector_funcs {
        void (*save)(struct drm_connector *connector);
        void (*restore)(struct drm_connector *connector);
        enum drm_connector_status (*detect)(struct drm_connector *connector);
-       void (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
+       int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
        int (*set_property)(struct drm_connector *connector, struct drm_property *property,
                             uint64_t val);
        void (*destroy)(struct drm_connector *connector);
index 4bc04cf460a7ee597f48bb05067a1bc59c7947eb..0c6f0e11b41bcfc823d94571c3be853087440e5a 100644 (file)
@@ -88,7 +88,7 @@ struct drm_connector_helper_funcs {
        struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
 };
 
-extern void drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
+extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
 extern void drm_helper_disable_unused_functions(struct drm_device *dev);
 extern int drm_helper_hotplug_stage_two(struct drm_device *dev);
 extern bool drm_helper_initial_config(struct drm_device *dev, bool can_grow);
index c8fdb6e658e1912ed64e81517cd8948ac1c0ebe0..110c600c885faab66310d67736c631f381028568 100644 (file)
@@ -52,7 +52,6 @@
 
 #ifndef __KERNEL__
 #include <linux/types.h>
-#include <asm/types.h>
 
 struct agp_version {
        __u16 major;
index 05621cf20709cdfee1fae5ad785275a32419f74c..8b724000aa50905baa68098991dc441ba3461f84 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef LINUX_ATM_IDT77105_H
 #define LINUX_ATM_IDT77105_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/atmioc.h>
 #include <linux/atmdev.h>
 
index fdebaaa9f66e81eb9261602e3fa88498b6f12ff2..65100d6cb89b911592b768fe7f12d88738e1c16e 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef __LINUX_CAPI_H__
 #define __LINUX_CAPI_H__
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/ioctl.h>
 #ifndef __KERNEL__
 #include <linux/kernelcapi.h>
index e88f3ecf38b438e464fbac92a420ef9897c8e952..3fd2194ff57324670062c5cfc12f95d05fd75f22 100644 (file)
@@ -280,5 +280,18 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
 asmlinkage long compat_sys_timerfd_gettime(int ufd,
                                   struct compat_itimerspec __user *otmr);
 
+asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
+                                     __u32 __user *pages,
+                                     const int __user *nodes,
+                                     int __user *status,
+                                     int flags);
+asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
+                                    struct compat_timeval __user *t);
+asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
+                                     struct compat_stat __user *statbuf,
+                                     int flag);
+asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
+                                 int flags, int mode);
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
index 5c7f9468f753b51fb05a0417930cffb2e709f59f..34f2789d9b9b0e5208e8a2eeeb085b94573efb8d 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef __CONNECTOR_H
 #define __CONNECTOR_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 
 #define CN_IDX_CONNECTOR               0xffffffff
 #define CN_VAL_CONNECTOR               0xffffffff
index 2d3d1e04ba92549e0b7350e8be685ef566d1abcf..d06fbf286346fdd65eb3e84451866a7c8c84c7f8 100644 (file)
@@ -150,8 +150,6 @@ struct CYZ_BOOT_CTRL {
  *     architectures and compilers.
  */
 
-#include <asm/types.h>
-
 typedef __u64  ucdouble;               /* 64 bits, unsigned */
 typedef __u32  uclong;                 /* 32 bits, unsigned */
 typedef __u16  ucshort;                /* 16 bits, unsigned */
index 1ee63df5be92ee21e31fcd23648475ac00309ad6..818fe21257e8c62acdb8847be5af682c1cc186b7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _LINUX_FB_H
 #define _LINUX_FB_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/i2c.h>
 
 struct dentry;
index 3644f632338473b7ad3c77e793454b30320b4d51..194da5a4b0d683a0d0c42628c00f2c3459ac109d 100644 (file)
@@ -871,7 +871,7 @@ struct ide_host {
        ide_hwif_t      *cur_port;      /* for hosts requiring serialization */
 
        /* used for hosts requiring serialization */
-       volatile long   host_busy;
+       volatile unsigned long  host_busy;
 };
 
 #define IDE_HOST_BUSY 0
index a7d6a2234b318c6b90109acec9845ea059bd63b2..c7a66882b6d0865cb697b981591356335759247a 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef __LINUX_IF_PPPOL2TP_H
 #define __LINUX_IF_PPPOL2TP_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 
 #ifdef __KERNEL__
 #include <linux/in.h>
index 6fb7f1788570dc0a3cd428e5b8518672261819c4..30c88b2245ffa157263fe4d1311deb39d25261fb 100644 (file)
@@ -17,7 +17,7 @@
 #define __LINUX_IF_PPPOX_H
 
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <asm/byteorder.h>
 
 #ifdef  __KERNEL__
index 9a6355f74db25b28233cb3d9d8765d7aec13632e..1249a0c20a38258f7cf3064ece21f6e54dcbf254 100644 (file)
@@ -16,7 +16,7 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
-#include <asm/types.h>
+#include <linux/types.h>
 #endif
 
 /*
index f6bb2ca8e3ba44484ec2a9844af400f2d2014052..32e4b2f722949374fdeae6f863af60028a6eecc6 100644 (file)
@@ -143,7 +143,8 @@ static inline unsigned long resource_type(struct resource *res)
 
 extern struct resource * __request_region(struct resource *,
                                        resource_size_t start,
-                                       resource_size_t n, const char *name, int relaxed);
+                                       resource_size_t n,
+                                       const char *name, int flags);
 
 /* Compatibility cruft */
 #define release_region(start,n)        __release_region(&ioport_resource, (start), (n))
index 6384b19efe64cc13dd671eceed9745f541295c8d..64246dce5663079b5f69afe9eabc05efc3e1229e 100644 (file)
@@ -614,6 +614,8 @@ struct transaction_s
  * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
  *     number that will fit in j_blocksize
  * @j_last_sync_writer: most recent pid which did a synchronous write
+ * @j_average_commit_time: the average amount of time in nanoseconds it
+ *     takes to commit a transaction to the disk.
  * @j_private: An opaque pointer to fs-private information.
  */
 
index b5e051295a6779c551f40cb6715569819e15a477..9e20c29c1e1401d1f814476087436d93fdb83ba0 100644 (file)
@@ -27,7 +27,7 @@
  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  */
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/input.h>
 
 /*
index 35525ac63337112e0dd61d5bb87bb494c3e25de2..5715f190760161fbbdfbdd3231f6e87c9a905b72 100644 (file)
@@ -7,7 +7,7 @@
  * Note: you must update KVM_API_VERSION if you change this interface.
  */
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/ioctl.h>
 #include <asm/kvm.h>
index b6b8a7f3ec66064778cf2b63b6eaa4a03dc25495..2c6bd66209ff6a076464b206662d7a6cf7730adb 100644 (file)
@@ -401,12 +401,14 @@ enum {
                                  ATA_TIMING_CYC8B,
        ATA_TIMING_ACTIVE       = (1 << 4),
        ATA_TIMING_RECOVER      = (1 << 5),
-       ATA_TIMING_CYCLE        = (1 << 6),
-       ATA_TIMING_UDMA         = (1 << 7),
+       ATA_TIMING_DMACK_HOLD   = (1 << 6),
+       ATA_TIMING_CYCLE        = (1 << 7),
+       ATA_TIMING_UDMA         = (1 << 8),
        ATA_TIMING_ALL          = ATA_TIMING_SETUP | ATA_TIMING_ACT8B |
                                  ATA_TIMING_REC8B | ATA_TIMING_CYC8B |
                                  ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER |
-                                 ATA_TIMING_CYCLE | ATA_TIMING_UDMA,
+                                 ATA_TIMING_DMACK_HOLD | ATA_TIMING_CYCLE |
+                                 ATA_TIMING_UDMA,
 };
 
 enum ata_xfer_mask {
@@ -866,6 +868,7 @@ struct ata_timing {
        unsigned short cyc8b;           /* t0 for 8-bit I/O */
        unsigned short active;          /* t2 or tD */
        unsigned short recover;         /* t2i or tK */
+       unsigned short dmack_hold;      /* tj */
        unsigned short cycle;           /* t0 */
        unsigned short udma;            /* t2CYCTYP/2 */
 };
@@ -927,6 +930,8 @@ extern void ata_host_init(struct ata_host *, struct device *,
 extern int ata_scsi_detect(struct scsi_host_template *sht);
 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
 extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
+extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev,
+                           int cmd, void __user *arg);
 extern void ata_sas_port_destroy(struct ata_port *);
 extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
                                           struct ata_port_info *, struct Scsi_Host *);
index 46169a7b559b9ebacd3e53c777a692008e4cb37f..6ffd6db5bb0d746c2a92deb358c450b2989b5c61 100644 (file)
@@ -80,7 +80,7 @@ enum {
 };
 
 #include <asm/posix_types.h>   /* for __kernel_old_dev_t */
-#include <asm/types.h>         /* for __u64 */
+#include <linux/types.h>       /* for __u64 */
 
 /* Backwards compatibility version */
 struct loop_info {
index 439f6f3cb0c445a18d5ee0036f500f06f836bafe..0b4df7eba85242d0897d1b3312c6967955be6a0a 100644 (file)
 #define SYSFS_MAGIC            0x62656572
 #define SECURITYFS_MAGIC       0x73636673
 #define TMPFS_MAGIC            0x01021994
+#define SQUASHFS_MAGIC         0x73717368
 #define EFS_SUPER_MAGIC                0x414A53
 #define EXT2_SUPER_MAGIC       0xEF53
 #define EXT3_SUPER_MAGIC       0xEF53
 #define XENFS_SUPER_MAGIC      0xabba1974
 #define EXT4_SUPER_MAGIC       0xEF53
+#define BTRFS_SUPER_MAGIC      0x9123683E
 #define HPFS_SUPER_MAGIC       0xf995e849
 #define ISOFS_SUPER_MAGIC      0x9660
 #define JFFS2_SUPER_MAGIC      0x72b6
index ae5b09493062871abcccb9df8aa6700bde00390c..404f678e734bbed61e512b1d6e071e18269232d5 100644 (file)
@@ -2,7 +2,7 @@
 #define __LINUX_MATROXFB_H__
 
 #include <asm/ioctl.h>
-#include <asm/types.h>
+#include <linux/types.h>
 #include <linux/videodev2.h>
 
 struct matroxioc_output_mode {
index b91a73fd1bcc2d22f64d5387b5c2dfe7473456c8..e8ddc98b8405fdf7c9d32680731e0d5738bb97e1 100644 (file)
@@ -260,7 +260,6 @@ static inline int put_page_testzero(struct page *page)
  */
 static inline int get_page_unless_zero(struct page *page)
 {
-       VM_BUG_ON(PageTail(page));
        return atomic_inc_not_zero(&page->_count);
 }
 
index bd2a870ec29621f54b4b53aea5dd15f8bb8c346f..34974b5a76f78d1d9d142c3df4fb0e23a0ba106e 100644 (file)
@@ -17,4 +17,7 @@
 void of_register_i2c_devices(struct i2c_adapter *adap,
                             struct device_node *adap_node);
 
+/* must call put_device() when done with returned i2c_client device */
+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
+
 #endif /* __LINUX_OF_I2C_H */
index d543365518ab476c3e0b9ef2a68de89e2b3268d1..d56ad9c21c09fb677e9a312da9c30987268ca504 100644 (file)
 #define PCI_DEVICE_ID_RDC_R6040                0x6040
 #define PCI_DEVICE_ID_RDC_R6060                0x6060
 #define PCI_DEVICE_ID_RDC_R6061                0x6061
+#define PCI_DEVICE_ID_RDC_D1010                0x1010
 
 #define PCI_VENDOR_ID_LENOVO           0x17aa
 
index 02268c54c250767b8ec3eda32b4c68edfe768ff5..94dd6645c60ad942b4996363cecdbce30a032e84 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __PHANTOM_H
 #define __PHANTOM_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 
 /* PHN_(G/S)ET_REG param */
 struct phm_reg {
index 5bd8975ed78e3708df073420de52251790c8d507..8c4bbdecc44fd2af5ce50a69b8869f00f41ebbf1 100644 (file)
@@ -2,7 +2,7 @@
 #define __LINUX_RADEONFB_H__
 
 #include <asm/ioctl.h>
-#include <asm/types.h>
+#include <linux/types.h>
 
 #define ATY_RADEON_LCD_ON      0x00000001
 #define ATY_RADEON_CRT_ON      0x00000002
index dede0a2cfc45980a067e916ea1fabfeee273c7fb..4c5bcf6ca7e8b0457bf1b25f2922221fb92985ac 100644 (file)
@@ -9,7 +9,7 @@
  *
  * Author: Pavel Emelianov <xemul@openvz.org>
  *
- * See Documentation/controllers/resource_counter.txt for more
+ * See Documentation/cgroups/resource_counter.txt for more
  * info about what this counter is.
  */
 
index be5284d4a0531509659097bf98a1da1bc2035e39..ea0c02fd5163c2b865d2041cc0a2f5e43e7c7743 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/types.h>
 #include <linux/compiler.h>
-#include <asm/byteorder.h>
+#include <asm/swab.h>
 
 /*
  * casts are necessary for constants, because we never know how for sure
index 18d0a243a7b3a8cd98e05386c10ac697258bbb56..16875f89e6a7135d28dfccb1c51e4f8174383bea 100644 (file)
@@ -54,6 +54,7 @@ struct compat_stat;
 struct compat_timeval;
 struct robust_list_head;
 struct getcpu_cache;
+struct old_linux_dirent;
 
 #include <linux/types.h>
 #include <linux/aio_abi.h>
@@ -65,6 +66,74 @@ struct getcpu_cache;
 #include <linux/quota.h>
 #include <linux/key.h>
 
+#define __SC_DECL1(t1, a1)     t1 a1
+#define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__)
+#define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__)
+#define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__)
+#define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__)
+#define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__)
+
+#define __SC_LONG1(t1, a1)     long a1
+#define __SC_LONG2(t2, a2, ...) long a2, __SC_LONG1(__VA_ARGS__)
+#define __SC_LONG3(t3, a3, ...) long a3, __SC_LONG2(__VA_ARGS__)
+#define __SC_LONG4(t4, a4, ...) long a4, __SC_LONG3(__VA_ARGS__)
+#define __SC_LONG5(t5, a5, ...) long a5, __SC_LONG4(__VA_ARGS__)
+#define __SC_LONG6(t6, a6, ...) long a6, __SC_LONG5(__VA_ARGS__)
+
+#define __SC_CAST1(t1, a1)     (t1) a1
+#define __SC_CAST2(t2, a2, ...) (t2) a2, __SC_CAST1(__VA_ARGS__)
+#define __SC_CAST3(t3, a3, ...) (t3) a3, __SC_CAST2(__VA_ARGS__)
+#define __SC_CAST4(t4, a4, ...) (t4) a4, __SC_CAST3(__VA_ARGS__)
+#define __SC_CAST5(t5, a5, ...) (t5) a5, __SC_CAST4(__VA_ARGS__)
+#define __SC_CAST6(t6, a6, ...) (t6) a6, __SC_CAST5(__VA_ARGS__)
+
+#define __SC_TEST(type)                BUILD_BUG_ON(sizeof(type) > sizeof(long))
+#define __SC_TEST1(t1, a1)     __SC_TEST(t1)
+#define __SC_TEST2(t2, a2, ...)        __SC_TEST(t2); __SC_TEST1(__VA_ARGS__)
+#define __SC_TEST3(t3, a3, ...)        __SC_TEST(t3); __SC_TEST2(__VA_ARGS__)
+#define __SC_TEST4(t4, a4, ...)        __SC_TEST(t4); __SC_TEST3(__VA_ARGS__)
+#define __SC_TEST5(t5, a5, ...)        __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
+#define __SC_TEST6(t6, a6, ...)        __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
+
+#define SYSCALL_DEFINE0(name)   asmlinkage long sys_##name(void)
+#define SYSCALL_DEFINE1(...)    SYSCALL_DEFINEx(1, __VA_ARGS__)
+#define SYSCALL_DEFINE2(...)    SYSCALL_DEFINEx(2, __VA_ARGS__)
+#define SYSCALL_DEFINE3(...)    SYSCALL_DEFINEx(3, __VA_ARGS__)
+#define SYSCALL_DEFINE4(...)    SYSCALL_DEFINEx(4, __VA_ARGS__)
+#define SYSCALL_DEFINE5(...)    SYSCALL_DEFINEx(5, __VA_ARGS__)
+#define SYSCALL_DEFINE6(...)    SYSCALL_DEFINEx(6, __VA_ARGS__)
+
+#ifdef CONFIG_PPC64
+#define SYSCALL_ALIAS(alias, name)                                     \
+       asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n"      \
+            "\t.globl ." #alias "\n\t.set ." #alias ", ." #name)
+#else
+#define SYSCALL_ALIAS(alias, name)                                     \
+       asm ("\t.globl " #alias "\n\t.set " #alias ", " #name)
+#endif
+
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+
+#define SYSCALL_DEFINE(name) static inline long SYSC_##name
+#define SYSCALL_DEFINEx(x, name, ...)                                  \
+       asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__));          \
+       static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__));      \
+       asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__))           \
+       {                                                               \
+               __SC_TEST##x(__VA_ARGS__);                              \
+               return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__));   \
+       }                                                               \
+       SYSCALL_ALIAS(sys_##name, SyS_##name);                          \
+       static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__))
+
+#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
+
+#define SYSCALL_DEFINE(name) asmlinkage long sys_##name
+#define SYSCALL_DEFINEx(x, name, ...)                                  \
+       asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__))
+
+#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
+
 asmlinkage long sys_time(time_t __user *tloc);
 asmlinkage long sys_stime(time_t __user *tptr);
 asmlinkage long sys_gettimeofday(struct timeval __user *tv,
@@ -77,7 +146,7 @@ asmlinkage long sys_times(struct tms __user *tbuf);
 
 asmlinkage long sys_gettid(void);
 asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp);
-asmlinkage unsigned long sys_alarm(unsigned int seconds);
+asmlinkage long sys_alarm(unsigned int seconds);
 asmlinkage long sys_getpid(void);
 asmlinkage long sys_getppid(void);
 asmlinkage long sys_getuid(void);
@@ -166,7 +235,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
                                unsigned long flags);
 
 asmlinkage long sys_exit(int error_code);
-asmlinkage void sys_exit_group(int error_code);
+asmlinkage long sys_exit_group(int error_code);
 asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
                                int options, struct rusage __user *ru);
 asmlinkage long sys_waitid(int which, pid_t pid,
@@ -196,7 +265,7 @@ asmlinkage long sys_tkill(int pid, int sig);
 asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo);
 asmlinkage long sys_sgetmask(void);
 asmlinkage long sys_ssetmask(int newmask);
-asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler);
+asmlinkage long sys_signal(int sig, __sighandler_t handler);
 asmlinkage long sys_pause(void);
 
 asmlinkage long sys_sync(void);
@@ -246,29 +315,29 @@ asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name,
                              const void __user *value, size_t size, int flags);
 asmlinkage long sys_fsetxattr(int fd, const char __user *name,
                              const void __user *value, size_t size, int flags);
-asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name,
-                               void __user *value, size_t size);
-asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name,
-                               void __user *value, size_t size);
-asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name,
-                               void __user *value, size_t size);
-asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list,
-                               size_t size);
-asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list,
-                               size_t size);
-asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long sys_getxattr(const char __user *path, const char __user *name,
+                            void __user *value, size_t size);
+asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name,
+                             void __user *value, size_t size);
+asmlinkage long sys_fgetxattr(int fd, const char __user *name,
+                             void __user *value, size_t size);
+asmlinkage long sys_listxattr(const char __user *path, char __user *list,
+                             size_t size);
+asmlinkage long sys_llistxattr(const char __user *path, char __user *list,
+                              size_t size);
+asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size);
 asmlinkage long sys_removexattr(const char __user *path,
                                const char __user *name);
 asmlinkage long sys_lremovexattr(const char __user *path,
                                 const char __user *name);
 asmlinkage long sys_fremovexattr(int fd, const char __user *name);
 
-asmlinkage unsigned long sys_brk(unsigned long brk);
+asmlinkage long sys_brk(unsigned long brk);
 asmlinkage long sys_mprotect(unsigned long start, size_t len,
                                unsigned long prot);
-asmlinkage unsigned long sys_mremap(unsigned long addr,
-                               unsigned long old_len, unsigned long new_len,
-                               unsigned long flags, unsigned long new_addr);
+asmlinkage long sys_mremap(unsigned long addr,
+                          unsigned long old_len, unsigned long new_len,
+                          unsigned long flags, unsigned long new_addr);
 asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
                        unsigned long prot, unsigned long pgoff,
                        unsigned long flags);
@@ -321,10 +390,10 @@ asmlinkage long sys_io_submit(aio_context_t, long,
                                struct iocb __user * __user *);
 asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
                              struct io_event __user *result);
-asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd,
-                               off_t __user *offset, size_t count);
-asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd,
-                               loff_t __user *offset, size_t count);
+asmlinkage long sys_sendfile(int out_fd, int in_fd,
+                            off_t __user *offset, size_t count);
+asmlinkage long sys_sendfile64(int out_fd, int in_fd,
+                              loff_t __user *offset, size_t count);
 asmlinkage long sys_readlink(const char __user *path,
                                char __user *buf, int bufsiz);
 asmlinkage long sys_creat(const char __user *pathname, int mode);
@@ -368,26 +437,25 @@ asmlinkage long sys_utime(char __user *filename,
                                struct utimbuf __user *times);
 asmlinkage long sys_utimes(char __user *filename,
                                struct timeval __user *utimes);
-asmlinkage off_t sys_lseek(unsigned int fd, off_t offset,
-                               unsigned int origin);
+asmlinkage long sys_lseek(unsigned int fd, off_t offset,
+                         unsigned int origin);
 asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
                        unsigned long offset_low, loff_t __user *result,
                        unsigned int origin);
-asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf,
-                               size_t count);
-asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
-asmlinkage ssize_t sys_readv(unsigned long fd,
-                               const struct iovec __user *vec,
-                               unsigned long vlen);
-asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf,
-                               size_t count);
-asmlinkage ssize_t sys_writev(unsigned long fd,
-                               const struct iovec __user *vec,
-                               unsigned long vlen);
-asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
-                               size_t count, loff_t pos);
-asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf,
-                               size_t count, loff_t pos);
+asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count);
+asmlinkage long sys_readahead(int fd, loff_t offset, size_t count);
+asmlinkage long sys_readv(unsigned long fd,
+                         const struct iovec __user *vec,
+                         unsigned long vlen);
+asmlinkage long sys_write(unsigned int fd, const char __user *buf,
+                         size_t count);
+asmlinkage long sys_writev(unsigned long fd,
+                          const struct iovec __user *vec,
+                          unsigned long vlen);
+asmlinkage long sys_pread64(unsigned int fd, char __user *buf,
+                           size_t count, loff_t pos);
+asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf,
+                            size_t count, loff_t pos);
 asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
 asmlinkage long sys_mkdir(const char __user *pathname, int mode);
 asmlinkage long sys_chdir(const char __user *filename);
@@ -476,7 +544,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
 asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr);
 asmlinkage long sys_mq_unlink(const char __user *name);
 asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout);
-asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout);
+asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout);
 asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification);
 asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat);
 
@@ -530,11 +598,6 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
                                const int __user *nodes,
                                int __user *status,
                                int flags);
-asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
-                               __u32 __user *pages,
-                               const int __user *nodes,
-                               int __user *status,
-                               int flags);
 asmlinkage long sys_mbind(unsigned long start, unsigned long len,
                                unsigned long mode,
                                unsigned long __user *nmask,
@@ -583,13 +646,6 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *bu
                               int bufsiz);
 asmlinkage long sys_utimensat(int dfd, char __user *filename,
                                struct timespec __user *utimes, int flags);
-asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
-                                    struct compat_timeval __user *t);
-asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
-                                     struct compat_stat __user *statbuf,
-                                     int flag);
-asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
-                                  int flags, int mode);
 asmlinkage long sys_unshare(unsigned long unshare_flags);
 
 asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
@@ -621,6 +677,15 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr);
 asmlinkage long sys_eventfd(unsigned int count);
 asmlinkage long sys_eventfd2(unsigned int count, int flags);
 asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
+asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int);
+asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
+                            fd_set __user *, struct timespec __user *,
+                            void __user *);
+asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int,
+                         struct timespec __user *, const sigset_t __user *,
+                         size_t);
+asmlinkage long sys_pipe2(int __user *, int);
+asmlinkage long sys_pipe(int __user *);
 
 int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
 
index 83e32f6d78592d188b3e82d489e18ec723d31db8..9e3182e659dbda6f7f86237757102aa53ca00b39 100644 (file)
@@ -39,6 +39,7 @@ struct iscsi_segment {
        unsigned int            total_copied;
 
        struct hash_desc        *hash;
+       unsigned char           padbuf[ISCSI_PAD_LEN];
        unsigned char           recv_digest[ISCSI_DIGEST_SIZE];
        unsigned char           digest[ISCSI_DIGEST_SIZE];
        unsigned int            digest_len;
index a724a149bf3f232aba760c6b584db3f52dfd7e32..2af83825634e2acbde448f88655f855df226f0b7 100644 (file)
@@ -323,26 +323,26 @@ config CGROUP_SCHED
          This option allows you to create arbitrary task groups
          using the "cgroup" pseudo filesystem and control
          the cpu bandwidth allocated to each such task group.
-         Refer to Documentation/cgroups.txt for more information
-         on "cgroup" pseudo filesystem.
+         Refer to Documentation/cgroups/cgroups.txt for more
+         information on "cgroup" pseudo filesystem.
 
 endchoice
 
-menu "Control Group support"
-config CGROUPS
-       bool "Control Group support"
+menuconfig CGROUPS
+       boolean "Control Group support"
        help
-         This option add support for grouping sets of processes together, for
+         This option adds support for grouping sets of processes together, for
          use with process control subsystems such as Cpusets, CFS, memory
          controls or device isolation.
          See
-               - Documentation/cpusets.txt     (Cpusets)
                - Documentation/scheduler/sched-design-CFS.txt  (CFS)
-               - Documentation/cgroups/ (features for grouping, isolation)
-               - Documentation/controllers/ (features for resource control)
+               - Documentation/cgroups/ (features for grouping, isolation
+                                         and resource control)
 
          Say N if unsure.
 
+if CGROUPS
+
 config CGROUP_DEBUG
        bool "Example debug cgroup subsystem"
        depends on CGROUPS
@@ -350,24 +350,24 @@ config CGROUP_DEBUG
        help
          This option enables a simple cgroup subsystem that
          exports useful debugging information about the cgroups
-         framework
+         framework.
 
-         Say N if unsure
+         Say N if unsure.
 
 config CGROUP_NS
-        bool "Namespace cgroup subsystem"
-        depends on CGROUPS
-        help
-          Provides a simple namespace cgroup subsystem to
-          provide hierarchical naming of sets of namespaces,
-          for instance virtual servers and checkpoint/restart
-          jobs.
+       bool "Namespace cgroup subsystem"
+       depends on CGROUPS
+       help
+         Provides a simple namespace cgroup subsystem to
+         provide hierarchical naming of sets of namespaces,
+         for instance virtual servers and checkpoint/restart
+         jobs.
 
 config CGROUP_FREEZER
-        bool "control group freezer subsystem"
-        depends on CGROUPS
-        help
-          Provides a way to freeze and unfreeze all tasks in a
+       bool "Freezer cgroup subsystem"
+       depends on CGROUPS
+       help
+         Provides a way to freeze and unfreeze all tasks in a
          cgroup.
 
 config CGROUP_DEVICE
@@ -388,18 +388,23 @@ config CPUSETS
 
          Say N if unsure.
 
+config PROC_PID_CPUSET
+       bool "Include legacy /proc/<pid>/cpuset file"
+       depends on CPUSETS
+       default y
+
 config CGROUP_CPUACCT
        bool "Simple CPU accounting cgroup subsystem"
        depends on CGROUPS
        help
          Provides a simple Resource Controller for monitoring the
-         total CPU consumed by the tasks in a cgroup
+         total CPU consumed by the tasks in a cgroup.
 
 config RESOURCE_COUNTERS
        bool "Resource counters"
        help
          This option enables controller independent resource accounting
-          infrastructure that works with cgroups
+         infrastructure that works with cgroups.
        depends on CGROUPS
 
 config CGROUP_MEM_RES_CTLR
@@ -425,9 +430,6 @@ config CGROUP_MEM_RES_CTLR
          This config option also selects MM_OWNER config option, which
          could in turn add some fork/exit overhead.
 
-config MM_OWNER
-       bool
-
 config CGROUP_MEM_RES_CTLR_SWAP
        bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)"
        depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL
@@ -444,8 +446,10 @@ config CGROUP_MEM_RES_CTLR_SWAP
          there will be no overhead from this. Even when you set this config=y,
          if boot option "noswapaccount" is set, swap will not be accounted.
 
+endif # CGROUPS
 
-endmenu
+config MM_OWNER
+       bool
 
 config SYSFS_DEPRECATED
        bool
@@ -483,11 +487,6 @@ config SYSFS_DEPRECATED_V2
          if the original kernel, that came with your distribution, has
          this option set to N.
 
-config PROC_PID_CPUSET
-       bool "Include legacy /proc/<pid>/cpuset file"
-       depends on CPUSETS
-       default y
-
 config RELAY
        bool "Kernel->user space relay support (formerly relayfs)"
        help
index 23fdb8492b8e56e431d46471359a69b298493b73..54b4077fed79aaac0cd03da6c725d5d322b1159c 100644 (file)
@@ -650,8 +650,8 @@ static struct file *do_open(struct dentry *dentry, int oflag)
        return dentry_open(dentry, mqueue_mnt, oflag, cred);
 }
 
-asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
-                               struct mq_attr __user *u_attr)
+SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode,
+               struct mq_attr __user *, u_attr)
 {
        struct dentry *dentry;
        struct file *filp;
@@ -721,7 +721,7 @@ out_putname:
        return fd;
 }
 
-asmlinkage long sys_mq_unlink(const char __user *u_name)
+SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
 {
        int err;
        char *name;
@@ -814,9 +814,9 @@ static inline void pipelined_receive(struct mqueue_inode_info *info)
        sender->state = STATE_READY;
 }
 
-asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr,
-       size_t msg_len, unsigned int msg_prio,
-       const struct timespec __user *u_abs_timeout)
+SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr,
+               size_t, msg_len, unsigned int, msg_prio,
+               const struct timespec __user *, u_abs_timeout)
 {
        struct file *filp;
        struct inode *inode;
@@ -907,9 +907,9 @@ out:
        return ret;
 }
 
-asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr,
-       size_t msg_len, unsigned int __user *u_msg_prio,
-       const struct timespec __user *u_abs_timeout)
+SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr,
+               size_t, msg_len, unsigned int __user *, u_msg_prio,
+               const struct timespec __user *, u_abs_timeout)
 {
        long timeout;
        ssize_t ret;
@@ -997,8 +997,8 @@ out:
  * and he isn't currently owner of notification, will be silently discarded.
  * It isn't explicitly defined in the POSIX.
  */
-asmlinkage long sys_mq_notify(mqd_t mqdes,
-                               const struct sigevent __user *u_notification)
+SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
+               const struct sigevent __user *, u_notification)
 {
        int ret;
        struct file *filp;
@@ -1123,9 +1123,9 @@ out:
        return ret;
 }
 
-asmlinkage long sys_mq_getsetattr(mqd_t mqdes,
-                       const struct mq_attr __user *u_mqstat,
-                       struct mq_attr __user *u_omqstat)
+SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
+               const struct mq_attr __user *, u_mqstat,
+               struct mq_attr __user *, u_omqstat)
 {
        int ret;
        struct mq_attr mqstat, omqstat;
index b4eee1c6101d6fda19583015a8f4881bc74f8f4b..2ceab7f12fcba404986a4cba4a3b6f768c25ca59 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -309,7 +309,7 @@ static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg)
        return security_msg_queue_associate(msq, msgflg);
 }
 
-asmlinkage long sys_msgget(key_t key, int msgflg)
+SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg)
 {
        struct ipc_namespace *ns;
        struct ipc_ops msg_ops;
@@ -466,7 +466,7 @@ out_up:
        return err;
 }
 
-asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)
+SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf)
 {
        struct msg_queue *msq;
        int err, version;
@@ -723,8 +723,8 @@ out_free:
        return err;
 }
 
-asmlinkage long
-sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg)
+SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz,
+               int, msgflg)
 {
        long mtype;
 
@@ -904,8 +904,8 @@ out_unlock:
        return msgsz;
 }
 
-asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
-                          long msgtyp, int msgflg)
+SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz,
+               long, msgtyp, int, msgflg)
 {
        long err, mtype;
 
index c68cd3f8f0c92259d9a0af3be4ec3adc6b3ad559..16a2189e96f9458d7626660b4c537dd718bd0fd6 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -308,7 +308,7 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp,
        return 0;
 }
 
-asmlinkage long sys_semget(key_t key, int nsems, int semflg)
+SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg)
 {
        struct ipc_namespace *ns;
        struct ipc_ops sem_ops;
@@ -887,7 +887,7 @@ out_up:
        return err;
 }
 
-asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg)
+SYSCALL_DEFINE(semctl)(int semid, int semnum, int cmd, union semun arg)
 {
        int err = -EINVAL;
        int version;
@@ -923,6 +923,13 @@ asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg)
                return -EINVAL;
        }
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_semctl(int semid, int semnum, int cmd, union semun arg)
+{
+       return SYSC_semctl((int) semid, (int) semnum, (int) cmd, arg);
+}
+SYSCALL_ALIAS(sys_semctl, SyS_semctl);
+#endif
 
 /* If the task doesn't already have a undo_list, then allocate one
  * here.  We guarantee there is only one thread using this undo list,
@@ -1048,8 +1055,8 @@ out:
        return un;
 }
 
-asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
-                       unsigned nsops, const struct timespec __user *timeout)
+SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
+               unsigned, nsops, const struct timespec __user *, timeout)
 {
        int error = -EINVAL;
        struct sem_array *sma;
@@ -1225,7 +1232,8 @@ out_free:
        return error;
 }
 
-asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops)
+SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops,
+               unsigned, nsops)
 {
        return sys_semtimedop(semid, tsops, nsops, NULL);
 }
index d0ab5527bf45607ae5ba8abc66219c218fab694a..a9e09ad2263e36e611c8e7599e34115cfb467b92 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -440,7 +440,7 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp,
        return 0;
 }
 
-asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
+SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg)
 {
        struct ipc_namespace *ns;
        struct ipc_ops shm_ops;
@@ -621,7 +621,7 @@ out_up:
        return err;
 }
 
-asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
+SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
 {
        struct shmid_kernel *shp;
        int err, version;
@@ -939,7 +939,7 @@ out_put_dentry:
        goto out_nattch;
 }
 
-asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
+SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
 {
        unsigned long ret;
        long err;
@@ -955,7 +955,7 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
  * detach and kill segment if marked destroyed.
  * The work is done in shm_close.
  */
-asmlinkage long sys_shmdt(char __user *shmaddr)
+SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
 {
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma, *next;
index 2aebc4cd787810a5e71ca4ea4aa35301220a6355..170a9213c1b68d6cee652fb7758fef556ecf127f 100644 (file)
@@ -40,9 +40,8 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o
 obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
 obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
-ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y)
-obj-y += smp.o
-else
+obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o
+ifneq ($(CONFIG_SMP),y)
 obj-y += up.o
 endif
 obj-$(CONFIG_SMP) += spinlock.o
index d57b7cbb98b6db63e017045f9bb39ea6eb2bebf8..7afa31564162d4acc03bd4ed34144ba459e11bdf 100644 (file)
@@ -277,7 +277,7 @@ static int acct_on(char *name)
  * should be written. If the filename is NULL, accounting will be
  * shutdown.
  */
-asmlinkage long sys_acct(const char __user *name)
+SYSCALL_DEFINE1(acct, const char __user *, name)
 {
        int error;
 
index 688926e496be18737d8ae37af9fe807f75185f56..4e17041963f57073a4fb3836c415b9a681e40383 100644 (file)
@@ -161,7 +161,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp,
  *
  * Returns 0 on success and < 0 on error.
  */
-asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
+SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
 {
        int ret = 0;
        pid_t pid;
@@ -235,7 +235,7 @@ asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
  *
  * Returns 0 on success and < 0 on error.
  */
-asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
+SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
 {
        struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
        unsigned i, tocopy;
index 647c77a88fcb5f39969241988bcbf6c8edcfc876..a85678865c5eca291f4c9a06e1b5005e3c79c06b 100644 (file)
@@ -568,7 +568,7 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c)
  * load balancing domains (sched domains) as specified by that partial
  * partition.
  *
- * See "What is sched_load_balance" in Documentation/cpusets.txt
+ * See "What is sched_load_balance" in Documentation/cgroups/cpusets.txt
  * for a background explanation of this.
  *
  * Does not return errors, on the theory that the callers of this
index 0511716e94247a86873bb095e1136d45aa362c2c..667c841c2952d6966a08ba9b11e00ad99d06520a 100644 (file)
@@ -209,8 +209,7 @@ static int __init proc_execdomains_init(void)
 module_init(proc_execdomains_init);
 #endif
 
-asmlinkage long
-sys_personality(u_long personality)
+SYSCALL_DEFINE1(personality, u_long, personality)
 {
        u_long old = current->personality;
 
index c7740fa3252cb0ab24d8f07bd89acf47006c3d60..f80dec3f1875db702b7729cdf91e4d2931cfcbbf 100644 (file)
@@ -1141,7 +1141,7 @@ NORET_TYPE void complete_and_exit(struct completion *comp, long code)
 
 EXPORT_SYMBOL(complete_and_exit);
 
-asmlinkage long sys_exit(int error_code)
+SYSCALL_DEFINE1(exit, int, error_code)
 {
        do_exit((error_code&0xff)<<8);
 }
@@ -1182,9 +1182,11 @@ do_group_exit(int exit_code)
  * wait4()-ing process will get the correct exit code - even if this
  * thread is not the thread group leader.
  */
-asmlinkage void sys_exit_group(int error_code)
+SYSCALL_DEFINE1(exit_group, int, error_code)
 {
        do_group_exit((error_code & 0xff) << 8);
+       /* NOTREACHED */
+       return 0;
 }
 
 static struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
@@ -1752,9 +1754,8 @@ end:
        return retval;
 }
 
-asmlinkage long sys_waitid(int which, pid_t upid,
-                          struct siginfo __user *infop, int options,
-                          struct rusage __user *ru)
+SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
+               infop, int, options, struct rusage __user *, ru)
 {
        struct pid *pid = NULL;
        enum pid_type type;
@@ -1793,8 +1794,8 @@ asmlinkage long sys_waitid(int which, pid_t upid,
        return ret;
 }
 
-asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr,
-                         int options, struct rusage __user *ru)
+SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr,
+               int, options, struct rusage __user *, ru)
 {
        struct pid *pid = NULL;
        enum pid_type type;
@@ -1831,7 +1832,7 @@ asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr,
  * sys_waitpid() remains for compatibility. waitpid() should be
  * implemented by calling sys_wait4() from libc.a.
  */
-asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options)
+SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options)
 {
        return sys_wait4(pid, stat_addr, options, NULL);
 }
index 1d68f1255dd824cf2fd1c06a1e6464bac718d26f..bf0cef8bbdf2410058e51e4bf689e49d83362fa2 100644 (file)
@@ -901,7 +901,7 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p)
        clear_freeze_flag(p);
 }
 
-asmlinkage long sys_set_tid_address(int __user *tidptr)
+SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
 {
        current->clear_child_tid = tidptr;
 
@@ -1603,7 +1603,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp
  * constructed. Here we are modifying the current, active,
  * task_struct.
  */
-asmlinkage long sys_unshare(unsigned long unshare_flags)
+SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
 {
        int err = 0;
        struct fs_struct *fs, *new_fs = NULL;
index 002aa189eb09ae0d66617f3236e4f53e31913547..f89d373a9c6d7ff5e6848404d4db5b84eb35819f 100644 (file)
@@ -1733,9 +1733,8 @@ pi_faulted:
  * @head: pointer to the list-head
  * @len: length of the list-head, as userspace expects
  */
-asmlinkage long
-sys_set_robust_list(struct robust_list_head __user *head,
-                   size_t len)
+SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head,
+               size_t, len)
 {
        if (!futex_cmpxchg_enabled)
                return -ENOSYS;
@@ -1756,9 +1755,9 @@ sys_set_robust_list(struct robust_list_head __user *head,
  * @head_ptr: pointer to a list-head pointer, the kernel fills it in
  * @len_ptr: pointer to a length field, the kernel fills in the header size
  */
-asmlinkage long
-sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr,
-                   size_t __user *len_ptr)
+SYSCALL_DEFINE3(get_robust_list, int, pid,
+               struct robust_list_head __user * __user *, head_ptr,
+               size_t __user *, len_ptr)
 {
        struct robust_list_head __user *head;
        unsigned long ret;
@@ -1978,9 +1977,9 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
 }
 
 
-asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val,
-                         struct timespec __user *utime, u32 __user *uaddr2,
-                         u32 val3)
+SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
+               struct timespec __user *, utime, u32 __user *, uaddr2,
+               u32, val3)
 {
        struct timespec ts;
        ktime_t t, *tp = NULL;
index 1455b7651b6b27f9343809260976a1df3e4678e6..2dc30c59c5fd63560cc5485ca0075c958f5c36e5 100644 (file)
@@ -1467,8 +1467,8 @@ out:
        return ret;
 }
 
-asmlinkage long
-sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
+SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
+               struct timespec __user *, rmtp)
 {
        struct timespec tu;
 
index db7c358b9a02f1cc50954517124c8272b5eed463..6a5fe93dd8bdd76a83732c18f27e5eb0f42de773 100644 (file)
@@ -100,7 +100,7 @@ int do_getitimer(int which, struct itimerval *value)
        return 0;
 }
 
-asmlinkage long sys_getitimer(int which, struct itimerval __user *value)
+SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value)
 {
        int error = -EFAULT;
        struct itimerval get_buffer;
@@ -260,9 +260,8 @@ unsigned int alarm_setitimer(unsigned int seconds)
        return it_old.it_value.tv_sec;
 }
 
-asmlinkage long sys_setitimer(int which,
-                             struct itimerval __user *value,
-                             struct itimerval __user *ovalue)
+SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value,
+               struct itimerval __user *, ovalue)
 {
        struct itimerval set_buffer, get_buffer;
        int error;
index 3fb855ad6aa07fb5e03281aab28a1d163fb7686d..8a6d7b08864ea199108cae686adbe1a8886a56a5 100644 (file)
@@ -934,9 +934,8 @@ struct kimage *kexec_crash_image;
 
 static DEFINE_MUTEX(kexec_mutex);
 
-asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
-                               struct kexec_segment __user *segments,
-                               unsigned long flags)
+SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
+               struct kexec_segment __user *, segments, unsigned long, flags)
 {
        struct kimage **dest_image, *image;
        int result;
index c9332c90d5a0dbc56dcd9d1277dcb948817b3c08..e8b51d41dd72cf8170d3404b14dff167978e324a 100644 (file)
@@ -743,8 +743,8 @@ static void wait_for_zero_refcount(struct module *mod)
        mutex_lock(&module_mutex);
 }
 
-asmlinkage long
-sys_delete_module(const char __user *name_user, unsigned int flags)
+SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
+               unsigned int, flags)
 {
        struct module *mod;
        char name[MODULE_NAME_LEN];
@@ -2296,10 +2296,8 @@ static noinline struct module *load_module(void __user *umod,
 }
 
 /* This is where the real work happens */
-asmlinkage long
-sys_init_module(void __user *umod,
-               unsigned long len,
-               const char __user *uargs)
+SYSCALL_DEFINE3(init_module, void __user *, umod,
+               unsigned long, len, const char __user *, uargs)
 {
        struct module *mod;
        int ret = 0;
index 887c63787de6634b9d46ddcdbb386d5d3ffe5250..052ec4d195c7d1ee68fc3b5f9eeb422b932bb3b5 100644 (file)
@@ -477,10 +477,9 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
 
 /* Create a POSIX.1b interval timer. */
 
-asmlinkage long
-sys_timer_create(const clockid_t which_clock,
-                struct sigevent __user *timer_event_spec,
-                timer_t __user * created_timer_id)
+SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
+               struct sigevent __user *, timer_event_spec,
+               timer_t __user *, created_timer_id)
 {
        struct k_itimer *new_timer;
        int error, new_timer_id;
@@ -661,8 +660,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
 }
 
 /* Get the time remaining on a POSIX.1b interval timer. */
-asmlinkage long
-sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting)
+SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
+               struct itimerspec __user *, setting)
 {
        struct k_itimer *timr;
        struct itimerspec cur_setting;
@@ -691,8 +690,7 @@ sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting)
  * the call back to do_schedule_next_timer().  So all we need to do is
  * to pick up the frozen overrun.
  */
-asmlinkage long
-sys_timer_getoverrun(timer_t timer_id)
+SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id)
 {
        struct k_itimer *timr;
        int overrun;
@@ -760,10 +758,9 @@ common_timer_set(struct k_itimer *timr, int flags,
 }
 
 /* Set a POSIX.1b interval timer */
-asmlinkage long
-sys_timer_settime(timer_t timer_id, int flags,
-                 const struct itimerspec __user *new_setting,
-                 struct itimerspec __user *old_setting)
+SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
+               const struct itimerspec __user *, new_setting,
+               struct itimerspec __user *, old_setting)
 {
        struct k_itimer *timr;
        struct itimerspec new_spec, old_spec;
@@ -816,8 +813,7 @@ static inline int timer_delete_hook(struct k_itimer *timer)
 }
 
 /* Delete a POSIX.1b interval timer. */
-asmlinkage long
-sys_timer_delete(timer_t timer_id)
+SYSCALL_DEFINE1(timer_delete, timer_t, timer_id)
 {
        struct k_itimer *timer;
        unsigned long flags;
@@ -903,8 +899,8 @@ int do_posix_clock_nonanosleep(const clockid_t clock, int flags,
 }
 EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep);
 
-asmlinkage long sys_clock_settime(const clockid_t which_clock,
-                                 const struct timespec __user *tp)
+SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
+               const struct timespec __user *, tp)
 {
        struct timespec new_tp;
 
@@ -916,8 +912,8 @@ asmlinkage long sys_clock_settime(const clockid_t which_clock,
        return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp));
 }
 
-asmlinkage long
-sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp)
+SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
+               struct timespec __user *,tp)
 {
        struct timespec kernel_tp;
        int error;
@@ -933,8 +929,8 @@ sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp)
 
 }
 
-asmlinkage long
-sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
+SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
+               struct timespec __user *, tp)
 {
        struct timespec rtn_tp;
        int error;
@@ -963,10 +959,9 @@ static int common_nsleep(const clockid_t which_clock, int flags,
                                 which_clock);
 }
 
-asmlinkage long
-sys_clock_nanosleep(const clockid_t which_clock, int flags,
-                   const struct timespec __user *rqtp,
-                   struct timespec __user *rmtp)
+SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
+               const struct timespec __user *, rqtp,
+               struct timespec __user *, rmtp)
 {
        struct timespec t;
 
index 7015733793e8c2fc71097b49875cdf11f25203a1..69188f226a93251009d22d6dc453ce3d59220816 100644 (file)
@@ -382,7 +382,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_syslog(int type, char __user *buf, int len)
+SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
 {
        return do_syslog(type, buf, len);
 }
@@ -742,11 +742,6 @@ EXPORT_SYMBOL(vprintk);
 
 #else
 
-asmlinkage long sys_syslog(int type, char __user *buf, int len)
-{
-       return -ENOSYS;
-}
-
 static void call_console_drivers(unsigned start, unsigned end)
 {
 }
index 29dc700e198cb71f3854aa632078f5d3d529c1a0..c9cf48b21f052a620b34151cc9de6c4b48f4ad66 100644 (file)
@@ -574,7 +574,7 @@ struct task_struct *ptrace_get_task_struct(pid_t pid)
 #define arch_ptrace_attach(child)      do { } while (0)
 #endif
 
-asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
+SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data)
 {
        struct task_struct *child;
        long ret;
index ca6a1536b205bf6b0271fa7d6fb92ea09f87b649..fd5d7d574bb96fe857818d32cfee8dde1a755540 100644 (file)
@@ -620,6 +620,7 @@ resource_size_t resource_alignment(struct resource *res)
  * @start: resource start address
  * @n: resource region size
  * @name: reserving caller's ID string
+ * @flags: IO resource flags
  */
 struct resource * __request_region(struct resource *parent,
                                   resource_size_t start, resource_size_t n,
index 8be2c13b50d018cc69280829e14e31612d4deddd..52bbf1c842a8e0baecd1cd9f53883806eaab1350 100644 (file)
@@ -1323,8 +1323,8 @@ static inline void update_load_sub(struct load_weight *lw, unsigned long dec)
  * slice expiry etc.
  */
 
-#define WEIGHT_IDLEPRIO                2
-#define WMULT_IDLEPRIO         (1 << 31)
+#define WEIGHT_IDLEPRIO                3
+#define WMULT_IDLEPRIO         1431655765
 
 /*
  * Nice levels are multiplicative, with a gentle 10% change for every
@@ -4440,7 +4440,7 @@ void __kprobes sub_preempt_count(int val)
        /*
         * Underflow?
         */
-       if (DEBUG_LOCKS_WARN_ON(val > preempt_count() - (!!kernel_locked())))
+       if (DEBUG_LOCKS_WARN_ON(val > preempt_count()))
                return;
        /*
         * Is the spinlock portion underflowing?
@@ -5126,7 +5126,7 @@ int can_nice(const struct task_struct *p, const int nice)
  * sys_setpriority is a more generic, but much slower function that
  * does similar things.
  */
-asmlinkage long sys_nice(int increment)
+SYSCALL_DEFINE1(nice, int, increment)
 {
        long nice, retval;
 
@@ -5433,8 +5433,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
  * @policy: new policy.
  * @param: structure containing the new RT priority.
  */
-asmlinkage long
-sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
+SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
+               struct sched_param __user *, param)
 {
        /* negative values for policy are not valid */
        if (policy < 0)
@@ -5448,7 +5448,7 @@ sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
  * @pid: the pid in question.
  * @param: structure containing the new RT priority.
  */
-asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param)
+SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
 {
        return do_sched_setscheduler(pid, -1, param);
 }
@@ -5457,7 +5457,7 @@ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param)
  * sys_sched_getscheduler - get the policy (scheduling class) of a thread
  * @pid: the pid in question.
  */
-asmlinkage long sys_sched_getscheduler(pid_t pid)
+SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
 {
        struct task_struct *p;
        int retval;
@@ -5482,7 +5482,7 @@ asmlinkage long sys_sched_getscheduler(pid_t pid)
  * @pid: the pid in question.
  * @param: structure containing the RT priority.
  */
-asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param)
+SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
 {
        struct sched_param lp;
        struct task_struct *p;
@@ -5600,8 +5600,8 @@ static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len,
  * @len: length in bytes of the bitmask pointed to by user_mask_ptr
  * @user_mask_ptr: user-space pointer to the new cpu mask
  */
-asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
-                                     unsigned long __user *user_mask_ptr)
+SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len,
+               unsigned long __user *, user_mask_ptr)
 {
        cpumask_var_t new_mask;
        int retval;
@@ -5648,8 +5648,8 @@ out_unlock:
  * @len: length in bytes of the bitmask pointed to by user_mask_ptr
  * @user_mask_ptr: user-space pointer to hold the current cpu mask
  */
-asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
-                                     unsigned long __user *user_mask_ptr)
+SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
+               unsigned long __user *, user_mask_ptr)
 {
        int ret;
        cpumask_var_t mask;
@@ -5678,7 +5678,7 @@ asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
  * This function yields the current CPU to other tasks. If there are no
  * other threads running on this CPU then this function will return.
  */
-asmlinkage long sys_sched_yield(void)
+SYSCALL_DEFINE0(sched_yield)
 {
        struct rq *rq = this_rq_lock();
 
@@ -5819,7 +5819,7 @@ long __sched io_schedule_timeout(long timeout)
  * this syscall returns the maximum rt_priority that can be used
  * by a given scheduling class.
  */
-asmlinkage long sys_sched_get_priority_max(int policy)
+SYSCALL_DEFINE1(sched_get_priority_max, int, policy)
 {
        int ret = -EINVAL;
 
@@ -5844,7 +5844,7 @@ asmlinkage long sys_sched_get_priority_max(int policy)
  * this syscall returns the minimum rt_priority that can be used
  * by a given scheduling class.
  */
-asmlinkage long sys_sched_get_priority_min(int policy)
+SYSCALL_DEFINE1(sched_get_priority_min, int, policy)
 {
        int ret = -EINVAL;
 
@@ -5869,8 +5869,8 @@ asmlinkage long sys_sched_get_priority_min(int policy)
  * this syscall writes the default timeslice value of a given process
  * into the user-space timespec buffer. A value of '0' means infinity.
  */
-asmlinkage
-long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval)
+SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
+               struct timespec __user *, interval)
 {
        struct task_struct *p;
        unsigned int time_slice;
@@ -9050,6 +9050,13 @@ static int tg_schedulable(struct task_group *tg, void *data)
                runtime = d->rt_runtime;
        }
 
+#ifdef CONFIG_USER_SCHED
+       if (tg == &root_task_group) {
+               period = global_rt_period();
+               runtime = global_rt_runtime();
+       }
+#endif
+
        /*
         * Cannot have more runtime than the period.
         */
index 8e1352c75557308bf1e892bb260b39e9feffd10f..5cc1c162044fc4f40b15c351cd170ce2c58703f7 100644 (file)
@@ -283,7 +283,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
                                                   struct sched_entity,
                                                   run_node);
 
-               if (vruntime == cfs_rq->min_vruntime)
+               if (!cfs_rq->curr)
                        vruntime = se->vruntime;
                else
                        vruntime = min_vruntime(vruntime, se->vruntime);
@@ -429,7 +429,10 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
        u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq);
 
        for_each_sched_entity(se) {
-               struct load_weight *load = &cfs_rq->load;
+               struct load_weight *load;
+
+               cfs_rq = cfs_rq_of(se);
+               load = &cfs_rq->load;
 
                if (unlikely(!se->on_rq)) {
                        struct load_weight lw = cfs_rq->load;
@@ -677,9 +680,13 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
                        unsigned long thresh = sysctl_sched_latency;
 
                        /*
-                        * convert the sleeper threshold into virtual time
+                        * Convert the sleeper threshold into virtual time.
+                        * SCHED_IDLE is a special sub-class.  We care about
+                        * fairness only relative to other SCHED_IDLE tasks,
+                        * all of which have the same weight.
                         */
-                       if (sched_feat(NORMALIZED_SLEEPER))
+                       if (sched_feat(NORMALIZED_SLEEPER) &&
+                                       task_of(se)->policy != SCHED_IDLE)
                                thresh = calc_delta_fair(thresh, se);
 
                        vruntime -= thresh;
@@ -1340,14 +1347,18 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
 
 static void set_last_buddy(struct sched_entity *se)
 {
-       for_each_sched_entity(se)
-               cfs_rq_of(se)->last = se;
+       if (likely(task_of(se)->policy != SCHED_IDLE)) {
+               for_each_sched_entity(se)
+                       cfs_rq_of(se)->last = se;
+       }
 }
 
 static void set_next_buddy(struct sched_entity *se)
 {
-       for_each_sched_entity(se)
-               cfs_rq_of(se)->next = se;
+       if (likely(task_of(se)->policy != SCHED_IDLE)) {
+               for_each_sched_entity(se)
+                       cfs_rq_of(se)->next = se;
+       }
 }
 
 /*
@@ -1393,12 +1404,18 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
                return;
 
        /*
-        * Batch tasks do not preempt (their preemption is driven by
+        * Batch and idle tasks do not preempt (their preemption is driven by
         * the tick):
         */
-       if (unlikely(p->policy == SCHED_BATCH))
+       if (unlikely(p->policy != SCHED_NORMAL))
                return;
 
+       /* Idle tasks are by definition preempted by everybody. */
+       if (unlikely(curr->policy == SCHED_IDLE)) {
+               resched_task(curr);
+               return;
+       }
+
        if (!sched_feat(WAKEUP_PREEMPT))
                return;
 
index 3152ac3b62e254390a39439a98ed53402d4ed6c1..e73759783dc84d8134c9e5603432d0729d4634a3 100644 (file)
@@ -1961,7 +1961,7 @@ EXPORT_SYMBOL(unblock_all_signals);
  * System call entry points.
  */
 
-asmlinkage long sys_restart_syscall(void)
+SYSCALL_DEFINE0(restart_syscall)
 {
        struct restart_block *restart = &current_thread_info()->restart_block;
        return restart->fn(restart);
@@ -2014,8 +2014,8 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset)
        return error;
 }
 
-asmlinkage long
-sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset, size_t sigsetsize)
+SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, set,
+               sigset_t __user *, oset, size_t, sigsetsize)
 {
        int error = -EINVAL;
        sigset_t old_set, new_set;
@@ -2074,8 +2074,7 @@ out:
        return error;
 }      
 
-asmlinkage long
-sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize)
+SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize)
 {
        return do_sigpending(set, sigsetsize);
 }
@@ -2146,11 +2145,9 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
 
 #endif
 
-asmlinkage long
-sys_rt_sigtimedwait(const sigset_t __user *uthese,
-                   siginfo_t __user *uinfo,
-                   const struct timespec __user *uts,
-                   size_t sigsetsize)
+SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese,
+               siginfo_t __user *, uinfo, const struct timespec __user *, uts,
+               size_t, sigsetsize)
 {
        int ret, sig;
        sigset_t these;
@@ -2223,8 +2220,7 @@ sys_rt_sigtimedwait(const sigset_t __user *uthese,
        return ret;
 }
 
-asmlinkage long
-sys_kill(pid_t pid, int sig)
+SYSCALL_DEFINE2(kill, pid_t, pid, int, sig)
 {
        struct siginfo info;
 
@@ -2283,7 +2279,7 @@ static int do_tkill(pid_t tgid, pid_t pid, int sig)
  *  exists but it's not belonging to the target process anymore. This
  *  method solves the problem of threads exiting and PIDs getting reused.
  */
-asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig)
+SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig)
 {
        /* This is only valid for single tasks */
        if (pid <= 0 || tgid <= 0)
@@ -2295,8 +2291,7 @@ asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig)
 /*
  *  Send a signal to only one task, even if it's a CLONE_THREAD task.
  */
-asmlinkage long
-sys_tkill(pid_t pid, int sig)
+SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig)
 {
        /* This is only valid for single tasks */
        if (pid <= 0)
@@ -2305,8 +2300,8 @@ sys_tkill(pid_t pid, int sig)
        return do_tkill(0, pid, sig);
 }
 
-asmlinkage long
-sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo)
+SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig,
+               siginfo_t __user *, uinfo)
 {
        siginfo_t info;
 
@@ -2434,8 +2429,7 @@ out:
 
 #ifdef __ARCH_WANT_SYS_SIGPENDING
 
-asmlinkage long
-sys_sigpending(old_sigset_t __user *set)
+SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set)
 {
        return do_sigpending(set, sizeof(*set));
 }
@@ -2446,8 +2440,8 @@ sys_sigpending(old_sigset_t __user *set)
 /* Some platforms have their own version with special arguments others
    support only sys_rt_sigprocmask.  */
 
-asmlinkage long
-sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset)
+SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set,
+               old_sigset_t __user *, oset)
 {
        int error;
        old_sigset_t old_set, new_set;
@@ -2497,11 +2491,10 @@ out:
 #endif /* __ARCH_WANT_SYS_SIGPROCMASK */
 
 #ifdef __ARCH_WANT_SYS_RT_SIGACTION
-asmlinkage long
-sys_rt_sigaction(int sig,
-                const struct sigaction __user *act,
-                struct sigaction __user *oact,
-                size_t sigsetsize)
+SYSCALL_DEFINE4(rt_sigaction, int, sig,
+               const struct sigaction __user *, act,
+               struct sigaction __user *, oact,
+               size_t, sigsetsize)
 {
        struct k_sigaction new_sa, old_sa;
        int ret = -EINVAL;
@@ -2531,15 +2524,13 @@ out:
 /*
  * For backwards compatibility.  Functionality superseded by sigprocmask.
  */
-asmlinkage long
-sys_sgetmask(void)
+SYSCALL_DEFINE0(sgetmask)
 {
        /* SMP safe */
        return current->blocked.sig[0];
 }
 
-asmlinkage long
-sys_ssetmask(int newmask)
+SYSCALL_DEFINE1(ssetmask, int, newmask)
 {
        int old;
 
@@ -2559,8 +2550,7 @@ sys_ssetmask(int newmask)
 /*
  * For backwards compatibility.  Functionality superseded by sigaction.
  */
-asmlinkage unsigned long
-sys_signal(int sig, __sighandler_t handler)
+SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
 {
        struct k_sigaction new_sa, old_sa;
        int ret;
@@ -2577,8 +2567,7 @@ sys_signal(int sig, __sighandler_t handler)
 
 #ifdef __ARCH_WANT_SYS_PAUSE
 
-asmlinkage long
-sys_pause(void)
+SYSCALL_DEFINE0(pause)
 {
        current->state = TASK_INTERRUPTIBLE;
        schedule();
@@ -2588,7 +2577,7 @@ sys_pause(void)
 #endif
 
 #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND
-asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
+SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize)
 {
        sigset_t newset;
 
index 763c3c17ded3e6c818283da75dd0865b93858c7a..e7dc0e10a485878a08a8c80b52e6919ca6da3c13 100644 (file)
@@ -143,7 +143,7 @@ out:
        return error;
 }
 
-asmlinkage long sys_setpriority(int which, int who, int niceval)
+SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
 {
        struct task_struct *g, *p;
        struct user_struct *user;
@@ -208,7 +208,7 @@ out:
  * has been offset by 20 (ie it returns 40..1 instead of -20..19)
  * to stay compatible.
  */
-asmlinkage long sys_getpriority(int which, int who)
+SYSCALL_DEFINE2(getpriority, int, which, int, who)
 {
        struct task_struct *g, *p;
        struct user_struct *user;
@@ -355,7 +355,8 @@ EXPORT_SYMBOL_GPL(kernel_power_off);
  *
  * reboot doesn't sync: do that yourself before calling this.
  */
-asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg)
+SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
+               void __user *, arg)
 {
        char buffer[256];
 
@@ -478,7 +479,7 @@ void ctrl_alt_del(void)
  * SMP: There are not races, the GIDs are checked only by filesystem
  *      operations (as far as semantic preservation is concerned).
  */
-asmlinkage long sys_setregid(gid_t rgid, gid_t egid)
+SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid)
 {
        const struct cred *old;
        struct cred *new;
@@ -529,7 +530,7 @@ error:
  *
  * SMP: Same implicit races as above.
  */
-asmlinkage long sys_setgid(gid_t gid)
+SYSCALL_DEFINE1(setgid, gid_t, gid)
 {
        const struct cred *old;
        struct cred *new;
@@ -597,7 +598,7 @@ static int set_user(struct cred *new)
  * 100% compatible with BSD.  A program which uses just setuid() will be
  * 100% compatible with POSIX with saved IDs. 
  */
-asmlinkage long sys_setreuid(uid_t ruid, uid_t euid)
+SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
 {
        const struct cred *old;
        struct cred *new;
@@ -661,7 +662,7 @@ error:
  * will allow a root program to temporarily drop privileges and be able to
  * regain them by swapping the real and effective uid.  
  */
-asmlinkage long sys_setuid(uid_t uid)
+SYSCALL_DEFINE1(setuid, uid_t, uid)
 {
        const struct cred *old;
        struct cred *new;
@@ -705,7 +706,7 @@ error:
  * This function implements a generic ability to update ruid, euid,
  * and suid.  This allows you to implement the 4.4 compatible seteuid().
  */
-asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
+SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
 {
        const struct cred *old;
        struct cred *new;
@@ -756,7 +757,7 @@ error:
        return retval;
 }
 
-asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid)
+SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid)
 {
        const struct cred *cred = current_cred();
        int retval;
@@ -771,7 +772,7 @@ asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __us
 /*
  * Same as above, but for rgid, egid, sgid.
  */
-asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
 {
        const struct cred *old;
        struct cred *new;
@@ -814,7 +815,7 @@ error:
        return retval;
 }
 
-asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid)
+SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid)
 {
        const struct cred *cred = current_cred();
        int retval;
@@ -833,7 +834,7 @@ asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __us
  * whatever uid it wants to). It normally shadows "euid", except when
  * explicitly set by setfsuid() or for access..
  */
-asmlinkage long sys_setfsuid(uid_t uid)
+SYSCALL_DEFINE1(setfsuid, uid_t, uid)
 {
        const struct cred *old;
        struct cred *new;
@@ -870,7 +871,7 @@ change_okay:
 /*
  * Samma pÃ¥ svenska..
  */
-asmlinkage long sys_setfsgid(gid_t gid)
+SYSCALL_DEFINE1(setfsgid, gid_t, gid)
 {
        const struct cred *old;
        struct cred *new;
@@ -919,7 +920,7 @@ void do_sys_times(struct tms *tms)
        tms->tms_cstime = cputime_to_clock_t(cstime);
 }
 
-asmlinkage long sys_times(struct tms __user * tbuf)
+SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
 {
        if (tbuf) {
                struct tms tmp;
@@ -944,7 +945,7 @@ asmlinkage long sys_times(struct tms __user * tbuf)
  * Auch. Had to add the 'did_exec' flag to conform completely to POSIX.
  * LBT 04.03.94
  */
-asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
+SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
 {
        struct task_struct *p;
        struct task_struct *group_leader = current->group_leader;
@@ -1015,7 +1016,7 @@ out:
        return err;
 }
 
-asmlinkage long sys_getpgid(pid_t pid)
+SYSCALL_DEFINE1(getpgid, pid_t, pid)
 {
        struct task_struct *p;
        struct pid *grp;
@@ -1045,14 +1046,14 @@ out:
 
 #ifdef __ARCH_WANT_SYS_GETPGRP
 
-asmlinkage long sys_getpgrp(void)
+SYSCALL_DEFINE0(getpgrp)
 {
        return sys_getpgid(0);
 }
 
 #endif
 
-asmlinkage long sys_getsid(pid_t pid)
+SYSCALL_DEFINE1(getsid, pid_t, pid)
 {
        struct task_struct *p;
        struct pid *sid;
@@ -1080,7 +1081,7 @@ out:
        return retval;
 }
 
-asmlinkage long sys_setsid(void)
+SYSCALL_DEFINE0(setsid)
 {
        struct task_struct *group_leader = current->group_leader;
        struct pid *sid = task_pid(group_leader);
@@ -1311,7 +1312,7 @@ int set_current_groups(struct group_info *group_info)
 
 EXPORT_SYMBOL(set_current_groups);
 
-asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist)
+SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
        const struct cred *cred = current_cred();
        int i;
@@ -1340,7 +1341,7 @@ out:
  *     without another task interfering.
  */
  
-asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist)
+SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
        struct group_info *group_info;
        int retval;
@@ -1394,7 +1395,7 @@ EXPORT_SYMBOL(in_egroup_p);
 
 DECLARE_RWSEM(uts_sem);
 
-asmlinkage long sys_newuname(struct new_utsname __user * name)
+SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
 {
        int errno = 0;
 
@@ -1405,7 +1406,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name)
        return errno;
 }
 
-asmlinkage long sys_sethostname(char __user *name, int len)
+SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
 {
        int errno;
        char tmp[__NEW_UTS_LEN];
@@ -1429,7 +1430,7 @@ asmlinkage long sys_sethostname(char __user *name, int len)
 
 #ifdef __ARCH_WANT_SYS_GETHOSTNAME
 
-asmlinkage long sys_gethostname(char __user *name, int len)
+SYSCALL_DEFINE2(gethostname, char __user *, name, int, len)
 {
        int i, errno;
        struct new_utsname *u;
@@ -1454,7 +1455,7 @@ asmlinkage long sys_gethostname(char __user *name, int len)
  * Only setdomainname; getdomainname can be implemented by calling
  * uname()
  */
-asmlinkage long sys_setdomainname(char __user *name, int len)
+SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
 {
        int errno;
        char tmp[__NEW_UTS_LEN];
@@ -1477,7 +1478,7 @@ asmlinkage long sys_setdomainname(char __user *name, int len)
        return errno;
 }
 
-asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim)
+SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
 {
        if (resource >= RLIM_NLIMITS)
                return -EINVAL;
@@ -1496,7 +1497,8 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim)
  *     Back compatibility for getrlimit. Needed for some apps.
  */
  
-asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim)
+SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
+               struct rlimit __user *, rlim)
 {
        struct rlimit x;
        if (resource >= RLIM_NLIMITS)
@@ -1514,7 +1516,7 @@ asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *r
 
 #endif
 
-asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
+SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim)
 {
        struct rlimit new_rlim, *old_rlim;
        int retval;
@@ -1687,7 +1689,7 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru)
        return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_getrusage(int who, struct rusage __user *ru)
+SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru)
 {
        if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN &&
            who != RUSAGE_THREAD)
@@ -1695,14 +1697,14 @@ asmlinkage long sys_getrusage(int who, struct rusage __user *ru)
        return getrusage(current, who, ru);
 }
 
-asmlinkage long sys_umask(int mask)
+SYSCALL_DEFINE1(umask, int, mask)
 {
        mask = xchg(&current->fs->umask, mask & S_IRWXUGO);
        return mask;
 }
 
-asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
-                         unsigned long arg4, unsigned long arg5)
+SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
+               unsigned long, arg4, unsigned long, arg5)
 {
        struct task_struct *me = current;
        unsigned char comm[sizeof(me->comm)];
@@ -1815,8 +1817,8 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
        return error;
 }
 
-asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
-                          struct getcpu_cache __user *unused)
+SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
+               struct getcpu_cache __user *, unused)
 {
        int err = 0;
        int cpu = raw_smp_processor_id();
index e14a23281707610c6d52338af9e091116e29b987..27dad29673879ae78b7124280346d418e520572b 100644 (file)
@@ -131,6 +131,7 @@ cond_syscall(sys_io_destroy);
 cond_syscall(sys_io_submit);
 cond_syscall(sys_io_cancel);
 cond_syscall(sys_io_getevents);
+cond_syscall(sys_syslog);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
index 89d74436318ce9bd2db36deadfbd7fbe850944da..368d1638ee78229c87067c4d805f7145fe79c352 100644 (file)
@@ -144,6 +144,7 @@ extern int acct_parm[];
 
 #ifdef CONFIG_IA64
 extern int no_unaligned_warning;
+extern int unaligned_dump_stack;
 #endif
 
 #ifdef CONFIG_RT_MUTEXES
@@ -781,6 +782,14 @@ static struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "unaligned-dump-stack",
+               .data           = &unaligned_dump_stack,
+               .maxlen         = sizeof (int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
 #endif
 #ifdef CONFIG_DETECT_SOFTLOCKUP
        {
@@ -1688,7 +1697,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol
        return error;
 }
 
-asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
+SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
 {
        struct __sysctl_args tmp;
        int error;
@@ -2989,7 +2998,7 @@ int sysctl_ms_jiffies(struct ctl_table *table,
 #else /* CONFIG_SYSCTL_SYSCALL */
 
 
-asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
+SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
 {
        struct __sysctl_args tmp;
        int error;
index 4886e3ce83a4d608da8e135a5290fcc8dea4d0cf..29511943871a15b2acf87cccf528513b07e57880 100644 (file)
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(sys_tz);
  * why not move it into the appropriate arch directory (for those
  * architectures that need it).
  */
-asmlinkage long sys_time(time_t __user * tloc)
+SYSCALL_DEFINE1(time, time_t __user *, tloc)
 {
        time_t i = get_seconds();
 
@@ -79,7 +79,7 @@ asmlinkage long sys_time(time_t __user * tloc)
  * architectures that need it).
  */
 
-asmlinkage long sys_stime(time_t __user *tptr)
+SYSCALL_DEFINE1(stime, time_t __user *, tptr)
 {
        struct timespec tv;
        int err;
@@ -99,8 +99,8 @@ asmlinkage long sys_stime(time_t __user *tptr)
 
 #endif /* __ARCH_WANT_SYS_TIME */
 
-asmlinkage long sys_gettimeofday(struct timeval __user *tv,
-                                struct timezone __user *tz)
+SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
+               struct timezone __user *, tz)
 {
        if (likely(tv != NULL)) {
                struct timeval ktv;
@@ -184,8 +184,8 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
        return 0;
 }
 
-asmlinkage long sys_settimeofday(struct timeval __user *tv,
-                               struct timezone __user *tz)
+SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv,
+               struct timezone __user *, tz)
 {
        struct timeval user_tv;
        struct timespec new_ts;
@@ -205,7 +205,7 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv,
        return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL);
 }
 
-asmlinkage long sys_adjtimex(struct timex __user *txc_p)
+SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p)
 {
        struct timex txc;               /* Local copy of parameter */
        int ret;
index dee3f641a7a72d5ec8f00c6ff07d64f0e1470385..13dd64fe143db216a31e750d66bb29d07c932ba3 100644 (file)
@@ -1129,7 +1129,7 @@ void do_timer(unsigned long ticks)
  * For backwards compatibility?  This can be done in libc so Alpha
  * and all newer ports shouldn't need it.
  */
-asmlinkage unsigned long sys_alarm(unsigned int seconds)
+SYSCALL_DEFINE1(alarm, unsigned int, seconds)
 {
        return alarm_setitimer(seconds);
 }
@@ -1152,7 +1152,7 @@ asmlinkage unsigned long sys_alarm(unsigned int seconds)
  *
  * This is SMP safe as current->tgid does not change.
  */
-asmlinkage long sys_getpid(void)
+SYSCALL_DEFINE0(getpid)
 {
        return task_tgid_vnr(current);
 }
@@ -1163,7 +1163,7 @@ asmlinkage long sys_getpid(void)
  * value of ->real_parent under rcu_read_lock(), see
  * release_task()->call_rcu(delayed_put_task_struct).
  */
-asmlinkage long sys_getppid(void)
+SYSCALL_DEFINE0(getppid)
 {
        int pid;
 
@@ -1174,25 +1174,25 @@ asmlinkage long sys_getppid(void)
        return pid;
 }
 
-asmlinkage long sys_getuid(void)
+SYSCALL_DEFINE0(getuid)
 {
        /* Only we change this so SMP safe */
        return current_uid();
 }
 
-asmlinkage long sys_geteuid(void)
+SYSCALL_DEFINE0(geteuid)
 {
        /* Only we change this so SMP safe */
        return current_euid();
 }
 
-asmlinkage long sys_getgid(void)
+SYSCALL_DEFINE0(getgid)
 {
        /* Only we change this so SMP safe */
        return current_gid();
 }
 
-asmlinkage long sys_getegid(void)
+SYSCALL_DEFINE0(getegid)
 {
        /* Only we change this so SMP safe */
        return  current_egid();
@@ -1308,7 +1308,7 @@ signed long __sched schedule_timeout_uninterruptible(signed long timeout)
 EXPORT_SYMBOL(schedule_timeout_uninterruptible);
 
 /* Thread ID - the internal kernel "pid" */
-asmlinkage long sys_gettid(void)
+SYSCALL_DEFINE0(gettid)
 {
        return task_pid_vnr(current);
 }
@@ -1400,7 +1400,7 @@ out:
        return 0;
 }
 
-asmlinkage long sys_sysinfo(struct sysinfo __user *info)
+SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info)
 {
        struct sysinfo val;
 
index 2460c3199b5a2e10e4bda0001d76b2c066975410..0314501688b9745f7601793fe17c0a14d7e1e147 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <asm/uaccess.h>
 
-asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group)
+SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group)
 {
        long ret = sys_chown(filename, low2highuid(user), low2highgid(group));
        /* avoid REGPARM breakage on x86: */
@@ -25,7 +25,7 @@ asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gi
        return ret;
 }
 
-asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group)
+SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group)
 {
        long ret = sys_lchown(filename, low2highuid(user), low2highgid(group));
        /* avoid REGPARM breakage on x86: */
@@ -33,7 +33,7 @@ asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_g
        return ret;
 }
 
-asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group)
+SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group)
 {
        long ret = sys_fchown(fd, low2highuid(user), low2highgid(group));
        /* avoid REGPARM breakage on x86: */
@@ -41,7 +41,7 @@ asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group)
        return ret;
 }
 
-asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid)
+SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid)
 {
        long ret = sys_setregid(low2highgid(rgid), low2highgid(egid));
        /* avoid REGPARM breakage on x86: */
@@ -49,7 +49,7 @@ asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid)
        return ret;
 }
 
-asmlinkage long sys_setgid16(old_gid_t gid)
+SYSCALL_DEFINE1(setgid16, old_gid_t, gid)
 {
        long ret = sys_setgid(low2highgid(gid));
        /* avoid REGPARM breakage on x86: */
@@ -57,7 +57,7 @@ asmlinkage long sys_setgid16(old_gid_t gid)
        return ret;
 }
 
-asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
+SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid)
 {
        long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid));
        /* avoid REGPARM breakage on x86: */
@@ -65,7 +65,7 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
        return ret;
 }
 
-asmlinkage long sys_setuid16(old_uid_t uid)
+SYSCALL_DEFINE1(setuid16, old_uid_t, uid)
 {
        long ret = sys_setuid(low2highuid(uid));
        /* avoid REGPARM breakage on x86: */
@@ -73,7 +73,7 @@ asmlinkage long sys_setuid16(old_uid_t uid)
        return ret;
 }
 
-asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid)
+SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid)
 {
        long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid),
                                 low2highuid(suid));
@@ -82,7 +82,7 @@ asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid)
        return ret;
 }
 
-asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid)
+SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, old_uid_t __user *, suid)
 {
        const struct cred *cred = current_cred();
        int retval;
@@ -94,7 +94,7 @@ asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid,
        return retval;
 }
 
-asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid)
+SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid)
 {
        long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid),
                                 low2highgid(sgid));
@@ -103,7 +103,8 @@ asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid)
        return ret;
 }
 
-asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid)
+
+SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid)
 {
        const struct cred *cred = current_cred();
        int retval;
@@ -115,7 +116,7 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid,
        return retval;
 }
 
-asmlinkage long sys_setfsuid16(old_uid_t uid)
+SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid)
 {
        long ret = sys_setfsuid(low2highuid(uid));
        /* avoid REGPARM breakage on x86: */
@@ -123,7 +124,7 @@ asmlinkage long sys_setfsuid16(old_uid_t uid)
        return ret;
 }
 
-asmlinkage long sys_setfsgid16(old_gid_t gid)
+SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid)
 {
        long ret = sys_setfsgid(low2highgid(gid));
        /* avoid REGPARM breakage on x86: */
@@ -161,7 +162,7 @@ static int groups16_from_user(struct group_info *group_info,
        return 0;
 }
 
-asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist)
+SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist)
 {
        const struct cred *cred = current_cred();
        int i;
@@ -184,7 +185,7 @@ out:
        return i;
 }
 
-asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist)
+SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist)
 {
        struct group_info *group_info;
        int retval;
@@ -209,22 +210,22 @@ asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist)
        return retval;
 }
 
-asmlinkage long sys_getuid16(void)
+SYSCALL_DEFINE0(getuid16)
 {
        return high2lowuid(current_uid());
 }
 
-asmlinkage long sys_geteuid16(void)
+SYSCALL_DEFINE0(geteuid16)
 {
        return high2lowuid(current_euid());
 }
 
-asmlinkage long sys_getgid16(void)
+SYSCALL_DEFINE0(getgid16)
 {
        return high2lowgid(current_gid());
 }
 
-asmlinkage long sys_getegid16(void)
+SYSCALL_DEFINE0(getegid16)
 {
        return high2lowgid(current_egid());
 }
index c04b9dcfcebe674e78663179073544edea5130b2..1ff27a28bb7d4a11d7cb23935675bd9e41c0ac83 100644 (file)
@@ -2,6 +2,7 @@
  * Uniprocessor-only support functions.  The counterpart to kernel/smp.c
  */
 
+#include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/smp.h>
index 1c4f9281f412db349d3a80e0ed51e51f6102027c..c11c5765cdefd2b5115e4f37e94905ab7364adad 100644 (file)
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
 {
        while (idp->id_free_cnt < IDR_FREE_MAX) {
                struct idr_layer *new;
-               new = kmem_cache_alloc(idr_layer_cache, gfp_mask);
+               new = kmem_cache_zalloc(idr_layer_cache, gfp_mask);
                if (new == NULL)
                        return (0);
                move_to_free_list(idp, new);
@@ -292,7 +292,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
  * and go back to the idr_pre_get() call.  If the idr is full, it will
  * return -ENOSPC.
  *
- * @id returns a value in the range 0 ... 0x7fffffff
+ * @id returns a value in the range @starting_id ... 0x7fffffff
  */
 int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
 {
@@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id)
 }
 EXPORT_SYMBOL(idr_replace);
 
-static void idr_cache_ctor(void *idr_layer)
-{
-       memset(idr_layer, 0, sizeof(struct idr_layer));
-}
-
 void __init idr_init_cache(void)
 {
        idr_layer_cache = kmem_cache_create("idr_layer_cache",
-                               sizeof(struct idr_layer), 0, SLAB_PANIC,
-                               idr_cache_ctor);
+                               sizeof(struct idr_layer), 0, SLAB_PANIC, NULL);
 }
 
 /**
@@ -723,7 +717,7 @@ EXPORT_SYMBOL(ida_pre_get);
  * and go back to the ida_pre_get() call.  If the ida is full, it will
  * return -ENOSPC.
  *
- * @p_id returns a value in the range 0 ... 0x7fffffff.
+ * @p_id returns a value in the range @starting_id ... 0x7fffffff.
  */
 int ida_get_new_above(struct ida *ida, int starting_id, int *p_id)
 {
index a1da969bd9803cf334c3c5c1e9746e96eba1f377..54a0f8040afa339a7e2f0cb459fd5b23c3d16acf 100644 (file)
@@ -24,7 +24,7 @@
  * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could
  * deactivate the pages and clear PG_Referenced.
  */
-asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
+SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 {
        struct file *file = fget(fd);
        struct address_space *mapping;
@@ -126,12 +126,26 @@ out:
        fput(file);
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_fadvise64_64(long fd, loff_t offset, loff_t len, long advice)
+{
+       return SYSC_fadvise64_64((int) fd, offset, len, (int) advice);
+}
+SYSCALL_ALIAS(sys_fadvise64_64, SyS_fadvise64_64);
+#endif
 
 #ifdef __ARCH_WANT_SYS_FADVISE64
 
-asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice)
+SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice)
 {
        return sys_fadvise64_64(fd, offset, len, advice);
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_fadvise64(long fd, loff_t offset, long len, long advice)
+{
+       return SYSC_fadvise64((int) fd, offset, (size_t)len, (int)advice);
+}
+SYSCALL_ALIAS(sys_fadvise64, SyS_fadvise64);
+#endif
 
 #endif
index ceba0bd0366261740b27c8f19785ae8857eeb8c8..23acefe51808fdf0b8ed7ec3a7a5c92ee424cad1 100644 (file)
@@ -1374,7 +1374,7 @@ do_readahead(struct address_space *mapping, struct file *filp,
        return 0;
 }
 
-asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count)
+SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count)
 {
        ssize_t ret;
        struct file *file;
@@ -1393,6 +1393,13 @@ asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count)
        }
        return ret;
 }
+#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
+asmlinkage long SyS_readahead(long fd, loff_t offset, long count)
+{
+       return SYSC_readahead((int) fd, offset, (size_t) count);
+}
+SYSCALL_ALIAS(sys_readahead, SyS_readahead);
+#endif
 
 #ifdef CONFIG_MMU
 /**
index 62d5bbda921aa55f49a03507b36cbff10c5f3b69..736ba7f3306a1078fa851fd3dce755205162abfc 100644 (file)
@@ -120,8 +120,8 @@ static int populate_range(struct mm_struct *mm, struct vm_area_struct *vma,
  * and the vma's default protection is used. Arbitrary protections
  * might be implemented in the future.
  */
-asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
-       unsigned long prot, unsigned long pgoff, unsigned long flags)
+SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+               unsigned long, prot, unsigned long, pgoff, unsigned long, flags)
 {
        struct mm_struct *mm = current->mm;
        struct address_space *mapping;
index f9349c18a1b51b6fbd98699ef930935949a550b5..b9ce574827c8a2a48b972f0261decc234edf9e27 100644 (file)
@@ -281,7 +281,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
  *  -EBADF  - map exists, but area maps something that isn't a file.
  *  -EAGAIN - a kernel resource was temporarily unavailable.
  */
-asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior)
+SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
 {
        unsigned long end, tmp;
        struct vm_area_struct * vma, *prev;
index e2996b80601f8fd20a3bb9d1216ebf3017d11afa..4d0ea3ceba6d2e40431f64f7e8d8c0f3c0022165 100644 (file)
@@ -358,6 +358,10 @@ void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru)
                return;
 
        pc = lookup_page_cgroup(page);
+       /*
+        * Used bit is set without atomic ops but after smp_wmb().
+        * For making pc->mem_cgroup visible, insert smp_rmb() here.
+        */
        smp_rmb();
        /* unused page is not rotated. */
        if (!PageCgroupUsed(pc))
@@ -374,7 +378,10 @@ void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru)
        if (mem_cgroup_disabled())
                return;
        pc = lookup_page_cgroup(page);
-       /* barrier to sync with "charge" */
+       /*
+        * Used bit is set without atomic ops but after smp_wmb().
+        * For making pc->mem_cgroup visible, insert smp_rmb() here.
+        */
        smp_rmb();
        if (!PageCgroupUsed(pc))
                return;
@@ -559,6 +566,14 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page)
                return NULL;
 
        pc = lookup_page_cgroup(page);
+       /*
+        * Used bit is set without atomic ops but after smp_wmb().
+        * For making pc->mem_cgroup visible, insert smp_rmb() here.
+        */
+       smp_rmb();
+       if (!PageCgroupUsed(pc))
+               return NULL;
+
        mz = page_cgroup_zoneinfo(pc);
        if (!mz)
                return NULL;
@@ -618,7 +633,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
  * called with hierarchy_mutex held
  */
 static struct mem_cgroup *
-mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem)
+__mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem)
 {
        struct cgroup *cgroup, *curr_cgroup, *root_cgroup;
 
@@ -629,19 +644,16 @@ mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem)
                /*
                 * Walk down to children
                 */
-               mem_cgroup_put(curr);
                cgroup = list_entry(curr_cgroup->children.next,
                                                struct cgroup, sibling);
                curr = mem_cgroup_from_cont(cgroup);
-               mem_cgroup_get(curr);
                goto done;
        }
 
 visit_parent:
        if (curr_cgroup == root_cgroup) {
-               mem_cgroup_put(curr);
-               curr = root_mem;
-               mem_cgroup_get(curr);
+               /* caller handles NULL case */
+               curr = NULL;
                goto done;
        }
 
@@ -649,11 +661,9 @@ visit_parent:
         * Goto next sibling
         */
        if (curr_cgroup->sibling.next != &curr_cgroup->parent->children) {
-               mem_cgroup_put(curr);
                cgroup = list_entry(curr_cgroup->sibling.next, struct cgroup,
                                                sibling);
                curr = mem_cgroup_from_cont(cgroup);
-               mem_cgroup_get(curr);
                goto done;
        }
 
@@ -664,7 +674,6 @@ visit_parent:
        goto visit_parent;
 
 done:
-       root_mem->last_scanned_child = curr;
        return curr;
 }
 
@@ -674,40 +683,46 @@ done:
  * that to reclaim free pages from.
  */
 static struct mem_cgroup *
-mem_cgroup_get_first_node(struct mem_cgroup *root_mem)
+mem_cgroup_get_next_node(struct mem_cgroup *root_mem)
 {
        struct cgroup *cgroup;
-       struct mem_cgroup *ret;
+       struct mem_cgroup *orig, *next;
        bool obsolete;
 
-       obsolete = mem_cgroup_is_obsolete(root_mem->last_scanned_child);
-
        /*
         * Scan all children under the mem_cgroup mem
         */
        mutex_lock(&mem_cgroup_subsys.hierarchy_mutex);
+
+       orig = root_mem->last_scanned_child;
+       obsolete = mem_cgroup_is_obsolete(orig);
+
        if (list_empty(&root_mem->css.cgroup->children)) {
-               ret = root_mem;
+               /*
+                * root_mem might have children before and last_scanned_child
+                * may point to one of them. We put it later.
+                */
+               if (orig)
+                       VM_BUG_ON(!obsolete);
+               next = NULL;
                goto done;
        }
 
-       if (!root_mem->last_scanned_child || obsolete) {
-
-               if (obsolete && root_mem->last_scanned_child)
-                       mem_cgroup_put(root_mem->last_scanned_child);
-
+       if (!orig || obsolete) {
                cgroup = list_first_entry(&root_mem->css.cgroup->children,
                                struct cgroup, sibling);
-               ret = mem_cgroup_from_cont(cgroup);
-               mem_cgroup_get(ret);
+               next = mem_cgroup_from_cont(cgroup);
        } else
-               ret = mem_cgroup_get_next_node(root_mem->last_scanned_child,
-                                               root_mem);
+               next = __mem_cgroup_get_next_node(orig, root_mem);
 
 done:
-       root_mem->last_scanned_child = ret;
+       if (next)
+               mem_cgroup_get(next);
+       root_mem->last_scanned_child = next;
+       if (orig)
+               mem_cgroup_put(orig);
        mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex);
-       return ret;
+       return (next) ? next : root_mem;
 }
 
 static bool mem_cgroup_check_under_limit(struct mem_cgroup *mem)
@@ -758,28 +773,25 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
         * but there might be left over accounting, even after children
         * have left.
         */
-       ret = try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap,
+       ret += try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap,
                                           get_swappiness(root_mem));
        if (mem_cgroup_check_under_limit(root_mem))
-               return 0;
+               return 1;       /* indicate reclaim has succeeded */
        if (!root_mem->use_hierarchy)
                return ret;
 
-       next_mem = mem_cgroup_get_first_node(root_mem);
+       next_mem = mem_cgroup_get_next_node(root_mem);
 
        while (next_mem != root_mem) {
                if (mem_cgroup_is_obsolete(next_mem)) {
-                       mem_cgroup_put(next_mem);
-                       next_mem = mem_cgroup_get_first_node(root_mem);
+                       next_mem = mem_cgroup_get_next_node(root_mem);
                        continue;
                }
-               ret = try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap,
+               ret += try_to_free_mem_cgroup_pages(next_mem, gfp_mask, noswap,
                                                   get_swappiness(next_mem));
                if (mem_cgroup_check_under_limit(root_mem))
-                       return 0;
-               mutex_lock(&mem_cgroup_subsys.hierarchy_mutex);
-               next_mem = mem_cgroup_get_next_node(next_mem, root_mem);
-               mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex);
+                       return 1;       /* indicate reclaim has succeeded */
+               next_mem = mem_cgroup_get_next_node(root_mem);
        }
        return ret;
 }
@@ -863,6 +875,8 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
 
                ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, gfp_mask,
                                                        noswap);
+               if (ret)
+                       continue;
 
                /*
                 * try_to_free_mem_cgroup_pages() might not give us a full
@@ -979,14 +993,15 @@ static int mem_cgroup_move_account(struct page_cgroup *pc,
        if (pc->mem_cgroup != from)
                goto out;
 
-       css_put(&from->css);
        res_counter_uncharge(&from->res, PAGE_SIZE);
        mem_cgroup_charge_statistics(from, pc, false);
        if (do_swap_account)
                res_counter_uncharge(&from->memsw, PAGE_SIZE);
+       css_put(&from->css);
+
+       css_get(&to->css);
        pc->mem_cgroup = to;
        mem_cgroup_charge_statistics(to, pc, true);
-       css_get(&to->css);
        ret = 0;
 out:
        unlock_page_cgroup(pc);
@@ -1019,8 +1034,10 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
        if (ret || !parent)
                return ret;
 
-       if (!get_page_unless_zero(page))
-               return -EBUSY;
+       if (!get_page_unless_zero(page)) {
+               ret = -EBUSY;
+               goto uncharge;
+       }
 
        ret = isolate_lru_page(page);
 
@@ -1029,19 +1046,23 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
 
        ret = mem_cgroup_move_account(pc, child, parent);
 
-       /* drop extra refcnt by try_charge() (move_account increment one) */
-       css_put(&parent->css);
        putback_lru_page(page);
        if (!ret) {
                put_page(page);
+               /* drop extra refcnt by try_charge() */
+               css_put(&parent->css);
                return 0;
        }
-       /* uncharge if move fails */
+
 cancel:
+       put_page(page);
+uncharge:
+       /* drop extra refcnt by try_charge() */
+       css_put(&parent->css);
+       /* uncharge if move fails */
        res_counter_uncharge(&parent->res, PAGE_SIZE);
        if (do_swap_account)
                res_counter_uncharge(&parent->memsw, PAGE_SIZE);
-       put_page(page);
        return ret;
 }
 
@@ -1971,6 +1992,7 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft,
 {
        struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
        struct mem_cgroup *parent;
+
        if (val > 100)
                return -EINVAL;
 
@@ -1978,15 +2000,22 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft,
                return -EINVAL;
 
        parent = mem_cgroup_from_cont(cgrp->parent);
+
+       cgroup_lock();
+
        /* If under hierarchy, only empty-root can set this value */
        if ((parent->use_hierarchy) ||
-           (memcg->use_hierarchy && !list_empty(&cgrp->children)))
+           (memcg->use_hierarchy && !list_empty(&cgrp->children))) {
+               cgroup_unlock();
                return -EINVAL;
+       }
 
        spin_lock(&memcg->reclaim_param_lock);
        memcg->swappiness = val;
        spin_unlock(&memcg->reclaim_param_lock);
 
+       cgroup_unlock();
+
        return 0;
 }
 
@@ -2181,7 +2210,7 @@ static void __init enable_swap_cgroup(void)
 }
 #endif
 
-static struct cgroup_subsys_state *
+static struct cgroup_subsys_state * __ref
 mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
 {
        struct mem_cgroup *mem, *parent;
@@ -2232,7 +2261,14 @@ static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss,
 static void mem_cgroup_destroy(struct cgroup_subsys *ss,
                                struct cgroup *cont)
 {
-       mem_cgroup_put(mem_cgroup_from_cont(cont));
+       struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
+       struct mem_cgroup *last_scanned_child = mem->last_scanned_child;
+
+       if (last_scanned_child) {
+               VM_BUG_ON(!mem_cgroup_is_obsolete(last_scanned_child));
+               mem_cgroup_put(last_scanned_child);
+       }
+       mem_cgroup_put(mem);
 }
 
 static int mem_cgroup_populate(struct cgroup_subsys *ss,
index e009ce8708597fe3c7542a92ec9201fe8d5f73b6..22bfa7a47a0b613cf9c39ee6e7d24f7dc3c9cf77 100644 (file)
@@ -1511,6 +1511,7 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
                        unsigned long pfn)
 {
        int ret;
+       pgprot_t pgprot = vma->vm_page_prot;
        /*
         * Technically, architectures with pte_special can avoid all these
         * restrictions (same for remap_pfn_range).  However we would like
@@ -1525,10 +1526,10 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
 
        if (addr < vma->vm_start || addr >= vma->vm_end)
                return -EFAULT;
-       if (track_pfn_vma_new(vma, vma->vm_page_prot, pfn, PAGE_SIZE))
+       if (track_pfn_vma_new(vma, &pgprot, pfn, PAGE_SIZE))
                return -EINVAL;
 
-       ret = insert_pfn(vma, addr, pfn, vma->vm_page_prot);
+       ret = insert_pfn(vma, addr, pfn, pgprot);
 
        if (ret)
                untrack_pfn_vma(vma, pfn, PAGE_SIZE);
@@ -1671,9 +1672,15 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
 
        vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
 
-       err = track_pfn_vma_new(vma, prot, pfn, PAGE_ALIGN(size));
-       if (err)
+       err = track_pfn_vma_new(vma, &prot, pfn, PAGE_ALIGN(size));
+       if (err) {
+               /*
+                * To indicate that track_pfn related cleanup is not
+                * needed from higher level routine calling unmap_vmas
+                */
+               vma->vm_flags &= ~(VM_IO | VM_RESERVED | VM_PFNMAP);
                return -EINVAL;
+       }
 
        BUG_ON(addr >= end);
        pfn -= addr >> PAGE_SHIFT;
@@ -3165,6 +3172,15 @@ void print_vma_addr(char *prefix, unsigned long ip)
 #ifdef CONFIG_PROVE_LOCKING
 void might_fault(void)
 {
+       /*
+        * Some code (nfs/sunrpc) uses socket ops on kernel memory while
+        * holding the mmap_sem, this is safe because kernel memory doesn't
+        * get paged out, therefore we'll never actually fault, and the
+        * below annotations will generate false positives.
+        */
+       if (segment_eq(get_fs(), KERNEL_DS))
+               return;
+
        might_sleep();
        /*
         * it would be nicer only to annotate paths which are not under
index e412ffa8e52ea945fb2ffa94a8de388e2de0875e..3eb4a6fdc04377130f628daaadfc2f970503addc 100644 (file)
@@ -1068,10 +1068,9 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode,
        return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0;
 }
 
-asmlinkage long sys_mbind(unsigned long start, unsigned long len,
-                       unsigned long mode,
-                       unsigned long __user *nmask, unsigned long maxnode,
-                       unsigned flags)
+SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len,
+               unsigned long, mode, unsigned long __user *, nmask,
+               unsigned long, maxnode, unsigned, flags)
 {
        nodemask_t nodes;
        int err;
@@ -1091,8 +1090,8 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len,
 }
 
 /* Set the process memory policy */
-asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
-               unsigned long maxnode)
+SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask,
+               unsigned long, maxnode)
 {
        int err;
        nodemask_t nodes;
@@ -1110,9 +1109,9 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
        return do_set_mempolicy(mode, flags, &nodes);
 }
 
-asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
-               const unsigned long __user *old_nodes,
-               const unsigned long __user *new_nodes)
+SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
+               const unsigned long __user *old_nodes,
+               const unsigned long __user *new_nodes)
 {
        const struct cred *cred = current_cred(), *tcred;
        struct mm_struct *mm;
@@ -1185,10 +1184,9 @@ out:
 
 
 /* Retrieve NUMA policy */
-asmlinkage long sys_get_mempolicy(int __user *policy,
-                               unsigned long __user *nmask,
-                               unsigned long maxnode,
-                               unsigned long addr, unsigned long flags)
+SYSCALL_DEFINE5(get_mempolicy, int __user *, policy,
+               unsigned long __user *, nmask, unsigned long, maxnode,
+               unsigned long, addr, unsigned long, flags)
 {
        int err;
        int uninitialized_var(pval);
index a30ea5fcf9f1cab76172fdb4f7473e8df0880cac..2bb4e1d6352046e9030a789a9b78c385cd104c5b 100644 (file)
@@ -1055,10 +1055,10 @@ out:
  * Move a list of pages in the address space of the currently executing
  * process.
  */
-asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
-                       const void __user * __user *pages,
-                       const int __user *nodes,
-                       int __user *status, int flags)
+SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
+               const void __user * __user *, pages,
+               const int __user *, nodes,
+               int __user *, status, int, flags)
 {
        const struct cred *cred = current_cred(), *tcred;
        struct task_struct *task;
index 5178800bc1294f6649651f5cb2d7ee9a6e183495..8cb508f84ea49ca03a7005574208ab3ec4a4e567 100644 (file)
@@ -177,8 +177,8 @@ none_mapped:
  *             mapped
  *  -EAGAIN - A kernel resource was temporarily unavailable.
  */
-asmlinkage long sys_mincore(unsigned long start, size_t len,
-       unsigned char __user * vec)
+SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
+               unsigned char __user *, vec)
 {
        long retval;
        unsigned long pages;
index e125156c664e9a860c9db12d9cc7d712cc4ed016..2904a347e4761169655696120751c371e4d74959 100644 (file)
@@ -530,7 +530,7 @@ static int do_mlock(unsigned long start, size_t len, int on)
        return error;
 }
 
-asmlinkage long sys_mlock(unsigned long start, size_t len)
+SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
 {
        unsigned long locked;
        unsigned long lock_limit;
@@ -558,7 +558,7 @@ asmlinkage long sys_mlock(unsigned long start, size_t len)
        return error;
 }
 
-asmlinkage long sys_munlock(unsigned long start, size_t len)
+SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
 {
        int ret;
 
@@ -595,7 +595,7 @@ out:
        return 0;
 }
 
-asmlinkage long sys_mlockall(int flags)
+SYSCALL_DEFINE1(mlockall, int, flags)
 {
        unsigned long lock_limit;
        int ret = -EINVAL;
@@ -623,7 +623,7 @@ out:
        return ret;
 }
 
-asmlinkage long sys_munlockall(void)
+SYSCALL_DEFINE0(munlockall)
 {
        int ret;
 
index 749623196cb96facba001c1dc55ae3ab235ff67b..8d95902e9a389ba84fea3e45c39ad3c5012cee9d 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -245,7 +245,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
        return next;
 }
 
-asmlinkage unsigned long sys_brk(unsigned long brk)
+SYSCALL_DEFINE1(brk, unsigned long, brk)
 {
        unsigned long rlim, retval;
        unsigned long newbrk, oldbrk;
@@ -1948,7 +1948,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len)
 
 EXPORT_SYMBOL(do_munmap);
 
-asmlinkage long sys_munmap(unsigned long addr, size_t len)
+SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 {
        int ret;
        struct mm_struct *mm = current->mm;
index d0f6e7ce09f1ee88beabccff1b4025b585375062..abe2694e13f497ea8ecaa443fa6d7d11a5edb084 100644 (file)
@@ -217,8 +217,8 @@ fail:
        return error;
 }
 
-asmlinkage long
-sys_mprotect(unsigned long start, size_t len, unsigned long prot)
+SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
+               unsigned long, prot)
 {
        unsigned long vm_flags, nstart, end, tmp, reqprot;
        struct vm_area_struct *vma, *prev;
index 646de959aa5873b44b1a7f978a5e99524b7fa09c..a39b7b91be46722789a0ce95ed5382405796077c 100644 (file)
@@ -420,9 +420,9 @@ out_nc:
        return ret;
 }
 
-asmlinkage unsigned long sys_mremap(unsigned long addr,
-       unsigned long old_len, unsigned long new_len,
-       unsigned long flags, unsigned long new_addr)
+SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+               unsigned long, new_len, unsigned long, flags,
+               unsigned long, new_addr)
 {
        unsigned long ret;
 
index 07dae08cf31c70c25b8c5ea6300265489c4c7d97..4083209b7f02e068b94ac50c16d0739a539bc47b 100644 (file)
@@ -28,7 +28,7 @@
  * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to
  * applications.
  */
-asmlinkage long sys_msync(unsigned long start, size_t len, int flags)
+SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
 {
        unsigned long end;
        struct mm_struct *mm = current->mm;
index 60ed8375c986f56604e1551836fcf0f48d1273a3..8cee8c8ff0f26d0f3381385215ef38f5f9b6feb8 100644 (file)
@@ -416,7 +416,7 @@ EXPORT_SYMBOL(vm_insert_page);
  *  to a regular file.  in this case, the unmapping will need
  *  to invoke file system routines that need the global lock.
  */
-asmlinkage unsigned long sys_brk(unsigned long brk)
+SYSCALL_DEFINE1(brk, unsigned long, brk)
 {
        struct mm_struct *mm = current->mm;
 
@@ -1573,7 +1573,7 @@ erase_whole_vma:
 }
 EXPORT_SYMBOL(do_munmap);
 
-asmlinkage long sys_munmap(unsigned long addr, size_t len)
+SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 {
        int ret;
        struct mm_struct *mm = current->mm;
@@ -1657,10 +1657,9 @@ unsigned long do_mremap(unsigned long addr,
 }
 EXPORT_SYMBOL(do_mremap);
 
-asmlinkage
-unsigned long sys_mremap(unsigned long addr,
-                        unsigned long old_len, unsigned long new_len,
-                        unsigned long flags, unsigned long new_addr)
+SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+               unsigned long, new_len, unsigned long, flags,
+               unsigned long, new_addr)
 {
        unsigned long ret;
 
index da422c47e2ee515bb68c131f0980c603b7d1b380..f48b831e5e5ca5e5b400247e973aeec2a6023f94 100644 (file)
@@ -1377,7 +1377,7 @@ out:
        return ret;
 }
 
-asmlinkage long sys_swapoff(const char __user * specialfile)
+SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
 {
        struct swap_info_struct * p = NULL;
        unsigned short *swap_map;
@@ -1633,7 +1633,7 @@ late_initcall(max_swapfiles_check);
  *
  * The swapon system call
  */
-asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
+SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
 {
        struct swap_info_struct * p;
        char *name = NULL;
index c5db9a7264d980c8ecde35e0db5a2628a5a0c680..75f49d312e8c1d47648f3e96b8a1eb6d14076405 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/highmem.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
-#include <linux/mutex.h>
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -24,6 +23,7 @@
 #include <linux/rbtree.h>
 #include <linux/radix-tree.h>
 #include <linux/rcupdate.h>
+#include <linux/bootmem.h>
 
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
@@ -495,7 +495,7 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
 static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
                                        int sync, int force_flush)
 {
-       static DEFINE_MUTEX(purge_lock);
+       static DEFINE_SPINLOCK(purge_lock);
        LIST_HEAD(valist);
        struct vmap_area *va;
        int nr = 0;
@@ -506,10 +506,10 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
         * the case that isn't actually used at the moment anyway.
         */
        if (!sync && !force_flush) {
-               if (!mutex_trylock(&purge_lock))
+               if (!spin_trylock(&purge_lock))
                        return;
        } else
-               mutex_lock(&purge_lock);
+               spin_lock(&purge_lock);
 
        rcu_read_lock();
        list_for_each_entry_rcu(va, &vmap_area_list, list) {
@@ -541,7 +541,7 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end,
                        __free_vmap_area(va);
                spin_unlock(&vmap_area_lock);
        }
-       mutex_unlock(&purge_lock);
+       spin_unlock(&purge_lock);
 }
 
 /*
@@ -984,6 +984,8 @@ EXPORT_SYMBOL(vm_map_ram);
 
 void __init vmalloc_init(void)
 {
+       struct vmap_area *va;
+       struct vm_struct *tmp;
        int i;
 
        for_each_possible_cpu(i) {
@@ -996,6 +998,14 @@ void __init vmalloc_init(void)
                vbq->nr_dirty = 0;
        }
 
+       /* Import existing vmlist entries. */
+       for (tmp = vmlist; tmp; tmp = tmp->next) {
+               va = alloc_bootmem(sizeof(struct vmap_area));
+               va->flags = tmp->flags | VM_VM_AREA;
+               va->va_start = (unsigned long)tmp->addr;
+               va->va_end = va->va_start + tmp->size;
+               __insert_vmap_area(va);
+       }
        vmap_initialized = true;
 }
 
index 0663f99e977a8af81e1c149d3b193b6b94acb520..7ed75c7bd5d1384943e7425dd9c81f44983fec8e 100644 (file)
@@ -23,7 +23,7 @@ config NET_9P_VIRTIO
          guest partitions and a host partition.
 
 config NET_9P_RDMA
-       depends on INET && INFINIBAND && EXPERIMENTAL
+       depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL
        tristate "9P RDMA Transport (Experimental)"
        help
          This builds support for an RDMA transport.
index 06603d73c411839fa78c58b84d5851805b0111d0..35dd7371752a9448ff6162af9255ac0b0891ec35 100644 (file)
@@ -1214,7 +1214,7 @@ int sock_create_kern(int family, int type, int protocol, struct socket **res)
        return __sock_create(&init_net, family, type, protocol, res, 1);
 }
 
-asmlinkage long sys_socket(int family, int type, int protocol)
+SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol)
 {
        int retval;
        struct socket *sock;
@@ -1255,8 +1255,8 @@ out_release:
  *     Create a pair of connected sockets.
  */
 
-asmlinkage long sys_socketpair(int family, int type, int protocol,
-                              int __user *usockvec)
+SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
+               int __user *, usockvec)
 {
        struct socket *sock1, *sock2;
        int fd1, fd2, err;
@@ -1356,7 +1356,7 @@ out_fd1:
  *     the protocol layer (having also checked the address is ok).
  */
 
-asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
+SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
 {
        struct socket *sock;
        struct sockaddr_storage address;
@@ -1385,7 +1385,7 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
  *     ready for listening.
  */
 
-asmlinkage long sys_listen(int fd, int backlog)
+SYSCALL_DEFINE2(listen, int, fd, int, backlog)
 {
        struct socket *sock;
        int err, fput_needed;
@@ -1418,8 +1418,8 @@ asmlinkage long sys_listen(int fd, int backlog)
  *     clean when we restucture accept also.
  */
 
-asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
-                           int __user *upeer_addrlen, int flags)
+SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+               int __user *, upeer_addrlen, int, flags)
 {
        struct socket *sock, *newsock;
        struct file *newfile;
@@ -1502,8 +1502,8 @@ out_fd:
        goto out_put;
 }
 
-asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr,
-                          int __user *upeer_addrlen)
+SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
+               int __user *, upeer_addrlen)
 {
        return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0);
 }
@@ -1520,8 +1520,8 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr,
  *     include the -EINPROGRESS status for such sockets.
  */
 
-asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr,
-                           int addrlen)
+SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+               int, addrlen)
 {
        struct socket *sock;
        struct sockaddr_storage address;
@@ -1552,8 +1552,8 @@ out:
  *     name to user space.
  */
 
-asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr,
-                               int __user *usockaddr_len)
+SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
+               int __user *, usockaddr_len)
 {
        struct socket *sock;
        struct sockaddr_storage address;
@@ -1583,8 +1583,8 @@ out:
  *     name to user space.
  */
 
-asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr,
-                               int __user *usockaddr_len)
+SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
+               int __user *, usockaddr_len)
 {
        struct socket *sock;
        struct sockaddr_storage address;
@@ -1615,9 +1615,9 @@ asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr,
  *     the protocol.
  */
 
-asmlinkage long sys_sendto(int fd, void __user *buff, size_t len,
-                          unsigned flags, struct sockaddr __user *addr,
-                          int addr_len)
+SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
+               unsigned, flags, struct sockaddr __user *, addr,
+               int, addr_len)
 {
        struct socket *sock;
        struct sockaddr_storage address;
@@ -1660,7 +1660,8 @@ out:
  *     Send a datagram down a socket.
  */
 
-asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags)
+SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len,
+               unsigned, flags)
 {
        return sys_sendto(fd, buff, len, flags, NULL, 0);
 }
@@ -1671,9 +1672,9 @@ asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags)
  *     sender address from kernel to user space.
  */
 
-asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size,
-                            unsigned flags, struct sockaddr __user *addr,
-                            int __user *addr_len)
+SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
+               unsigned, flags, struct sockaddr __user *, addr,
+               int __user *, addr_len)
 {
        struct socket *sock;
        struct iovec iov;
@@ -1725,8 +1726,8 @@ asmlinkage long sys_recv(int fd, void __user *ubuf, size_t size,
  *     to pass the user mode parameter for the protocols to sort out.
  */
 
-asmlinkage long sys_setsockopt(int fd, int level, int optname,
-                              char __user *optval, int optlen)
+SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname,
+               char __user *, optval, int, optlen)
 {
        int err, fput_needed;
        struct socket *sock;
@@ -1759,8 +1760,8 @@ out_put:
  *     to pass a user mode parameter for the protocols to sort out.
  */
 
-asmlinkage long sys_getsockopt(int fd, int level, int optname,
-                              char __user *optval, int __user *optlen)
+SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname,
+               char __user *, optval, int __user *, optlen)
 {
        int err, fput_needed;
        struct socket *sock;
@@ -1789,7 +1790,7 @@ out_put:
  *     Shutdown a socket.
  */
 
-asmlinkage long sys_shutdown(int fd, int how)
+SYSCALL_DEFINE2(shutdown, int, fd, int, how)
 {
        int err, fput_needed;
        struct socket *sock;
@@ -1815,7 +1816,7 @@ asmlinkage long sys_shutdown(int fd, int how)
  *     BSD sendmsg interface
  */
 
-asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags)
+SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags)
 {
        struct compat_msghdr __user *msg_compat =
            (struct compat_msghdr __user *)msg;
@@ -1921,8 +1922,8 @@ out:
  *     BSD recvmsg interface
  */
 
-asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg,
-                           unsigned int flags)
+SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg,
+               unsigned int, flags)
 {
        struct compat_msghdr __user *msg_compat =
            (struct compat_msghdr __user *)msg;
@@ -2045,7 +2046,7 @@ static const unsigned char nargs[19]={
  *  it is set by the callees.
  */
 
-asmlinkage long sys_socketcall(int call, unsigned long __user *args)
+SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
 {
        unsigned long a[6];
        unsigned long a0, a1;
index 7bed4ed2c5197c5d360533665dcea69bc6446109..45eb0ae98ebab2c6a771e1d10bfbb10df9231823 100755 (executable)
@@ -10,7 +10,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.26';
+my $V = '0.27';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -411,13 +411,15 @@ sub ctx_statement_block {
 
        my $type = '';
        my $level = 0;
-       my @stack = ([$type, $level]);
+       my @stack = ();
        my $p;
        my $c;
        my $len = 0;
 
        my $remainder;
        while (1) {
+               @stack = (['', 0]) if ($#stack == -1);
+
                #warn "CSB: blk<$blk> remain<$remain>\n";
                # If we are about to drop off the end, pull in more
                # context.
@@ -1663,7 +1665,7 @@ sub process {
                        # Should not end with a space.
                        $to =~ s/\s+$//;
                        # '*'s should not have spaces between.
-                       while ($to =~ s/(.)\s\*/$1\*/) {
+                       while ($to =~ s/\*\s+\*/\*\*/) {
                        }
 
                        #print "from<$from> to<$to>\n";
@@ -1678,7 +1680,7 @@ sub process {
                        # Should not end with a space.
                        $to =~ s/\s+$//;
                        # '*'s should not have spaces between.
-                       while ($to =~ s/(.)\s\*/$1\*/) {
+                       while ($to =~ s/\*\s+\*/\*\*/) {
                        }
                        # Modifiers should have spaces.
                        $to =~ s/(\b$Modifier$)/$1 /;
@@ -2014,7 +2016,11 @@ sub process {
 
                        # Flatten any parentheses
                        $value =~ s/\)\(/\) \(/g;
-                       while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) {
+                       while ($value =~ s/\[[^\{\}]*\]/1/ ||
+                              $value !~ /(?:$Ident|-?$Constant)\s*
+                                            $Compare\s*
+                                            (?:$Ident|-?$Constant)/x &&
+                              $value =~ s/\([^\(\)]*\)/1/) {
                        }
 
                        if ($value =~ /^(?:$Ident|-?$Constant)$/) {
@@ -2102,6 +2108,11 @@ sub process {
                                ERROR("trailing statements should be on next line\n" . $herecurr);
                        }
                }
+# if should not continue a brace
+               if ($line =~ /}\s*if\b/) {
+                       ERROR("trailing statements should be on next line\n" .
+                               $herecurr);
+               }
 # case and default should not have general statements after them
                if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
                    $line !~ /\G(?:
@@ -2516,9 +2527,10 @@ sub process {
                        WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
                }
 # check for struct file_operations, ensure they are const.
-               if ($line =~ /\bstruct\s+file_operations\b/ &&
-                   $line !~ /\bconst\b/) {
-                       WARN("struct file_operations should normally be const\n" . $herecurr);
+               if ($line !~ /\bconst\b/ &&
+                   $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) {
+                       WARN("struct $1 should normally be const\n" .
+                               $herecurr);
                }
 
 # use of NR_CPUS is usually wrong
index 09796797d122f7a624fb35584e00a67a07b8d4a9..e9335e1c6cf50726b3d18f67e069f285a8e5b84e 100644 (file)
@@ -54,11 +54,11 @@ static int key_get_type_from_user(char *type,
  * - returns the new key's serial number
  * - implements add_key()
  */
-asmlinkage long sys_add_key(const char __user *_type,
-                           const char __user *_description,
-                           const void __user *_payload,
-                           size_t plen,
-                           key_serial_t ringid)
+SYSCALL_DEFINE5(add_key, const char __user *, _type,
+               const char __user *, _description,
+               const void __user *, _payload,
+               size_t, plen,
+               key_serial_t, ringid)
 {
        key_ref_t keyring_ref, key_ref;
        char type[32], *description;
@@ -146,10 +146,10 @@ asmlinkage long sys_add_key(const char __user *_type,
  *   - if the _callout_info string is empty, it will be rendered as "-"
  * - implements request_key()
  */
-asmlinkage long sys_request_key(const char __user *_type,
-                               const char __user *_description,
-                               const char __user *_callout_info,
-                               key_serial_t destringid)
+SYSCALL_DEFINE4(request_key, const char __user *, _type,
+               const char __user *, _description,
+               const char __user *, _callout_info,
+               key_serial_t, destringid)
 {
        struct key_type *ktype;
        struct key *key;
@@ -1216,8 +1216,8 @@ long keyctl_get_security(key_serial_t keyid,
 /*
  * the key control system call
  */
-asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3,
-                          unsigned long arg4, unsigned long arg5)
+SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
+               unsigned long, arg4, unsigned long, arg5)
 {
        switch (option) {
        case KEYCTL_GET_KEYRING_ID:
index 3c596da2b9b5aa07e168797630e79a2d56050340..b7bba7dc7cf15ee0e18b6147839d0c3c8ae59d3b 100644 (file)
@@ -2723,6 +2723,67 @@ int snd_hda_check_board_config(struct hda_codec *codec,
 }
 EXPORT_SYMBOL_HDA(snd_hda_check_board_config);
 
+/**
+ * snd_hda_check_board_codec_sid_config - compare the current codec
+                                         subsystem ID with the
+                                         config table
+
+          This is important for Gateway notebooks with SB450 HDA Audio
+          where the vendor ID of the PCI device is:
+               ATI Technologies Inc SB450 HDA Audio [1002:437b]
+          and the vendor/subvendor are found only at the codec.
+
+ * @codec: the HDA codec
+ * @num_configs: number of config enums
+ * @models: array of model name strings
+ * @tbl: configuration table, terminated by null entries
+ *
+ * Compares the modelname or PCI subsystem id of the current codec with the
+ * given configuration table.  If a matching entry is found, returns its
+ * config value (supposed to be 0 or positive).
+ *
+ * If no entries are matching, the function returns a negative value.
+ */
+int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
+                              int num_configs, const char **models,
+                              const struct snd_pci_quirk *tbl)
+{
+       const struct snd_pci_quirk *q;
+
+       /* Search for codec ID */
+       for (q = tbl; q->subvendor; q++) {
+               unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);
+
+               if (vendorid == codec->subsystem_id)
+                       break;
+       }
+
+       if (!q->subvendor)
+               return -1;
+
+       tbl = q;
+
+       if (tbl->value >= 0 && tbl->value < num_configs) {
+#ifdef CONFIG_SND_DEBUG_DETECT
+               char tmp[10];
+               const char *model = NULL;
+               if (models)
+                       model = models[tbl->value];
+               if (!model) {
+                       sprintf(tmp, "#%d", tbl->value);
+                       model = tmp;
+               }
+               snd_printdd(KERN_INFO "hda_codec: model '%s' is selected "
+                           "for config %x:%x (%s)\n",
+                           model, tbl->subvendor, tbl->subdevice,
+                           (tbl->name ? tbl->name : "Unknown device"));
+#endif
+               return tbl->value;
+       }
+       return -1;
+}
+EXPORT_SYMBOL_HDA(snd_hda_check_board_codec_sid_config);
+
 /**
  * snd_hda_add_new_ctls - create controls from the array
  * @codec: the HDA codec
@@ -2815,7 +2876,7 @@ void snd_hda_power_down(struct hda_codec *codec)
                return;
        if (power_save(codec)) {
                codec->power_transition = 1; /* avoid reentrance */
-               schedule_delayed_work(&codec->power_work,
+               queue_delayed_work(codec->bus->workq, &codec->power_work,
                                msecs_to_jiffies(power_save(codec) * 1000));
        }
 }
index 6f2fe0f9fdd8acfeaeeab7f478be6abb39889d91..1dd8716c387f74e036a30d14301e37e443d77925 100644 (file)
@@ -296,6 +296,9 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
 int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
                               const char **modelnames,
                               const struct snd_pci_quirk *pci_list);
+int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
+                               int num_configs, const char **models,
+                               const struct snd_pci_quirk *tbl);
 int snd_hda_add_new_ctls(struct hda_codec *codec,
                         struct snd_kcontrol_new *knew);
 
index 96952a37d8847c4b2c667bdfb5d249235f07aa59..d57d8132a06ebedfc6855a4c5e12507aac50651a 100644 (file)
@@ -160,6 +160,7 @@ static int patch_nvhdmi(struct hda_codec *codec)
  */
 static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
        { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi },
+       { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi },
        { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi },
        { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi },
        { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi },
@@ -167,6 +168,7 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
 };
 
 MODULE_ALIAS("snd-hda-codec-id:10de0002");
+MODULE_ALIAS("snd-hda-codec-id:10de0006");
 MODULE_ALIAS("snd-hda-codec-id:10de0007");
 MODULE_ALIAS("snd-hda-codec-id:10de0067");
 MODULE_ALIAS("snd-hda-codec-id:10de8001");
index ea4c88fe05c40cb36ccd7e78bf2781702925c823..82dd0843197075f41b9c4e2462810e196d5872fe 100644 (file)
@@ -10573,6 +10573,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
        SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
        SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
        SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA),
+       SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
        SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
        SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
        SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31),
index 35b83dc6e19e5922104f5319302f7e7fa0376d73..c39deebb588f3116a4a4bfdaf8d7c2c86a9d4fea 100644 (file)
@@ -55,7 +55,8 @@ enum {
        STAC_9200_DELL_M25,
        STAC_9200_DELL_M26,
        STAC_9200_DELL_M27,
-       STAC_9200_GATEWAY,
+       STAC_9200_M4,
+       STAC_9200_M4_2,
        STAC_9200_PANASONIC,
        STAC_9200_MODELS
 };
@@ -89,14 +90,19 @@ enum {
        STAC_DELL_M4_2,
        STAC_DELL_M4_3,
        STAC_HP_M4,
+       STAC_HP_DV5,
        STAC_92HD71BXX_MODELS
 };
 
 enum {
        STAC_925x_REF,
+       STAC_M1,
+       STAC_M1_2,
+       STAC_M2,
        STAC_M2_2,
-       STAC_MA6,
-       STAC_PA6,
+       STAC_M3,
+       STAC_M5,
+       STAC_M6,
        STAC_925x_MODELS
 };
 
@@ -331,6 +337,10 @@ static unsigned int stac92hd83xxx_pwr_mapping[4] = {
        0x03, 0x0c, 0x10, 0x40,
 };
 
+static hda_nid_t stac92hd83xxx_amp_nids[1] = {
+       0xc,
+};
+
 static hda_nid_t stac92hd71bxx_pwr_nids[3] = {
        0x0a, 0x0d, 0x0f
 };
@@ -875,6 +885,8 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = {
 static struct hda_verb stac925x_core_init[] = {
        /* set dac0mux for dac converter */
        { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
+       /* unmute and set max the selector */
+       { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f },
        {}
 };
 
@@ -1334,7 +1346,16 @@ static unsigned int ref9200_pin_configs[8] = {
        0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
 };
 
-/* 
+static unsigned int gateway9200_m4_pin_configs[8] = {
+       0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
+       0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
+};
+static unsigned int gateway9200_m4_2_pin_configs[8] = {
+       0x400000fe, 0x404500f4, 0x400100f0, 0x90110010,
+       0x400100f1, 0x02a1902e, 0x500000f2, 0x500000f3,
+};
+
+/*
     STAC 9200 pin configs for
     102801A8
     102801DE
@@ -1464,6 +1485,8 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
        [STAC_9200_DELL_M25] = dell9200_m25_pin_configs,
        [STAC_9200_DELL_M26] = dell9200_m26_pin_configs,
        [STAC_9200_DELL_M27] = dell9200_m27_pin_configs,
+       [STAC_9200_M4] = gateway9200_m4_pin_configs,
+       [STAC_9200_M4_2] = gateway9200_m4_2_pin_configs,
        [STAC_9200_PANASONIC] = ref9200_pin_configs,
 };
 
@@ -1480,7 +1503,8 @@ static const char *stac9200_models[STAC_9200_MODELS] = {
        [STAC_9200_DELL_M25] = "dell-m25",
        [STAC_9200_DELL_M26] = "dell-m26",
        [STAC_9200_DELL_M27] = "dell-m27",
-       [STAC_9200_GATEWAY] = "gateway",
+       [STAC_9200_M4] = "gateway-m4",
+       [STAC_9200_M4_2] = "gateway-m4-2",
        [STAC_9200_PANASONIC] = "panasonic",
 };
 
@@ -1550,11 +1574,9 @@ static struct snd_pci_quirk stac9200_cfg_tbl[] = {
        /* Panasonic */
        SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC),
        /* Gateway machines needs EAPD to be set on resume */
-       SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_GATEWAY),
-       SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*",
-                     STAC_9200_GATEWAY),
-       SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707",
-                     STAC_9200_GATEWAY),
+       SND_PCI_QUIRK(0x107b, 0x0205, "Gateway S-7110M", STAC_9200_M4),
+       SND_PCI_QUIRK(0x107b, 0x0317, "Gateway MT3423, MX341*", STAC_9200_M4_2),
+       SND_PCI_QUIRK(0x107b, 0x0318, "Gateway ML3019, MT3707", STAC_9200_M4_2),
        /* OQO Mobile */
        SND_PCI_QUIRK(0x1106, 0x3288, "OQO Model 2", STAC_9200_OQO),
        {} /* terminator */
@@ -1565,44 +1587,85 @@ static unsigned int ref925x_pin_configs[8] = {
        0x90a70320, 0x02214210, 0x01019020, 0x9033032e,
 };
 
-static unsigned int stac925x_MA6_pin_configs[8] = {
-       0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021,
-       0x90a70320, 0x90100211, 0x400003f1, 0x9033032e,
+static unsigned int stac925xM1_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
 };
 
-static unsigned int stac925x_PA6_pin_configs[8] = {
-       0x40c003f0, 0x424503f2, 0x01813022, 0x02a19021,
-       0x50a103f0, 0x90100211, 0x400003f1, 0x9033032e,
+static unsigned int stac925xM1_2_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
+};
+
+static unsigned int stac925xM2_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
 };
 
 static unsigned int stac925xM2_2_pin_configs[8] = {
-       0x40c003f3, 0x424503f2, 0x04180011, 0x02a19020,
-       0x50a103f0, 0x90100212, 0x400003f1, 0x9033032e,
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
+};
+
+static unsigned int stac925xM3_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x503303f3,
+};
+
+static unsigned int stac925xM5_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x9033032e,
+};
+
+static unsigned int stac925xM6_pin_configs[8] = {
+       0x40c003f4, 0x424503f2, 0x400000f3, 0x02a19020,
+       0x40a000f0, 0x90100210, 0x400003f1, 0x90330320,
 };
 
 static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
        [STAC_REF] = ref925x_pin_configs,
+       [STAC_M1] = stac925xM1_pin_configs,
+       [STAC_M1_2] = stac925xM1_2_pin_configs,
+       [STAC_M2] = stac925xM2_pin_configs,
        [STAC_M2_2] = stac925xM2_2_pin_configs,
-       [STAC_MA6] = stac925x_MA6_pin_configs,
-       [STAC_PA6] = stac925x_PA6_pin_configs,
+       [STAC_M3] = stac925xM3_pin_configs,
+       [STAC_M5] = stac925xM5_pin_configs,
+       [STAC_M6] = stac925xM6_pin_configs,
 };
 
 static const char *stac925x_models[STAC_925x_MODELS] = {
        [STAC_REF] = "ref",
+       [STAC_M1] = "m1",
+       [STAC_M1_2] = "m1-2",
+       [STAC_M2] = "m2",
        [STAC_M2_2] = "m2-2",
-       [STAC_MA6] = "m6",
-       [STAC_PA6] = "pa6",
+       [STAC_M3] = "m3",
+       [STAC_M5] = "m5",
+       [STAC_M6] = "m6",
+};
+
+static struct snd_pci_quirk stac925x_codec_id_cfg_tbl[] = {
+       SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_M2),
+       SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_M5),
+       SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_M1),
+       SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_M2),
+       SND_PCI_QUIRK(0x107b, 0x0367, "Gateway MX6453", STAC_M1_2),
+       /* Not sure about the brand name for those */
+       SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M1),
+       SND_PCI_QUIRK(0x107b, 0x0507, "Gateway mobile", STAC_M3),
+       SND_PCI_QUIRK(0x107b, 0x0281, "Gateway mobile", STAC_M6),
+       SND_PCI_QUIRK(0x107b, 0x0685, "Gateway mobile", STAC_M2_2),
+       {} /* terminator */
 };
 
 static struct snd_pci_quirk stac925x_cfg_tbl[] = {
        /* SigmaTel reference board */
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
        SND_PCI_QUIRK(0x8384, 0x7632, "Stac9202 Reference Board", STAC_REF),
-       SND_PCI_QUIRK(0x107b, 0x0316, "Gateway M255", STAC_REF),
-       SND_PCI_QUIRK(0x107b, 0x0366, "Gateway MP6954", STAC_REF),
-       SND_PCI_QUIRK(0x107b, 0x0461, "Gateway NX560XL", STAC_MA6),
-       SND_PCI_QUIRK(0x107b, 0x0681, "Gateway NX860", STAC_PA6),
-       SND_PCI_QUIRK(0x1002, 0x437b, "Gateway MX6453", STAC_M2_2),
+
+       /* Default table for unknown ID */
+       SND_PCI_QUIRK(0x1002, 0x437b, "Gateway mobile", STAC_M2_2),
+
        {} /* terminator */
 };
 
@@ -1682,7 +1745,7 @@ static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
 static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
        /* SigmaTel reference board */
        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
-                     "DFI LanParty", STAC_92HD71BXX_REF),
+                     "DFI LanParty", STAC_92HD83XXX_REF),
        {} /* terminator */
 };
 
@@ -1716,6 +1779,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
        [STAC_DELL_M4_2]        = dell_m4_2_pin_configs,
        [STAC_DELL_M4_3]        = dell_m4_3_pin_configs,
        [STAC_HP_M4]            = NULL,
+       [STAC_HP_DV5]           = NULL,
 };
 
 static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
@@ -1724,6 +1788,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
        [STAC_DELL_M4_2] = "dell-m4-2",
        [STAC_DELL_M4_3] = "dell-m4-3",
        [STAC_HP_M4] = "hp-m4",
+       [STAC_HP_DV5] = "hp-dv5",
 };
 
 static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
@@ -1736,6 +1801,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
                      "HP dv7", STAC_HP_M4),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
                      "HP dv7", STAC_HP_M4),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
+                     "HP dv5", STAC_HP_DV5),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
                                "unknown HP", STAC_HP_M4),
        SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
@@ -4163,8 +4230,19 @@ static void stac92xx_hp_detect(struct hda_codec *codec)
                        continue;
                if (presence)
                        stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
+#if 0 /* FIXME */
+/* Resetting the pinctl like below may lead to (a sort of) regressions
+ * on some devices since they use the HP pin actually for line/speaker
+ * outs although the default pin config shows a different pin (that is
+ * wrong and useless).
+ *
+ * So, it's basically a problem of default pin configs, likely a BIOS issue.
+ * But, disabling the code below just works around it, and I'm too tired of
+ * bug reports with such devices... 
+ */
                else
                        stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val);
+#endif /* FIXME */
        }
 } 
 
@@ -4390,7 +4468,8 @@ static int patch_stac9200(struct hda_codec *codec)
        spec->num_adcs = 1;
        spec->num_pwrs = 0;
 
-       if (spec->board_config == STAC_9200_GATEWAY ||
+       if (spec->board_config == STAC_9200_M4 ||
+           spec->board_config == STAC_9200_M4_2 ||
            spec->board_config == STAC_9200_OQO)
                spec->init = stac9200_eapd_init;
        else
@@ -4408,6 +4487,12 @@ static int patch_stac9200(struct hda_codec *codec)
                return err;
        }
 
+       /* CF-74 has no headphone detection, and the driver should *NOT*
+        * do detection and HP/speaker toggle because the hardware does it.
+        */
+       if (spec->board_config == STAC_9200_PANASONIC)
+               spec->hp_detect = 0;
+
        codec->patch_ops = stac92xx_patch_ops;
 
        return 0;
@@ -4425,12 +4510,22 @@ static int patch_stac925x(struct hda_codec *codec)
        codec->spec = spec;
        spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
        spec->pin_nids = stac925x_pin_nids;
-       spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
+
+       /* Check first for codec ID */
+       spec->board_config = snd_hda_check_board_codec_sid_config(codec,
+                                                       STAC_925x_MODELS,
+                                                       stac925x_models,
+                                                       stac925x_codec_id_cfg_tbl);
+
+       /* Now checks for PCI ID, if codec ID is not found */
+       if (spec->board_config < 0)
+               spec->board_config = snd_hda_check_board_config(codec,
+                                                       STAC_925x_MODELS,
                                                        stac925x_models,
                                                        stac925x_cfg_tbl);
  again:
        if (spec->board_config < 0) {
-               snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x," 
+               snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
                                      "using BIOS defaults\n");
                err = stac92xx_save_bios_config_regs(codec);
        } else
@@ -4672,6 +4767,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
        spec->dmux_nids = stac92hd83xxx_dmux_nids;
        spec->adc_nids = stac92hd83xxx_adc_nids;
        spec->pwr_nids = stac92hd83xxx_pwr_nids;
+       spec->amp_nids = stac92hd83xxx_amp_nids;
        spec->pwr_mapping = stac92hd83xxx_pwr_mapping;
        spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
        spec->multiout.dac_nids = spec->dac_nids;
@@ -4689,6 +4785,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
        spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
        spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids);
        spec->num_adcs = ARRAY_SIZE(stac92hd83xxx_adc_nids);
+       spec->num_amps = ARRAY_SIZE(stac92hd83xxx_amp_nids);
        spec->num_dmics = STAC92HD83XXX_NUM_DMICS;
        spec->dinput_mux = &stac92hd83xxx_dmux;
        spec->pin_nids = stac92hd83xxx_pin_nids;
index 98c6a8c65d813cb9f816d3e2d83a206cdbb1935e..e9e829e83d7ae4b3f51493b6aa231236c1316fdb 100644 (file)
@@ -26,7 +26,7 @@
  * SPI 0 -> 1st PCM1796 (front)
  * SPI 1 -> 2nd PCM1796 (surround)
  * SPI 2 -> 3rd PCM1796 (center/LFE)
- * SPI 4 -> 4th PCM1796 (back)
+ * SPI 4 -> 4th PCM1796 (back) and EEPROM self-destruct (do not use!)
  *
  * GPIO 2 -> M0 of CS5381
  * GPIO 3 -> M1 of CS5381
@@ -207,6 +207,12 @@ static void xonar_gpio_changed(struct oxygen *chip);
 static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
                                     u8 reg, u8 value)
 {
+       /*
+        * We don't want to do writes on SPI 4 because the EEPROM, which shares
+        * the same pin, might get confused and broken.  We'd better take care
+        * that the driver works with the default register values ...
+        */
+#if 0
        /* maps ALSA channel pair number to SPI output */
        static const u8 codec_map[4] = {
                0, 1, 2, 4
@@ -217,6 +223,7 @@ static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
                         (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) |
                         OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
                         (reg << 8) | value);
+#endif
 }
 
 static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
@@ -750,6 +757,9 @@ static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -12700, 100, 0);
 
 static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
 {
+       if (!strncmp(template->name, "Master Playback ", 16))
+               /* disable volume/mute because they would require SPI writes */
+               return 1;
        if (!strncmp(template->name, "CD Capture ", 11))
                /* CD in is actually connected to the video in pin */
                template->private_value ^= AC97_CD ^ AC97_VIDEO;
@@ -840,9 +850,8 @@ static const struct oxygen_model model_xonar_d2 = {
        .dac_volume_min = 0x0f,
        .dac_volume_max = 0xff,
        .misc_flags = OXYGEN_MISC_MIDI,
-       .function_flags = OXYGEN_FUNCTION_SPI |
-                         OXYGEN_FUNCTION_ENABLE_SPI_4_5,
-       .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
+       .function_flags = OXYGEN_FUNCTION_SPI,
+       .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S,
        .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
 };
 
index 8f9e3859c37ca70f802fdb5c3f8f25ed75731b8d..ff321110ec029604bd8cd0e4862940fe1e1b88c4 100644 (file)
@@ -477,7 +477,7 @@ static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream)
                card->dma_start_bus_addr[SND_PS3_CH_R] =
                        runtime->dma_addr + (runtime->dma_bytes / 2);
 
-               pr_debug("%s: vaddr=%p bus=%#lx\n", __func__,
+               pr_debug("%s: vaddr=%p bus=%#llx\n", __func__,
                         card->dma_start_vaddr[SND_PS3_CH_L],
                         card->dma_start_bus_addr[SND_PS3_CH_L]);
 
@@ -1030,7 +1030,7 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
                pr_info("%s: nullbuffer alloc failed\n", __func__);
                goto clean_preallocate;
        }
-       pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__,
+       pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__,
                 the_card.null_buffer_start_vaddr,
                 the_card.null_buffer_start_dma_addr);
        /* set default sample rate/word width */
index 493a4e8aa27357cb74d07ed9858b7cdbc8c2e7e2..a2f1da8b464602fbac5ec55e86295d0f5fcda7ec 100644 (file)
@@ -720,7 +720,8 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
        struct snd_soc_dapm_path *path;
        int found = 0;
 
-       if (widget->id != snd_soc_dapm_mux)
+       if (widget->id != snd_soc_dapm_mux &&
+           widget->id != snd_soc_dapm_value_mux)
                return -ENODEV;
 
        if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
index 92115755d98e7f8626651ebbf3af6782e60ccd0e..5d8ef09b9dcc17d01f85d2ca27047a7faa30fe4f 100644 (file)
        .bInterfaceClass = USB_CLASS_AUDIO,
        .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL
 },
+{
+       USB_DEVICE(0x046d, 0x0990),
+       .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+               .vendor_name = "Logitech, Inc.",
+               .product_name = "QuickCam Pro 9000",
+               .ifnum = QUIRK_NO_INTERFACE
+       }
+},
 
 /*
  * Yamaha devices