]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jan 2009 00:53:42 +0000 (16:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jan 2009 00:53:42 +0000 (16:53 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix UP build failure.

457 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/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/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/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/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/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/libata-sff.c
drivers/ata/pata_it821x.c
drivers/block/nbd.c
drivers/block/xsysace.c
drivers/char/bsr.c
drivers/char/hvc_console.c
drivers/char/hvc_irq.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/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/isdn/i4l/isdn_net.c
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-hp-disk.c [deleted file]
drivers/mfd/twl4030-core.c
drivers/misc/sgi-xp/xpc_sn2.c
drivers/net/arm/etherh.c
drivers/net/ax88796.c
drivers/net/b44.c
drivers/net/b44.h
drivers/net/bnx2x.h
drivers/net/bnx2x_main.c
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_qmr.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/gianfar.c
drivers/net/ibm_newemac/mal.c
drivers/net/ibm_newemac/mal.h
drivers/net/ibmveth.c
drivers/net/irda/irda-usb.c
drivers/net/iseries_veth.c
drivers/net/korina.c
drivers/net/mlx4/main.c
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic_ctx.c
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_init.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/pasemi_mac.c
drivers/net/phy/phy_device.c
drivers/net/ppp_generic.c
drivers/net/sis900.c
drivers/net/usb/hso.c
drivers/net/wan/ixp4xx_hss.c
drivers/net/wireless/Kconfig
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath5k/pcu.c
drivers/net/wireless/ath5k/reg.h
drivers/net/wireless/ath9k/Kconfig
drivers/net/wireless/ath9k/main.c
drivers/net/wireless/ath9k/xmit.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-hcmd.c
drivers/net/wireless/libertas_tf/main.c
drivers/net/wireless/orinoco/orinoco.c
drivers/net/wireless/orinoco/orinoco_cs.c
drivers/net/wireless/p54/p54common.c
drivers/net/wireless/p54/p54usb.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00leds.c
drivers/net/wireless/rt2x00/rt2x00lib.h
drivers/net/wireless/rt2x00/rt2x00queue.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt73usb.c
drivers/net/wireless/rtl818x/rtl8180_dev.c
drivers/net/wireless/rtl818x/rtl8187_dev.c
drivers/of/of_i2c.c
drivers/parisc/superio.c
drivers/pci/intel-iommu.c
drivers/pci/syscall.c
drivers/pcmcia/electra_cf.c
drivers/rtc/rtc-pxa.c
drivers/rtc/rtc-twl4030.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/serial/8250.c
drivers/serial/8250_pci.c
drivers/serial/8250_pnp.c
drivers/serial/atmel_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
fs/aio.c
fs/btrfs/super.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/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/loop.h
include/linux/magic.h
include/linux/matroxfb.h
include/linux/mm.h
include/linux/netdevice.h
include/linux/netfilter/x_tables.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
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/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/bridge/br_netfilter.c
net/bridge/netfilter/ebtables.c
net/can/bcm.c
net/core/dev.c
net/core/skbuff.c
net/ipv4/netfilter/iptable_filter.c
net/ipv4/netfilter/iptable_mangle.c
net/ipv4/netfilter/iptable_raw.c
net/ipv4/netfilter/iptable_security.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv4/tcp.c
net/ipv6/ip6_fib.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/mac80211/ht.c
net/mac80211/iface.c
net/mac80211/mesh_plink.c
net/mac80211/rc80211_minstrel.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/x_tables.c
net/netfilter/xt_time.c
net/sched/sch_htb.c
net/socket.c
net/xfrm/xfrm_user.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/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 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 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 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 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 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 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 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) {
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 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..09676b4e5d8964d77a4cc555cbe30e616c62e7b0 100644 (file)
@@ -318,7 +318,8 @@ 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. */
+       if (!hp->irq_requested)
+               tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */
 
        hp->tty = tty;
 
@@ -764,13 +765,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 +875,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 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 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 7c5f97033b9ff71151f496ee36d0887f8ff9af40..cb8943da4f122f8c3fdf2703d405160ddad309b5 100644 (file)
@@ -292,7 +292,9 @@ isdn_net_unbind_channel(isdn_net_local * lp)
        lp->dialstate = 0;
        dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL;
        dev->st_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL;
-       isdn_free_channel(lp->isdn_device, lp->isdn_channel, ISDN_USAGE_NET);
+       if (lp->isdn_device != -1 && lp->isdn_channel != -1)
+               isdn_free_channel(lp->isdn_device, lp->isdn_channel,
+                                 ISDN_USAGE_NET);
        lp->flags &= ~ISDN_NET_CONNECTED;
        lp->isdn_device = -1;
        lp->isdn_channel = -1;
@@ -2513,7 +2515,6 @@ static const struct net_device_ops isdn_netdev_ops = {
        .ndo_stop             = isdn_net_close,
        .ndo_do_ioctl         = isdn_net_ioctl,
 
-       .ndo_validate_addr    = NULL,
        .ndo_start_xmit       = isdn_net_start_xmit,
        .ndo_get_stats        = isdn_net_get_stats,
        .ndo_tx_timeout       = isdn_net_tx_timeout,
@@ -2528,12 +2529,8 @@ static void _isdn_setup(struct net_device *dev)
 
        ether_setup(dev);
 
-       dev->flags = IFF_NOARP | IFF_POINTOPOINT;
        /* Setup the generic properties */
-       dev->mtu = 1500;
        dev->flags = IFF_NOARP|IFF_POINTOPOINT;
-       dev->type = ARPHRD_ETHER;
-       dev->addr_len = ETH_ALEN;
        dev->header_ops = NULL;
        dev->netdev_ops = &isdn_netdev_ops;
 
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 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 745ac188babe8c6419b81d0956002388b7a8a21c..d15d8b79d8e5332891134ab5bb1424aa83b66388 100644 (file)
@@ -646,7 +646,7 @@ static const struct net_device_ops etherh_netdev_ops = {
        .ndo_get_stats          = ei_get_stats,
        .ndo_set_multicast_list = ei_set_multicast_list,
        .ndo_validate_addr      = eth_validate_addr,
-       .ndo_set_mac_addr       = eth_set_mac_addr,
+       .ndo_set_mac_address    = eth_set_mac_addr,
        .ndo_change_mtu         = eth_change_mtu,
 #ifdef CONFIG_NET_POLL_CONTROLLER
        .ndo_poll_controller    = ei_poll,
index 337488ec707cfc2aad6b14ae7aec63315510529c..a4eb6c40678ccb46b6a597e5264c2a81dc78650e 100644 (file)
@@ -37,7 +37,10 @@ static int phy_debug = 0;
 #define __ei_open       ax_ei_open
 #define __ei_close      ax_ei_close
 #define __ei_poll      ax_ei_poll
+#define __ei_start_xmit ax_ei_start_xmit
 #define __ei_tx_timeout ax_ei_tx_timeout
+#define __ei_get_stats  ax_ei_get_stats
+#define __ei_set_multicast_list ax_ei_set_multicast_list
 #define __ei_interrupt  ax_ei_interrupt
 #define ____alloc_ei_netdev ax__alloc_ei_netdev
 #define __NS8390_init   ax_NS8390_init
@@ -623,6 +626,23 @@ static void ax_eeprom_register_write(struct eeprom_93cx6 *eeprom)
 }
 #endif
 
+static const struct net_device_ops ax_netdev_ops = {
+       .ndo_open               = ax_open,
+       .ndo_stop               = ax_close,
+       .ndo_do_ioctl           = ax_ioctl,
+
+       .ndo_start_xmit         = ax_ei_start_xmit,
+       .ndo_tx_timeout         = ax_ei_tx_timeout,
+       .ndo_get_stats          = ax_ei_get_stats,
+       .ndo_set_multicast_list = ax_ei_set_multicast_list,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = ax_ei_poll,
+#endif
+};
+
 /* setup code */
 
 static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local)
@@ -738,9 +758,7 @@ static int ax_init_dev(struct net_device *dev, int first_init)
        ei_status.get_8390_hdr  = &ax_get_8390_hdr;
        ei_status.priv = 0;
 
-       dev->open               = ax_open;
-       dev->stop               = ax_close;
-       dev->do_ioctl           = ax_ioctl;
+       dev->netdev_ops         = &ax_netdev_ops;
        dev->ethtool_ops        = &ax_ethtool_ops;
 
        ax->msg_enable          = NETIF_MSG_LINK;
@@ -753,9 +771,6 @@ static int ax_init_dev(struct net_device *dev, int first_init)
        ax->mii.mdio_write      = ax_phy_write;
        ax->mii.dev             = dev;
 
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ax_ei_poll;
-#endif
        ax_NS8390_init(dev, 0);
 
        if (first_init)
index 5ae131c147f9724d38917b31d4a0ada3328de93c..c38512ebcea65fd0408ae0821d3be177b2854e26 100644 (file)
@@ -679,6 +679,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
                        dev_kfree_skb_any(skb);
                        return -ENOMEM;
                }
+               bp->force_copybreak = 1;
        }
 
        rh = (struct rx_header *) skb->data;
@@ -800,7 +801,7 @@ static int b44_rx(struct b44 *bp, int budget)
                /* Omit CRC. */
                len -= 4;
 
-               if (len > RX_COPY_THRESHOLD) {
+               if (!bp->force_copybreak && len > RX_COPY_THRESHOLD) {
                        int skb_size;
                        skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod);
                        if (skb_size < 0)
@@ -2152,6 +2153,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
        bp = netdev_priv(dev);
        bp->sdev = sdev;
        bp->dev = dev;
+       bp->force_copybreak = 0;
 
        bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE);
 
index 7db0c84a795096451b92253576d38028a277eacd..e678498de6dbed9ee0948eec2ee2457912c9ef7f 100644 (file)
@@ -395,7 +395,7 @@ struct b44 {
        u32                     rx_pending;
        u32                     tx_pending;
        u8                      phy_addr;
-
+       u8                      force_copybreak;
        struct mii_if_info      mii_if;
 };
 
index fd705d1295a7b0ea78c27d79a905b5d21ba165cf..6fcccef4cf3d02bbc0449eaabbf7f081ce9f2cc5 100644 (file)
  * (you will need to reboot afterwards) */
 /* #define BNX2X_STOP_ON_ERROR */
 
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#define BCM_VLAN                       1
+#endif
+
+
 /* error/debug prints */
 
 #define DRV_MODULE_NAME                "bnx2x"
 #endif
 
 
-#ifdef NETIF_F_HW_VLAN_TX
-#define BCM_VLAN                       1
-#endif
-
-
 #define U64_LO(x)                      (u32)(((u64)(x)) & 0xffffffff)
 #define U64_HI(x)                      (u32)(((u64)(x)) >> 32)
 #define HILO_U64(hi, lo)               ((((u64)(hi)) << 32) + (lo))
@@ -150,6 +150,9 @@ struct sw_rx_page {
 
 #define PAGES_PER_SGE_SHIFT            0
 #define PAGES_PER_SGE                  (1 << PAGES_PER_SGE_SHIFT)
+#define SGE_PAGE_SIZE                  PAGE_SIZE
+#define SGE_PAGE_SHIFT                 PAGE_SHIFT
+#define SGE_PAGE_ALIGN(addr)           PAGE_ALIGN(addr)
 
 #define BCM_RX_ETH_PAYLOAD_ALIGN       64
 
@@ -736,7 +739,7 @@ struct bnx2x {
        struct bnx2x_fastpath   fp[MAX_CONTEXT];
        void __iomem            *regview;
        void __iomem            *doorbells;
-#define BNX2X_DB_SIZE          (16*2048)
+#define BNX2X_DB_SIZE          (16*BCM_PAGE_SIZE)
 
        struct net_device       *dev;
        struct pci_dev          *pdev;
@@ -801,6 +804,8 @@ struct bnx2x {
 #define TPA_ENABLE_FLAG                        0x80
 #define NO_MCP_FLAG                    0x100
 #define BP_NOMCP(bp)                   (bp->flags & NO_MCP_FLAG)
+#define HW_VLAN_TX_FLAG                        0x400
+#define HW_VLAN_RX_FLAG                        0x800
 
        int                     func;
 #define BP_PORT(bp)                    (bp->func % PORT_MAX)
@@ -811,7 +816,7 @@ struct bnx2x {
        int                     pm_cap;
        int                     pcie_cap;
 
-       struct work_struct      sp_task;
+       struct delayed_work     sp_task;
        struct work_struct      reset_task;
 
        struct timer_list       timer;
index 4be05847f86fe7d1fcd865a6108920a7ef108c54..7c533797c064aceb12132306eb862d44ebf8c000 100644 (file)
@@ -38,9 +38,7 @@
 #include <linux/time.h>
 #include <linux/ethtool.h>
 #include <linux/mii.h>
-#ifdef NETIF_F_HW_VLAN_TX
-       #include <linux/if_vlan.h>
-#endif
+#include <linux/if_vlan.h>
 #include <net/ip.h>
 #include <net/tcp.h>
 #include <net/checksum.h>
@@ -95,6 +93,7 @@ MODULE_PARM_DESC(debug, "default debug msglevel");
 module_param(use_multi, int, 0);
 MODULE_PARM_DESC(use_multi, "use per-CPU queues");
 #endif
+static struct workqueue_struct *bnx2x_wq;
 
 enum bnx2x_board_type {
        BCM57710 = 0,
@@ -671,7 +670,8 @@ static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw)
                synchronize_irq(bp->pdev->irq);
 
        /* make sure sp_task is not running */
-       cancel_work_sync(&bp->sp_task);
+       cancel_delayed_work(&bp->sp_task);
+       flush_workqueue(bnx2x_wq);
 }
 
 /* fast path */
@@ -972,7 +972,7 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp,
                return;
 
        pci_unmap_page(bp->pdev, pci_unmap_addr(sw_buf, mapping),
-                      BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE);
+                      SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE);
        __free_pages(page, PAGES_PER_SGE_SHIFT);
 
        sw_buf->page = NULL;
@@ -1000,7 +1000,7 @@ static inline int bnx2x_alloc_rx_sge(struct bnx2x *bp,
        if (unlikely(page == NULL))
                return -ENOMEM;
 
-       mapping = pci_map_page(bp->pdev, page, 0, BCM_PAGE_SIZE*PAGES_PER_SGE,
+       mapping = pci_map_page(bp->pdev, page, 0, SGE_PAGE_SIZE*PAGES_PER_SGE,
                               PCI_DMA_FROMDEVICE);
        if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
                __free_pages(page, PAGES_PER_SGE_SHIFT);
@@ -1096,9 +1096,9 @@ static void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp,
                                  struct eth_fast_path_rx_cqe *fp_cqe)
 {
        struct bnx2x *bp = fp->bp;
-       u16 sge_len = BCM_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) -
+       u16 sge_len = SGE_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) -
                                     le16_to_cpu(fp_cqe->len_on_bd)) >>
-                     BCM_PAGE_SHIFT;
+                     SGE_PAGE_SHIFT;
        u16 last_max, last_elem, first_elem;
        u16 delta = 0;
        u16 i;
@@ -1203,22 +1203,22 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                               u16 cqe_idx)
 {
        struct sw_rx_page *rx_pg, old_rx_pg;
-       struct page *sge;
        u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd);
        u32 i, frag_len, frag_size, pages;
        int err;
        int j;
 
        frag_size = le16_to_cpu(fp_cqe->pkt_len) - len_on_bd;
-       pages = BCM_PAGE_ALIGN(frag_size) >> BCM_PAGE_SHIFT;
+       pages = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT;
 
        /* This is needed in order to enable forwarding support */
        if (frag_size)
-               skb_shinfo(skb)->gso_size = min((u32)BCM_PAGE_SIZE,
+               skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE,
                                               max(frag_size, (u32)len_on_bd));
 
 #ifdef BNX2X_STOP_ON_ERROR
-       if (pages > 8*PAGES_PER_SGE) {
+       if (pages >
+           min((u32)8, (u32)MAX_SKB_FRAGS) * SGE_PAGE_SIZE * PAGES_PER_SGE) {
                BNX2X_ERR("SGL length is too long: %d. CQE index is %d\n",
                          pages, cqe_idx);
                BNX2X_ERR("fp_cqe->pkt_len = %d  fp_cqe->len_on_bd = %d\n",
@@ -1234,9 +1234,8 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
 
                /* FW gives the indices of the SGE as if the ring is an array
                   (meaning that "next" element will consume 2 indices) */
-               frag_len = min(frag_size, (u32)(BCM_PAGE_SIZE*PAGES_PER_SGE));
+               frag_len = min(frag_size, (u32)(SGE_PAGE_SIZE*PAGES_PER_SGE));
                rx_pg = &fp->rx_page_ring[sge_idx];
-               sge = rx_pg->page;
                old_rx_pg = *rx_pg;
 
                /* If we fail to allocate a substitute page, we simply stop
@@ -1249,7 +1248,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
 
                /* Unmap the page as we r going to pass it to the stack */
                pci_unmap_page(bp->pdev, pci_unmap_addr(&old_rx_pg, mapping),
-                             BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE);
+                             SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE);
 
                /* Add one frag and update the appropriate fields in the skb */
                skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len);
@@ -1282,6 +1281,13 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
        if (likely(new_skb)) {
                /* fix ip xsum and give it to the stack */
                /* (no need to map the new skb) */
+#ifdef BCM_VLAN
+               int is_vlan_cqe =
+                       (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) &
+                        PARSING_FLAGS_VLAN);
+               int is_not_hwaccel_vlan_cqe =
+                       (is_vlan_cqe && (!(bp->flags & HW_VLAN_RX_FLAG)));
+#endif
 
                prefetch(skb);
                prefetch(((char *)(skb)) + 128);
@@ -1306,6 +1312,12 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                        struct iphdr *iph;
 
                        iph = (struct iphdr *)skb->data;
+#ifdef BCM_VLAN
+                       /* If there is no Rx VLAN offloading -
+                          take VLAN tag into an account */
+                       if (unlikely(is_not_hwaccel_vlan_cqe))
+                               iph = (struct iphdr *)((u8 *)iph + VLAN_HLEN);
+#endif
                        iph->check = 0;
                        iph->check = ip_fast_csum((u8 *)iph, iph->ihl);
                }
@@ -1313,9 +1325,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                if (!bnx2x_fill_frag_skb(bp, fp, skb,
                                         &cqe->fast_path_cqe, cqe_idx)) {
 #ifdef BCM_VLAN
-                       if ((bp->vlgrp != NULL) &&
-                           (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) &
-                            PARSING_FLAGS_VLAN))
+                       if ((bp->vlgrp != NULL) && is_vlan_cqe &&
+                           (!is_not_hwaccel_vlan_cqe))
                                vlan_hwaccel_receive_skb(skb, bp->vlgrp,
                                                le16_to_cpu(cqe->fast_path_cqe.
                                                            vlan_tag));
@@ -1355,11 +1366,23 @@ static inline void bnx2x_update_rx_prod(struct bnx2x *bp,
        rx_prods.cqe_prod = rx_comp_prod;
        rx_prods.sge_prod = rx_sge_prod;
 
+       /*
+        * Make sure that the BD and SGE data is updated before updating the
+        * producers since FW might read the BD/SGE right after the producer
+        * is updated.
+        * This is only applicable for weak-ordered memory model archs such
+        * as IA-64. The following barrier is also mandatory since FW will
+        * assumes BDs must have buffers.
+        */
+       wmb();
+
        for (i = 0; i < sizeof(struct tstorm_eth_rx_producers)/4; i++)
                REG_WR(bp, BAR_TSTRORM_INTMEM +
                       TSTORM_RX_PRODS_OFFSET(BP_PORT(bp), FP_CL_ID(fp)) + i*4,
                       ((u32 *)&rx_prods)[i]);
 
+       mmiowb(); /* keep prod updates ordered */
+
        DP(NETIF_MSG_RX_STATUS,
           "Wrote: bd_prod %u  cqe_prod %u  sge_prod %u\n",
           bd_prod, rx_comp_prod, rx_sge_prod);
@@ -1415,7 +1438,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
                DP(NETIF_MSG_RX_STATUS, "CQE type %x  err %x  status %x"
                   "  queue %x  vlan %x  len %u\n", CQE_TYPE(cqe_fp_flags),
                   cqe_fp_flags, cqe->fast_path_cqe.status_flags,
-                  cqe->fast_path_cqe.rss_hash_result,
+                  le32_to_cpu(cqe->fast_path_cqe.rss_hash_result),
                   le16_to_cpu(cqe->fast_path_cqe.vlan_tag),
                   le16_to_cpu(cqe->fast_path_cqe.pkt_len));
 
@@ -1547,7 +1570,7 @@ reuse_rx:
                }
 
 #ifdef BCM_VLAN
-               if ((bp->vlgrp != NULL) &&
+               if ((bp->vlgrp != NULL) && (bp->flags & HW_VLAN_RX_FLAG) &&
                    (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) &
                     PARSING_FLAGS_VLAN))
                        vlan_hwaccel_receive_skb(skb, bp->vlgrp,
@@ -1580,7 +1603,6 @@ next_cqe:
        /* Update producers */
        bnx2x_update_rx_prod(bp, fp, bd_prod_fw, sw_comp_prod,
                             fp->rx_sge_prod);
-       mmiowb(); /* keep prod updates ordered */
 
        fp->rx_pkt += rx_pkt;
        fp->rx_calls++;
@@ -1660,7 +1682,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
 
 
        if (unlikely(status & 0x1)) {
-               schedule_work(&bp->sp_task);
+               queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);
 
                status &= ~0x1;
                if (!status)
@@ -1887,7 +1909,8 @@ static int bnx2x_set_spio(struct bnx2x *bp, int spio_num, u32 mode)
 
 static void bnx2x_calc_fc_adv(struct bnx2x *bp)
 {
-       switch (bp->link_vars.ieee_fc) {
+       switch (bp->link_vars.ieee_fc &
+               MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) {
        case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE:
                bp->port.advertising &= ~(ADVERTISED_Asym_Pause |
                                          ADVERTISED_Pause);
@@ -1957,10 +1980,11 @@ static u8 bnx2x_initial_phy_init(struct bnx2x *bp)
                rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars);
                bnx2x_release_phy_lock(bp);
 
+               bnx2x_calc_fc_adv(bp);
+
                if (bp->link_vars.link_up)
                        bnx2x_link_report(bp);
 
-               bnx2x_calc_fc_adv(bp);
 
                return rc;
        }
@@ -2220,9 +2244,7 @@ static void bnx2x_link_attn(struct bnx2x *bp)
        /* Make sure that we are synced with the current statistics */
        bnx2x_stats_handle(bp, STATS_EVENT_STOP);
 
-       bnx2x_acquire_phy_lock(bp);
        bnx2x_link_update(&bp->link_params, &bp->link_vars);
-       bnx2x_release_phy_lock(bp);
 
        if (bp->link_vars.link_up) {
 
@@ -2471,6 +2493,8 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted)
        if (asserted & ATTN_HARD_WIRED_MASK) {
                if (asserted & ATTN_NIG_FOR_FUNC) {
 
+                       bnx2x_acquire_phy_lock(bp);
+
                        /* save nig interrupt mask */
                        bp->nig_mask = REG_RD(bp, nig_int_mask_addr);
                        REG_WR(bp, nig_int_mask_addr, 0);
@@ -2526,8 +2550,10 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted)
        REG_WR(bp, hc_addr, asserted);
 
        /* now set back the mask */
-       if (asserted & ATTN_NIG_FOR_FUNC)
+       if (asserted & ATTN_NIG_FOR_FUNC) {
                REG_WR(bp, nig_int_mask_addr, bp->nig_mask);
+               bnx2x_release_phy_lock(bp);
+       }
 }
 
 static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn)
@@ -2795,8 +2821,10 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted)
 static void bnx2x_attn_int(struct bnx2x *bp)
 {
        /* read local copy of bits */
-       u32 attn_bits = bp->def_status_blk->atten_status_block.attn_bits;
-       u32 attn_ack = bp->def_status_blk->atten_status_block.attn_bits_ack;
+       u32 attn_bits = le32_to_cpu(bp->def_status_blk->atten_status_block.
+                                                               attn_bits);
+       u32 attn_ack = le32_to_cpu(bp->def_status_blk->atten_status_block.
+                                                               attn_bits_ack);
        u32 attn_state = bp->attn_state;
 
        /* look for changed bits */
@@ -2820,7 +2848,7 @@ static void bnx2x_attn_int(struct bnx2x *bp)
 
 static void bnx2x_sp_task(struct work_struct *work)
 {
-       struct bnx2x *bp = container_of(work, struct bnx2x, sp_task);
+       struct bnx2x *bp = container_of(work, struct bnx2x, sp_task.work);
        u16 status;
 
 
@@ -2844,7 +2872,7 @@ static void bnx2x_sp_task(struct work_struct *work)
        if (status & 0x2)
                bp->stats_pending = 0;
 
-       bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, bp->def_att_idx,
+       bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, le16_to_cpu(bp->def_att_idx),
                     IGU_INT_NOP, 1);
        bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx),
                     IGU_INT_NOP, 1);
@@ -2875,7 +2903,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
                return IRQ_HANDLED;
 #endif
 
-       schedule_work(&bp->sp_task);
+       queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);
 
        return IRQ_HANDLED;
 }
@@ -2892,7 +2920,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
 #define ADD_64(s_hi, a_hi, s_lo, a_lo) \
        do { \
                s_lo += a_lo; \
-               s_hi += a_hi + (s_lo < a_lo) ? 1 : 0; \
+               s_hi += a_hi + ((s_lo < a_lo) ? 1 : 0); \
        } while (0)
 
 /* difference = minuend - subtrahend */
@@ -4496,7 +4524,7 @@ static void bnx2x_init_context(struct bnx2x *bp)
 
 static void bnx2x_init_ind_table(struct bnx2x *bp)
 {
-       int port = BP_PORT(bp);
+       int func = BP_FUNC(bp);
        int i;
 
        if (!is_multi(bp))
@@ -4505,10 +4533,8 @@ static void bnx2x_init_ind_table(struct bnx2x *bp)
        DP(NETIF_MSG_IFUP, "Initializing indirection table\n");
        for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++)
                REG_WR8(bp, BAR_TSTRORM_INTMEM +
-                       TSTORM_INDIRECTION_TABLE_OFFSET(port) + i,
-                       i % bp->num_queues);
-
-       REG_WR(bp, PRS_REG_A_PRSU_20, 0xf);
+                       TSTORM_INDIRECTION_TABLE_OFFSET(func) + i,
+                       BP_CL_ID(bp) + (i % bp->num_queues));
 }
 
 static void bnx2x_set_client_config(struct bnx2x *bp)
@@ -4517,12 +4543,12 @@ static void bnx2x_set_client_config(struct bnx2x *bp)
        int port = BP_PORT(bp);
        int i;
 
-       tstorm_client.mtu = bp->dev->mtu + ETH_OVREHEAD;
+       tstorm_client.mtu = bp->dev->mtu;
        tstorm_client.statistics_counter_id = BP_CL_ID(bp);
        tstorm_client.config_flags =
                                TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE;
 #ifdef BCM_VLAN
-       if (bp->rx_mode && bp->vlgrp) {
+       if (bp->rx_mode && bp->vlgrp && (bp->flags & HW_VLAN_RX_FLAG)) {
                tstorm_client.config_flags |=
                                TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE;
                DP(NETIF_MSG_IFUP, "vlan removal enabled\n");
@@ -4531,7 +4557,7 @@ static void bnx2x_set_client_config(struct bnx2x *bp)
 
        if (bp->flags & TPA_ENABLE_FLAG) {
                tstorm_client.max_sges_for_packet =
-                       BCM_PAGE_ALIGN(tstorm_client.mtu) >> BCM_PAGE_SHIFT;
+                       SGE_PAGE_ALIGN(tstorm_client.mtu) >> SGE_PAGE_SHIFT;
                tstorm_client.max_sges_for_packet =
                        ((tstorm_client.max_sges_for_packet +
                          PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >>
@@ -4714,10 +4740,11 @@ static void bnx2x_init_internal_func(struct bnx2x *bp)
                         bp->e1hov);
        }
 
-       /* Init CQ ring mapping and aggregation size */
-       max_agg_size = min((u32)(bp->rx_buf_size +
-                                8*BCM_PAGE_SIZE*PAGES_PER_SGE),
-                          (u32)0xffff);
+       /* Init CQ ring mapping and aggregation size, the FW limit is 8 frags */
+       max_agg_size =
+               min((u32)(min((u32)8, (u32)MAX_SKB_FRAGS) *
+                         SGE_PAGE_SIZE * PAGES_PER_SGE),
+                   (u32)0xffff);
        for_each_queue(bp, i) {
                struct bnx2x_fastpath *fp = &bp->fp[i];
 
@@ -4785,6 +4812,15 @@ static void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)
        bnx2x_init_context(bp);
        bnx2x_init_internal(bp, load_code);
        bnx2x_init_ind_table(bp);
+       bnx2x_stats_init(bp);
+
+       /* At this point, we are ready for interrupts */
+       atomic_set(&bp->intr_sem, 0);
+
+       /* flush all before enabling interrupts */
+       mb();
+       mmiowb();
+
        bnx2x_int_enable(bp);
 }
 
@@ -5134,7 +5170,6 @@ static int bnx2x_init_common(struct bnx2x *bp)
        REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1);
        REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1);
        REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1);
-       REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 1);
 
 /*     REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */
        REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1);
@@ -5212,6 +5247,7 @@ static int bnx2x_init_common(struct bnx2x *bp)
        }
 
        bnx2x_init_block(bp, PRS_COMMON_START, PRS_COMMON_END);
+       REG_WR(bp, PRS_REG_A_PRSU_20, 0xf);
        /* set NIC mode */
        REG_WR(bp, PRS_REG_NIC_MODE, 1);
        if (CHIP_IS_E1H(bp))
@@ -6393,17 +6429,8 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
                }
        }
 
-       bnx2x_stats_init(bp);
-
        bp->state = BNX2X_STATE_OPENING_WAIT4_PORT;
 
-       /* Enable Rx interrupt handling before sending the ramrod
-          as it's completed on Rx FP queue */
-       bnx2x_napi_enable(bp);
-
-       /* Enable interrupt handling */
-       atomic_set(&bp->intr_sem, 0);
-
        rc = bnx2x_setup_leading(bp);
        if (rc) {
                BNX2X_ERR("Setup leading failed!\n");
@@ -7501,7 +7528,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 
        mutex_init(&bp->port.phy_mutex);
 
-       INIT_WORK(&bp->sp_task, bnx2x_sp_task);
+       INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
        INIT_WORK(&bp->reset_task, bnx2x_reset_task);
 
        rc = bnx2x_get_hwinfo(bp);
@@ -8727,6 +8754,8 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
        tx_bd->general_data = ((UNICAST_ADDRESS <<
                                ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1);
 
+       wmb();
+
        fp->hw_tx_prods->bds_prod =
                cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1);
        mb(); /* FW restriction: must not reorder writing nbd and packets */
@@ -8778,7 +8807,6 @@ test_loopback_rx_exit:
        /* Update producers */
        bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod,
                             fp->rx_sge_prod);
-       mmiowb(); /* keep prod updates ordered */
 
 test_loopback_exit:
        bp->link_params.loopback_mode = LOOPBACK_NONE;
@@ -9549,11 +9577,14 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
           "sending pkt %u @%p  next_idx %u  bd %u @%p\n",
           pkt_prod, tx_buf, fp->tx_pkt_prod, bd_prod, tx_bd);
 
-       if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb)) {
+#ifdef BCM_VLAN
+       if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb) &&
+           (bp->flags & HW_VLAN_TX_FLAG)) {
                tx_bd->vlan = cpu_to_le16(vlan_tx_tag_get(skb));
                tx_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG;
                vlan_off += 4;
        } else
+#endif
                tx_bd->vlan = cpu_to_le16(pkt_prod);
 
        if (xmit_type) {
@@ -9705,6 +9736,15 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d  bd %u\n", nbd, bd_prod);
 
+       /*
+        * Make sure that the BD data is updated before updating the producer
+        * since FW might read the BD right after the producer is updated.
+        * This is only applicable for weak-ordered memory model archs such
+        * as IA-64. The following barrier is also mandatory since FW will
+        * assumes packets must have BDs.
+        */
+       wmb();
+
        fp->hw_tx_prods->bds_prod =
                cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd);
        mb(); /* FW restriction: must not reorder writing nbd and packets */
@@ -9718,6 +9758,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
        dev->trans_start = jiffies;
 
        if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) {
+               /* We want bnx2x_tx_int to "see" the updated tx_bd_prod
+                  if we put Tx into XOFF state. */
+               smp_mb();
                netif_stop_queue(dev);
                bp->eth_stats.driver_xoff++;
                if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3)
@@ -9987,6 +10030,16 @@ static void bnx2x_vlan_rx_register(struct net_device *dev,
        struct bnx2x *bp = netdev_priv(dev);
 
        bp->vlgrp = vlgrp;
+
+       /* Set flags according to the required capabilities */
+       bp->flags &= ~(HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG);
+
+       if (dev->features & NETIF_F_HW_VLAN_TX)
+               bp->flags |= HW_VLAN_TX_FLAG;
+
+       if (dev->features & NETIF_F_HW_VLAN_RX)
+               bp->flags |= HW_VLAN_RX_FLAG;
+
        if (netif_running(dev))
                bnx2x_set_client_config(bp);
 }
@@ -10143,6 +10196,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
                dev->features |= NETIF_F_HIGHDMA;
 #ifdef BCM_VLAN
        dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
+       bp->flags |= (HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG);
 #endif
        dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
        dev->features |= NETIF_F_TSO6;
@@ -10519,12 +10573,20 @@ static struct pci_driver bnx2x_pci_driver = {
 
 static int __init bnx2x_init(void)
 {
+       bnx2x_wq = create_singlethread_workqueue("bnx2x");
+       if (bnx2x_wq == NULL) {
+               printk(KERN_ERR PFX "Cannot create workqueue\n");
+               return -ENOMEM;
+       }
+
        return pci_register_driver(&bnx2x_pci_driver);
 }
 
 static void __exit bnx2x_cleanup(void)
 {
        pci_unregister_driver(&bnx2x_pci_driver);
+
+       destroy_workqueue(bnx2x_wq);
 }
 
 module_init(bnx2x_init);
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 4e6a9195fe5f6503e5bd609098a203186fab936c..ce900e54d8d1dfa7db79e016472c7ce4996631c1 100644 (file)
@@ -795,6 +795,7 @@ static int fs_enet_open(struct net_device *dev)
 
        err = fs_init_phy(dev);
        if (err) {
+               free_irq(fep->interrupt, dev);
                if (fep->fpi->use_napi)
                        napi_disable(&fep->napi);
                return err;
index efcbeb6c8673f569de72465c5eb327da4b2fd3b9..ea530673236ef8e6f46f6ab05c87ba47e1096f02 100644 (file)
@@ -1622,10 +1622,18 @@ static int gfar_clean_tx_ring(struct net_device *dev)
 static void gfar_schedule_cleanup(struct net_device *dev)
 {
        struct gfar_private *priv = netdev_priv(dev);
+       unsigned long flags;
+
+       spin_lock_irqsave(&priv->txlock, flags);
+       spin_lock(&priv->rxlock);
+
        if (netif_rx_schedule_prep(&priv->napi)) {
                gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED);
                __netif_rx_schedule(&priv->napi);
        }
+
+       spin_unlock(&priv->rxlock);
+       spin_unlock_irqrestore(&priv->txlock, flags);
 }
 
 /* Interrupt Handler for Transmit complete */
index ecf9798987fade1915904f6cb011b8f61f93346f..2a2fc17b28780678eff7efaf0f6d17586e09e7c2 100644 (file)
@@ -613,7 +613,9 @@ static int __devinit mal_probe(struct of_device *ofdev,
        INIT_LIST_HEAD(&mal->list);
        spin_lock_init(&mal->lock);
 
-       netif_napi_add(NULL, &mal->napi, mal_poll,
+       init_dummy_netdev(&mal->dummy_dev);
+
+       netif_napi_add(&mal->dummy_dev, &mal->napi, mal_poll,
                       CONFIG_IBM_NEW_EMAC_POLL_WEIGHT);
 
        /* Load power-on reset defaults */
index 2f0a87360844afc3d1dd7eaaf3f3b0ebd6f6510c..9ededfbf0726d3814e55e8c9fe44c003cef72c1d 100644 (file)
@@ -214,6 +214,8 @@ struct mal_instance {
        int                     index;
        spinlock_t              lock;
 
+       struct net_device       dummy_dev;
+
        unsigned int features;
 };
 
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 29118f58a141d56aa925c8f0c353103365191a06..3a22dc41b656f02ec97281e751dd1dc0a38786fb 100644 (file)
@@ -1073,7 +1073,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
 {
        unsigned int i;
        int ret;
-       char stir421x_fw_name[11];
+       char stir421x_fw_name[12];
        const struct firmware *fw;
        const unsigned char *fw_version_ptr; /* pointer to version string */
        unsigned long fw_version = 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 4a5580c1126a00b383e4588b4ab6a2fa5376845e..1d6e48e13366732abf0ab8560600c476cdbf3253 100644 (file)
 #define KORINA_NUM_RDS 64  /* number of receive descriptors */
 #define KORINA_NUM_TDS 64  /* number of transmit descriptors */
 
-#define KORINA_RBSIZE  536 /* size of one resource buffer = Ether MTU */
+/* KORINA_RBSIZE is the hardware's default maximum receive
+ * frame size in bytes. Having this hardcoded means that there
+ * is no support for MTU sizes greater than 1500. */
+#define KORINA_RBSIZE  1536 /* size of one resource buffer = Ether MTU */
 #define KORINA_RDS_MASK        (KORINA_NUM_RDS - 1)
 #define KORINA_TDS_MASK        (KORINA_NUM_TDS - 1)
 #define RD_RING_SIZE   (KORINA_NUM_RDS * sizeof(struct dma_desc))
@@ -196,7 +199,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
        struct korina_private *lp = netdev_priv(dev);
        unsigned long flags;
        u32 length;
-       u32 chain_index;
+       u32 chain_prev, chain_next;
        struct dma_desc *td;
 
        spin_lock_irqsave(&lp->lock, flags);
@@ -228,8 +231,8 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
        /* Setup the transmit descriptor. */
        dma_cache_inv((u32) td, sizeof(*td));
        td->ca = CPHYSADDR(skb->data);
-       chain_index = (lp->tx_chain_tail - 1) &
-                       KORINA_TDS_MASK;
+       chain_prev = (lp->tx_chain_tail - 1) & KORINA_TDS_MASK;
+       chain_next = (lp->tx_chain_tail + 1) & KORINA_TDS_MASK;
 
        if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
                if (lp->tx_chain_status == desc_empty) {
@@ -237,7 +240,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
                        td->control = DMA_COUNT(length) |
                                        DMA_DESC_COF | DMA_DESC_IOF;
                        /* Move tail */
-                       lp->tx_chain_tail = chain_index;
+                       lp->tx_chain_tail = chain_next;
                        /* Write to NDPTR */
                        writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]),
                                        &lp->tx_dma_regs->dmandptr);
@@ -248,12 +251,12 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
                        td->control = DMA_COUNT(length) |
                                        DMA_DESC_COF | DMA_DESC_IOF;
                        /* Link to prev */
-                       lp->td_ring[chain_index].control &=
+                       lp->td_ring[chain_prev].control &=
                                        ~DMA_DESC_COF;
                        /* Link to prev */
-                       lp->td_ring[chain_index].link =  CPHYSADDR(td);
+                       lp->td_ring[chain_prev].link =  CPHYSADDR(td);
                        /* Move tail */
-                       lp->tx_chain_tail = chain_index;
+                       lp->tx_chain_tail = chain_next;
                        /* Write to NDPTR */
                        writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]),
                                        &(lp->tx_dma_regs->dmandptr));
@@ -267,17 +270,16 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev)
                        td->control = DMA_COUNT(length) |
                                        DMA_DESC_COF | DMA_DESC_IOF;
                        /* Move tail */
-                       lp->tx_chain_tail = chain_index;
+                       lp->tx_chain_tail = chain_next;
                        lp->tx_chain_status = desc_filled;
-                       netif_stop_queue(dev);
                } else {
                        /* Update tail */
                        td->control = DMA_COUNT(length) |
                                        DMA_DESC_COF | DMA_DESC_IOF;
-                       lp->td_ring[chain_index].control &=
+                       lp->td_ring[chain_prev].control &=
                                        ~DMA_DESC_COF;
-                       lp->td_ring[chain_index].link =  CPHYSADDR(td);
-                       lp->tx_chain_tail = chain_index;
+                       lp->td_ring[chain_prev].link =  CPHYSADDR(td);
+                       lp->tx_chain_tail = chain_next;
                }
        }
        dma_cache_wback((u32) td, sizeof(*td));
@@ -327,13 +329,13 @@ static irqreturn_t korina_rx_dma_interrupt(int irq, void *dev_id)
 
        dmas = readl(&lp->rx_dma_regs->dmas);
        if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) {
-               netif_rx_schedule_prep(&lp->napi);
-
                dmasm = readl(&lp->rx_dma_regs->dmasm);
                writel(dmasm | (DMA_STAT_DONE |
                                DMA_STAT_HALT | DMA_STAT_ERR),
                                &lp->rx_dma_regs->dmasm);
 
+               netif_rx_schedule(&lp->napi);
+
                if (dmas & DMA_STAT_ERR)
                        printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name);
 
@@ -350,15 +352,20 @@ static int korina_rx(struct net_device *dev, int limit)
        struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done];
        struct sk_buff *skb, *skb_new;
        u8 *pkt_buf;
-       u32 devcs, pkt_len, dmas, rx_free_desc;
+       u32 devcs, pkt_len, dmas;
        int count;
 
        dma_cache_inv((u32)rd, sizeof(*rd));
 
        for (count = 0; count < limit; count++) {
+               skb = lp->rx_skb[lp->rx_next_done];
+               skb_new = NULL;
 
                devcs = rd->devcs;
 
+               if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0)
+                       break;
+
                /* Update statistics counters */
                if (devcs & ETH_RX_CRC)
                        dev->stats.rx_crc_errors++;
@@ -381,63 +388,55 @@ static int korina_rx(struct net_device *dev, int limit)
                         * in Rc32434 (errata ref #077) */
                        dev->stats.rx_errors++;
                        dev->stats.rx_dropped++;
-               }
-
-               while ((rx_free_desc = KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
-                       /* init the var. used for the later
-                        * operations within the while loop */
-                       skb_new = NULL;
+               } else if ((devcs & ETH_RX_ROK)) {
                        pkt_len = RCVPKT_LENGTH(devcs);
-                       skb = lp->rx_skb[lp->rx_next_done];
-
-                       if ((devcs & ETH_RX_ROK)) {
-                               /* must be the (first and) last
-                                * descriptor then */
-                               pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data;
-
-                               /* invalidate the cache */
-                               dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4);
-
-                               /* Malloc up new buffer. */
-                               skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2);
-
-                               if (!skb_new)
-                                       break;
-                               /* Do not count the CRC */
-                               skb_put(skb, pkt_len - 4);
-                               skb->protocol = eth_type_trans(skb, dev);
-
-                               /* Pass the packet to upper layers */
-                               netif_receive_skb(skb);
-                               dev->stats.rx_packets++;
-                               dev->stats.rx_bytes += pkt_len;
-
-                               /* Update the mcast stats */
-                               if (devcs & ETH_RX_MP)
-                                       dev->stats.multicast++;
-
-                               lp->rx_skb[lp->rx_next_done] = skb_new;
-                       }
-
-                       rd->devcs = 0;
-
-                       /* Restore descriptor's curr_addr */
-                       if (skb_new)
-                               rd->ca = CPHYSADDR(skb_new->data);
-                       else
-                               rd->ca = CPHYSADDR(skb->data);
-
-                       rd->control = DMA_COUNT(KORINA_RBSIZE) |
-                               DMA_DESC_COD | DMA_DESC_IOD;
-                       lp->rd_ring[(lp->rx_next_done - 1) &
-                               KORINA_RDS_MASK].control &=
-                               ~DMA_DESC_COD;
-
-                       lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK;
-                       dma_cache_wback((u32)rd, sizeof(*rd));
-                       rd = &lp->rd_ring[lp->rx_next_done];
-                       writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas);
+
+                       /* must be the (first and) last
+                        * descriptor then */
+                       pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data;
+
+                       /* invalidate the cache */
+                       dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4);
+
+                       /* Malloc up new buffer. */
+                       skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2);
+
+                       if (!skb_new)
+                               break;
+                       /* Do not count the CRC */
+                       skb_put(skb, pkt_len - 4);
+                       skb->protocol = eth_type_trans(skb, dev);
+
+                       /* Pass the packet to upper layers */
+                       netif_receive_skb(skb);
+                       dev->stats.rx_packets++;
+                       dev->stats.rx_bytes += pkt_len;
+
+                       /* Update the mcast stats */
+                       if (devcs & ETH_RX_MP)
+                               dev->stats.multicast++;
+
+                       lp->rx_skb[lp->rx_next_done] = skb_new;
                }
+
+               rd->devcs = 0;
+
+               /* Restore descriptor's curr_addr */
+               if (skb_new)
+                       rd->ca = CPHYSADDR(skb_new->data);
+               else
+                       rd->ca = CPHYSADDR(skb->data);
+
+               rd->control = DMA_COUNT(KORINA_RBSIZE) |
+                       DMA_DESC_COD | DMA_DESC_IOD;
+               lp->rd_ring[(lp->rx_next_done - 1) &
+                       KORINA_RDS_MASK].control &=
+                       ~DMA_DESC_COD;
+
+               lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK;
+               dma_cache_wback((u32)rd, sizeof(*rd));
+               rd = &lp->rd_ring[lp->rx_next_done];
+               writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas);
        }
 
        dmas = readl(&lp->rx_dma_regs->dmas);
@@ -623,12 +622,12 @@ korina_tx_dma_interrupt(int irq, void *dev_id)
        dmas = readl(&lp->tx_dma_regs->dmas);
 
        if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) {
-               korina_tx(dev);
-
                dmasm = readl(&lp->tx_dma_regs->dmasm);
                writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR),
                                &lp->tx_dma_regs->dmasm);
 
+               korina_tx(dev);
+
                if (lp->tx_chain_status == desc_filled &&
                        (readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
                        writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]),
@@ -901,6 +900,8 @@ static int korina_restart(struct net_device *dev)
 
        korina_free_ring(dev);
 
+       napi_disable(&lp->napi);
+
        ret = korina_init(dev);
        if (ret < 0) {
                printk(KERN_ERR DRV_NAME "%s: cannot restart device\n",
@@ -999,14 +1000,14 @@ static int korina_open(struct net_device *dev)
         * that handles the Done Finished
         * Ovr and Und Events */
        ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt,
-               IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Rx", dev);
+                       IRQF_DISABLED, "Korina ethernet Rx", dev);
        if (ret < 0) {
                printk(KERN_ERR DRV_NAME "%s: unable to get Rx DMA IRQ %d\n",
                    dev->name, lp->rx_irq);
                goto err_release;
        }
        ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt,
-               IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Tx", dev);
+                       IRQF_DISABLED, "Korina ethernet Tx", dev);
        if (ret < 0) {
                printk(KERN_ERR DRV_NAME "%s: unable to get Tx DMA IRQ %d\n",
                    dev->name, lp->tx_irq);
@@ -1015,7 +1016,7 @@ static int korina_open(struct net_device *dev)
 
        /* Install handler for overrun error. */
        ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt,
-                       IRQF_SHARED | IRQF_DISABLED, "Ethernet Overflow", dev);
+                       IRQF_DISABLED, "Ethernet Overflow", dev);
        if (ret < 0) {
                printk(KERN_ERR DRV_NAME"%s: unable to get OVR IRQ %d\n",
                    dev->name, lp->ovr_irq);
@@ -1024,7 +1025,7 @@ static int korina_open(struct net_device *dev)
 
        /* Install handler for underflow error. */
        ret = request_irq(lp->und_irq, &korina_und_interrupt,
-                       IRQF_SHARED | IRQF_DISABLED, "Ethernet Underflow", dev);
+                       IRQF_DISABLED, "Ethernet Underflow", dev);
        if (ret < 0) {
                printk(KERN_ERR DRV_NAME "%s: unable to get UND IRQ %d\n",
                    dev->name, lp->und_irq);
@@ -1067,6 +1068,8 @@ static int korina_close(struct net_device *dev)
 
        korina_free_ring(dev);
 
+       napi_disable(&lp->napi);
+
        free_irq(lp->rx_irq, dev);
        free_irq(lp->tx_irq, dev);
        free_irq(lp->ovr_irq, dev);
@@ -1089,7 +1092,6 @@ static int korina_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        SET_NETDEV_DEV(dev, &pdev->dev);
-       platform_set_drvdata(pdev, dev);
        lp = netdev_priv(dev);
 
        bif->dev = dev;
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 f8e601c51da71e011ccd0f141b328d29040f2817..c11c568fd7db642fbd83ecc1095530598272e742 100644 (file)
@@ -308,27 +308,16 @@ struct netxen_ring_ctx {
 #define netxen_set_cmd_desc_ctxid(cmd_desc, var)       \
        ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0))
 
-#define netxen_set_cmd_desc_flags(cmd_desc, val)       \
-       (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \
-               ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f)
-#define netxen_set_cmd_desc_opcode(cmd_desc, val)      \
-       (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \
-               ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7)
-
-#define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \
-       (cmd_desc)->num_of_buffers_total_length = \
-               ((cmd_desc)->num_of_buffers_total_length & \
-               ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff)
-#define netxen_set_cmd_desc_totallength(cmd_desc, val) \
-       (cmd_desc)->num_of_buffers_total_length = \
-               ((cmd_desc)->num_of_buffers_total_length & \
-               ~cpu_to_le32((u32)0xffffff << 8)) | \
-               cpu_to_le32(((val) & 0xffffff) << 8)
-
-#define netxen_get_cmd_desc_opcode(cmd_desc)   \
-       ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f)
-#define netxen_get_cmd_desc_totallength(cmd_desc)      \
-       ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff)
+#define netxen_set_tx_port(_desc, _port) \
+       (_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0)
+
+#define netxen_set_tx_flags_opcode(_desc, _flags, _opcode) \
+       (_desc)->flags_opcode = \
+       cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7))
+
+#define netxen_set_tx_frags_len(_desc, _frags, _len) \
+       (_desc)->num_of_buffers_total_length = \
+       cpu_to_le32(((_frags) & 0xff) | (((_len) & 0xffffff) << 8))
 
 struct cmd_desc_type0 {
        u8 tcp_hdr_offset;      /* For LSO only */
@@ -510,7 +499,8 @@ typedef enum {
        NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a,
        NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b,
        NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031,
-       NETXEN_BRDTYPE_P3_10G_XFP = 0x0032
+       NETXEN_BRDTYPE_P3_10G_XFP = 0x0032,
+       NETXEN_BRDTYPE_P3_10G_TP = 0x0080
 
 } netxen_brdtype_t;
 
@@ -757,7 +747,7 @@ extern char netxen_nic_driver_name[];
  */
 struct netxen_skb_frag {
        u64 dma;
-       u32 length;
+       ulong length;
 };
 
 #define _netxen_set_bits(config_word, start, bits, val)        {\
@@ -783,13 +773,7 @@ struct netxen_skb_frag {
 struct netxen_cmd_buffer {
        struct sk_buff *skb;
        struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1];
-       u32 total_length;
-       u32 mss;
-       u16 port;
-       u8 cmd;
-       u8 frag_count;
-       unsigned long time_stamp;
-       u32 state;
+       u32 frag_count;
 };
 
 /* In rx_buffer, we do not need multiple fragments as is a single buffer */
@@ -876,7 +860,6 @@ struct nx_host_rds_ring {
        u32 skb_size;
        struct netxen_rx_buffer *rx_buf_arr;    /* rx buffers for receive   */
        struct list_head free_list;
-       int begin_alloc;
 };
 
 /*
@@ -995,31 +978,31 @@ struct netxen_recv_context {
  */
 
 typedef struct {
-       u64 host_phys_addr;     /* Ring base addr */
-       u32 ring_size;          /* Ring entries */
-       u16 msi_index;
-       u16 rsvd;               /* Padding */
+       __le64 host_phys_addr;  /* Ring base addr */
+       __le32 ring_size;               /* Ring entries */
+       __le16 msi_index;
+       __le16 rsvd;            /* Padding */
 } nx_hostrq_sds_ring_t;
 
 typedef struct {
-       u64 host_phys_addr;     /* Ring base addr */
-       u64 buff_size;          /* Packet buffer size */
-       u32 ring_size;          /* Ring entries */
-       u32 ring_kind;          /* Class of ring */
+       __le64 host_phys_addr;  /* Ring base addr */
+       __le64 buff_size;               /* Packet buffer size */
+       __le32 ring_size;               /* Ring entries */
+       __le32 ring_kind;               /* Class of ring */
 } nx_hostrq_rds_ring_t;
 
 typedef struct {
-       u64 host_rsp_dma_addr;  /* Response dma'd here */
-       u32 capabilities[4];    /* Flag bit vector */
-       u32 host_int_crb_mode;  /* Interrupt crb usage */
-       u32 host_rds_crb_mode;  /* RDS crb usage */
+       __le64 host_rsp_dma_addr;       /* Response dma'd here */
+       __le32 capabilities[4]; /* Flag bit vector */
+       __le32 host_int_crb_mode;       /* Interrupt crb usage */
+       __le32 host_rds_crb_mode;       /* RDS crb usage */
        /* These ring offsets are relative to data[0] below */
-       u32 rds_ring_offset;    /* Offset to RDS config */
-       u32 sds_ring_offset;    /* Offset to SDS config */
-       u16 num_rds_rings;      /* Count of RDS rings */
-       u16 num_sds_rings;      /* Count of SDS rings */
-       u16 rsvd1;              /* Padding */
-       u16 rsvd2;              /* Padding */
+       __le32 rds_ring_offset; /* Offset to RDS config */
+       __le32 sds_ring_offset; /* Offset to SDS config */
+       __le16 num_rds_rings;   /* Count of RDS rings */
+       __le16 num_sds_rings;   /* Count of SDS rings */
+       __le16 rsvd1;           /* Padding */
+       __le16 rsvd2;           /* Padding */
        u8  reserved[128];      /* reserve space for future expansion*/
        /* MUST BE 64-bit aligned.
           The following is packed:
@@ -1029,24 +1012,24 @@ typedef struct {
 } nx_hostrq_rx_ctx_t;
 
 typedef struct {
-       u32 host_producer_crb;  /* Crb to use */
-       u32 rsvd1;              /* Padding */
+       __le32 host_producer_crb;       /* Crb to use */
+       __le32 rsvd1;           /* Padding */
 } nx_cardrsp_rds_ring_t;
 
 typedef struct {
-       u32 host_consumer_crb;  /* Crb to use */
-       u32 interrupt_crb;      /* Crb to use */
+       __le32 host_consumer_crb;       /* Crb to use */
+       __le32 interrupt_crb;   /* Crb to use */
 } nx_cardrsp_sds_ring_t;
 
 typedef struct {
        /* These ring offsets are relative to data[0] below */
-       u32 rds_ring_offset;    /* Offset to RDS config */
-       u32 sds_ring_offset;    /* Offset to SDS config */
-       u32 host_ctx_state;     /* Starting State */
-       u32 num_fn_per_port;    /* How many PCI fn share the port */
-       u16 num_rds_rings;      /* Count of RDS rings */
-       u16 num_sds_rings;      /* Count of SDS rings */
-       u16 context_id;         /* Handle for context */
+       __le32 rds_ring_offset; /* Offset to RDS config */
+       __le32 sds_ring_offset; /* Offset to SDS config */
+       __le32 host_ctx_state;  /* Starting State */
+       __le32 num_fn_per_port; /* How many PCI fn share the port */
+       __le16 num_rds_rings;   /* Count of RDS rings */
+       __le16 num_sds_rings;   /* Count of SDS rings */
+       __le16 context_id;              /* Handle for context */
        u8  phys_port;          /* Physical id of port */
        u8  virt_port;          /* Virtual/Logical id of port */
        u8  reserved[128];      /* save space for future expansion */
@@ -1072,34 +1055,34 @@ typedef struct {
  */
 
 typedef struct {
-       u64 host_phys_addr;     /* Ring base addr */
-       u32 ring_size;          /* Ring entries */
-       u32 rsvd;               /* Padding */
+       __le64 host_phys_addr;  /* Ring base addr */
+       __le32 ring_size;               /* Ring entries */
+       __le32 rsvd;            /* Padding */
 } nx_hostrq_cds_ring_t;
 
 typedef struct {
-       u64 host_rsp_dma_addr;  /* Response dma'd here */
-       u64 cmd_cons_dma_addr;  /*  */
-       u64 dummy_dma_addr;     /*  */
-       u32 capabilities[4];    /* Flag bit vector */
-       u32 host_int_crb_mode;  /* Interrupt crb usage */
-       u32 rsvd1;              /* Padding */
-       u16 rsvd2;              /* Padding */
-       u16 interrupt_ctl;
-       u16 msi_index;
-       u16 rsvd3;              /* Padding */
+       __le64 host_rsp_dma_addr;       /* Response dma'd here */
+       __le64 cmd_cons_dma_addr;       /*  */
+       __le64 dummy_dma_addr;  /*  */
+       __le32 capabilities[4]; /* Flag bit vector */
+       __le32 host_int_crb_mode;       /* Interrupt crb usage */
+       __le32 rsvd1;           /* Padding */
+       __le16 rsvd2;           /* Padding */
+       __le16 interrupt_ctl;
+       __le16 msi_index;
+       __le16 rsvd3;           /* Padding */
        nx_hostrq_cds_ring_t cds_ring;  /* Desc of cds ring */
        u8  reserved[128];      /* future expansion */
 } nx_hostrq_tx_ctx_t;
 
 typedef struct {
-       u32 host_producer_crb;  /* Crb to use */
-       u32 interrupt_crb;      /* Crb to use */
+       __le32 host_producer_crb;       /* Crb to use */
+       __le32 interrupt_crb;   /* Crb to use */
 } nx_cardrsp_cds_ring_t;
 
 typedef struct {
-       u32 host_ctx_state;     /* Starting state */
-       u16 context_id;         /* Handle for context */
+       __le32 host_ctx_state;  /* Starting state */
+       __le16 context_id;              /* Handle for context */
        u8  phys_port;          /* Physical id of port */
        u8  virt_port;          /* Virtual/Logical id of port */
        nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */
@@ -1202,9 +1185,9 @@ enum {
 #define VPORT_MISS_MODE_ACCEPT_MULTI   2 /* accept unmatched multicast */
 
 typedef struct {
-       u64 qhdr;
-       u64 req_hdr;
-       u64 words[6];
+       __le64 qhdr;
+       __le64 req_hdr;
+       __le64 words[6];
 } nx_nic_req_t;
 
 typedef struct {
@@ -1486,8 +1469,6 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter);
 
 void netxen_initialize_adapter_ops(struct netxen_adapter *adapter);
 int netxen_init_firmware(struct netxen_adapter *adapter);
-void netxen_tso_check(struct netxen_adapter *adapter,
-                     struct cmd_desc_type0 *desc, struct sk_buff *skb);
 void netxen_nic_clear_stats(struct netxen_adapter *adapter);
 void netxen_watchdog_task(struct work_struct *work);
 void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx,
@@ -1496,6 +1477,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter);
 u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max);
 void netxen_p2_nic_set_multi(struct net_device *netdev);
 void netxen_p3_nic_set_multi(struct net_device *netdev);
+void netxen_p3_free_mac_list(struct netxen_adapter *adapter);
 int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32);
 int netxen_config_intr_coalesce(struct netxen_adapter *adapter);
 
index 64b51643c626c366f89df716d4569195e75d57c5..746bdb4704181e94494b2ea694c4d4c9e431fe19 100644 (file)
@@ -76,7 +76,7 @@ netxen_api_unlock(struct netxen_adapter *adapter)
 static u32
 netxen_poll_rsp(struct netxen_adapter *adapter)
 {
-       u32 raw_rsp, rsp = NX_CDRP_RSP_OK;
+       u32 rsp = NX_CDRP_RSP_OK;
        int     timeout = 0;
 
        do {
@@ -86,10 +86,7 @@ netxen_poll_rsp(struct netxen_adapter *adapter)
                if (++timeout > NX_OS_CRB_RETRY_COUNT)
                        return NX_CDRP_RSP_TIMEOUT;
 
-               netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET,
-                               &raw_rsp);
-
-               rsp = le32_to_cpu(raw_rsp);
+               netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, &rsp);
        } while (!NX_CDRP_IS_RSP(rsp));
 
        return rsp;
@@ -109,20 +106,16 @@ netxen_issue_cmd(struct netxen_adapter *adapter,
        if (netxen_api_lock(adapter))
                return NX_RCODE_TIMEOUT;
 
-       netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET,
-                       cpu_to_le32(signature));
+       netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, signature);
 
-       netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET,
-                       cpu_to_le32(arg1));
+       netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, arg1);
 
-       netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET,
-                       cpu_to_le32(arg2));
+       netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, arg2);
 
-       netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET,
-                       cpu_to_le32(arg3));
+       netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, arg3);
 
        netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET,
-                       cpu_to_le32(NX_CDRP_FORM_CMD(cmd)));
+                       NX_CDRP_FORM_CMD(cmd));
 
        rsp = netxen_poll_rsp(adapter);
 
@@ -133,7 +126,6 @@ netxen_issue_cmd(struct netxen_adapter *adapter,
                rcode = NX_RCODE_TIMEOUT;
        } else if (rsp == NX_CDRP_RSP_FAIL) {
                netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET, &rcode);
-               rcode = le32_to_cpu(rcode);
 
                printk(KERN_ERR "%s: failed card response code:0x%x\n",
                                netxen_nic_driver_name, rcode);
@@ -183,7 +175,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 
        int i, nrds_rings, nsds_rings;
        size_t rq_size, rsp_size;
-       u32 cap, reg;
+       u32 cap, reg, val;
 
        int err;
 
@@ -225,11 +217,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 
        prq->num_rds_rings = cpu_to_le16(nrds_rings);
        prq->num_sds_rings = cpu_to_le16(nsds_rings);
-       prq->rds_ring_offset = 0;
-       prq->sds_ring_offset = prq->rds_ring_offset +
+       prq->rds_ring_offset = cpu_to_le32(0);
+
+       val = le32_to_cpu(prq->rds_ring_offset) +
                (sizeof(nx_hostrq_rds_ring_t) * nrds_rings);
+       prq->sds_ring_offset = cpu_to_le32(val);
 
-       prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + prq->rds_ring_offset);
+       prq_rds = (nx_hostrq_rds_ring_t *)(prq->data +
+                       le32_to_cpu(prq->rds_ring_offset));
 
        for (i = 0; i < nrds_rings; i++) {
 
@@ -241,17 +236,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
                prq_rds[i].buff_size = cpu_to_le64(rds_ring->dma_size);
        }
 
-       prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + prq->sds_ring_offset);
+       prq_sds = (nx_hostrq_sds_ring_t *)(prq->data +
+                       le32_to_cpu(prq->sds_ring_offset));
 
        prq_sds[0].host_phys_addr =
                cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr);
        prq_sds[0].ring_size = cpu_to_le32(adapter->max_rx_desc_count);
        /* only one msix vector for now */
-       prq_sds[0].msi_index = cpu_to_le32(0);
-
-       /* now byteswap offsets */
-       prq->rds_ring_offset = cpu_to_le32(prq->rds_ring_offset);
-       prq->sds_ring_offset = cpu_to_le32(prq->sds_ring_offset);
+       prq_sds[0].msi_index = cpu_to_le16(0);
 
        phys_addr = hostrq_phys_addr;
        err = netxen_issue_cmd(adapter,
@@ -269,9 +261,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 
 
        prsp_rds = ((nx_cardrsp_rds_ring_t *)
-                        &prsp->data[prsp->rds_ring_offset]);
+                        &prsp->data[le32_to_cpu(prsp->rds_ring_offset)]);
 
-       for (i = 0; i < le32_to_cpu(prsp->num_rds_rings); i++) {
+       for (i = 0; i < le16_to_cpu(prsp->num_rds_rings); i++) {
                rds_ring = &recv_ctx->rds_rings[i];
 
                reg = le32_to_cpu(prsp_rds[i].host_producer_crb);
@@ -279,7 +271,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
        }
 
        prsp_sds = ((nx_cardrsp_sds_ring_t *)
-                       &prsp->data[prsp->sds_ring_offset]);
+                       &prsp->data[le32_to_cpu(prsp->sds_ring_offset)]);
        reg = le32_to_cpu(prsp_sds[0].host_consumer_crb);
        recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200);
 
@@ -288,7 +280,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
 
        recv_ctx->state = le32_to_cpu(prsp->host_ctx_state);
        recv_ctx->context_id = le16_to_cpu(prsp->context_id);
-       recv_ctx->virt_port = le16_to_cpu(prsp->virt_port);
+       recv_ctx->virt_port = prsp->virt_port;
 
 out_free_rsp:
        pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr);
index e45ce29517299a140ff4c8ee6dfb9c66768ef177..c0bd40fcf708e0caa92c7c5f96a1af5c5fe7b618 100644 (file)
@@ -136,11 +136,9 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 
                ecmd->port = PORT_TP;
 
-               if (netif_running(dev)) {
-                       ecmd->speed = adapter->link_speed;
-                       ecmd->duplex = adapter->link_duplex;
-                       ecmd->autoneg = adapter->link_autoneg;
-               }
+               ecmd->speed = adapter->link_speed;
+               ecmd->duplex = adapter->link_duplex;
+               ecmd->autoneg = adapter->link_autoneg;
 
        } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
                u32 val;
@@ -171,7 +169,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
        } else
                return -EIO;
 
-       ecmd->phy_address = adapter->portnum;
+       ecmd->phy_address = adapter->physical_port;
        ecmd->transceiver = XCVR_EXTERNAL;
 
        switch ((netxen_brdtype_t) boardinfo->board_type) {
@@ -180,13 +178,13 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
        case NETXEN_BRDTYPE_P3_REF_QG:
        case NETXEN_BRDTYPE_P3_4_GB:
        case NETXEN_BRDTYPE_P3_4_GB_MM:
-       case NETXEN_BRDTYPE_P3_10000_BASE_T:
 
                ecmd->supported |= SUPPORTED_Autoneg;
                ecmd->advertising |= ADVERTISED_Autoneg;
        case NETXEN_BRDTYPE_P2_SB31_10G_CX4:
        case NETXEN_BRDTYPE_P3_10G_CX4:
        case NETXEN_BRDTYPE_P3_10G_CX4_LP:
+       case NETXEN_BRDTYPE_P3_10000_BASE_T:
                ecmd->supported |= SUPPORTED_TP;
                ecmd->advertising |= ADVERTISED_TP;
                ecmd->port = PORT_TP;
@@ -204,16 +202,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
                ecmd->port = PORT_FIBRE;
                ecmd->autoneg = AUTONEG_DISABLE;
                break;
-       case NETXEN_BRDTYPE_P2_SB31_10G:
        case NETXEN_BRDTYPE_P3_10G_SFP_PLUS:
        case NETXEN_BRDTYPE_P3_10G_SFP_CT:
        case NETXEN_BRDTYPE_P3_10G_SFP_QT:
+               ecmd->advertising |= ADVERTISED_TP;
+               ecmd->supported |= SUPPORTED_TP;
+       case NETXEN_BRDTYPE_P2_SB31_10G:
        case NETXEN_BRDTYPE_P3_10G_XFP:
                ecmd->supported |= SUPPORTED_FIBRE;
                ecmd->advertising |= ADVERTISED_FIBRE;
                ecmd->port = PORT_FIBRE;
                ecmd->autoneg = AUTONEG_DISABLE;
                break;
+       case NETXEN_BRDTYPE_P3_10G_TP:
+               if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
+                       ecmd->autoneg = AUTONEG_DISABLE;
+                       ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP);
+                       ecmd->advertising |=
+                               (ADVERTISED_FIBRE | ADVERTISED_TP);
+                       ecmd->port = PORT_FIBRE;
+               } else {
+                       ecmd->autoneg = AUTONEG_ENABLE;
+                       ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg);
+                       ecmd->advertising |=
+                               (ADVERTISED_TP | ADVERTISED_Autoneg);
+                       ecmd->port = PORT_TP;
+               }
+               break;
        default:
                printk(KERN_ERR "netxen-nic: Unsupported board model %d\n",
                       (netxen_brdtype_t) boardinfo->board_type);
index aa6e603bfcbf701e9a95b504ff00ea67f7afd04b..821cff68b3f302c9fa7260215583e113e971b051 100644 (file)
@@ -503,17 +503,15 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
 
        i = 0;
 
+       netif_tx_lock_bh(adapter->netdev);
+
        producer = adapter->cmd_producer;
        do {
                cmd_desc = &cmd_desc_arr[i];
 
                pbuf = &adapter->cmd_buf_arr[producer];
-               pbuf->mss = 0;
-               pbuf->total_length = 0;
                pbuf->skb = NULL;
-               pbuf->cmd = 0;
                pbuf->frag_count = 0;
-               pbuf->port = 0;
 
                /* adapter->ahw.cmd_desc_head[producer] = *cmd_desc; */
                memcpy(&adapter->ahw.cmd_desc_head[producer],
@@ -531,6 +529,8 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
 
        netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer);
 
+       netif_tx_unlock_bh(adapter->netdev);
+
        return 0;
 }
 
@@ -539,16 +539,19 @@ static int nx_p3_sre_macaddr_change(struct net_device *dev,
 {
        struct netxen_adapter *adapter = netdev_priv(dev);
        nx_nic_req_t req;
-       nx_mac_req_t mac_req;
+       nx_mac_req_t *mac_req;
+       u64 word;
        int rv;
 
        memset(&req, 0, sizeof(nx_nic_req_t));
-       req.qhdr |= (NX_NIC_REQUEST << 23);
-       req.req_hdr |= NX_MAC_EVENT;
-       req.req_hdr |= ((u64)adapter->portnum << 16);
-       mac_req.op = op;
-       memcpy(&mac_req.mac_addr, addr, 6);
-       req.words[0] = cpu_to_le64(*(u64 *)&mac_req);
+       req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23);
+
+       word = NX_MAC_EVENT | ((u64)adapter->portnum << 16);
+       req.req_hdr = cpu_to_le64(word);
+
+       mac_req = (nx_mac_req_t *)&req.words[0];
+       mac_req->op = op;
+       memcpy(mac_req->mac_addr, addr, 6);
 
        rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
        if (rv != 0) {
@@ -612,18 +615,35 @@ send_fw_cmd:
 int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
 {
        nx_nic_req_t req;
+       u64 word;
 
        memset(&req, 0, sizeof(nx_nic_req_t));
 
-       req.qhdr |= (NX_HOST_REQUEST << 23);
-       req.req_hdr |= NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE;
-       req.req_hdr |= ((u64)adapter->portnum << 16);
+       req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23);
+
+       word = NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE |
+                       ((u64)adapter->portnum << 16);
+       req.req_hdr = cpu_to_le64(word);
+
        req.words[0] = cpu_to_le64(mode);
 
        return netxen_send_cmd_descs(adapter,
                                (struct cmd_desc_type0 *)&req, 1);
 }
 
+void netxen_p3_free_mac_list(struct netxen_adapter *adapter)
+{
+       nx_mac_list_t *cur, *next;
+
+       cur = adapter->mac_list;
+
+       while (cur) {
+               next = cur->next;
+               kfree(cur);
+               cur = next;
+       }
+}
+
 #define        NETXEN_CONFIG_INTR_COALESCE     3
 
 /*
@@ -632,13 +652,15 @@ int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
 int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
 {
        nx_nic_req_t req;
+       u64 word;
        int rv;
 
        memset(&req, 0, sizeof(nx_nic_req_t));
 
-       req.qhdr |= (NX_NIC_REQUEST << 23);
-       req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE;
-       req.req_hdr |= ((u64)adapter->portnum << 16);
+       req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23);
+
+       word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16);
+       req.req_hdr = cpu_to_le64(word);
 
        memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal));
 
@@ -772,13 +794,10 @@ int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac)
        adapter->hw_read_wx(adapter, crbaddr, &mac_lo, 4);
        adapter->hw_read_wx(adapter, crbaddr+4, &mac_hi, 4);
 
-       mac_hi = cpu_to_le32(mac_hi);
-       mac_lo = cpu_to_le32(mac_lo);
-
        if (pci_func & 1)
-               *mac = ((mac_lo >> 16) | ((u64)mac_hi << 16));
+               *mac = le64_to_cpu((mac_lo >> 16) | ((u64)mac_hi << 16));
        else
-               *mac = ((mac_lo) | ((u64)mac_hi << 32));
+               *mac = le64_to_cpu((u64)mac_lo | ((u64)mac_hi << 32));
 
        return 0;
 }
@@ -937,7 +956,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter)
 {
        int i;
        u32 data, size = 0;
-       u32 flashaddr = NETXEN_BOOTLD_START, memaddr = NETXEN_BOOTLD_START;
+       u32 flashaddr = NETXEN_BOOTLD_START;
 
        size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4;
 
@@ -949,10 +968,8 @@ int netxen_load_firmware(struct netxen_adapter *adapter)
                if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0)
                        return -EIO;
 
-               adapter->pci_mem_write(adapter, memaddr, &data, 4);
+               adapter->pci_mem_write(adapter, flashaddr, &data, 4);
                flashaddr += 4;
-               memaddr += 4;
-               cond_resched();
        }
        msleep(1);
 
@@ -2034,7 +2051,13 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
                rv = -1;
        }
 
-       DPRINTK(INFO, "Discovered board type:0x%x  ", boardinfo->board_type);
+       if (boardinfo->board_type == NETXEN_BRDTYPE_P3_4_GB_MM) {
+               u32 gpio = netxen_nic_reg_read(adapter,
+                               NETXEN_ROMUSB_GLB_PAD_GPIO_I);
+               if ((gpio & 0x8000) == 0)
+                       boardinfo->board_type = NETXEN_BRDTYPE_P3_10G_TP;
+       }
+
        switch ((netxen_brdtype_t) boardinfo->board_type) {
        case NETXEN_BRDTYPE_P2_SB35_4G:
                adapter->ahw.board_type = NETXEN_NIC_GBE;
@@ -2053,7 +2076,6 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_10G_SFP_QT:
        case NETXEN_BRDTYPE_P3_10G_XFP:
        case NETXEN_BRDTYPE_P3_10000_BASE_T:
-
                adapter->ahw.board_type = NETXEN_NIC_XGBE;
                break;
        case NETXEN_BRDTYPE_P1_BD:
@@ -2063,9 +2085,12 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_REF_QG:
        case NETXEN_BRDTYPE_P3_4_GB:
        case NETXEN_BRDTYPE_P3_4_GB_MM:
-
                adapter->ahw.board_type = NETXEN_NIC_GBE;
                break;
+       case NETXEN_BRDTYPE_P3_10G_TP:
+               adapter->ahw.board_type = (adapter->portnum < 2) ?
+                       NETXEN_NIC_XGBE : NETXEN_NIC_GBE;
+               break;
        default:
                printk("%s: Unknown(%x)\n", netxen_nic_driver_name,
                       boardinfo->board_type);
@@ -2110,12 +2135,16 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
 {
        __u32 status;
        __u32 autoneg;
-       __u32 mode;
        __u32 port_mode;
 
-       netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode);
-       if (netxen_get_niu_enable_ge(mode)) {   /* Gb 10/100/1000 Mbps mode */
+       if (!netif_carrier_ok(adapter->netdev)) {
+               adapter->link_speed   = 0;
+               adapter->link_duplex  = -1;
+               adapter->link_autoneg = AUTONEG_ENABLE;
+               return;
+       }
 
+       if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
                adapter->hw_read_wx(adapter,
                                NETXEN_PORT_MODE_ADDR, &port_mode, 4);
                if (port_mode == NETXEN_PORT_MODE_802_3_AP) {
@@ -2141,7 +2170,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
                                        adapter->link_speed = SPEED_1000;
                                        break;
                                default:
-                                       adapter->link_speed = -1;
+                                       adapter->link_speed = 0;
                                        break;
                                }
                                switch (netxen_get_phy_duplex(status)) {
@@ -2164,7 +2193,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
                                goto link_down;
                } else {
                      link_down:
-                       adapter->link_speed = -1;
+                       adapter->link_speed = 0;
                        adapter->link_duplex = -1;
                }
        }
index d924468e506eb48af997a075ad3b51d69800b876..ca7c8d8050c998b158e451efe975be219b549771 100644 (file)
@@ -308,7 +308,6 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
                        }
                        memset(rds_ring->rx_buf_arr, 0, RCV_BUFFSIZE);
                        INIT_LIST_HEAD(&rds_ring->free_list);
-                       rds_ring->begin_alloc = 0;
                        /*
                         * Now go through all of them, set reference handles
                         * and put them in the queues.
@@ -439,6 +438,8 @@ static int netxen_wait_rom_done(struct netxen_adapter *adapter)
        long timeout = 0;
        long done = 0;
 
+       cond_resched();
+
        while (done == 0) {
                done = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_GLB_STATUS);
                done &= 2;
@@ -533,12 +534,9 @@ static int do_rom_fast_write(struct netxen_adapter *adapter, int addr,
 static int do_rom_fast_read(struct netxen_adapter *adapter,
                            int addr, int *valp)
 {
-       cond_resched();
-
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr);
-       netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3);
-       udelay(100);            /* prevent bursting on CRB */
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0);
+       netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3);
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb);
        if (netxen_wait_rom_done(adapter)) {
                printk("Error waiting for rom done\n");
@@ -546,7 +544,7 @@ static int do_rom_fast_read(struct netxen_adapter *adapter,
        }
        /* reset abyte_cnt and dummy_byte_cnt */
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0);
-       udelay(100);            /* prevent bursting on CRB */
+       udelay(10);
        netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0);
 
        *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA);
@@ -884,14 +882,16 @@ int netxen_flash_unlock(struct netxen_adapter *adapter)
 int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
 {
        int addr, val;
-       int i, init_delay = 0;
+       int i, n, init_delay = 0;
        struct crb_addr_pair *buf;
-       unsigned offset, n;
+       unsigned offset;
        u32 off;
 
        /* resetall */
+       rom_lock(adapter);
        netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET,
                                    0xffffffff);
+       netxen_rom_unlock(adapter);
 
        if (verbose) {
                if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0)
@@ -910,7 +910,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
 
        if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
                if (netxen_rom_fast_read(adapter, 0, &n) != 0 ||
-                       (n != 0xcafecafeUL) ||
+                       (n != 0xcafecafe) ||
                        netxen_rom_fast_read(adapter, 4, &n) != 0) {
                        printk(KERN_ERR "%s: ERROR Reading crb_init area: "
                                        "n: %08x\n", netxen_nic_driver_name, n);
@@ -975,6 +975,14 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
                        /* do not reset PCI */
                        if (off == (ROMUSB_GLB + 0xbc))
                                continue;
+                       if (off == (ROMUSB_GLB + 0xa8))
+                               continue;
+                       if (off == (ROMUSB_GLB + 0xc8)) /* core clock */
+                               continue;
+                       if (off == (ROMUSB_GLB + 0x24)) /* MN clock */
+                               continue;
+                       if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */
+                               continue;
                        if (off == (NETXEN_CRB_PEG_NET_1 + 0x18))
                                buf[i].data = 0x1020;
                        /* skip the function enable register */
@@ -992,23 +1000,21 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
                        continue;
                }
 
+               init_delay = 1;
                /* After writing this register, HW needs time for CRB */
                /* to quiet down (else crb_window returns 0xffffffff) */
                if (off == NETXEN_ROMUSB_GLB_SW_RESET) {
-                       init_delay = 1;
+                       init_delay = 1000;
                        if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
                                /* hold xdma in reset also */
                                buf[i].data = NETXEN_NIC_XDMA_RESET;
+                               buf[i].data = 0x8000ff;
                        }
                }
 
                adapter->hw_write_wx(adapter, off, &buf[i].data, 4);
 
-               if (init_delay == 1) {
-                       msleep(1000);
-                       init_delay = 0;
-               }
-               msleep(1);
+               msleep(init_delay);
        }
        kfree(buf);
 
@@ -1277,7 +1283,7 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
 
                dev_kfree_skb_any(skb);
                for (i = 0; i < nr_frags; i++) {
-                       index = frag_desc->frag_handles[i];
+                       index = le16_to_cpu(frag_desc->frag_handles[i]);
                        skb = netxen_process_rxbuf(adapter,
                                        rds_ring, index, cksum);
                        if (skb)
@@ -1428,7 +1434,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid)
        struct rcv_desc *pdesc;
        struct netxen_rx_buffer *buffer;
        int count = 0;
-       int index = 0;
        netxen_ctx_msg msg = 0;
        dma_addr_t dma;
        struct list_head *head;
@@ -1436,7 +1441,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid)
        rds_ring = &recv_ctx->rds_rings[ringid];
 
        producer = rds_ring->producer;
-       index = rds_ring->begin_alloc;
        head = &rds_ring->free_list;
 
        /* We can start writing rx descriptors into the phantom memory. */
@@ -1444,39 +1448,37 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid)
 
                skb = dev_alloc_skb(rds_ring->skb_size);
                if (unlikely(!skb)) {
-                       rds_ring->begin_alloc = index;
                        break;
                }
 
+               if (!adapter->ahw.cut_through)
+                       skb_reserve(skb, 2);
+
+               dma = pci_map_single(pdev, skb->data,
+                               rds_ring->dma_size, PCI_DMA_FROMDEVICE);
+               if (pci_dma_mapping_error(pdev, dma)) {
+                       dev_kfree_skb_any(skb);
+                       break;
+               }
+
+               count++;
                buffer = list_entry(head->next, struct netxen_rx_buffer, list);
                list_del(&buffer->list);
 
-               count++;        /* now there should be no failure */
-               pdesc = &rds_ring->desc_head[producer];
-
-               if (!adapter->ahw.cut_through)
-                       skb_reserve(skb, 2);
-               /* This will be setup when we receive the
-                * buffer after it has been filled  FSL  TBD TBD
-                * skb->dev = netdev;
-                */
-               dma = pci_map_single(pdev, skb->data, rds_ring->dma_size,
-                                    PCI_DMA_FROMDEVICE);
-               pdesc->addr_buffer = cpu_to_le64(dma);
                buffer->skb = skb;
                buffer->state = NETXEN_BUFFER_BUSY;
                buffer->dma = dma;
+
                /* make a rcv descriptor  */
+               pdesc = &rds_ring->desc_head[producer];
+               pdesc->addr_buffer = cpu_to_le64(dma);
                pdesc->reference_handle = cpu_to_le16(buffer->ref_handle);
                pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size);
-               DPRINTK(INFO, "done writing descripter\n");
-               producer =
-                   get_next_index(producer, rds_ring->max_rx_desc_count);
-               index = get_next_index(index, rds_ring->max_rx_desc_count);
+
+               producer = get_next_index(producer, rds_ring->max_rx_desc_count);
        }
        /* if we did allocate buffers, then write the count to Phantom */
        if (count) {
-               rds_ring->begin_alloc = index;
                rds_ring->producer = producer;
                        /* Window = 1 */
                adapter->pci_write_normalize(adapter,
@@ -1515,49 +1517,50 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter,
        struct rcv_desc *pdesc;
        struct netxen_rx_buffer *buffer;
        int count = 0;
-       int index = 0;
        struct list_head *head;
+       dma_addr_t dma;
 
        rds_ring = &recv_ctx->rds_rings[ringid];
 
        producer = rds_ring->producer;
-       index = rds_ring->begin_alloc;
        head = &rds_ring->free_list;
        /* We can start writing rx descriptors into the phantom memory. */
        while (!list_empty(head)) {
 
                skb = dev_alloc_skb(rds_ring->skb_size);
                if (unlikely(!skb)) {
-                       rds_ring->begin_alloc = index;
                        break;
                }
 
+               if (!adapter->ahw.cut_through)
+                       skb_reserve(skb, 2);
+
+               dma = pci_map_single(pdev, skb->data,
+                               rds_ring->dma_size, PCI_DMA_FROMDEVICE);
+               if (pci_dma_mapping_error(pdev, dma)) {
+                       dev_kfree_skb_any(skb);
+                       break;
+               }
+
+               count++;
                buffer = list_entry(head->next, struct netxen_rx_buffer, list);
                list_del(&buffer->list);
 
-               count++;        /* now there should be no failure */
-               pdesc = &rds_ring->desc_head[producer];
-               if (!adapter->ahw.cut_through)
-                       skb_reserve(skb, 2);
                buffer->skb = skb;
                buffer->state = NETXEN_BUFFER_BUSY;
-               buffer->dma = pci_map_single(pdev, skb->data,
-                                            rds_ring->dma_size,
-                                            PCI_DMA_FROMDEVICE);
+               buffer->dma = dma;
 
                /* make a rcv descriptor  */
+               pdesc = &rds_ring->desc_head[producer];
                pdesc->reference_handle = cpu_to_le16(buffer->ref_handle);
                pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size);
                pdesc->addr_buffer = cpu_to_le64(buffer->dma);
-               producer =
-                   get_next_index(producer, rds_ring->max_rx_desc_count);
-               index = get_next_index(index, rds_ring->max_rx_desc_count);
-               buffer = &rds_ring->rx_buf_arr[index];
+
+               producer = get_next_index(producer, rds_ring->max_rx_desc_count);
        }
 
        /* if we did allocate buffers, then write the count to Phantom */
        if (count) {
-               rds_ring->begin_alloc = index;
                rds_ring->producer = producer;
                        /* Window = 1 */
                adapter->pci_write_normalize(adapter,
index ba01524b5531a46d7ced8efd6470ad825601c23e..86867405a367daa5b1bef9d6b1f0133774e5ea1f 100644 (file)
@@ -39,6 +39,7 @@
 #include "netxen_nic_phan_reg.h"
 
 #include <linux/dma-mapping.h>
+#include <linux/if_vlan.h>
 #include <net/ip.h>
 
 MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
@@ -242,7 +243,7 @@ static void netxen_check_options(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_4_GB:
        case NETXEN_BRDTYPE_P3_4_GB_MM:
                adapter->msix_supported = !!use_msi_x;
-               adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G;
+               adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
                break;
 
        case NETXEN_BRDTYPE_P2_SB35_4G:
@@ -251,6 +252,14 @@ static void netxen_check_options(struct netxen_adapter *adapter)
                adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
                break;
 
+       case NETXEN_BRDTYPE_P3_10G_TP:
+               adapter->msix_supported = !!use_msi_x;
+               if (adapter->ahw.board_type == NETXEN_NIC_XGBE)
+                       adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G;
+               else
+                       adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
+               break;
+
        default:
                adapter->msix_supported = 0;
                adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
@@ -271,10 +280,15 @@ static void netxen_check_options(struct netxen_adapter *adapter)
 static int
 netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot)
 {
-       int ret = 0;
+       u32 val, timeout;
 
        if (first_boot == 0x55555555) {
                /* This is the first boot after power up */
+               adapter->pci_write_normalize(adapter,
+                       NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC);
+
+               if (!NX_IS_REVISION_P2(adapter->ahw.revision_id))
+                       return 0;
 
                /* PCI bus master workaround */
                adapter->hw_read_wx(adapter,
@@ -294,18 +308,26 @@ netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot)
                        /* clear the register for future unloads/loads */
                        adapter->pci_write_normalize(adapter,
                                        NETXEN_CAM_RAM(0x1fc), 0);
-                       ret = -1;
+                       return -EIO;
                }
 
-               if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
-                       /* Start P2 boot loader */
-                       adapter->pci_write_normalize(adapter,
-                               NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC);
-                       adapter->pci_write_normalize(adapter,
-                                       NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1);
-               }
+               /* Start P2 boot loader */
+               val = adapter->pci_read_normalize(adapter,
+                               NETXEN_ROMUSB_GLB_PEGTUNE_DONE);
+               adapter->pci_write_normalize(adapter,
+                               NETXEN_ROMUSB_GLB_PEGTUNE_DONE, val | 0x1);
+               timeout = 0;
+               do {
+                       msleep(1);
+                       val = adapter->pci_read_normalize(adapter,
+                                       NETXEN_CAM_RAM(0x1fc));
+
+                       if (++timeout > 5000)
+                               return -EIO;
+
+               } while (val == NETXEN_BDINFO_MAGIC);
        }
-       return ret;
+       return 0;
 }
 
 static void netxen_set_port_mode(struct netxen_adapter *adapter)
@@ -784,8 +806,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                                                CRB_CMDPEG_STATE, 0);
                        netxen_pinit_from_rom(adapter, 0);
                        msleep(1);
-                       netxen_load_firmware(adapter);
                }
+               netxen_load_firmware(adapter);
 
                if (NX_IS_REVISION_P3(revision_id))
                        netxen_pcie_strap_init(adapter);
@@ -801,13 +823,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
                }
 
-               if ((first_boot == 0x55555555) &&
-                       (NX_IS_REVISION_P2(revision_id))) {
-                       /* Unlock the HW, prompting the boot sequence */
-                       adapter->pci_write_normalize(adapter,
-                                       NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1);
-               }
-
                err = netxen_initialize_adapter_offload(adapter);
                if (err)
                        goto err_out_iounmap;
@@ -821,7 +836,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i);
 
                /* Handshake with the card before we register the devices. */
-               netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
+               err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
+               if (err)
+                       goto err_out_free_offload;
 
        }       /* first_driver */
 
@@ -925,6 +942,7 @@ err_out_disable_msi:
        if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
                pci_disable_msi(pdev);
 
+err_out_free_offload:
        if (first_driver)
                netxen_free_adapter_offload(adapter);
 
@@ -968,6 +986,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
                netxen_free_hw_resources(adapter);
                netxen_release_rx_buffers(adapter);
                netxen_free_sw_resources(adapter);
+
+               if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+                       netxen_p3_free_mac_list(adapter);
        }
 
        if (adapter->portnum == 0)
@@ -1137,29 +1158,64 @@ static int netxen_nic_close(struct net_device *netdev)
        return 0;
 }
 
-void netxen_tso_check(struct netxen_adapter *adapter,
+static bool netxen_tso_check(struct net_device *netdev,
                      struct cmd_desc_type0 *desc, struct sk_buff *skb)
 {
-       if (desc->mss) {
-               desc->total_hdr_length = (sizeof(struct ethhdr) +
-                                         ip_hdrlen(skb) + tcp_hdrlen(skb));
+       bool tso = false;
+       u8 opcode = TX_ETHER_PKT;
 
-               if ((NX_IS_REVISION_P3(adapter->ahw.revision_id)) &&
-                               (skb->protocol == htons(ETH_P_IPV6)))
-                       netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO6);
-               else
-                       netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO);
+       if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) &&
+                       skb_shinfo(skb)->gso_size > 0) {
+
+               desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
+               desc->total_hdr_length =
+                       skb_transport_offset(skb) + tcp_hdrlen(skb);
+
+               opcode = (skb->protocol == htons(ETH_P_IPV6)) ?
+                               TX_TCP_LSO6 : TX_TCP_LSO;
+               tso = true;
 
        } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
-               if (ip_hdr(skb)->protocol == IPPROTO_TCP)
-                       netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT);
-               else if (ip_hdr(skb)->protocol == IPPROTO_UDP)
-                       netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT);
-               else
-                       return;
+               u8 l4proto;
+
+               if (skb->protocol == htons(ETH_P_IP)) {
+                       l4proto = ip_hdr(skb)->protocol;
+
+                       if (l4proto == IPPROTO_TCP)
+                               opcode = TX_TCP_PKT;
+                       else if(l4proto == IPPROTO_UDP)
+                               opcode = TX_UDP_PKT;
+               } else if (skb->protocol == htons(ETH_P_IPV6)) {
+                       l4proto = ipv6_hdr(skb)->nexthdr;
+
+                       if (l4proto == IPPROTO_TCP)
+                               opcode = TX_TCPV6_PKT;
+                       else if(l4proto == IPPROTO_UDP)
+                               opcode = TX_UDPV6_PKT;
+               }
        }
        desc->tcp_hdr_offset = skb_transport_offset(skb);
        desc->ip_hdr_offset = skb_network_offset(skb);
+       netxen_set_tx_flags_opcode(desc, 0, opcode);
+       return tso;
+}
+
+static void
+netxen_clean_tx_dma_mapping(struct pci_dev *pdev,
+               struct netxen_cmd_buffer *pbuf, int last)
+{
+       int k;
+       struct netxen_skb_frag *buffrag;
+
+       buffrag = &pbuf->frag_array[0];
+       pci_unmap_single(pdev, buffrag->dma,
+                       buffrag->length, PCI_DMA_TODEVICE);
+
+       for (k = 1; k < last; k++) {
+               buffrag = &pbuf->frag_array[k];
+               pci_unmap_page(pdev, buffrag->dma,
+                       buffrag->length, PCI_DMA_TODEVICE);
+       }
 }
 
 static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -1167,33 +1223,22 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        struct netxen_adapter *adapter = netdev_priv(netdev);
        struct netxen_hardware_context *hw = &adapter->ahw;
        unsigned int first_seg_len = skb->len - skb->data_len;
+       struct netxen_cmd_buffer *pbuf;
        struct netxen_skb_frag *buffrag;
-       unsigned int i;
+       struct cmd_desc_type0 *hwdesc;
+       struct pci_dev *pdev = adapter->pdev;
+       dma_addr_t temp_dma;
+       int i, k;
 
        u32 producer, consumer;
-       u32 saved_producer = 0;
-       struct cmd_desc_type0 *hwdesc;
-       int k;
-       struct netxen_cmd_buffer *pbuf = NULL;
-       int frag_count;
-       int no_of_desc;
+       int frag_count, no_of_desc;
        u32 num_txd = adapter->max_tx_desc_count;
+       bool is_tso = false;
 
        frag_count = skb_shinfo(skb)->nr_frags + 1;
 
        /* There 4 fragments per descriptor */
        no_of_desc = (frag_count + 3) >> 2;
-       if (netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) {
-               if (skb_shinfo(skb)->gso_size > 0) {
-
-                       no_of_desc++;
-                       if ((ip_hdrlen(skb) + tcp_hdrlen(skb) +
-                            sizeof(struct ethhdr)) >
-                           (sizeof(struct cmd_desc_type0) - 2)) {
-                               no_of_desc++;
-                       }
-               }
-       }
 
        producer = adapter->cmd_producer;
        smp_mb();
@@ -1205,34 +1250,26 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        }
 
        /* Copy the descriptors into the hardware    */
-       saved_producer = producer;
        hwdesc = &hw->cmd_desc_head[producer];
        memset(hwdesc, 0, sizeof(struct cmd_desc_type0));
        /* Take skb->data itself */
        pbuf = &adapter->cmd_buf_arr[producer];
-       if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) &&
-                       skb_shinfo(skb)->gso_size > 0) {
-               pbuf->mss = skb_shinfo(skb)->gso_size;
-               hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
-       } else {
-               pbuf->mss = 0;
-               hwdesc->mss = 0;
-       }
-       pbuf->total_length = skb->len;
+
+       is_tso = netxen_tso_check(netdev, hwdesc, skb);
+
        pbuf->skb = skb;
-       pbuf->cmd = TX_ETHER_PKT;
        pbuf->frag_count = frag_count;
-       pbuf->port = adapter->portnum;
        buffrag = &pbuf->frag_array[0];
-       buffrag->dma = pci_map_single(adapter->pdev, skb->data, first_seg_len,
+       temp_dma = pci_map_single(pdev, skb->data, first_seg_len,
                                      PCI_DMA_TODEVICE);
+       if (pci_dma_mapping_error(pdev, temp_dma))
+               goto drop_packet;
+
+       buffrag->dma = temp_dma;
        buffrag->length = first_seg_len;
-       netxen_set_cmd_desc_totallength(hwdesc, skb->len);
-       netxen_set_cmd_desc_num_of_buff(hwdesc, frag_count);
-       netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT);
+       netxen_set_tx_frags_len(hwdesc, frag_count, skb->len);
+       netxen_set_tx_port(hwdesc, adapter->portnum);
 
-       netxen_set_cmd_desc_port(hwdesc, adapter->portnum);
-       netxen_set_cmd_desc_ctxid(hwdesc, adapter->portnum);
        hwdesc->buffer1_length = cpu_to_le16(first_seg_len);
        hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma);
 
@@ -1240,7 +1277,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                struct skb_frag_struct *frag;
                int len, temp_len;
                unsigned long offset;
-               dma_addr_t temp_dma;
 
                /* move to next desc. if there is a need */
                if ((i & 0x3) == 0) {
@@ -1256,8 +1292,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                offset = frag->page_offset;
 
                temp_len = len;
-               temp_dma = pci_map_page(adapter->pdev, frag->page, offset,
+               temp_dma = pci_map_page(pdev, frag->page, offset,
                                        len, PCI_DMA_TODEVICE);
+               if (pci_dma_mapping_error(pdev, temp_dma)) {
+                       netxen_clean_tx_dma_mapping(pdev, pbuf, i);
+                       goto drop_packet;
+               }
 
                buffrag++;
                buffrag->dma = temp_dma;
@@ -1285,16 +1325,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        }
        producer = get_next_index(producer, num_txd);
 
-       /* might change opcode to TX_TCP_LSO */
-       netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb);
-
        /* For LSO, we need to copy the MAC/IP/TCP headers into
         * the descriptor ring
         */
-       if (netxen_get_cmd_desc_opcode(&hw->cmd_desc_head[saved_producer])
-           == TX_TCP_LSO) {
+       if (is_tso) {
                int hdr_len, first_hdr_len, more_hdr;
-               hdr_len = hw->cmd_desc_head[saved_producer].total_hdr_length;
+               hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
                if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) {
                        first_hdr_len = sizeof(struct cmd_desc_type0) - 2;
                        more_hdr = 1;
@@ -1336,6 +1372,11 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        netdev->trans_start = jiffies;
 
        return NETDEV_TX_OK;
+
+drop_packet:
+       adapter->stats.txdropped++;
+       dev_kfree_skb_any(skb);
+       return NETDEV_TX_OK;
 }
 
 static int netxen_nic_check_temp(struct netxen_adapter *adapter)
@@ -1407,6 +1448,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
                        netif_carrier_off(netdev);
                        netif_stop_queue(netdev);
                }
+
+               netxen_nic_set_link_parameters(adapter);
        } else if (!adapter->ahw.linkup && linkup) {
                printk(KERN_INFO "%s: %s NIC Link is up\n",
                       netxen_nic_driver_name, netdev->name);
@@ -1415,6 +1458,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
                        netif_carrier_on(netdev);
                        netif_wake_queue(netdev);
                }
+
+               netxen_nic_set_link_parameters(adapter);
        }
 }
 
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 e35460165bf76709211ffa16f969a3b1fb07dbe8..0a06e4fd37d9b16e37a9e54e901cd659d7044163 100644 (file)
@@ -231,15 +231,6 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
        if ((phy_id & 0x1fffffff) == 0x1fffffff)
                return NULL;
 
-       /*
-        * Broken hardware is sometimes missing the pull-up resistor on the
-        * MDIO line, which results in reads to non-existent devices returning
-        * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
-        * device as well.
-        */
-       if (phy_id == 0)
-               return NULL;
-
        dev = phy_device_create(bus, addr, phy_id);
 
        return dev;
index 06b448285eb5d0783c104383c12b0e4add6309ea..7b2728b8f1b7327e77c92dd4afa93c712af2a36d 100644 (file)
@@ -250,6 +250,7 @@ static int ppp_connect_channel(struct channel *pch, int unit);
 static int ppp_disconnect_channel(struct channel *pch);
 static void ppp_destroy_channel(struct channel *pch);
 static int unit_get(struct idr *p, void *ptr);
+static int unit_set(struct idr *p, void *ptr, int n);
 static void unit_put(struct idr *p, int n);
 static void *unit_find(struct idr *p, int n);
 
@@ -2432,11 +2433,18 @@ ppp_create_interface(int unit, int *retp)
        } else {
                if (unit_find(&ppp_units_idr, unit))
                        goto out2; /* unit already exists */
-               else {
-                       /* darn, someone is cheating us? */
-                       *retp = -EINVAL;
+               /*
+                * if caller need a specified unit number
+                * lets try to satisfy him, otherwise --
+                * he should better ask us for new unit number
+                *
+                * NOTE: yes I know that returning EEXIST it's not
+                * fair but at least pppd will ask us to allocate
+                * new unit in this case so user is happy :)
+                */
+               unit = unit_set(&ppp_units_idr, ppp, unit);
+               if (unit < 0)
                        goto out2;
-               }
        }
 
        /* Initialize the new ppp unit */
@@ -2677,14 +2685,37 @@ static void __exit ppp_cleanup(void)
  * by holding all_ppp_mutex
  */
 
+/* associate pointer with specified number */
+static int unit_set(struct idr *p, void *ptr, int n)
+{
+       int unit, err;
+
+again:
+       if (!idr_pre_get(p, GFP_KERNEL)) {
+               printk(KERN_ERR "PPP: No free memory for idr\n");
+               return -ENOMEM;
+       }
+
+       err = idr_get_new_above(p, ptr, n, &unit);
+       if (err == -EAGAIN)
+               goto again;
+
+       if (unit != n) {
+               idr_remove(p, unit);
+               return -EINVAL;
+       }
+
+       return unit;
+}
+
 /* get new free unit number and associate pointer with it */
 static int unit_get(struct idr *p, void *ptr)
 {
        int unit, err;
 
 again:
-       if (idr_pre_get(p, GFP_KERNEL) == 0) {
-               printk(KERN_ERR "Out of memory expanding drawable idr\n");
+       if (!idr_pre_get(p, GFP_KERNEL)) {
+               printk(KERN_ERR "PPP: No free memory for idr\n");
                return -ENOMEM;
        }
 
index 6cbefcae9ac2c844e6334390cb33a7ef8ddb3006..be4465bc0a693d642c23ec465e3ce0ad035ad625 100644 (file)
@@ -509,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
        else
                ret = sis900_get_mac_addr(pci_dev, net_dev);
 
-       if (ret == 0) {
-               printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name);
-               ret = -ENODEV;
-               goto err_unmap_rx;
+       if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) {
+               random_ether_addr(net_dev->dev_addr);
+               printk(KERN_WARNING "%s: Unreadable or invalid MAC address,"
+                               "using random generated one\n", dev_name);
        }
 
        /* 630ET : set the mii access mode as software-mode */
index c4918b86ed193cb4647510b950e114d952a627fd..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);
 
@@ -1792,8 +1793,8 @@ static int mux_device_request(struct hso_serial *serial, u8 type, u16 port,
 
        /* initialize */
        ctrl_req->wValue = 0;
-       ctrl_req->wIndex = hso_port_to_mux(port);
-       ctrl_req->wLength = size;
+       ctrl_req->wIndex = cpu_to_le16(hso_port_to_mux(port));
+       ctrl_req->wLength = cpu_to_le16(size);
 
        if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) {
                /* Reading command */
@@ -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 2dc241689d37a8f878f6b80202ed38dd95805435..0dbd85b0162da72a9a577cd91358b90b5d52d07b 100644 (file)
@@ -622,7 +622,7 @@ static void hss_hdlc_rx_irq(void *pdev)
        printk(KERN_DEBUG "%s: hss_hdlc_rx_irq\n", dev->name);
 #endif
        qmgr_disable_irq(queue_ids[port->id].rx);
-       netif_rx_schedule(dev, &port->napi);
+       netif_rx_schedule(&port->napi);
 }
 
 static int hss_hdlc_poll(struct napi_struct *napi, int budget)
@@ -651,7 +651,7 @@ static int hss_hdlc_poll(struct napi_struct *napi, int budget)
                        printk(KERN_DEBUG "%s: hss_hdlc_poll"
                               " netif_rx_complete\n", dev->name);
 #endif
-                       netif_rx_complete(dev, napi);
+                       netif_rx_complete(napi);
                        qmgr_enable_irq(rxq);
                        if (!qmgr_stat_empty(rxq) &&
                            netif_rx_reschedule(napi)) {
@@ -1069,7 +1069,7 @@ static int hss_hdlc_open(struct net_device *dev)
        hss_start_hdlc(port);
 
        /* we may already have RX data, enables IRQ */
-       netif_rx_schedule(dev, &port->napi);
+       netif_rx_schedule(&port->napi);
        return 0;
 
 err_unlock:
index ea543fcf2687aa9e0bacea24dad83dbe44897233..e4f9f747de88c94404ddbe17294783a3e37fa1ff 100644 (file)
@@ -111,7 +111,7 @@ config WLAN_80211
          lets you choose drivers.
 
 config PCMCIA_RAYCS
-       tristate "Aviator/Raytheon 2.4MHz wireless support"
+       tristate "Aviator/Raytheon 2.4GHz wireless support"
        depends on PCMCIA && WLAN_80211
        select WIRELESS_EXT
        ---help---
index 4af2607deec09ad9582e2aa488723b461daf8416..8ef87356e083f28241db4298c1a0a0384732f340 100644 (file)
@@ -2644,7 +2644,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                if (skb_headroom(skb) < padsize) {
                        ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough"
                                  " headroom to pad %d\n", hdrlen, padsize);
-                       return -1;
+                       return NETDEV_TX_BUSY;
                }
                skb_push(skb, padsize);
                memmove(skb->data, skb->data+padsize, hdrlen);
@@ -2655,7 +2655,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                ATH5K_ERR(sc, "no further txbuf available, dropping packet\n");
                spin_unlock_irqrestore(&sc->txbuflock, flags);
                ieee80211_stop_queue(hw, skb_get_queue_mapping(skb));
-               return -1;
+               return NETDEV_TX_BUSY;
        }
        bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list);
        list_del(&bf->list);
@@ -2673,10 +2673,10 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
                sc->txbuf_len++;
                spin_unlock_irqrestore(&sc->txbuflock, flags);
                dev_kfree_skb_any(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static int
index 0cac05c6a9ce8dda1b1c50a5da26db3c187b9ecb..75eb9f43c7417980266d2eb652f7ac5a9ad70580 100644 (file)
@@ -65,7 +65,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
                if (ah->ah_version == AR5K_AR5210)
                        pcu_reg |= AR5K_STA_ID1_NO_PSPOLL;
                else
-                       AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC);
+                       AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS);
                break;
 
        case NL80211_IFTYPE_AP:
@@ -75,7 +75,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
                if (ah->ah_version == AR5K_AR5210)
                        pcu_reg |= AR5K_STA_ID1_NO_PSPOLL;
                else
-                       AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC);
+                       AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS);
                break;
 
        case NL80211_IFTYPE_STATION:
index 91aaeaf881995c583747feae712254a21e667872..9189ab13286cafde039c7201fec8ae17c456fde2 100644 (file)
@@ -73,7 +73,7 @@
 #define        AR5K_CFG_SWRD           0x00000004      /* Byte-swap RX descriptor */
 #define        AR5K_CFG_SWRB           0x00000008      /* Byte-swap RX buffer */
 #define        AR5K_CFG_SWRG           0x00000010      /* Byte-swap Register access */
-#define AR5K_CFG_ADHOC         0x00000020      /* AP/Adhoc indication [5211+] */
+#define AR5K_CFG_IBSS          0x00000020      /* 0-BSS, 1-IBSS [5211+] */
 #define AR5K_CFG_PHY_OK                0x00000100      /* [5211+] */
 #define AR5K_CFG_EEBS          0x00000200      /* EEPROM is busy */
 #define        AR5K_CFG_CLKGD          0x00000400      /* Clock gated (Disable dynamic clock) */
index c43bd321f97fb6abfbbbce9bca13f37bfd1f5552..90a8dd8737862a99625f38f4da6dff60cc2d7f0c 100644 (file)
@@ -1,6 +1,7 @@
 config ATH9K
        tristate "Atheros 802.11n wireless cards support"
        depends on PCI && MAC80211 && WLAN_80211
+       depends on RFKILL || RFKILL=n
        select MAC80211_LEDS
        select LEDS_CLASS
        select NEW_LEDS
index 191eec50dc751c1fff9142f76d7960a5eb4c23db..727f067aca4f8a764cbf9284c287b20ad96b73e4 100644 (file)
@@ -2164,13 +2164,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
                                                    conf->ht.channel_type);
                }
 
+               ath_update_chainmask(sc, conf->ht.enabled);
+
                if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) {
                        DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n");
                        mutex_unlock(&sc->mutex);
                        return -EINVAL;
                }
-
-               ath_update_chainmask(sc, conf->ht.enabled);
        }
 
        if (changed & IEEE80211_CONF_CHANGE_POWER)
index 3bfc3b90f2569013092e82959a03bfebdf39b979..c92f0c6e4adcd1ac64bf0975f5a1f32ed3bf0bfd 100644 (file)
@@ -126,15 +126,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
                tx_info->flags |= IEEE80211_TX_STAT_ACK;
        }
 
-       tx_info->status.rates[0].count = tx_status->retries;
-       if (tx_info->status.rates[0].flags & IEEE80211_TX_RC_MCS) {
-               /* Change idx from internal table index to MCS index */
-               int idx = tx_info->status.rates[0].idx;
-               struct ath_rate_table *rate_table = sc->cur_rate_table;
-               if (idx >= 0 && idx < rate_table->rate_cnt)
-                       tx_info->status.rates[0].idx =
-                               rate_table->info[idx].ratecode & 0x7f;
-       }
+       tx_info->status.rates[0].count = tx_status->retries + 1;
 
        hdrlen = ieee80211_get_hdrlen_from_skb(skb);
        padsize = hdrlen & 3;
@@ -264,25 +256,22 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb,
        }
 
        /* Get seqno */
-
-       if (ieee80211_is_data(fc) && !is_pae(skb)) {
-               /* For HT capable stations, we save tidno for later use.
-                * We also override seqno set by upper layer with the one
-                * in tx aggregation state.
-                *
-                * If fragmentation is on, the sequence number is
-                * not overridden, since it has been
-                * incremented by the fragmentation routine.
-                *
-                * FIXME: check if the fragmentation threshold exceeds
-                * IEEE80211 max.
-                */
-               tid = ATH_AN_2_TID(an, bf->bf_tidno);
-               hdr->seq_ctrl = cpu_to_le16(tid->seq_next <<
-                                           IEEE80211_SEQ_SEQ_SHIFT);
-               bf->bf_seqno = tid->seq_next;
-               INCR(tid->seq_next, IEEE80211_SEQ_MAX);
-       }
+       /* For HT capable stations, we save tidno for later use.
+        * We also override seqno set by upper layer with the one
+        * in tx aggregation state.
+        *
+        * If fragmentation is on, the sequence number is
+        * not overridden, since it has been
+        * incremented by the fragmentation routine.
+        *
+        * FIXME: check if the fragmentation threshold exceeds
+        * IEEE80211 max.
+        */
+       tid = ATH_AN_2_TID(an, bf->bf_tidno);
+       hdr->seq_ctrl = cpu_to_le16(tid->seq_next <<
+                       IEEE80211_SEQ_SEQ_SHIFT);
+       bf->bf_seqno = tid->seq_next;
+       INCR(tid->seq_next, IEEE80211_SEQ_MAX);
 }
 
 static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb,
@@ -1718,11 +1707,10 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf,
 
        /* Assign seqno, tidno */
 
-       if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR))
+       if (ieee80211_is_data_qos(fc) && (sc->sc_flags & SC_OP_TXAGGR))
                assign_aggr_tid_seqno(skb, bf);
 
        /* DMA setup */
-
        bf->bf_mpdu = skb;
 
        bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data,
index 7b31a327b24a33e643be1021360af7fdcb8273da..c788bad10661b5fa2442d37ea636561e95258688 100644 (file)
@@ -3261,7 +3261,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
        struct b43_wldev *down_dev;
        struct b43_wldev *d;
        int err;
-       bool gmode;
+       bool uninitialized_var(gmode);
        int prev_status;
 
        /* Find a device and PHY which supports the band. */
index c1324e31d2f6465e0260e4df84e6e85c49c35e28..fb996c27a19b4b3340b7e682f319eae0a627631e 100644 (file)
@@ -2465,7 +2465,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev)
 static int b43legacy_switch_phymode(struct b43legacy_wl *wl,
                                      unsigned int new_mode)
 {
-       struct b43legacy_wldev *up_dev;
+       struct b43legacy_wldev *uninitialized_var(up_dev);
        struct b43legacy_wldev *down_dev;
        int err;
        bool gmode = 0;
index 8fdb34222c0a4f3e3ba8c11644fc429ed6de7300..45cfa1cf194a2d3218efe4cb2a9ba8e03adc9df3 100644 (file)
@@ -2219,7 +2219,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
                /* set tx power value for all OFDM rates */
                for (rate_index = 0; rate_index < IWL_OFDM_RATES;
                     rate_index++) {
-                       s32 power_idx;
+                       s32 uninitialized_var(power_idx);
                        int rc;
 
                        /* use channel group's clip-power table,
index 52966ffbef6ec6231bfbb18fc2228572faec23a6..ba997204c8d4482a219128428629b8eebca4974f 100644 (file)
@@ -255,7 +255,7 @@ struct iwl_cmd_header {
  *        0x3)  54 Mbps
  *
  * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"):
- *  3-0:   10)  1 Mbps
+ *  6-0:   10)  1 Mbps
  *         20)  2 Mbps
  *         55)  5.5 Mbps
  *        110)  11 Mbps
index 01a2169cececb1dc7abbed3d2bf8b41ece10d3d3..8c71ad4f88c5f98e027293a1459d5700a388bb17 100644 (file)
@@ -51,6 +51,7 @@ const char *get_cmd_string(u8 cmd)
                IWL_CMD(REPLY_REMOVE_STA);
                IWL_CMD(REPLY_REMOVE_ALL_STA);
                IWL_CMD(REPLY_WEPKEY);
+               IWL_CMD(REPLY_3945_RX);
                IWL_CMD(REPLY_TX);
                IWL_CMD(REPLY_RATE_SCALE);
                IWL_CMD(REPLY_LEDS_CMD);
index d1fc305de5fe03c755368b70690d3f81d5fe54ba..e7289e2e7f16fb87e3a96113f4efe1e43433dbe6 100644 (file)
@@ -206,7 +206,7 @@ static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
         * there are no buffered multicast frames to send
         */
        ieee80211_stop_queues(priv->hw);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static void lbtf_tx_work(struct work_struct *work)
index bc84e2792f8a887838f42c02bbe5ed4f68c500af..c3bb85e0251e87731899fb17d8b186feda2c6883 100644 (file)
@@ -1610,6 +1610,16 @@ static void orinoco_rx_isr_tasklet(unsigned long data)
        struct orinoco_rx_data *rx_data, *temp;
        struct hermes_rx_descriptor *desc;
        struct sk_buff *skb;
+       unsigned long flags;
+
+       /* orinoco_rx requires the driver lock, and we also need to
+        * protect priv->rx_list, so just hold the lock over the
+        * lot.
+        *
+        * If orinoco_lock fails, we've unplugged the card. In this
+        * case just abort. */
+       if (orinoco_lock(priv, &flags) != 0)
+               return;
 
        /* extract desc and skb from queue */
        list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) {
@@ -1622,6 +1632,8 @@ static void orinoco_rx_isr_tasklet(unsigned long data)
 
                kfree(desc);
        }
+
+       orinoco_unlock(priv, &flags);
 }
 
 /********************************************************************/
@@ -3645,12 +3657,22 @@ struct net_device
 void free_orinocodev(struct net_device *dev)
 {
        struct orinoco_private *priv = netdev_priv(dev);
+       struct orinoco_rx_data *rx_data, *temp;
 
-       /* No need to empty priv->rx_list: if the tasklet is scheduled
-        * when we call tasklet_kill it will run one final time,
-        * emptying the list */
+       /* If the tasklet is scheduled when we call tasklet_kill it
+        * will run one final time. However the tasklet will only
+        * drain priv->rx_list if the hw is still available. */
        tasklet_kill(&priv->rx_tasklet);
 
+       /* Explicitly drain priv->rx_list */
+       list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) {
+               list_del(&rx_data->list);
+
+               dev_kfree_skb(rx_data->skb);
+               kfree(rx_data->desc);
+               kfree(rx_data);
+       }
+
        unregister_pm_notifier(&priv->pm_notifier);
        orinoco_uncache_fw(priv);
 
index f127602670ece436e88b80345cde5917ee729082..0b32215d3f5d3ec4498b8ce2e957ea8c6b4b5628 100644 (file)
@@ -435,6 +435,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */
        PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */
        PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */
+       PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0003), /* ARtem Onair Comcard 11 */
        PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */
        PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */
        PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */
index 82354b974a04773e752307f45f393bed8a89763c..c6a370fa9bcbf11115fdd9063327356339f4504d 100644 (file)
@@ -138,6 +138,7 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
        u8 *fw_version = NULL;
        size_t len;
        int i;
+       int maxlen;
 
        if (priv->rx_start)
                return 0;
@@ -195,6 +196,16 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
                        else
                                priv->rx_mtu = (size_t)
                                        0x620 - priv->tx_hdr_len;
+                       maxlen = priv->tx_hdr_len + /* USB devices */
+                                sizeof(struct p54_rx_data) +
+                                4 + /* rx alignment */
+                                IEEE80211_MAX_FRAG_THRESHOLD;
+                       if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) {
+                               printk(KERN_INFO "p54: rx_mtu reduced from %d "
+                                                "to %d\n", priv->rx_mtu,
+                                                maxlen);
+                               priv->rx_mtu = maxlen;
+                       }
                        break;
                        }
                case BR_CODE_EXPOSED_IF:
@@ -575,6 +586,7 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb)
        u16 freq = le16_to_cpu(hdr->freq);
        size_t header_len = sizeof(*hdr);
        u32 tsf32;
+       u8 rate = hdr->rate & 0xf;
 
        /*
         * If the device is in a unspecified state we have to
@@ -603,8 +615,11 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb)
        rx_status.qual = (100 * hdr->rssi) / 127;
        if (hdr->rate & 0x10)
                rx_status.flag |= RX_FLAG_SHORTPRE;
-       rx_status.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ?
-                       hdr->rate : (hdr->rate - 4)) & 0xf;
+       if (dev->conf.channel->band == IEEE80211_BAND_5GHZ)
+               rx_status.rate_idx = (rate < 4) ? 0 : rate - 4;
+       else
+               rx_status.rate_idx = rate;
+
        rx_status.freq = freq;
        rx_status.band =  dev->conf.channel->band;
        rx_status.antenna = hdr->antenna;
@@ -798,6 +813,16 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
                        info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
                info->status.ack_signal = p54_rssi_to_dbm(dev,
                                (int)payload->ack_rssi);
+
+               if (entry_data->key_type == P54_CRYPTO_TKIPMICHAEL) {
+                       u8 *iv = (u8 *)(entry_data->align + pad +
+                                       entry_data->crypt_offset);
+
+                       /* Restore the original TKIP IV. */
+                       iv[2] = iv[0];
+                       iv[0] = iv[1];
+                       iv[1] = (iv[0] | 0x20) & 0x7f;  /* WEPSeed - 8.3.2.2 */
+               }
                skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data));
                ieee80211_tx_status_irqsafe(dev, entry);
                goto out;
@@ -1383,7 +1408,6 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
        hdr->tries = ridx;
        txhdr->rts_rate_idx = 0;
        if (info->control.hw_key) {
-               crypt_offset += info->control.hw_key->iv_len;
                txhdr->key_type = p54_convert_algo(info->control.hw_key->alg);
                txhdr->key_len = min((u8)16, info->control.hw_key->keylen);
                memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len);
@@ -1397,6 +1421,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
                }
                /* reserve some space for ICV */
                len += info->control.hw_key->icv_len;
+               memset(skb_put(skb, info->control.hw_key->icv_len), 0,
+                      info->control.hw_key->icv_len);
        } else {
                txhdr->key_type = 0;
                txhdr->key_len = 0;
@@ -1824,7 +1850,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev,
 
 static int p54_config(struct ieee80211_hw *dev, u32 changed)
 {
-       int ret;
+       int ret = 0;
        struct p54_common *priv = dev->priv;
        struct ieee80211_conf *conf = &dev->conf;
 
index c44a200059d21c4ce0aae4a6f66b2e61af73984e..6a6a72f6f82cb5fbc6a3317520e721c1cfba2818 100644 (file)
@@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
        {USB_DEVICE(0x050d, 0x7050)},   /* Belkin F5D7050 ver 1000 */
        {USB_DEVICE(0x0572, 0x2000)},   /* Cohiba Proto board */
        {USB_DEVICE(0x0572, 0x2002)},   /* Cohiba Proto board */
+       {USB_DEVICE(0x06b9, 0x0121)},   /* Thomson SpeedTouch 121g */
        {USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
        {USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
        {USB_DEVICE(0x0846, 0x4240)},   /* Netgear WG111 (v2) */
@@ -284,6 +285,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb)
        usb_fill_bulk_urb(data_urb, priv->udev,
                          usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA),
                          skb->data, skb->len, p54u_tx_cb, skb);
+       data_urb->transfer_flags |= URB_ZERO_PACKET;
 
        usb_anchor_urb(data_urb, &priv->submitted);
        if (usb_submit_urb(data_urb, GFP_ATOMIC)) {
index 30028e2422fcfde7706b285042b7a4b9b12863c9..af6b5847be5ce4362a5c4256ad64d35238d9433b 100644 (file)
@@ -38,7 +38,7 @@
 /*
  * Allow hardware encryption to be disabled.
  */
-static int modparam_nohwcrypt = 1;
+static int modparam_nohwcrypt = 0;
 module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
 MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
 
@@ -376,11 +376,11 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
 
                /*
                 * The driver does not support the IV/EIV generation
-                * in hardware. However it doesn't support the IV/EIV
-                * inside the ieee80211 frame either, but requires it
-                * to be provided seperately for the descriptor.
-                * rt2x00lib will cut the IV/EIV data out of all frames
-                * given to us by mac80211, but we must tell mac80211
+                * in hardware. However it demands the data to be provided
+                * both seperately as well as inside the frame.
+                * We already provided the CONFIG_CRYPTO_COPY_IV to rt2x00lib
+                * to ensure rt2x00lib will not strip the data from the
+                * frame after the copy, now we must tell mac80211
                 * to generate the IV/EIV data.
                 */
                key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
@@ -1181,7 +1181,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
                           test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
        rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
        rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
-       rt2x00_set_field32(&word, TXD_W0_CIPHER, txdesc->cipher);
+       rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher);
        rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
        rt2x00_desc_write(txd, 0, word);
 }
@@ -1334,14 +1334,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
 
                /* ICV is located at the end of frame */
 
-               /*
-                * Hardware has stripped IV/EIV data from 802.11 frame during
-                * decryption. It has provided the data seperately but rt2x00lib
-                * should decide if it should be reinserted.
-                */
-               rxdesc->flags |= RX_FLAG_IV_STRIPPED;
-               if (rxdesc->cipher != CIPHER_TKIP)
-                       rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
+               rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
                if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)
                        rxdesc->flags |= RX_FLAG_DECRYPTED;
                else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
index 6d92542fcf0da8c509846726e230b0a40d839d84..87c0f2c8307752be2521032a6904b82ce9530942 100644 (file)
@@ -807,13 +807,11 @@ static void rt2x00lib_rate(struct ieee80211_rate *entry,
 {
        entry->flags = 0;
        entry->bitrate = rate->bitrate;
-       entry->hw_value = rt2x00_create_rate_hw_value(index, 0);
-       entry->hw_value_short = entry->hw_value;
+       entry->hw_value =index;
+       entry->hw_value_short = index;
 
-       if (rate->flags & DEV_RATE_SHORT_PREAMBLE) {
+       if (rate->flags & DEV_RATE_SHORT_PREAMBLE)
                entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE;
-               entry->hw_value_short |= rt2x00_create_rate_hw_value(index, 1);
-       }
 }
 
 static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
index 68f4e0fc35b9e057043b8423a5e752c4e3eb2441..a0cd35b6beb5a5f1a1865dff5e89456a4f435d17 100644 (file)
@@ -97,7 +97,7 @@ void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled)
 
 void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled)
 {
-       if (rt2x00dev->led_radio.type == LED_TYPE_ASSOC)
+       if (rt2x00dev->led_radio.type == LED_TYPE_RADIO)
                rt2x00led_led_simple(&rt2x00dev->led_radio, enabled);
 }
 
index 03024327767be6c83f23343914bed7e208840377..86cd26fbf76922a429ad5b0424e80504ec92d776 100644 (file)
@@ -52,22 +52,11 @@ struct rt2x00_rate {
 
 extern const struct rt2x00_rate rt2x00_supported_rates[12];
 
-static inline u16 rt2x00_create_rate_hw_value(const u16 index,
-                                             const u16 short_preamble)
-{
-       return (short_preamble << 8) | (index & 0xff);
-}
-
 static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
 {
        return &rt2x00_supported_rates[hw_value & 0xff];
 }
 
-static inline int rt2x00_get_rate_preamble(const u16 hw_value)
-{
-       return (hw_value & 0xff00);
-}
-
 /*
  * Radio control handlers.
  */
index eaec6bd93ed5e0adc3f5a0911a8d9dac72356db1..746a8f36b931ec33589a4a37d34e18bf6a05f5fd 100644 (file)
@@ -313,7 +313,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
                 * When preamble is enabled we should set the
                 * preamble bit for the signal.
                 */
-               if (rt2x00_get_rate_preamble(rate->hw_value))
+               if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
                        txdesc->signal |= 0x08;
        }
 }
index 83df312ac56fe02b3b833022c8f432d674e0215e..0b29d767a2582296d0e7d22ea22b24fb02dae543 100644 (file)
@@ -434,11 +434,11 @@ static int rt2x00usb_find_endpoints(struct rt2x00_dev *rt2x00dev)
 
                if (usb_endpoint_is_bulk_in(ep_desc)) {
                        rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc);
-               } else if (usb_endpoint_is_bulk_out(ep_desc)) {
+               } else if (usb_endpoint_is_bulk_out(ep_desc) &&
+                          (queue != queue_end(rt2x00dev))) {
                        rt2x00usb_assign_endpoint(queue, ep_desc);
+                       queue = queue_next(queue);
 
-                       if (queue != queue_end(rt2x00dev))
-                               queue = queue_next(queue);
                        tx_ep_desc = ep_desc;
                }
        }
index d638a8a593705384f58a2cbf6a6e95fd4dd7d0db..96a8d69f8790480b8fee654beebf60b4e5efbda2 100644 (file)
@@ -2321,6 +2321,7 @@ static struct usb_device_id rt73usb_device_table[] = {
        /* Linksys */
        { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) },
        { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) },
+       { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) },
        /* MSI */
        { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) },
        { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) },
index 5f887fb137a9c0d4e95b2fd926e517fb479b4dae..387c133ec0f2629413da721c09fdc3253326c359 100644 (file)
@@ -897,6 +897,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
        dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
                     IEEE80211_HW_RX_INCLUDES_FCS |
                     IEEE80211_HW_SIGNAL_UNSPEC;
+       dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
        dev->queues = 1;
        dev->max_signal = 65;
 
index 00ce3ef39abe6e496de43fa10edaf3e3dd97858a..6ad6bac37706e595e55879ada1de127690b29127 100644 (file)
@@ -213,7 +213,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
        urb = usb_alloc_urb(0, GFP_ATOMIC);
        if (!urb) {
                kfree_skb(skb);
-               return -ENOMEM;
+               return NETDEV_TX_OK;
        }
 
        flags = skb->len;
@@ -281,7 +281,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
        }
        usb_free_urb(urb);
 
-       return rc;
+       return NETDEV_TX_OK;
 }
 
 static void rtl8187_rx_cb(struct urb *urb)
@@ -1471,6 +1471,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf)
        ieee80211_unregister_hw(dev);
 
        priv = dev->priv;
+       usb_reset_device(priv->udev);
        usb_put_dev(interface_to_usbdev(intf));
        ieee80211_free_hw(dev);
 }
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 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 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 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 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 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 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 0a14b495532fcc901d3c3baaa29cb4753d327d7f..7256cf242eb07c7f86521326b1ef6bdd338ce645 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;
 
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 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 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 f24556813375f0b54ec13066f22c10a40775010a..ec54785d34f90904224afe17a2713a8f32ed05ba 100644 (file)
@@ -467,7 +467,7 @@ struct netdev_queue {
  *     This function is called when network device transistions to the down
  *     state.
  *
- * int (*ndo_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);
+ * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);
  *     Called when a packet needs to be transmitted.
  *     Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED,
  *     Required can not be NULL.
@@ -795,6 +795,7 @@ struct net_device
               NETREG_UNREGISTERING,    /* called unregister_netdevice */
               NETREG_UNREGISTERED,     /* completed unregister todo */
               NETREG_RELEASED,         /* called free_netdev */
+              NETREG_DUMMY,            /* dummy device for NAPI poll */
        } reg_state;
 
        /* Called from unregister, can be used to call free_netdev */
@@ -1077,6 +1078,8 @@ extern void               free_netdev(struct net_device *dev);
 extern void            synchronize_net(void);
 extern int             register_netdevice_notifier(struct notifier_block *nb);
 extern int             unregister_netdevice_notifier(struct notifier_block *nb);
+extern int             init_dummy_netdev(struct net_device *dev);
+
 extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
 extern struct net_device       *dev_get_by_index(struct net *net, int ifindex);
 extern struct net_device       *__dev_get_by_index(struct net *net, int ifindex);
index e52ce475d19f13796080ba21f24e4464054f0990..c7ee8744d26bb11567d4b789ca0221dc99985c7c 100644 (file)
@@ -270,6 +270,7 @@ struct xt_match
        struct list_head list;
 
        const char name[XT_FUNCTION_MAXNAMELEN-1];
+       u_int8_t revision;
 
        /* Return true or false: return FALSE and set *hotdrop = 1 to
            force immediate packet drop. */
@@ -302,7 +303,6 @@ struct xt_match
        unsigned short proto;
 
        unsigned short family;
-       u_int8_t revision;
 };
 
 /* Registration hooks for targets. */
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 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..eb1931eef58716ac12aed1c473141136caa5d378 100644 (file)
@@ -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;
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 a65e43a17fbb2c3ab6334be3ab60f8ffd0e19ced..cf754ace0b75ba8c57e35e9420cfd97137ff88f9 100644 (file)
@@ -58,11 +58,11 @@ static struct ctl_table_header *brnf_sysctl_header;
 static int brnf_call_iptables __read_mostly = 1;
 static int brnf_call_ip6tables __read_mostly = 1;
 static int brnf_call_arptables __read_mostly = 1;
-static int brnf_filter_vlan_tagged __read_mostly = 1;
-static int brnf_filter_pppoe_tagged __read_mostly = 1;
+static int brnf_filter_vlan_tagged __read_mostly = 0;
+static int brnf_filter_pppoe_tagged __read_mostly = 0;
 #else
-#define brnf_filter_vlan_tagged 1
-#define brnf_filter_pppoe_tagged 1
+#define brnf_filter_vlan_tagged 0
+#define brnf_filter_pppoe_tagged 0
 #endif
 
 static inline __be16 vlan_proto(const struct sk_buff *skb)
@@ -686,8 +686,11 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
        if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) ||
            IS_PPPOE_IP(skb))
                pf = PF_INET;
-       else
+       else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
+                IS_PPPOE_IPV6(skb))
                pf = PF_INET6;
+       else
+               return NF_ACCEPT;
 
        nf_bridge_pull_encap_header(skb);
 
@@ -828,8 +831,11 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
        if (skb->protocol == htons(ETH_P_IP) || IS_VLAN_IP(skb) ||
            IS_PPPOE_IP(skb))
                pf = PF_INET;
-       else
+       else if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
+                IS_PPPOE_IPV6(skb))
                pf = PF_INET6;
+       else
+               return NF_ACCEPT;
 
 #ifdef CONFIG_NETFILTER_DEBUG
        if (skb->dst == NULL) {
index 8a8743d7d6e77cf36ce4cec7ebe1748be158ba5f..820252aee81f1c1f59bba3cf3e666c2e494b5812 100644 (file)
@@ -79,7 +79,7 @@ static inline int ebt_do_match (struct ebt_entry_match *m,
 {
        par->match     = m->u.match;
        par->matchinfo = m->data;
-       return m->u.match->match(skb, par);
+       return m->u.match->match(skb, par) ? EBT_MATCH : EBT_NOMATCH;
 }
 
 static inline int ebt_dev_check(char *entry, const struct net_device *device)
index 1649c8ab2c2fa61798f2ce4d41d06a2f279b47c8..b7c7d46511365ef5ff8c7bc93678a2ef97966c18 100644 (file)
@@ -347,51 +347,54 @@ static void bcm_tx_timeout_tsklet(unsigned long data)
        struct bcm_op *op = (struct bcm_op *)data;
        struct bcm_msg_head msg_head;
 
-       /* create notification to user */
-       msg_head.opcode  = TX_EXPIRED;
-       msg_head.flags   = op->flags;
-       msg_head.count   = op->count;
-       msg_head.ival1   = op->ival1;
-       msg_head.ival2   = op->ival2;
-       msg_head.can_id  = op->can_id;
-       msg_head.nframes = 0;
-
-       bcm_send_to_user(op, &msg_head, NULL, 0);
-}
-
-/*
- * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions
- */
-static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer)
-{
-       struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer);
-       enum hrtimer_restart ret = HRTIMER_NORESTART;
-
        if (op->kt_ival1.tv64 && (op->count > 0)) {
 
                op->count--;
-               if (!op->count && (op->flags & TX_COUNTEVT))
-                       tasklet_schedule(&op->tsklet);
+               if (!op->count && (op->flags & TX_COUNTEVT)) {
+
+                       /* create notification to user */
+                       msg_head.opcode  = TX_EXPIRED;
+                       msg_head.flags   = op->flags;
+                       msg_head.count   = op->count;
+                       msg_head.ival1   = op->ival1;
+                       msg_head.ival2   = op->ival2;
+                       msg_head.can_id  = op->can_id;
+                       msg_head.nframes = 0;
+
+                       bcm_send_to_user(op, &msg_head, NULL, 0);
+               }
        }
 
        if (op->kt_ival1.tv64 && (op->count > 0)) {
 
                /* send (next) frame */
                bcm_can_tx(op);
-               hrtimer_forward(hrtimer, ktime_get(), op->kt_ival1);
-               ret = HRTIMER_RESTART;
+               hrtimer_start(&op->timer,
+                             ktime_add(ktime_get(), op->kt_ival1),
+                             HRTIMER_MODE_ABS);
 
        } else {
                if (op->kt_ival2.tv64) {
 
                        /* send (next) frame */
                        bcm_can_tx(op);
-                       hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2);
-                       ret = HRTIMER_RESTART;
+                       hrtimer_start(&op->timer,
+                                     ktime_add(ktime_get(), op->kt_ival2),
+                                     HRTIMER_MODE_ABS);
                }
        }
+}
 
-       return ret;
+/*
+ * bcm_tx_timeout_handler - performes cyclic CAN frame transmissions
+ */
+static enum hrtimer_restart bcm_tx_timeout_handler(struct hrtimer *hrtimer)
+{
+       struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer);
+
+       tasklet_schedule(&op->tsklet);
+
+       return HRTIMER_NORESTART;
 }
 
 /*
index b715a55cccc417e07c3165b544b7fc95d162f90f..8d675975d85b97cd6352e56999d6f3a1c13d4b0b 100644 (file)
@@ -2392,6 +2392,9 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
        if (!(skb->dev->features & NETIF_F_GRO))
                goto normal;
 
+       if (skb_is_gso(skb) || skb_shinfo(skb)->frag_list)
+               goto normal;
+
        rcu_read_lock();
        list_for_each_entry_rcu(ptype, head, list) {
                struct sk_buff *p;
@@ -2488,12 +2491,6 @@ EXPORT_SYMBOL(napi_gro_receive);
 
 void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
 {
-       skb_shinfo(skb)->nr_frags = 0;
-
-       skb->len -= skb->data_len;
-       skb->truesize -= skb->data_len;
-       skb->data_len = 0;
-
        __skb_pull(skb, skb_headlen(skb));
        skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb));
 
@@ -4433,6 +4430,45 @@ err_uninit:
        goto out;
 }
 
+/**
+ *     init_dummy_netdev       - init a dummy network device for NAPI
+ *     @dev: device to init
+ *
+ *     This takes a network device structure and initialize the minimum
+ *     amount of fields so it can be used to schedule NAPI polls without
+ *     registering a full blown interface. This is to be used by drivers
+ *     that need to tie several hardware interfaces to a single NAPI
+ *     poll scheduler due to HW limitations.
+ */
+int init_dummy_netdev(struct net_device *dev)
+{
+       /* Clear everything. Note we don't initialize spinlocks
+        * are they aren't supposed to be taken by any of the
+        * NAPI code and this dummy netdev is supposed to be
+        * only ever used for NAPI polls
+        */
+       memset(dev, 0, sizeof(struct net_device));
+
+       /* make sure we BUG if trying to hit standard
+        * register/unregister code path
+        */
+       dev->reg_state = NETREG_DUMMY;
+
+       /* initialize the ref count */
+       atomic_set(&dev->refcnt, 1);
+
+       /* NAPI wants this */
+       INIT_LIST_HEAD(&dev->napi_list);
+
+       /* a dummy interface is started by default */
+       set_bit(__LINK_STATE_PRESENT, &dev->state);
+       set_bit(__LINK_STATE_START, &dev->state);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(init_dummy_netdev);
+
+
 /**
  *     register_netdev - register a network device
  *     @dev: device to register
index 5110b359c758c2e8abe7d13e5f63f90269fbbd5e..65eac77390337e9857c73736618a60ff09737d84 100644 (file)
@@ -2602,6 +2602,12 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
                       skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t));
 
                skb_shinfo(p)->nr_frags += skb_shinfo(skb)->nr_frags;
+               skb_shinfo(skb)->nr_frags = 0;
+
+               skb->truesize -= skb->data_len;
+               skb->len -= skb->data_len;
+               skb->data_len = 0;
+
                NAPI_GRO_CB(skb)->free = 1;
                goto done;
        }
index c9224310ebae68c8573292e06dd1ebd02f21d9ec..52cb6939d093f67f19af6a5c2b69d7fdf46c1921 100644 (file)
@@ -93,13 +93,8 @@ ipt_local_out_hook(unsigned int hook,
 {
        /* root is playing with raw sockets. */
        if (skb->len < sizeof(struct iphdr) ||
-           ip_hdrlen(skb) < sizeof(struct iphdr)) {
-               if (net_ratelimit())
-                       printk("iptable_filter: ignoring short SOCK_RAW "
-                              "packet.\n");
+           ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
-       }
-
        return ipt_do_table(skb, hook, in, out,
                            dev_net(out)->ipv4.iptable_filter);
 }
index 69f2c4287146a078b4f33910591bb30ec73797fd..3929d20b9e452aa33d92f29502b1ccb3fc47c306 100644 (file)
@@ -132,12 +132,8 @@ ipt_local_hook(unsigned int hook,
 
        /* root is playing with raw sockets. */
        if (skb->len < sizeof(struct iphdr)
-           || ip_hdrlen(skb) < sizeof(struct iphdr)) {
-               if (net_ratelimit())
-                       printk("iptable_mangle: ignoring short SOCK_RAW "
-                              "packet.\n");
+           || ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
-       }
 
        /* Save things which could affect route */
        mark = skb->mark;
index 8faebfe638f1fab623f6d528d031720aa6ad4dc7..7f65d18333e3ad195f8f03e6accb86c89612dd55 100644 (file)
@@ -65,12 +65,8 @@ ipt_local_hook(unsigned int hook,
 {
        /* root is playing with raw sockets. */
        if (skb->len < sizeof(struct iphdr) ||
-           ip_hdrlen(skb) < sizeof(struct iphdr)) {
-               if (net_ratelimit())
-                       printk("iptable_raw: ignoring short SOCK_RAW "
-                              "packet.\n");
+           ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
-       }
        return ipt_do_table(skb, hook, in, out,
                            dev_net(out)->ipv4.iptable_raw);
 }
index 36f3be3cc4285ece3804fbabecc6e238fdd6756e..a52a35f4a584fbc34b95a1f55c86e2ea62133731 100644 (file)
@@ -96,12 +96,8 @@ ipt_local_out_hook(unsigned int hook,
 {
        /* Somebody is playing with raw sockets. */
        if (skb->len < sizeof(struct iphdr)
-           || ip_hdrlen(skb) < sizeof(struct iphdr)) {
-               if (net_ratelimit())
-                       printk(KERN_INFO "iptable_security: ignoring short "
-                              "SOCK_RAW packet.\n");
+           || ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
-       }
        return ipt_do_table(skb, hook, in, out,
                            dev_net(out)->ipv4.iptable_security);
 }
index b2141e11575ebb33cb93deec8202525a70348eb5..4beb04fac588720b0b114ed2f68e8fe5be448e90 100644 (file)
@@ -145,11 +145,8 @@ static unsigned int ipv4_conntrack_local(unsigned int hooknum,
 {
        /* root is playing with raw sockets. */
        if (skb->len < sizeof(struct iphdr) ||
-           ip_hdrlen(skb) < sizeof(struct iphdr)) {
-               if (net_ratelimit())
-                       printk("ipt_hook: happy cracking.\n");
+           ip_hdrlen(skb) < sizeof(struct iphdr))
                return NF_ACCEPT;
-       }
        return nf_conntrack_in(dev_net(out), PF_INET, hooknum, skb);
 }
 
index 1fd3ef7718b60cfec90235220f9494c6c3f05757..2a8bee26f43d9dcb58079a291a69264455342b22 100644 (file)
@@ -20,7 +20,7 @@
 #include <net/netfilter/nf_conntrack_core.h>
 #include <net/netfilter/nf_log.h>
 
-static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ;
+static unsigned int nf_ct_icmp_timeout __read_mostly = 30*HZ;
 
 static bool icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
                              struct nf_conntrack_tuple *tuple)
index ce572f9dff023529e6aaea9dcea9aa9476a9746d..0cd71b84e483d3a1685bde2e947117b8a24aac91 100644 (file)
@@ -522,8 +522,12 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
                                unsigned int offset, size_t len)
 {
        struct tcp_splice_state *tss = rd_desc->arg.data;
+       int ret;
 
-       return skb_splice_bits(skb, offset, tss->pipe, tss->len, tss->flags);
+       ret = skb_splice_bits(skb, offset, tss->pipe, rd_desc->count, tss->flags);
+       if (ret > 0)
+               rd_desc->count -= ret;
+       return ret;
 }
 
 static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
@@ -531,6 +535,7 @@ static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
        /* Store TCP splice context information in read_descriptor_t. */
        read_descriptor_t rd_desc = {
                .arg.data = tss,
+               .count    = tss->len,
        };
 
        return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv);
@@ -611,11 +616,13 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
                tss.len -= ret;
                spliced += ret;
 
+               if (!timeo)
+                       break;
                release_sock(sk);
                lock_sock(sk);
 
                if (sk->sk_err || sk->sk_state == TCP_CLOSE ||
-                   (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo ||
+                   (sk->sk_shutdown & RCV_SHUTDOWN) ||
                    signal_pending(current))
                        break;
        }
@@ -2382,7 +2389,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
        unsigned int seq;
        __be32 delta;
        unsigned int oldlen;
-       unsigned int len;
+       unsigned int mss;
 
        if (!pskb_may_pull(skb, sizeof(*th)))
                goto out;
@@ -2398,10 +2405,13 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
        oldlen = (u16)~skb->len;
        __skb_pull(skb, thlen);
 
+       mss = skb_shinfo(skb)->gso_size;
+       if (unlikely(skb->len <= mss))
+               goto out;
+
        if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
                /* Packet is from an untrusted source, reset gso_segs. */
                int type = skb_shinfo(skb)->gso_type;
-               int mss;
 
                if (unlikely(type &
                             ~(SKB_GSO_TCPV4 |
@@ -2412,7 +2422,6 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
                             !(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))))
                        goto out;
 
-               mss = skb_shinfo(skb)->gso_size;
                skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
 
                segs = NULL;
@@ -2423,8 +2432,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
        if (IS_ERR(segs))
                goto out;
 
-       len = skb_shinfo(skb)->gso_size;
-       delta = htonl(oldlen + (thlen + len));
+       delta = htonl(oldlen + (thlen + mss));
 
        skb = segs;
        th = tcp_hdr(skb);
@@ -2440,7 +2448,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
                             csum_fold(csum_partial(skb_transport_header(skb),
                                                    thlen, skb->csum));
 
-               seq += len;
+               seq += mss;
                skb = skb->next;
                th = tcp_hdr(skb);
 
index 29c7c99e69f7611034354319b9e6452f26972635..52ee1dced2ffe2ed28c86e6ef7dd355cfe18ee70 100644 (file)
@@ -298,6 +298,10 @@ static void fib6_dump_end(struct netlink_callback *cb)
        struct fib6_walker_t *w = (void*)cb->args[2];
 
        if (w) {
+               if (cb->args[4]) {
+                       cb->args[4] = 0;
+                       fib6_walker_unlink(w);
+               }
                cb->args[2] = 0;
                kfree(w);
        }
@@ -330,15 +334,12 @@ static int fib6_dump_table(struct fib6_table *table, struct sk_buff *skb,
                read_lock_bh(&table->tb6_lock);
                res = fib6_walk_continue(w);
                read_unlock_bh(&table->tb6_lock);
-               if (res != 0) {
-                       if (res < 0)
-                               fib6_walker_unlink(w);
-                       goto end;
+               if (res <= 0) {
+                       fib6_walker_unlink(w);
+                       cb->args[4] = 0;
                }
-               fib6_walker_unlink(w);
-               cb->args[4] = 0;
        }
-end:
+
        return res;
 }
 
index bd52151d31e92f19146b96dfa324259d46670a0e..c455cf4ee7560a744a08bafbe546eb3e1b2a7998 100644 (file)
@@ -26,7 +26,7 @@
 #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h>
 #include <net/netfilter/nf_log.h>
 
-static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
+static unsigned int nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
 
 static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb,
                                unsigned int dataoff,
index 5f510a13b9f0a5679d3ed736efa927532fc18f2a..c5c0c5271096ca7ae3369c2d99b0eeafe34bd413 100644 (file)
@@ -469,7 +469,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
        struct ieee80211_sub_if_data *sdata;
        u16 start_seq_num;
        u8 *state;
-       int ret;
+       int ret = 0;
 
        if ((tid >= STA_TID_NUM) || !(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION))
                return -EINVAL;
index 5abbc3f07dd6eb4c035b697698c878450e444c1e..b9074824862aee74c9e6555f3d43a0cba51cd4f8 100644 (file)
@@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
                return 0;
 
        /* Setting ad-hoc mode on non-IBSS channel is not supported. */
-       if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
+       if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS &&
+           type == NL80211_IFTYPE_ADHOC)
                return -EOPNOTSUPP;
 
        /*
index 929ba542fd7294fb812983384552cb2fbb869076..1159bdb4119c6ecad0167b266b9fa4f8fb7b3b4a 100644 (file)
@@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
 
        sta->flags = WLAN_STA_AUTHORIZED;
        sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+       rate_control_rate_init(sta);
 
        return sta;
 }
index 2b3b490a6073467755e3b83998d1480398864148..3824990d340bdb75f5357088740438d8658e6f75 100644 (file)
@@ -395,13 +395,15 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
 {
        struct minstrel_sta_info *mi = priv_sta;
        struct minstrel_priv *mp = priv;
-       struct minstrel_rate *mr_ctl;
+       struct ieee80211_local *local = hw_to_local(mp->hw);
+       struct ieee80211_rate *ctl_rate;
        unsigned int i, n = 0;
        unsigned int t_slot = 9; /* FIXME: get real slot time */
 
        mi->lowest_rix = rate_lowest_index(sband, sta);
-       mr_ctl = &mi->r[rix_to_ndx(mi, mi->lowest_rix)];
-       mi->sp_ack_dur = mr_ctl->ack_time;
+       ctl_rate = &sband->bitrates[mi->lowest_rix];
+       mi->sp_ack_dur = ieee80211_frame_duration(local, 10, ctl_rate->bitrate,
+                               !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1);
 
        for (i = 0; i < sband->n_bitrates; i++) {
                struct minstrel_rate *mr = &mi->r[n];
@@ -416,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
 
                mr->rix = i;
                mr->bitrate = sband->bitrates[i].bitrate / 5;
-               calc_rate_durations(mi, hw_to_local(mp->hw), mr,
+               calc_rate_durations(mi, local, mr,
                                &sband->bitrates[i]);
 
                /* calculate maximum number of retransmissions before
index 7e83f74cd5de3dea8f3ba32a2feea84f12cbe359..90ce9ddb9451a0c02f8d55b380ea07ee618265ed 100644 (file)
@@ -469,7 +469,7 @@ struct nf_conn *nf_conntrack_alloc(struct net *net,
                                   const struct nf_conntrack_tuple *repl,
                                   gfp_t gfp)
 {
-       struct nf_conn *ct = NULL;
+       struct nf_conn *ct;
 
        if (unlikely(!nf_conntrack_hash_rnd_initted)) {
                get_random_bytes(&nf_conntrack_hash_rnd, 4);
@@ -551,7 +551,7 @@ init_conntrack(struct net *net,
        }
 
        ct = nf_conntrack_alloc(net, tuple, &repl_tuple, GFP_ATOMIC);
-       if (ct == NULL || IS_ERR(ct)) {
+       if (IS_ERR(ct)) {
                pr_debug("Can't allocate conntrack.\n");
                return (struct nf_conntrack_tuple_hash *)ct;
        }
index 00e8c27130ff6ad6fa345b860948ddb8dca2bf4e..3dddec6d2f7ed05ed4de8a1a38c0b2ce572cdb9c 100644 (file)
@@ -1134,7 +1134,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
        struct nf_conntrack_helper *helper;
 
        ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC);
-       if (ct == NULL || IS_ERR(ct))
+       if (IS_ERR(ct))
                return -ENOMEM;
 
        if (!cda[CTA_TIMEOUT])
index 89837a4eef7621e6678049fee3c096bf67de8acf..bfbf521f6ea5a4bba99387781d9033cba0ff30a1 100644 (file)
@@ -273,6 +273,10 @@ static int match_revfn(u8 af, const char *name, u8 revision, int *bestp)
                                have_rev = 1;
                }
        }
+
+       if (af != NFPROTO_UNSPEC && !have_rev)
+               return match_revfn(NFPROTO_UNSPEC, name, revision, bestp);
+
        return have_rev;
 }
 
@@ -289,6 +293,10 @@ static int target_revfn(u8 af, const char *name, u8 revision, int *bestp)
                                have_rev = 1;
                }
        }
+
+       if (af != NFPROTO_UNSPEC && !have_rev)
+               return target_revfn(NFPROTO_UNSPEC, name, revision, bestp);
+
        return have_rev;
 }
 
index 29375ba8db7335ca8dfb02b02336783f96fec83d..93acaa59d1089909378d2c6768942345e197217e 100644 (file)
@@ -243,6 +243,17 @@ static struct xt_match xt_time_mt_reg __read_mostly = {
 
 static int __init time_mt_init(void)
 {
+       int minutes = sys_tz.tz_minuteswest;
+
+       if (minutes < 0) /* east of Greenwich */
+               printk(KERN_INFO KBUILD_MODNAME
+                      ": kernel timezone is +%02d%02d\n",
+                      -minutes / 60, -minutes % 60);
+       else /* west of Greenwich */
+               printk(KERN_INFO KBUILD_MODNAME
+                      ": kernel timezone is -%02d%02d\n",
+                      minutes / 60, minutes % 60);
+
        return xt_register_match(&xt_time_mt_reg);
 }
 
index 5070643ce534b468a85b3df2f1666d0ae35b08ad..2f0f0b04d3fb127efa75b362beeb62c9aab11bde 100644 (file)
@@ -661,12 +661,13 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
  * next pending event (0 for no event in pq).
  * Note: Applied are events whose have cl->pq_key <= q->now.
  */
-static psched_time_t htb_do_events(struct htb_sched *q, int level)
+static psched_time_t htb_do_events(struct htb_sched *q, int level,
+                                  unsigned long start)
 {
        /* don't run for longer than 2 jiffies; 2 is used instead of
           1 to simplify things when jiffy is going to be incremented
           too soon */
-       unsigned long stop_at = jiffies + 2;
+       unsigned long stop_at = start + 2;
        while (time_before(jiffies, stop_at)) {
                struct htb_class *cl;
                long diff;
@@ -685,8 +686,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level)
                if (cl->cmode != HTB_CAN_SEND)
                        htb_add_to_wait_tree(q, cl, diff);
        }
-       /* too much load - let's continue on next jiffie */
-       return q->now + PSCHED_TICKS_PER_SEC / HZ;
+       /* too much load - let's continue on next jiffie (including above) */
+       return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ;
 }
 
 /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
@@ -845,6 +846,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
        struct htb_sched *q = qdisc_priv(sch);
        int level;
        psched_time_t next_event;
+       unsigned long start_at;
 
        /* try to dequeue direct packets as high prio (!) to minimize cpu work */
        skb = __skb_dequeue(&q->direct_queue);
@@ -857,6 +859,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
        if (!sch->q.qlen)
                goto fin;
        q->now = psched_get_time();
+       start_at = jiffies;
 
        next_event = q->now + 5 * PSCHED_TICKS_PER_SEC;
 
@@ -866,14 +869,14 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
                psched_time_t event;
 
                if (q->now >= q->near_ev_cache[level]) {
-                       event = htb_do_events(q, level);
+                       event = htb_do_events(q, level, start_at);
                        if (!event)
                                event = q->now + PSCHED_TICKS_PER_SEC;
                        q->near_ev_cache[level] = event;
                } else
                        event = q->near_ev_cache[level];
 
-               if (event && next_event > event)
+               if (next_event > event)
                        next_event = event;
 
                m = ~q->row_mask[level];
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 b95a2d64eb59c3f86e066acc86fee8e2e7fb61e1..7877e7975dae3f5ea0b2ceae879362f2a47d2198 100644 (file)
@@ -1914,10 +1914,17 @@ static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
 }
 #endif
 
+/* For the xfrm_usersa_info cases we have to work around some 32-bit vs.
+ * 64-bit compatability issues.  On 32-bit the structure is 220 bytes, but
+ * for 64-bit it gets padded out to 224 bytes.  Those bytes are just
+ * padding and don't have any content we care about.  Therefore as long
+ * as we have enough bytes for the content we can make both cases work.
+ */
+
 #define XMSGSIZE(type) sizeof(struct type)
 
 static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = {
-       [XFRM_MSG_NEWSA       - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info),
+       [XFRM_MSG_NEWSA       - XFRM_MSG_BASE] = 220, /* see above */
        [XFRM_MSG_DELSA       - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id),
        [XFRM_MSG_GETSA       - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id),
        [XFRM_MSG_NEWPOLICY   - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info),
@@ -1927,7 +1934,7 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = {
        [XFRM_MSG_ACQUIRE     - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire),
        [XFRM_MSG_EXPIRE      - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire),
        [XFRM_MSG_UPDPOLICY   - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info),
-       [XFRM_MSG_UPDSA       - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info),
+       [XFRM_MSG_UPDSA       - XFRM_MSG_BASE] = 220, /* see above */
        [XFRM_MSG_POLEXPIRE   - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire),
        [XFRM_MSG_FLUSHSA     - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush),
        [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0,
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 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