From 0c109ce41d5198d3658dfb05b35a1fca9347d58c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 15 Jan 2009 17:31:00 +0100 Subject: [PATCH] --- yaml --- r: 129911 b: refs/heads/master c: c9280d681c4093405fc896dc25f81d5ff9de8183 h: refs/heads/master i: 129909: af8cf5cbedcbce582402b76373ea0b80ab6fd1da 129907: 1f4e8fc3a59daa0efcc9941355872a7870095420 129903: d1130e5f4ea36b9ab639928f57e2aa9b70001de3 v: v3 --- [refs] | 2 +- trunk/CREDITS | 11 +- trunk/Documentation/DMA-API.txt | 9 +- trunk/Documentation/accounting/getdelays.c | 4 - trunk/Documentation/cgroups/cgroups.txt | 5 +- .../{cgroups => controllers}/cpuacct.txt | 0 .../{cgroups => controllers}/devices.txt | 0 .../{cgroups => controllers}/memcg_test.txt | 2 +- .../{cgroups => controllers}/memory.txt | 0 .../resource_counter.txt | 0 trunk/Documentation/{cgroups => }/cpusets.txt | 0 trunk/Documentation/filesystems/proc.txt | 288 +++- trunk/Documentation/hwmon/adt7475 | 87 -- trunk/Documentation/hwmon/lis3lv02d | 30 +- trunk/Documentation/laptops/thinkpad-acpi.txt | 25 +- trunk/Documentation/mips/AU1xxx_IDE.README | 6 +- .../scheduler/sched-design-CFS.txt | 2 +- trunk/Documentation/sysctl/vm.txt | 619 +++------ trunk/Documentation/sysrq.txt | 19 +- trunk/MAINTAINERS | 19 +- trunk/Makefile | 2 +- trunk/arch/Kconfig | 3 - trunk/arch/alpha/include/asm/Kbuild | 1 + trunk/arch/alpha/include/asm/byteorder.h | 1 + trunk/arch/alpha/include/asm/machvec.h | 4 - trunk/arch/alpha/include/asm/pgalloc.h | 7 +- trunk/arch/alpha/include/asm/rtc.h | 12 +- trunk/arch/alpha/kernel/.gitignore | 1 - trunk/arch/alpha/kernel/core_marvel.c | 10 +- trunk/arch/alpha/kernel/entry.S | 8 +- trunk/arch/alpha/kernel/irq_srm.c | 2 - trunk/arch/alpha/kernel/machvec_impl.h | 5 +- trunk/arch/alpha/kernel/proto.h | 2 - trunk/arch/alpha/kernel/sys_jensen.c | 2 - trunk/arch/alpha/kernel/sys_marvel.c | 56 +- trunk/arch/alpha/kernel/sys_nautilus.c | 4 - trunk/arch/alpha/kernel/systbls.S | 2 +- trunk/arch/alpha/kernel/time.c | 10 - trunk/arch/alpha/mm/init.c | 7 + trunk/arch/arm/include/asm/Kbuild | 1 + trunk/arch/arm/include/asm/byteorder.h | 2 + trunk/arch/arm/kernel/calls.S | 2 +- trunk/arch/arm/mach-imx/clock.c | 2 +- trunk/arch/arm/mach-imx/generic.c | 6 +- .../arch/arm/mach-imx/include/mach/imx-regs.h | 106 ++ trunk/arch/arm/mach-w90x900/mach-w90p910evb.c | 1 - trunk/arch/arm/mach-w90x900/time.c | 1 + trunk/arch/arm/mm/proc-syms.c | 1 - trunk/arch/avr32/include/asm/Kbuild | 1 + trunk/arch/avr32/include/asm/byteorder.h | 1 + trunk/arch/blackfin/include/asm/Kbuild | 1 + trunk/arch/blackfin/include/asm/byteorder.h | 1 + trunk/arch/cris/arch-v10/kernel/entry.S | 2 +- trunk/arch/cris/arch-v32/kernel/entry.S | 2 +- .../arch-v10/arch/{swab.h => byteorder.h} | 16 +- .../cris/include/arch-v32/arch/byteorder.h | 20 + trunk/arch/cris/include/arch-v32/arch/swab.h | 24 - trunk/arch/cris/include/asm/byteorder.h | 19 + trunk/arch/cris/include/asm/swab.h | 8 - trunk/arch/h8300/include/asm/Kbuild | 1 + trunk/arch/h8300/include/asm/byteorder.h | 1 + trunk/arch/h8300/kernel/syscalls.S | 2 +- trunk/arch/ia64/Kconfig | 1 - trunk/arch/ia64/configs/generic_defconfig | 2 +- trunk/arch/ia64/ia32/ia32_entry.S | 2 +- trunk/arch/ia64/include/asm/Kbuild | 1 + trunk/arch/ia64/include/asm/byteorder.h | 1 + trunk/arch/ia64/include/asm/dma-mapping.h | 2 - trunk/arch/ia64/include/asm/machvec.h | 7 - trunk/arch/ia64/include/asm/machvec_init.h | 1 - trunk/arch/ia64/include/asm/machvec_sn2.h | 2 - trunk/arch/ia64/include/asm/unistd.h | 2 +- trunk/arch/ia64/kernel/entry.S | 2 +- trunk/arch/ia64/kernel/kprobes.c | 2 +- trunk/arch/ia64/kernel/sys_ia64.c | 2 +- trunk/arch/ia64/kernel/unaligned.c | 6 +- trunk/arch/ia64/pci/pci.c | 27 - trunk/arch/ia64/sn/pci/pci_dma.c | 6 - trunk/arch/ia64/xen/time.c | 4 +- trunk/arch/m68k/kernel/entry.S | 2 +- trunk/arch/m68knommu/include/asm/Kbuild | 2 + trunk/arch/m68knommu/include/asm/byteorder.h | 1 + trunk/arch/m68knommu/kernel/syscalltable.S | 2 +- trunk/arch/mips/include/asm/Kbuild | 1 + trunk/arch/mips/include/asm/byteorder.h | 2 + trunk/arch/mips/kernel/scall32-o32.S | 2 +- trunk/arch/mn10300/kernel/entry.S | 2 +- trunk/arch/parisc/include/asm/Kbuild | 1 + trunk/arch/parisc/include/asm/byteorder.h | 1 + trunk/arch/powerpc/Kconfig | 1 - trunk/arch/powerpc/boot/dts/mpc8315erdb.dts | 4 +- trunk/arch/powerpc/boot/dts/mpc8544ds.dts | 4 +- trunk/arch/powerpc/boot/dts/mpc8572ds.dts | 4 +- .../powerpc/boot/dts/mpc8572ds_camp_core0.dts | 2 +- .../powerpc/boot/dts/mpc8572ds_camp_core1.dts | 2 +- trunk/arch/powerpc/configs/ppc64_defconfig | 26 +- trunk/arch/powerpc/include/asm/Kbuild | 1 + trunk/arch/powerpc/include/asm/byteorder.h | 2 + trunk/arch/powerpc/include/asm/ps3.h | 8 +- trunk/arch/powerpc/include/asm/qe.h | 19 +- trunk/arch/powerpc/include/asm/rtas.h | 2 +- trunk/arch/powerpc/include/asm/systbl.h | 2 +- trunk/arch/powerpc/include/asm/types.h | 7 +- trunk/arch/powerpc/kernel/asm-offsets.c | 7 - trunk/arch/powerpc/kernel/cacheinfo.c | 10 +- trunk/arch/powerpc/kernel/dma-iommu.c | 4 +- trunk/arch/powerpc/kernel/head_64.S | 9 - trunk/arch/powerpc/kernel/head_fsl_booke.S | 8 +- trunk/arch/powerpc/kernel/iommu.c | 12 +- trunk/arch/powerpc/kernel/lparcfg.c | 10 +- trunk/arch/powerpc/kernel/machine_kexec.c | 25 - trunk/arch/powerpc/kernel/pci_64.c | 6 +- trunk/arch/powerpc/kernel/prom.c | 5 - trunk/arch/powerpc/kernel/setup_64.c | 6 +- trunk/arch/powerpc/kernel/vmlinux.lds.S | 4 +- trunk/arch/powerpc/mm/fsl_booke_mmu.c | 9 +- trunk/arch/powerpc/mm/mmu_decl.h | 11 +- trunk/arch/powerpc/mm/slice.c | 11 +- trunk/arch/powerpc/mm/stab.c | 4 +- trunk/arch/powerpc/oprofile/op_model_pa6t.c | 6 +- trunk/arch/powerpc/platforms/512x/clock.c | 4 +- .../powerpc/platforms/52xx/mpc52xx_gpio.c | 3 + .../arch/powerpc/platforms/52xx/mpc52xx_pic.c | 8 +- trunk/arch/powerpc/platforms/83xx/Makefile | 1 - trunk/arch/powerpc/platforms/Kconfig | 11 - .../powerpc/platforms/cell/beat_interrupt.c | 2 +- .../powerpc/platforms/cell/celleb_scc_epci.c | 4 +- trunk/arch/powerpc/platforms/cell/iommu.c | 4 +- trunk/arch/powerpc/platforms/cell/ras.c | 8 +- trunk/arch/powerpc/platforms/cell/spu_base.c | 4 +- .../powerpc/platforms/cell/spu_callbacks.c | 2 +- .../powerpc/platforms/cell/spufs/coredump.c | 2 +- .../arch/powerpc/platforms/cell/spufs/fault.c | 2 +- .../arch/powerpc/platforms/cell/spufs/file.c | 6 +- trunk/arch/powerpc/platforms/fsl_uli1575.c | 1 - trunk/arch/powerpc/platforms/iseries/iommu.c | 4 +- trunk/arch/powerpc/platforms/powermac/smp.c | 2 +- .../arch/powerpc/platforms/ps3/device-init.c | 26 +- trunk/arch/powerpc/platforms/ps3/htab.c | 2 +- trunk/arch/powerpc/platforms/ps3/interrupt.c | 28 +- trunk/arch/powerpc/platforms/ps3/mm.c | 97 +- trunk/arch/powerpc/platforms/ps3/os-area.c | 2 +- trunk/arch/powerpc/platforms/ps3/repository.c | 22 +- trunk/arch/powerpc/platforms/ps3/setup.c | 2 +- trunk/arch/powerpc/platforms/ps3/spu.c | 12 +- trunk/arch/powerpc/platforms/ps3/system-bus.c | 14 +- trunk/arch/powerpc/platforms/pseries/iommu.c | 35 +- trunk/arch/powerpc/sysdev/fsl_pci.c | 107 +- trunk/arch/powerpc/sysdev/mpic.c | 2 +- trunk/arch/s390/Kconfig | 1 - trunk/arch/s390/include/asm/Kbuild | 1 + trunk/arch/s390/include/asm/byteorder.h | 1 + trunk/arch/s390/kernel/compat_wrapper.S | 4 +- trunk/arch/s390/kernel/entry.h | 16 +- trunk/arch/s390/kernel/process.c | 9 +- trunk/arch/s390/kernel/signal.c | 19 +- trunk/arch/s390/kernel/sys_s390.c | 35 +- trunk/arch/s390/kernel/syscalls.S | 12 +- trunk/arch/sh/include/asm/Kbuild | 1 + trunk/arch/sh/include/asm/byteorder.h | 2 + trunk/arch/sh/include/asm/syscalls_32.h | 6 +- trunk/arch/sh/kernel/sys_sh32.c | 2 +- trunk/arch/sh/kernel/syscalls_32.S | 4 +- trunk/arch/sh/kernel/syscalls_64.S | 2 +- trunk/arch/sparc/include/asm/Kbuild | 1 + trunk/arch/sparc/include/asm/byteorder.h | 1 + trunk/arch/sparc/kernel/entry.S | 4 +- trunk/arch/sparc/kernel/sparc_ksyms_64.c | 11 + trunk/arch/sparc/kernel/syscalls.S | 2 +- trunk/arch/sparc/kernel/systbls_32.S | 4 +- trunk/arch/sparc/kernel/systbls_64.S | 4 +- trunk/arch/x86/include/asm/Kbuild | 1 + trunk/arch/x86/include/asm/byteorder.h | 1 + trunk/arch/x86/include/asm/pgtable.h | 19 - trunk/arch/x86/kernel/entry_32.S | 2 + trunk/arch/x86/kernel/kprobes.c | 2 +- trunk/arch/x86/kernel/syscall_table_32.S | 2 +- trunk/arch/x86/mm/pat.c | 45 +- trunk/arch/x86/pci/i386.c | 12 +- trunk/arch/xtensa/include/asm/Kbuild | 2 + trunk/arch/xtensa/include/asm/byteorder.h | 2 + trunk/drivers/acpi/Makefile | 2 +- trunk/drivers/acpi/ec.c | 73 +- trunk/drivers/acpi/{sleep.c => main.c} | 0 trunk/drivers/acpi/thermal.c | 16 +- trunk/drivers/ata/Kconfig | 9 - trunk/drivers/ata/Makefile | 1 - trunk/drivers/ata/libata-core.c | 73 +- trunk/drivers/ata/libata-scsi.c | 17 +- trunk/drivers/ata/libata-sff.c | 9 +- trunk/drivers/ata/pata_ali.c | 28 +- trunk/drivers/ata/pata_atiixp.c | 32 +- trunk/drivers/ata/pata_it821x.c | 17 +- trunk/drivers/ata/pata_octeon_cf.c | 965 ------------- trunk/drivers/ata/sata_fsl.c | 2 +- trunk/drivers/ata/sata_via.c | 2 - trunk/drivers/block/nbd.c | 4 - trunk/drivers/block/ps3disk.c | 18 +- trunk/drivers/block/xsysace.c | 1 - trunk/drivers/char/bsr.c | 2 +- trunk/drivers/char/hvc_console.c | 12 +- trunk/drivers/char/hvc_irq.c | 2 +- trunk/drivers/char/ps3flash.c | 18 +- trunk/drivers/char/synclink_gt.c | 16 +- trunk/drivers/char/sysrq.c | 6 - trunk/drivers/char/tty_ioctl.c | 2 +- trunk/drivers/gpio/max7301.c | 6 +- trunk/drivers/gpio/max732x.c | 6 +- trunk/drivers/gpio/mcp23s08.c | 6 +- trunk/drivers/gpio/pca953x.c | 6 +- trunk/drivers/gpio/pcf857x.c | 12 +- trunk/drivers/gpu/drm/drm_crtc_helper.c | 175 +-- trunk/drivers/gpu/drm/drm_irq.c | 18 +- trunk/drivers/gpu/drm/i915/i915_dma.c | 10 - trunk/drivers/gpu/drm/i915/i915_drv.h | 23 - trunk/drivers/gpu/drm/i915/i915_gem.c | 189 +-- trunk/drivers/gpu/drm/i915/i915_irq.c | 6 - trunk/drivers/gpu/drm/i915/intel_display.c | 43 +- trunk/drivers/gpu/drm/i915/intel_lvds.c | 7 - trunk/drivers/hwmon/Kconfig | 24 +- trunk/drivers/hwmon/Makefile | 2 - trunk/drivers/hwmon/abituguru3.c | 24 +- trunk/drivers/hwmon/adt7475.c | 1221 ----------------- trunk/drivers/hwmon/applesmc.c | 5 - trunk/drivers/hwmon/hp_accel.c | 75 +- trunk/drivers/hwmon/k8temp.c | 55 +- trunk/drivers/i2c/chips/Kconfig | 11 + trunk/drivers/i2c/chips/Makefile | 1 + .../i2c/chips}/mcu_mpc8349emitx.c | 0 trunk/drivers/ide/Kconfig | 5 + trunk/drivers/ide/ide-disk.c | 2 +- trunk/drivers/ide/ide-iops.c | 2 +- trunk/drivers/ide/ide-pm.c | 12 +- trunk/drivers/ide/ide-probe.c | 2 +- trunk/drivers/ide/it821x.c | 15 +- trunk/drivers/ide/sl82c105.c | 4 + trunk/drivers/ide/tx4938ide.c | 1 + trunk/drivers/ide/via82cxxx.c | 2 + trunk/drivers/infiniband/hw/ehca/ehca_main.c | 2 +- trunk/drivers/infiniband/hw/mlx4/main.c | 13 +- trunk/drivers/infiniband/hw/nes/nes_cm.c | 12 +- trunk/drivers/infiniband/hw/nes/nes_utils.c | 4 +- .../drivers/infiniband/ulp/ipoib/ipoib_main.c | 38 +- .../infiniband/ulp/ipoib/ipoib_multicast.c | 3 - trunk/drivers/infiniband/ulp/iser/Kconfig | 2 +- trunk/drivers/isdn/i4l/isdn_net.c | 9 +- trunk/drivers/leds/Kconfig | 7 + trunk/drivers/leds/Makefile | 1 + trunk/drivers/leds/leds-hp-disk.c | 137 ++ trunk/drivers/message/fusion/lsi/mpi.h | 7 +- trunk/drivers/message/fusion/lsi/mpi_cnfg.h | 47 +- trunk/drivers/message/fusion/lsi/mpi_fc.h | 2 +- .../message/fusion/lsi/mpi_history.txt | 86 +- trunk/drivers/message/fusion/lsi/mpi_init.h | 2 +- trunk/drivers/message/fusion/lsi/mpi_ioc.h | 22 +- trunk/drivers/message/fusion/lsi/mpi_lan.h | 2 +- trunk/drivers/message/fusion/lsi/mpi_log_fc.h | 2 +- .../drivers/message/fusion/lsi/mpi_log_sas.h | 37 +- trunk/drivers/message/fusion/lsi/mpi_raid.h | 11 +- trunk/drivers/message/fusion/lsi/mpi_sas.h | 18 +- trunk/drivers/message/fusion/lsi/mpi_targ.h | 2 +- trunk/drivers/message/fusion/lsi/mpi_tool.h | 2 +- trunk/drivers/message/fusion/lsi/mpi_type.h | 4 +- trunk/drivers/message/fusion/mptbase.c | 87 +- trunk/drivers/message/fusion/mptbase.h | 3 - trunk/drivers/message/fusion/mptscsih.c | 3 - trunk/drivers/mfd/twl4030-core.c | 8 +- trunk/drivers/misc/Makefile | 1 + .../{platform/x86 => misc}/dell-laptop.c | 2 +- trunk/drivers/misc/sgi-xp/xpc_sn2.c | 2 +- trunk/drivers/net/arm/etherh.c | 2 +- trunk/drivers/net/ax88796.c | 27 +- trunk/drivers/net/b44.c | 4 +- trunk/drivers/net/b44.h | 2 +- trunk/drivers/net/bnx2x.h | 19 +- trunk/drivers/net/bnx2x_main.c | 178 +-- trunk/drivers/net/ehea/ehea_main.c | 8 +- trunk/drivers/net/ehea/ehea_qmr.c | 18 +- trunk/drivers/net/fs_enet/fs_enet-main.c | 1 - trunk/drivers/net/gianfar.c | 8 - trunk/drivers/net/ibm_newemac/mal.c | 4 +- trunk/drivers/net/ibm_newemac/mal.h | 2 - trunk/drivers/net/ibmveth.c | 16 +- trunk/drivers/net/irda/irda-usb.c | 2 +- trunk/drivers/net/iseries_veth.c | 2 +- trunk/drivers/net/korina.c | 158 ++- trunk/drivers/net/mlx4/main.c | 4 +- trunk/drivers/net/netxen/netxen_nic.h | 146 +- trunk/drivers/net/netxen/netxen_nic_ctx.c | 50 +- trunk/drivers/net/netxen/netxen_nic_ethtool.c | 31 +- trunk/drivers/net/netxen/netxen_nic_hw.c | 97 +- trunk/drivers/net/netxen/netxen_nic_init.c | 105 +- trunk/drivers/net/netxen/netxen_nic_main.c | 210 ++- trunk/drivers/net/pasemi_mac.c | 6 +- trunk/drivers/net/phy/phy_device.c | 9 + trunk/drivers/net/ppp_generic.c | 43 +- trunk/drivers/net/sis900.c | 8 +- trunk/drivers/net/usb/hso.c | 12 +- trunk/drivers/net/wan/ixp4xx_hss.c | 6 +- trunk/drivers/net/wireless/Kconfig | 2 +- trunk/drivers/net/wireless/ath5k/base.c | 8 +- trunk/drivers/net/wireless/ath5k/pcu.c | 4 +- trunk/drivers/net/wireless/ath5k/reg.h | 2 +- trunk/drivers/net/wireless/ath9k/Kconfig | 1 - trunk/drivers/net/wireless/ath9k/main.c | 4 +- trunk/drivers/net/wireless/ath9k/xmit.c | 48 +- trunk/drivers/net/wireless/b43/main.c | 2 +- trunk/drivers/net/wireless/b43legacy/main.c | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-3945.c | 2 +- .../net/wireless/iwlwifi/iwl-commands.h | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c | 1 - trunk/drivers/net/wireless/libertas_tf/main.c | 2 +- trunk/drivers/net/wireless/orinoco/orinoco.c | 28 +- .../drivers/net/wireless/orinoco/orinoco_cs.c | 1 - trunk/drivers/net/wireless/p54/p54common.c | 34 +- trunk/drivers/net/wireless/p54/p54usb.c | 2 - trunk/drivers/net/wireless/rt2x00/rt2500usb.c | 23 +- trunk/drivers/net/wireless/rt2x00/rt2x00dev.c | 8 +- .../drivers/net/wireless/rt2x00/rt2x00leds.c | 2 +- trunk/drivers/net/wireless/rt2x00/rt2x00lib.h | 11 + .../drivers/net/wireless/rt2x00/rt2x00queue.c | 2 +- trunk/drivers/net/wireless/rt2x00/rt2x00usb.c | 6 +- trunk/drivers/net/wireless/rt2x00/rt73usb.c | 1 - .../net/wireless/rtl818x/rtl8180_dev.c | 1 - .../net/wireless/rtl818x/rtl8187_dev.c | 5 +- trunk/drivers/of/of_i2c.c | 19 - trunk/drivers/parisc/superio.c | 1 + trunk/drivers/pci/hotplug/acpiphp_glue.c | 2 - trunk/drivers/pci/intel-iommu.c | 3 +- trunk/drivers/pci/pci.c | 8 +- trunk/drivers/pci/syscall.c | 12 +- trunk/drivers/pcmcia/electra_cf.c | 2 +- trunk/drivers/platform/x86/Kconfig | 23 - trunk/drivers/platform/x86/Makefile | 1 - trunk/drivers/platform/x86/eeepc-laptop.c | 4 +- trunk/drivers/platform/x86/thinkpad_acpi.c | 910 ++---------- trunk/drivers/ps3/ps3-lpm.c | 16 +- trunk/drivers/ps3/ps3-vuart.c | 32 +- trunk/drivers/ps3/ps3stor_lib.c | 14 +- trunk/drivers/rtc/rtc-pxa.c | 2 - trunk/drivers/rtc/rtc-twl4030.c | 49 +- trunk/drivers/scsi/ibmvscsi/ibmvfc.c | 14 +- trunk/drivers/scsi/ibmvscsi/ibmvfc.h | 6 +- trunk/drivers/scsi/ibmvscsi/ibmvscsi.c | 12 +- trunk/drivers/scsi/ipr.c | 2 +- trunk/drivers/scsi/libiscsi_tcp.c | 3 +- trunk/drivers/scsi/libsas/sas_scsi_host.c | 2 +- trunk/drivers/scsi/ps3rom.c | 6 +- trunk/drivers/scsi/qla2xxx/qla_init.c | 58 +- trunk/drivers/scsi/qla2xxx/qla_mid.c | 1 - trunk/drivers/scsi/qla2xxx/qla_os.c | 7 +- trunk/drivers/scsi/scsi.c | 5 +- trunk/drivers/scsi/scsi_devinfo.c | 1 - trunk/drivers/serial/8250.c | 2 - trunk/drivers/serial/8250_pci.c | 8 - trunk/drivers/serial/8250_pnp.c | 2 - trunk/drivers/serial/atmel_serial.c | 2 +- trunk/drivers/serial/of_serial.c | 1 - trunk/drivers/serial/pnx8xxx_uart.c | 23 +- trunk/drivers/spi/atmel_spi.c | 3 +- trunk/drivers/spi/xilinx_spi.c | 137 +- trunk/drivers/usb/core/hub.c | 2 +- trunk/drivers/usb/serial/ftdi_sio.c | 2 +- trunk/drivers/video/bf54x-lq043fb.c | 15 +- trunk/drivers/video/bfin-t350mcqb-fb.c | 15 +- trunk/drivers/video/ps3fb.c | 4 +- trunk/fs/aio.c | 22 +- trunk/fs/btrfs/ioctl.h | 14 +- trunk/fs/btrfs/super.c | 5 +- trunk/fs/btrfs/volumes.c | 1 - trunk/fs/buffer.c | 2 +- trunk/fs/compat.c | 6 +- trunk/fs/dcache.c | 2 +- trunk/fs/dcookies.c | 10 +- trunk/fs/eventfd.c | 5 +- trunk/fs/eventpoll.c | 18 +- trunk/fs/exec.c | 2 +- trunk/fs/ext2/dir.c | 7 +- trunk/fs/fcntl.c | 11 +- trunk/fs/filesystems.c | 2 +- trunk/fs/ioctl.c | 2 +- trunk/fs/ioprio.c | 5 +- trunk/fs/locks.c | 2 +- trunk/fs/namei.c | 35 +- trunk/fs/namespace.c | 13 +- trunk/fs/nfsctl.c | 4 +- trunk/fs/notify/inotify/inotify_user.c | 9 +- trunk/fs/open.c | 82 +- trunk/fs/pipe.c | 4 +- trunk/fs/quota.c | 3 +- trunk/fs/read_write.c | 49 +- trunk/fs/readdir.c | 9 +- trunk/fs/select.c | 29 +- trunk/fs/signalfd.c | 8 +- trunk/fs/splice.c | 12 +- trunk/fs/squashfs/squashfs_fs.h | 1 + trunk/fs/squashfs/super.c | 1 - trunk/fs/stat.c | 38 +- trunk/fs/super.c | 2 +- trunk/fs/sync.c | 32 +- trunk/fs/timerfd.c | 10 +- trunk/fs/utimes.c | 11 +- trunk/fs/xattr.c | 53 +- trunk/fs/xfs/linux-2.6/xfs_aops.h | 2 + trunk/fs/xfs/linux-2.6/xfs_buf.c | 79 +- trunk/fs/xfs/linux-2.6/xfs_export.c | 23 +- trunk/fs/xfs/xfs_acl.h | 1 + trunk/fs/xfs/xfs_ag.h | 2 +- trunk/fs/xfs/xfs_attr_leaf.c | 72 +- trunk/fs/xfs/xfs_attr_leaf.h | 12 + trunk/fs/xfs/xfs_bit.h | 10 +- trunk/fs/xfs/xfs_bmap_btree.c | 84 +- trunk/fs/xfs/xfs_btree.c | 4 +- trunk/fs/xfs/xfs_dir2_block.c | 7 +- trunk/fs/xfs/xfs_dir2_leaf.c | 6 +- trunk/fs/xfs/xfs_dir2_sf.c | 15 +- trunk/fs/xfs/xfs_types.h | 4 +- trunk/include/acpi/actbl.h | 2 +- trunk/include/asm-frv/Kbuild | 1 + trunk/include/asm-frv/byteorder.h | 1 + trunk/include/asm-generic/Kbuild.asm | 1 - trunk/include/asm-generic/pgtable.h | 4 +- trunk/include/asm-generic/rtc.h | 14 +- trunk/include/asm-m32r/Kbuild | 1 + trunk/include/asm-m32r/byteorder.h | 2 + trunk/include/asm-m68k/Kbuild | 1 + trunk/include/asm-m68k/byteorder.h | 1 + trunk/include/asm-mn10300/Kbuild | 1 + trunk/include/asm-mn10300/byteorder.h | 1 + trunk/include/drm/drm_crtc.h | 2 +- trunk/include/drm/drm_crtc_helper.h | 2 +- trunk/include/linux/agpgart.h | 1 + trunk/include/linux/atm_idt77105.h | 2 +- trunk/include/linux/capi.h | 2 +- trunk/include/linux/compat.h | 13 - trunk/include/linux/connector.h | 2 +- trunk/include/linux/cyclades.h | 2 + trunk/include/linux/fb.h | 2 +- trunk/include/linux/ide.h | 2 +- trunk/include/linux/if_pppol2tp.h | 2 +- trunk/include/linux/if_pppox.h | 2 +- trunk/include/linux/input.h | 2 +- trunk/include/linux/ioport.h | 3 +- trunk/include/linux/jbd.h | 2 - trunk/include/linux/joystick.h | 2 +- trunk/include/linux/kvm.h | 2 +- trunk/include/linux/libata.h | 11 +- trunk/include/linux/loop.h | 2 +- trunk/include/linux/magic.h | 2 - trunk/include/linux/matroxfb.h | 2 +- trunk/include/linux/mm.h | 1 + trunk/include/linux/netdevice.h | 5 +- trunk/include/linux/netfilter/x_tables.h | 2 +- trunk/include/linux/of_i2c.h | 3 - trunk/include/linux/pci_ids.h | 1 - trunk/include/linux/phantom.h | 2 +- trunk/include/linux/radeonfb.h | 2 +- trunk/include/linux/res_counter.h | 2 +- trunk/include/linux/swab.h | 2 +- trunk/include/linux/syscalls.h | 169 +-- trunk/include/scsi/libiscsi_tcp.h | 1 - trunk/init/Kconfig | 65 +- trunk/ipc/mqueue.c | 28 +- trunk/ipc/msg.c | 12 +- trunk/ipc/sem.c | 18 +- trunk/ipc/shm.c | 8 +- trunk/kernel/Makefile | 5 +- trunk/kernel/acct.c | 2 +- trunk/kernel/capability.c | 4 +- trunk/kernel/cpuset.c | 2 +- trunk/kernel/exec_domain.c | 3 +- trunk/kernel/exit.c | 17 +- trunk/kernel/fork.c | 4 +- trunk/kernel/futex.c | 17 +- trunk/kernel/hrtimer.c | 4 +- trunk/kernel/itimer.c | 7 +- trunk/kernel/kexec.c | 5 +- trunk/kernel/kprobes.c | 2 +- trunk/kernel/module.c | 10 +- trunk/kernel/posix-timers.c | 43 +- trunk/kernel/power/Makefile | 3 +- trunk/kernel/printk.c | 7 +- trunk/kernel/ptrace.c | 2 +- trunk/kernel/resource.c | 1 - trunk/kernel/sched.c | 43 +- trunk/kernel/sched_fair.c | 37 +- trunk/kernel/signal.c | 59 +- trunk/kernel/sys.c | 70 +- trunk/kernel/sys_ni.c | 1 - trunk/kernel/sysctl.c | 13 +- trunk/kernel/time.c | 14 +- trunk/kernel/timer.c | 18 +- trunk/kernel/uid16.c | 39 +- trunk/kernel/up.c | 1 - trunk/lib/idr.c | 14 +- trunk/mm/fadvise.c | 18 +- trunk/mm/filemap.c | 9 +- trunk/mm/fremap.c | 4 +- trunk/mm/madvise.c | 2 +- trunk/mm/memcontrol.c | 130 +- trunk/mm/memory.c | 24 +- trunk/mm/mempolicy.c | 24 +- trunk/mm/migrate.c | 8 +- trunk/mm/mincore.c | 4 +- trunk/mm/mlock.c | 8 +- trunk/mm/mmap.c | 4 +- trunk/mm/mprotect.c | 4 +- trunk/mm/mremap.c | 6 +- trunk/mm/msync.c | 2 +- trunk/mm/nommu.c | 11 +- trunk/mm/swapfile.c | 4 +- trunk/mm/vmalloc.c | 20 +- trunk/net/9p/Kconfig | 2 +- trunk/net/bridge/br_netfilter.c | 18 +- trunk/net/bridge/netfilter/ebtables.c | 2 +- trunk/net/can/bcm.c | 57 +- trunk/net/core/dev.c | 48 +- trunk/net/core/skbuff.c | 6 - trunk/net/ipv4/netfilter/iptable_filter.c | 7 +- trunk/net/ipv4/netfilter/iptable_mangle.c | 6 +- trunk/net/ipv4/netfilter/iptable_raw.c | 6 +- trunk/net/ipv4/netfilter/iptable_security.c | 6 +- .../netfilter/nf_conntrack_l3proto_ipv4.c | 5 +- .../ipv4/netfilter/nf_conntrack_proto_icmp.c | 2 +- trunk/net/ipv4/tcp.c | 24 +- trunk/net/ipv6/ip6_fib.c | 15 +- .../netfilter/nf_conntrack_proto_icmpv6.c | 2 +- trunk/net/mac80211/ht.c | 2 +- trunk/net/mac80211/iface.c | 3 +- trunk/net/mac80211/mesh_plink.c | 1 - trunk/net/mac80211/rc80211_minstrel.c | 10 +- trunk/net/netfilter/nf_conntrack_core.c | 4 +- trunk/net/netfilter/nf_conntrack_netlink.c | 2 +- trunk/net/netfilter/x_tables.c | 8 - trunk/net/netfilter/xt_time.c | 11 - trunk/net/sched/sch_htb.c | 15 +- trunk/net/socket.c | 63 +- trunk/net/xfrm/xfrm_user.c | 11 +- trunk/scripts/checkpatch.pl | 28 +- trunk/security/keys/keyctl.c | 22 +- trunk/sound/pci/hda/patch_sigmatel.c | 15 +- trunk/sound/pci/oxygen/virtuoso.c | 17 +- trunk/sound/ppc/snd_ps3.c | 4 +- trunk/sound/soc/atmel/atmel-pcm.c | 2 + trunk/sound/soc/soc-dapm.c | 3 +- trunk/sound/usb/usbquirks.h | 8 - 546 files changed, 3658 insertions(+), 7901 deletions(-) rename trunk/Documentation/{cgroups => controllers}/cpuacct.txt (100%) rename trunk/Documentation/{cgroups => controllers}/devices.txt (100%) rename trunk/Documentation/{cgroups => controllers}/memcg_test.txt (99%) rename trunk/Documentation/{cgroups => controllers}/memory.txt (100%) rename trunk/Documentation/{cgroups => controllers}/resource_counter.txt (100%) rename trunk/Documentation/{cgroups => }/cpusets.txt (100%) delete mode 100644 trunk/Documentation/hwmon/adt7475 delete mode 100644 trunk/arch/alpha/kernel/.gitignore rename trunk/arch/cris/include/arch-v10/arch/{swab.h => byteorder.h} (55%) create mode 100644 trunk/arch/cris/include/arch-v32/arch/byteorder.h delete mode 100644 trunk/arch/cris/include/arch-v32/arch/swab.h delete mode 100644 trunk/arch/cris/include/asm/swab.h rename trunk/drivers/acpi/{sleep.c => main.c} (100%) delete mode 100644 trunk/drivers/ata/pata_octeon_cf.c delete mode 100644 trunk/drivers/hwmon/adt7475.c rename trunk/{arch/powerpc/platforms/83xx => drivers/i2c/chips}/mcu_mpc8349emitx.c (100%) create mode 100644 trunk/drivers/leds/leds-hp-disk.c rename trunk/drivers/{platform/x86 => misc}/dell-laptop.c (99%) diff --git a/[refs] b/[refs] index db67d157ac48..cb29f9ae0344 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: db45705c7fc473fd2ffb2c9621df4a4a4f33f1ad +refs/heads/master: c9280d681c4093405fc896dc25f81d5ff9de8183 diff --git a/trunk/CREDITS b/trunk/CREDITS index 2b39168c06aa..939da46a87fb 100644 --- a/trunk/CREDITS +++ b/trunk/CREDITS @@ -3786,11 +3786,14 @@ S: The Netherlands N: David Woodhouse E: dwmw2@infradead.org -D: JFFS2 file system, Memory Technology Device subsystem, +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: various other stuff that annoyed me by not working. -S: c/o Intel Corporation -S: Pipers Way -S: Swindon. SN3 1RJ +S: c/o Red Hat Engineering +S: Rustat House +S: 60 Clifton Road +S: Cambridge. CB1 7EG S: England N: Chris Wright diff --git a/trunk/Documentation/DMA-API.txt b/trunk/Documentation/DMA-API.txt index 52441694fe03..b462bb149543 100644 --- a/trunk/Documentation/DMA-API.txt +++ b/trunk/Documentation/DMA-API.txt @@ -170,15 +170,16 @@ Returns: 0 if successful and a negative error if not. u64 dma_get_required_mask(struct device *dev) -This API returns the mask that the platform requires to -operate efficiently. Usually this means the returned mask +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 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 a dma_set_mask() -call to set the mask to the value returned. +wish to take advantage of it, you should issue another dma_set_mask() +call to lower the mask again. Part Id - Streaming DMA mappings diff --git a/trunk/Documentation/accounting/getdelays.c b/trunk/Documentation/accounting/getdelays.c index 7ea231172c85..cc49400b4af8 100644 --- a/trunk/Documentation/accounting/getdelays.c +++ b/trunk/Documentation/accounting/getdelays.c @@ -392,10 +392,6 @@ int main(int argc, char *argv[]) goto err; } } - if (!maskset && !tid && !containerset) { - usage(); - goto err; - } do { int i; diff --git a/trunk/Documentation/cgroups/cgroups.txt b/trunk/Documentation/cgroups/cgroups.txt index d9e5d6f41b92..e33ee74eee77 100644 --- a/trunk/Documentation/cgroups/cgroups.txt +++ b/trunk/Documentation/cgroups/cgroups.txt @@ -1,8 +1,7 @@ CGROUPS ------- -Written by Paul Menage based on -Documentation/cgroups/cpusets.txt +Written by Paul Menage based on Documentation/cpusets.txt Original copyright statements from cpusets.txt: Portions Copyright (C) 2004 BULL SA. @@ -69,7 +68,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/cgroups/cpusets.txt) allows +access. For example, cpusets (see Documentation/cpusets.txt) allows you to associate a set of CPUs and a set of memory nodes with the tasks in each cgroup. diff --git a/trunk/Documentation/cgroups/cpuacct.txt b/trunk/Documentation/controllers/cpuacct.txt similarity index 100% rename from trunk/Documentation/cgroups/cpuacct.txt rename to trunk/Documentation/controllers/cpuacct.txt diff --git a/trunk/Documentation/cgroups/devices.txt b/trunk/Documentation/controllers/devices.txt similarity index 100% rename from trunk/Documentation/cgroups/devices.txt rename to trunk/Documentation/controllers/devices.txt diff --git a/trunk/Documentation/cgroups/memcg_test.txt b/trunk/Documentation/controllers/memcg_test.txt similarity index 99% rename from trunk/Documentation/cgroups/memcg_test.txt rename to trunk/Documentation/controllers/memcg_test.txt index 19533f93b7a2..08d4d3ea0d79 100644 --- a/trunk/Documentation/cgroups/memcg_test.txt +++ b/trunk/Documentation/controllers/memcg_test.txt @@ -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/cgroups/memory.txt) +(*) Topics on API should be in Documentation/controllers/memory.txt) 0. How to record usage ? 2 objects are used. diff --git a/trunk/Documentation/cgroups/memory.txt b/trunk/Documentation/controllers/memory.txt similarity index 100% rename from trunk/Documentation/cgroups/memory.txt rename to trunk/Documentation/controllers/memory.txt diff --git a/trunk/Documentation/cgroups/resource_counter.txt b/trunk/Documentation/controllers/resource_counter.txt similarity index 100% rename from trunk/Documentation/cgroups/resource_counter.txt rename to trunk/Documentation/controllers/resource_counter.txt diff --git a/trunk/Documentation/cgroups/cpusets.txt b/trunk/Documentation/cpusets.txt similarity index 100% rename from trunk/Documentation/cgroups/cpusets.txt rename to trunk/Documentation/cpusets.txt diff --git a/trunk/Documentation/filesystems/proc.txt b/trunk/Documentation/filesystems/proc.txt index bbebc3a43ac0..d105eb45282a 100644 --- a/trunk/Documentation/filesystems/proc.txt +++ b/trunk/Documentation/filesystems/proc.txt @@ -1371,8 +1371,292 @@ auto_msgmni default value is 1. 2.4 /proc/sys/vm - The virtual memory subsystem ----------------------------------------------- -Please see: Documentation/sysctls/vm.txt for a description of these -entries. +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. 2.5 /proc/sys/dev - Device specific parameters diff --git a/trunk/Documentation/hwmon/adt7475 b/trunk/Documentation/hwmon/adt7475 deleted file mode 100644 index a2b1abec850e..000000000000 --- a/trunk/Documentation/hwmon/adt7475 +++ /dev/null @@ -1,87 +0,0 @@ -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. diff --git a/trunk/Documentation/hwmon/lis3lv02d b/trunk/Documentation/hwmon/lis3lv02d index 0fcfc4a7ccdc..65dfb0c0fd67 100644 --- a/trunk/Documentation/hwmon/lis3lv02d +++ b/trunk/Documentation/hwmon/lis3lv02d @@ -13,21 +13,18 @@ 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 @@ -42,12 +39,11 @@ 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. diff --git a/trunk/Documentation/laptops/thinkpad-acpi.txt b/trunk/Documentation/laptops/thinkpad-acpi.txt index 41bc99fa1884..898b4987bb80 100644 --- a/trunk/Documentation/laptops/thinkpad-acpi.txt +++ b/trunk/Documentation/laptops/thinkpad-acpi.txt @@ -1,7 +1,7 @@ ThinkPad ACPI Extras Driver - Version 0.22 - November 23rd, 2008 + Version 0.21 + May 29th, 2008 Borislav Deianov Henrique de Moraes Holschuh @@ -16,8 +16,7 @@ supported by the generic Linux ACPI drivers. This driver used to be named ibm-acpi until kernel 2.6.21 and release 0.13-20070314. It used to be in the drivers/acpi tree, but it was moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel -2.6.22, and release 0.14. It was moved to drivers/platform/x86 for -kernel 2.6.29 and release 0.22. +2.6.22, and release 0.14. The driver is named "thinkpad-acpi". In some places, like module names, "thinkpad_acpi" is used because of userspace issues. @@ -1413,24 +1412,6 @@ Sysfs notes: rfkill controller switch "tpacpi_wwan_sw": refer to Documentation/rfkill.txt for details. -EXPERIMENTAL: UWB ------------------ - -This feature is marked EXPERIMENTAL because it has not been extensively -tested and validated in various ThinkPad models yet. The feature may not -work as expected. USE WITH CAUTION! To use this feature, you need to supply -the experimental=1 parameter when loading the module. - -sysfs rfkill class: switch "tpacpi_uwb_sw" - -This feature exports an rfkill controller for the UWB device, if one is -present and enabled in the BIOS. - -Sysfs notes: - - rfkill controller switch "tpacpi_uwb_sw": refer to - Documentation/rfkill.txt for details. - Multiple Commands, Module Parameters ------------------------------------ diff --git a/trunk/Documentation/mips/AU1xxx_IDE.README b/trunk/Documentation/mips/AU1xxx_IDE.README index 8ace35ebdcd5..f54962aea84d 100644 --- a/trunk/Documentation/mips/AU1xxx_IDE.README +++ b/trunk/Documentation/mips/AU1xxx_IDE.README @@ -52,12 +52,14 @@ Two files are introduced: b) 'drivers/ide/mips/au1xxx-ide.c' contains the functionality of the AU1XXX IDE driver -Following extra configs variables are introduced: +Four 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 @@ -85,6 +87,7 @@ 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 @@ -102,6 +105,7 @@ 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 diff --git a/trunk/Documentation/scheduler/sched-design-CFS.txt b/trunk/Documentation/scheduler/sched-design-CFS.txt index 6f33593e59e2..8398ca4ff4ed 100644 --- a/trunk/Documentation/scheduler/sched-design-CFS.txt +++ b/trunk/Documentation/scheduler/sched-design-CFS.txt @@ -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/cgroups.txt for more information about this filesystem. + Documentation/cgroups.txt for more information about this filesystem. Only one of these options to group tasks can be chosen and not both. diff --git a/trunk/Documentation/sysctl/vm.txt b/trunk/Documentation/sysctl/vm.txt index 3197fc83bc51..a3415070bcac 100644 --- a/trunk/Documentation/sysctl/vm.txt +++ b/trunk/Documentation/sysctl/vm.txt @@ -1,13 +1,12 @@ -Documentation for /proc/sys/vm/* kernel version 2.6.29 +Documentation for /proc/sys/vm/* kernel version 2.2.10 (c) 1998, 1999, Rik van Riel - (c) 2008 Peter W. Morreale 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.6.29. +/proc/sys/vm and is valid for Linux kernel version 2.2. The files in this directory can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel and @@ -17,244 +16,83 @@ 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: - -- block_dump -- dirty_background_bytes +- overcommit_memory +- page-cluster +- dirty_ratio - dirty_background_ratio -- dirty_bytes - dirty_expire_centisecs -- dirty_ratio - dirty_writeback_centisecs -- drop_caches -- hugepages_treat_as_movable -- hugetlb_shm_group -- laptop_mode -- legacy_va_layout -- lowmem_reserve_ratio +- highmem_is_dirtyable (only if CONFIG_HIGHMEM set) - max_map_count - min_free_kbytes -- min_slab_ratio +- laptop_mode +- block_dump +- drop-caches +- zone_reclaim_mode - min_unmapped_ratio -- mmap_min_addr -- nr_hugepages -- nr_overcommit_hugepages -- nr_pdflush_threads -- nr_trim_pages (only if CONFIG_MMU=n) -- numa_zonelist_order +- min_slab_ratio +- panic_on_oom - 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 - - -============================================================== - -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. - -============================================================== - -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 total system memory, the number of pages at which -the pdflush background writeback daemon will start writing out dirty data. - -============================================================== - -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_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. - -============================================================== - -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. +- mmap_min_address +- numa_zonelist_order +- nr_hugepages +- nr_overcommit_hugepages +- nr_trim_pages (only if CONFIG_MMU=n) ============================================================== -dirty_writeback_centisecs +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: -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. +See Documentation/filesystems/proc.txt ============================================================== -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. +overcommit_memory: -============================================================== +This value contains a flag that enables memory overcommitment. -hugepages_treat_as_movable +When this flag is 0, the kernel attempts to estimate the amount +of free memory left when userspace requests more memory. -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. +When this flag is 1, the kernel pretends there is always enough +memory until it actually runs out. -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. +When this flag is 2, the kernel uses a "never overcommit" +policy that attempts to prevent any overcommit of memory. -============================================================== +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. -hugetlb_shm_group +The default value is 0. -hugetlb_shm_group contains group id that is allowed to create SysV -shared memory segment using hugetlb page. +See Documentation/vm/overcommit-accounting and +security/commoncap.c::cap_vm_enough_memory() for more information. ============================================================== -laptop_mode +overcommit_ratio: -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. +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. ============================================================== -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. +page-cluster: -============================================================== +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. -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%). +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. ============================================================== @@ -275,9 +113,9 @@ The default value is 65536. min_free_kbytes: -This is used to force the Linux VM to keep a minimum number +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 +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 @@ -286,140 +124,116 @@ become subtly broken, and prone to deadlock under high loads. Setting this too high will OOM your machine instantly. -============================================================= - -min_slab_ratio: - -This is available only on NUMA kernels. - -A percentage of the total pages in each zone. On Zone reclaim -(fallback from the local zone occurs) slabs will be reclaimed if more -than this percentage of pages in a zone are reclaimable slab pages. -This insures that the slab growth stays under control even in NUMA -systems that rarely perform global reclaim. - -The default is 5 percent. - -Note that slab reclaim is triggered in a per zone / node fashion. -The process of reclaiming slab memory is currently not node specific -and may not be fast. - -============================================================= - -min_unmapped_ratio: - -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. - -The default is 1 percent. - ============================================================== -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. - -============================================================== - -nr_hugepages +percpu_pagelist_fraction -Change the minimum size of the hugepage pool. +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. -See Documentation/vm/hugetlbpage.txt +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. -nr_overcommit_hugepages +=============================================================== -Change the maximum size of the hugepage pool. The maximum is -nr_hugepages + nr_overcommit_hugepages. +zone_reclaim_mode: -See Documentation/vm/hugetlbpage.txt +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 -nr_pdflush_threads +1 = Zone reclaim on +2 = Zone reclaim writes dirty pages out +4 = Zone reclaim swaps pages -The current number of pdflush threads. This value is read-only. -The value changes according to the number of dirty pages in the system. +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. -When neccessary, additional pdflush threads are created, one per second, up to -nr_pdflush_threads_max. +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. -nr_trim_pages +Allowing regular swap effectively restricts allocations to the local +node unless explicitly overridden by memory policies or cpuset +configurations. -This is available only on NOMMU kernels. +============================================================= -This value adjusts the excess page trimming behaviour of power-of-2 aligned -NOMMU mmap allocations. +min_unmapped_ratio: -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. +This is available only on NUMA kernels. -The default value is 1. +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. -See Documentation/nommu-mmap.txt for more information. +The default is 1 percent. -============================================================== +============================================================= -numa_zonelist_order +min_slab_ratio: -This sysctl is only for NUMA. -'where the memory is allocated from' is controlled by zonelists. -(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. - you may be able to read ZONE_DMA as ZONE_DMA32...) +This is available only on NUMA kernels. -In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. -ZONE_NORMAL -> ZONE_DMA -This means that a memory allocation request for GFP_KERNEL will -get memory from ZONE_DMA only when ZONE_NORMAL is not available. +A percentage of the total pages in each zone. On Zone reclaim +(fallback from the local zone occurs) slabs will be reclaimed if more +than this percentage of pages in a zone are reclaimable slab pages. +This insures that the slab growth stays under control even in NUMA +systems that rarely perform global reclaim. -In NUMA case, you can think of following 2 types of order. -Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL +The default is 5 percent. -(A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL -(B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA. +Note that slab reclaim is triggered in a per zone / node fashion. +The process of reclaiming slab memory is currently not node specific +and may not be fast. -Type(A) offers the best locality for processes on Node(0), but ZONE_DMA -will be used before ZONE_NORMAL exhaustion. This increases possibility of -out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small. +============================================================= -Type(B) cannot offer the best locality but is more robust against OOM of -the DMA zone. +panic_on_oom -Type(A) is called as "Node" order. Type (B) is "Zone" order. +This enables or disables panic on out-of-memory feature. -"Node order" orders the zonelists by node, then by zone within each node. -Specify "[Nn]ode" for zone order +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. -"Zone Order" orders the zonelists by zone type, then by node within each -zone. Specify "[Zz]one"for zode order. +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. -Specify "[Dd]efault" to request automatic configuration. Autoconfiguration -will select "node" order in following case. -(1) if the DMA zone does not exist or -(2) if the DMA zone comprises greater than 50% of the available memory or -(3) if any node's DMA zone comprises greater than 60% of its local memory and - the amount of local memory is big enough. +If this is set to 2, the kernel panics compulsorily even on the +above-mentioned. -Otherwise, "zone" order will be selected. Default order is recommended unless -this is causing problems for your system/application. +The default value is 0. +1 and 2 are for failover of clustering. Please select either +according to your policy of failover. -============================================================== +============================================================= oom_dump_tasks @@ -440,7 +254,7 @@ OOM killer actually kills a memory-hogging task. The default value is 0. -============================================================== +============================================================= oom_kill_allocating_task @@ -463,157 +277,92 @@ The default value is 0. ============================================================== -overcommit_memory: - -This value contains a flag that enables memory overcommitment. - -When this flag is 0, the kernel attempts to estimate the amount -of free memory left when userspace requests more 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. - -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: +mmap_min_addr -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 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. ============================================================== -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. +numa_zonelist_order -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. +This sysctl is only for NUMA. +'where the memory is allocated from' is controlled by zonelists. +(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. + you may be able to read ZONE_DMA as ZONE_DMA32...) -If this is set to 2, the kernel panics compulsorily even on the -above-mentioned. +In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. +ZONE_NORMAL -> ZONE_DMA +This means that a memory allocation request for GFP_KERNEL will +get memory from ZONE_DMA only when ZONE_NORMAL is not available. -The default value is 0. -1 and 2 are for failover of clustering. Please select either -according to your policy of failover. +In NUMA case, you can think of following 2 types of order. +Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL -============================================================= +(A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL +(B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA. -percpu_pagelist_fraction +Type(A) offers the best locality for processes on Node(0), but ZONE_DMA +will be used before ZONE_NORMAL exhaustion. This increases possibility of +out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small. -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. +Type(B) cannot offer the best locality but is more robust against OOM of +the DMA zone. -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) +Type(A) is called as "Node" order. Type (B) is "Zone" order. -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. +"Node order" orders the zonelists by node, then by zone within each node. +Specify "[Nn]ode" for zone order -============================================================== +"Zone Order" orders the zonelists by zone type, then by node within each +zone. Specify "[Zz]one"for zode order. -stat_interval +Specify "[Dd]efault" to request automatic configuration. Autoconfiguration +will select "node" order in following case. +(1) if the DMA zone does not exist or +(2) if the DMA zone comprises greater than 50% of the available memory or +(3) if any node's DMA zone comprises greater than 60% of its local memory and + the amount of local memory is big enough. -The time interval between which vm statistics are updated. The default -is 1 second. +Otherwise, "zone" order will be selected. Default order is recommended unless +this is causing problems for your system/application. ============================================================== -swappiness +nr_hugepages -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. +Change the minimum size of the hugepage pool. -The default value is 60. +See Documentation/vm/hugetlbpage.txt ============================================================== -vfs_cache_pressure ------------------- +nr_overcommit_hugepages -Controls the tendency of the kernel to reclaim the memory which is used for -caching of directory and inode objects. +Change the maximum size of the hugepage pool. The maximum is +nr_hugepages + nr_overcommit_hugepages. -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. +See Documentation/vm/hugetlbpage.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. - -This is value ORed together of - -1 = Zone reclaim on -2 = Zone reclaim writes dirty pages out -4 = Zone reclaim swaps pages +nr_trim_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. +This is available only on NOMMU kernels. -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. +This value adjusts the excess page trimming behaviour of power-of-2 aligned +NOMMU mmap allocations. -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. +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. -Allowing regular swap effectively restricts allocations to the local -node unless explicitly overridden by memory policies or cpuset -configurations. +The default value is 1. -============ End of Document ================================= +See Documentation/nommu-mmap.txt for more information. diff --git a/trunk/Documentation/sysrq.txt b/trunk/Documentation/sysrq.txt index 9e592c718afb..10a0263ebb3f 100644 --- a/trunk/Documentation/sysrq.txt +++ b/trunk/Documentation/sysrq.txt @@ -1,5 +1,6 @@ Linux Magic System Request Key Hacks Documentation for sysrq.c +Last update: 2007-AUG-04 * What is the magic SysRq key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -210,24 +211,6 @@ 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 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 3fe4dc2c2564..6f65a269cb17 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1581,13 +1581,6 @@ 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. @@ -1821,14 +1814,6 @@ 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 @@ -4857,11 +4842,11 @@ S: Supported XFS FILESYSTEM P: Silicon Graphics Inc -P: Bill O'Donnell +P: Tim Shimmin M: xfs-masters@oss.sgi.com L: xfs@oss.sgi.com W: http://oss.sgi.com/projects/xfs -T: git://oss.sgi.com/xfs/xfs.git +T: git git://oss.sgi.com:8090/xfs/xfs-2.6.git S: Supported XILINX SYSTEMACE DRIVER diff --git a/trunk/Makefile b/trunk/Makefile index 207303da3971..c06e250eca18 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 29 -EXTRAVERSION = -rc2 +EXTRAVERSION = -rc1 NAME = Erotic Pickled Herring # *DOCUMENTATION* diff --git a/trunk/arch/Kconfig b/trunk/arch/Kconfig index 550dab22daa1..2e13aa261929 100644 --- a/trunk/arch/Kconfig +++ b/trunk/arch/Kconfig @@ -62,9 +62,6 @@ 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 diff --git a/trunk/arch/alpha/include/asm/Kbuild b/trunk/arch/alpha/include/asm/Kbuild index b7c8f188b313..4dad27360576 100644 --- a/trunk/arch/alpha/include/asm/Kbuild +++ b/trunk/arch/alpha/include/asm/Kbuild @@ -9,3 +9,4 @@ unifdef-y += console.h unifdef-y += fpu.h unifdef-y += sysinfo.h unifdef-y += compiler.h +unifdef-y += swab.h diff --git a/trunk/arch/alpha/include/asm/byteorder.h b/trunk/arch/alpha/include/asm/byteorder.h index 73683093202d..6772f3168701 100644 --- a/trunk/arch/alpha/include/asm/byteorder.h +++ b/trunk/arch/alpha/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _ALPHA_BYTEORDER_H #define _ALPHA_BYTEORDER_H +#include #include #endif /* _ALPHA_BYTEORDER_H */ diff --git a/trunk/arch/alpha/include/asm/machvec.h b/trunk/arch/alpha/include/asm/machvec.h index fea4ea75b79d..a86c083cdf7f 100644 --- a/trunk/arch/alpha/include/asm/machvec.h +++ b/trunk/arch/alpha/include/asm/machvec.h @@ -21,7 +21,6 @@ struct pci_dev; struct pci_ops; struct pci_controller; struct _alpha_agp_info; -struct rtc_time; struct alpha_machine_vector { @@ -95,9 +94,6 @@ 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 */ diff --git a/trunk/arch/alpha/include/asm/pgalloc.h b/trunk/arch/alpha/include/asm/pgalloc.h index bc2a0daf2d92..fd090155dccd 100644 --- a/trunk/arch/alpha/include/asm/pgalloc.h +++ b/trunk/arch/alpha/include/asm/pgalloc.h @@ -50,12 +50,7 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd) free_page((unsigned long)pmd); } -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; -} +extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) diff --git a/trunk/arch/alpha/include/asm/rtc.h b/trunk/arch/alpha/include/asm/rtc.h index 1f7fba671ae6..4e854b1333eb 100644 --- a/trunk/arch/alpha/include/asm/rtc.h +++ b/trunk/arch/alpha/include/asm/rtc.h @@ -1,15 +1,9 @@ #ifndef _ALPHA_RTC_H #define _ALPHA_RTC_H -#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 +/* + * Alpha uses the default access methods for the RTC. + */ #include diff --git a/trunk/arch/alpha/kernel/.gitignore b/trunk/arch/alpha/kernel/.gitignore deleted file mode 100644 index c5f676c3c224..000000000000 --- a/trunk/arch/alpha/kernel/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vmlinux.lds diff --git a/trunk/arch/alpha/kernel/core_marvel.c b/trunk/arch/alpha/kernel/core_marvel.c index e302daecbe56..9cd8dca742a7 100644 --- a/trunk/arch/alpha/kernel/core_marvel.c +++ b/trunk/arch/alpha/kernel/core_marvel.c @@ -658,8 +658,16 @@ __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; diff --git a/trunk/arch/alpha/kernel/entry.S b/trunk/arch/alpha/kernel/entry.S index aa2e50cf9857..f77345bc66a9 100644 --- a/trunk/arch/alpha/kernel/entry.S +++ b/trunk/arch/alpha/kernel/entry.S @@ -896,9 +896,9 @@ sys_getxpid: .end sys_getxpid .align 4 - .globl sys_alpha_pipe - .ent sys_alpha_pipe -sys_alpha_pipe: + .globl sys_pipe + .ent sys_pipe +sys_pipe: lda $sp, -16($sp) stq $26, 0($sp) .prologue 0 @@ -916,7 +916,7 @@ sys_alpha_pipe: stq $1, 80+16($sp) 1: lda $sp, 16($sp) ret -.end sys_alpha_pipe +.end sys_pipe .align 4 .globl sys_execve diff --git a/trunk/arch/alpha/kernel/irq_srm.c b/trunk/arch/alpha/kernel/irq_srm.c index a03fbca4940e..32212014fbe9 100644 --- a/trunk/arch/alpha/kernel/irq_srm.c +++ b/trunk/arch/alpha/kernel/irq_srm.c @@ -63,8 +63,6 @@ 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; diff --git a/trunk/arch/alpha/kernel/machvec_impl.h b/trunk/arch/alpha/kernel/machvec_impl.h index 512685f78097..466c9dff8181 100644 --- a/trunk/arch/alpha/kernel/machvec_impl.h +++ b/trunk/arch/alpha/kernel/machvec_impl.h @@ -40,10 +40,7 @@ #define CAT1(x,y) x##y #define CAT(x,y) CAT1(x,y) -#define DO_DEFAULT_RTC \ - .rtc_port = 0x70, \ - .rtc_get_time = common_get_rtc_time, \ - .rtc_set_time = common_set_rtc_time +#define DO_DEFAULT_RTC .rtc_port = 0x70 #define DO_EV4_MMU \ .max_asn = EV4_MAX_ASN, \ diff --git a/trunk/arch/alpha/kernel/proto.h b/trunk/arch/alpha/kernel/proto.h index fe14c6747cd6..708d5ca87782 100644 --- a/trunk/arch/alpha/kernel/proto.h +++ b/trunk/arch/alpha/kernel/proto.h @@ -145,8 +145,6 @@ 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); diff --git a/trunk/arch/alpha/kernel/sys_jensen.c b/trunk/arch/alpha/kernel/sys_jensen.c index e2516f9a8967..2c3de97de46c 100644 --- a/trunk/arch/alpha/kernel/sys_jensen.c +++ b/trunk/arch/alpha/kernel/sys_jensen.c @@ -261,8 +261,6 @@ 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, diff --git a/trunk/arch/alpha/kernel/sys_marvel.c b/trunk/arch/alpha/kernel/sys_marvel.c index c5a1a2438c67..828449cd2636 100644 --- a/trunk/arch/alpha/kernel/sys_marvel.c +++ b/trunk/arch/alpha/kernel/sys_marvel.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "proto.h" #include "err_impl.h" @@ -427,57 +426,6 @@ 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) { @@ -518,9 +466,7 @@ marvel_smp_callin(void) struct alpha_machine_vector marvel_ev7_mv __initmv = { .vector_name = "MARVEL/EV7", DO_EV7_MMU, - .rtc_port = 0x70, - .rtc_get_time = marvel_get_rtc_time, - .rtc_set_time = marvel_set_rtc_time, + DO_DEFAULT_RTC, DO_MARVEL_IO, .machine_check = marvel_machine_check, .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS, diff --git a/trunk/arch/alpha/kernel/sys_nautilus.c b/trunk/arch/alpha/kernel/sys_nautilus.c index 99c0f46f6b9c..a7f23b5ab814 100644 --- a/trunk/arch/alpha/kernel/sys_nautilus.c +++ b/trunk/arch/alpha/kernel/sys_nautilus.c @@ -245,10 +245,6 @@ 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); } diff --git a/trunk/arch/alpha/kernel/systbls.S b/trunk/arch/alpha/kernel/systbls.S index 9d9e3a98bb95..ba914af18c4f 100644 --- a/trunk/arch/alpha/kernel/systbls.S +++ b/trunk/arch/alpha/kernel/systbls.S @@ -52,7 +52,7 @@ sys_call_table: .quad sys_setpgid .quad alpha_ni_syscall /* 40 */ .quad sys_dup - .quad sys_alpha_pipe + .quad sys_pipe .quad osf_set_program_attributes .quad alpha_ni_syscall .quad sys_open /* 45 */ diff --git a/trunk/arch/alpha/kernel/time.c b/trunk/arch/alpha/kernel/time.c index b04e2cbf23a4..e6a231435cba 100644 --- a/trunk/arch/alpha/kernel/time.c +++ b/trunk/arch/alpha/kernel/time.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include @@ -181,15 +180,6 @@ 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 diff --git a/trunk/arch/alpha/mm/init.c b/trunk/arch/alpha/mm/init.c index 5d7a16eab312..234e42b8ee74 100644 --- a/trunk/arch/alpha/mm/init.c +++ b/trunk/arch/alpha/mm/init.c @@ -59,6 +59,13 @@ 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 diff --git a/trunk/arch/arm/include/asm/Kbuild b/trunk/arch/arm/include/asm/Kbuild index 73237bd130a2..43b0b2ba392f 100644 --- a/trunk/arch/arm/include/asm/Kbuild +++ b/trunk/arch/arm/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm unifdef-y += hwcap.h +unifdef-y += swab.h diff --git a/trunk/arch/arm/include/asm/byteorder.h b/trunk/arch/arm/include/asm/byteorder.h index 77379748b171..c02b6fc28e1a 100644 --- a/trunk/arch/arm/include/asm/byteorder.h +++ b/trunk/arch/arm/include/asm/byteorder.h @@ -15,6 +15,8 @@ #ifndef __ASM_ARM_BYTEORDER_H #define __ASM_ARM_BYTEORDER_H +#include + #ifdef __ARMEB__ #include #else diff --git a/trunk/arch/arm/kernel/calls.S b/trunk/arch/arm/kernel/calls.S index 9ca8d13f05f7..09a061cb7838 100644 --- a/trunk/arch/arm/kernel/calls.S +++ b/trunk/arch/arm/kernel/calls.S @@ -98,7 +98,7 @@ CALL(sys_uselib) CALL(sys_swapon) CALL(sys_reboot) - CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */ + CALL(OBSOLETE(old_readdir)) /* used by libc4 */ /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ CALL(sys_munmap) CALL(sys_truncate) diff --git a/trunk/arch/arm/mach-imx/clock.c b/trunk/arch/arm/mach-imx/clock.c index cf332aeb942e..7ec60fc91565 100644 --- a/trunk/arch/arm/mach-imx/clock.c +++ b/trunk/arch/arm/mach-imx/clock.c @@ -23,7 +23,7 @@ #include #include -#include +#include /* * Very simple approach: We can't disable clocks, so we do diff --git a/trunk/arch/arm/mach-imx/generic.c b/trunk/arch/arm/mach-imx/generic.c index 887cb21f75b0..fa72174dd95c 100644 --- a/trunk/arch/arm/mach-imx/generic.c +++ b/trunk/arch/arm/mach-imx/generic.c @@ -245,11 +245,11 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info) imx_mmc_device.dev.platform_data = info; } -static struct imx_fb_platform_data imx_fb_info; +static struct imxfb_mach_info imx_fb_info; -void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info) +void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info) { - memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data)); + memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info)); } static struct resource imxfb_resources[] = { diff --git a/trunk/arch/arm/mach-imx/include/mach/imx-regs.h b/trunk/arch/arm/mach-imx/include/mach/imx-regs.h index 490297fc0e38..fb9de2733879 100644 --- a/trunk/arch/arm/mach-imx/include/mach/imx-regs.h +++ b/trunk/arch/arm/mach-imx/include/mach/imx-regs.h @@ -373,4 +373,110 @@ #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 diff --git a/trunk/arch/arm/mach-w90x900/mach-w90p910evb.c b/trunk/arch/arm/mach-w90x900/mach-w90p910evb.c index 9ebc93f48530..9307a2475438 100644 --- a/trunk/arch/arm/mach-w90x900/mach-w90p910evb.c +++ b/trunk/arch/arm/mach-w90x900/mach-w90p910evb.c @@ -29,7 +29,6 @@ #include #include -#include #include "cpu.h" diff --git a/trunk/arch/arm/mach-w90x900/time.c b/trunk/arch/arm/mach-w90x900/time.c index bcc838f6b393..3a69e381f316 100644 --- a/trunk/arch/arm/mach-w90x900/time.c +++ b/trunk/arch/arm/mach-w90x900/time.c @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/arm/mm/proc-syms.c b/trunk/arch/arm/mm/proc-syms.c index 195e48edd8c2..4ad3bf291ad3 100644 --- a/trunk/arch/arm/mm/proc-syms.c +++ b/trunk/arch/arm/mm/proc-syms.c @@ -27,7 +27,6 @@ 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 diff --git a/trunk/arch/avr32/include/asm/Kbuild b/trunk/arch/avr32/include/asm/Kbuild index 3136628ba8d2..219822c8ad18 100644 --- a/trunk/arch/avr32/include/asm/Kbuild +++ b/trunk/arch/avr32/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm +header-y += swab.h header-y += cachectl.h diff --git a/trunk/arch/avr32/include/asm/byteorder.h b/trunk/arch/avr32/include/asm/byteorder.h index 50abc21619a8..2aba64b4e122 100644 --- a/trunk/arch/avr32/include/asm/byteorder.h +++ b/trunk/arch/avr32/include/asm/byteorder.h @@ -4,6 +4,7 @@ #ifndef __ASM_AVR32_BYTEORDER_H #define __ASM_AVR32_BYTEORDER_H +#include #include #endif /* __ASM_AVR32_BYTEORDER_H */ diff --git a/trunk/arch/blackfin/include/asm/Kbuild b/trunk/arch/blackfin/include/asm/Kbuild index 606ecfdcc962..d0d1ac435544 100644 --- a/trunk/arch/blackfin/include/asm/Kbuild +++ b/trunk/arch/blackfin/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm unifdef-y += fixed_code.h +unifdef-y += swab.h diff --git a/trunk/arch/blackfin/include/asm/byteorder.h b/trunk/arch/blackfin/include/asm/byteorder.h index 3e69106a4d37..b9e797a497b4 100644 --- a/trunk/arch/blackfin/include/asm/byteorder.h +++ b/trunk/arch/blackfin/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _BLACKFIN_BYTEORDER_H #define _BLACKFIN_BYTEORDER_H +#include #include #endif /* _BLACKFIN_BYTEORDER_H */ diff --git a/trunk/arch/cris/arch-v10/kernel/entry.S b/trunk/arch/cris/arch-v10/kernel/entry.S index 72f5cd319b97..ed171d389e65 100644 --- a/trunk/arch/cris/arch-v10/kernel/entry.S +++ b/trunk/arch/cris/arch-v10/kernel/entry.S @@ -691,7 +691,7 @@ sys_call_table: .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/cris/arch-v32/kernel/entry.S b/trunk/arch/cris/arch-v32/kernel/entry.S index 5e674c8f7c51..7f6f93e6b70e 100644 --- a/trunk/arch/cris/arch-v32/kernel/entry.S +++ b/trunk/arch/cris/arch-v32/kernel/entry.S @@ -614,7 +614,7 @@ sys_call_table: .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/cris/include/arch-v10/arch/swab.h b/trunk/arch/cris/include/arch-v10/arch/byteorder.h similarity index 55% rename from trunk/arch/cris/include/arch-v10/arch/swab.h rename to trunk/arch/cris/include/arch-v10/arch/byteorder.h index e4e847d8a05e..255b646b7fa8 100644 --- a/trunk/arch/cris/include/arch-v10/arch/swab.h +++ b/trunk/arch/cris/include/arch-v10/arch/byteorder.h @@ -1,30 +1,26 @@ -#ifndef _CRIS_ARCH_SWAB_H -#define _CRIS_ARCH_SWAB_H +#ifndef _CRIS_ARCH_BYTEORDER_H +#define _CRIS_ARCH_BYTEORDER_H #include #include -#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/trunk/arch/cris/include/arch-v32/arch/byteorder.h b/trunk/arch/cris/include/arch-v32/arch/byteorder.h new file mode 100644 index 000000000000..6ef8fb4a35f2 --- /dev/null +++ b/trunk/arch/cris/include/arch-v32/arch/byteorder.h @@ -0,0 +1,20 @@ +#ifndef _ASM_CRIS_ARCH_BYTEORDER_H +#define _ASM_CRIS_ARCH_BYTEORDER_H + +#include + +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/trunk/arch/cris/include/arch-v32/arch/swab.h b/trunk/arch/cris/include/arch-v32/arch/swab.h deleted file mode 100644 index 9a4ea5e209c2..000000000000 --- a/trunk/arch/cris/include/arch-v32/arch/swab.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _ASM_CRIS_ARCH_SWAB_H -#define _ASM_CRIS_ARCH_SWAB_H - -#include - -#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 */ diff --git a/trunk/arch/cris/include/asm/byteorder.h b/trunk/arch/cris/include/asm/byteorder.h index bcd189798e26..cc8e418cfd14 100644 --- a/trunk/arch/cris/include/asm/byteorder.h +++ b/trunk/arch/cris/include/asm/byteorder.h @@ -1,6 +1,25 @@ #ifndef _CRIS_BYTEORDER_H #define _CRIS_BYTEORDER_H +#ifdef __GNUC__ + +#ifdef __KERNEL__ +#include + +/* 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 #endif diff --git a/trunk/arch/cris/include/asm/swab.h b/trunk/arch/cris/include/asm/swab.h deleted file mode 100644 index 80668e88419c..000000000000 --- a/trunk/arch/cris/include/asm/swab.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _CRIS_SWAB_H -#define _CRIS_SWAB_H - -#ifdef __KERNEL__ -#include -#endif /* __KERNEL__ */ - -#endif /* _CRIS_SWAB_H */ diff --git a/trunk/arch/h8300/include/asm/Kbuild b/trunk/arch/h8300/include/asm/Kbuild index c68e1680da01..27b108a86b39 100644 --- a/trunk/arch/h8300/include/asm/Kbuild +++ b/trunk/arch/h8300/include/asm/Kbuild @@ -1 +1,2 @@ include include/asm-generic/Kbuild.asm +unifdef-y += swab.h diff --git a/trunk/arch/h8300/include/asm/byteorder.h b/trunk/arch/h8300/include/asm/byteorder.h index 13539da99efd..c36b80a3dd84 100644 --- a/trunk/arch/h8300/include/asm/byteorder.h +++ b/trunk/arch/h8300/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _H8300_BYTEORDER_H #define _H8300_BYTEORDER_H +#include #include #endif /* _H8300_BYTEORDER_H */ diff --git a/trunk/arch/h8300/kernel/syscalls.S b/trunk/arch/h8300/kernel/syscalls.S index 4eb67faac633..54e21c3f2057 100644 --- a/trunk/arch/h8300/kernel/syscalls.S +++ b/trunk/arch/h8300/kernel/syscalls.S @@ -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(sys_old_readdir) + .long SYMBOL_NAME(old_readdir) .long SYMBOL_NAME(old_mmap) /* 90 */ .long SYMBOL_NAME(sys_munmap) .long SYMBOL_NAME(sys_truncate) diff --git a/trunk/arch/ia64/Kconfig b/trunk/arch/ia64/Kconfig index 6183aeccecf1..3d31636cbafb 100644 --- a/trunk/arch/ia64/Kconfig +++ b/trunk/arch/ia64/Kconfig @@ -17,7 +17,6 @@ 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 diff --git a/trunk/arch/ia64/configs/generic_defconfig b/trunk/arch/ia64/configs/generic_defconfig index a109db30ce55..27eb67604c53 100644 --- a/trunk/arch/ia64/configs/generic_defconfig +++ b/trunk/arch/ia64/configs/generic_defconfig @@ -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=y +# CONFIG_SATA_VITESSE is not set # CONFIG_SATA_INIC162X is not set # CONFIG_PATA_ACPI is not set # CONFIG_PATA_ALI is not set diff --git a/trunk/arch/ia64/ia32/ia32_entry.S b/trunk/arch/ia64/ia32/ia32_entry.S index a46f8395e9a5..a8cf19958850 100644 --- a/trunk/arch/ia64/ia32/ia32_entry.S +++ b/trunk/arch/ia64/ia32/ia32_entry.S @@ -220,7 +220,7 @@ ia32_syscall_table: data8 sys_mkdir data8 sys_rmdir /* 40 */ data8 sys_dup - data8 sys_ia64_pipe + data8 sys_pipe data8 compat_sys_times data8 sys_ni_syscall /* old prof syscall holder */ data8 sys32_brk /* 45 */ diff --git a/trunk/arch/ia64/include/asm/Kbuild b/trunk/arch/ia64/include/asm/Kbuild index ccbe8ae47a61..3b25bd9dca91 100644 --- a/trunk/arch/ia64/include/asm/Kbuild +++ b/trunk/arch/ia64/include/asm/Kbuild @@ -14,3 +14,4 @@ unifdef-y += gcc_intrin.h unifdef-y += intrinsics.h unifdef-y += perfmon.h unifdef-y += ustack.h +unifdef-y += swab.h diff --git a/trunk/arch/ia64/include/asm/byteorder.h b/trunk/arch/ia64/include/asm/byteorder.h index a8dd73558150..0f84c5cb703d 100644 --- a/trunk/arch/ia64/include/asm/byteorder.h +++ b/trunk/arch/ia64/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _ASM_IA64_BYTEORDER_H #define _ASM_IA64_BYTEORDER_H +#include #include #endif /* _ASM_IA64_BYTEORDER_H */ diff --git a/trunk/arch/ia64/include/asm/dma-mapping.h b/trunk/arch/ia64/include/asm/dma-mapping.h index 1f912d927585..bbab7e2b0fc9 100644 --- a/trunk/arch/ia64/include/asm/dma-mapping.h +++ b/trunk/arch/ia64/include/asm/dma-mapping.h @@ -9,8 +9,6 @@ #include #include -#define ARCH_HAS_DMA_GET_REQUIRED_MASK - struct dma_mapping_ops { int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); diff --git a/trunk/arch/ia64/include/asm/machvec.h b/trunk/arch/ia64/include/asm/machvec.h index fe87b2121707..59c17e446683 100644 --- a/trunk/arch/ia64/include/asm/machvec.h +++ b/trunk/arch/ia64/include/asm/machvec.h @@ -62,7 +62,6 @@ 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 @@ -160,7 +159,6 @@ 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 @@ -215,7 +213,6 @@ 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; @@ -266,7 +263,6 @@ 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, \ @@ -370,9 +366,6 @@ 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 diff --git a/trunk/arch/ia64/include/asm/machvec_init.h b/trunk/arch/ia64/include/asm/machvec_init.h index 37a469849ab9..ef964b286842 100644 --- a/trunk/arch/ia64/include/asm/machvec_init.h +++ b/trunk/arch/ia64/include/asm/machvec_init.h @@ -3,7 +3,6 @@ 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; diff --git a/trunk/arch/ia64/include/asm/machvec_sn2.h b/trunk/arch/ia64/include/asm/machvec_sn2.h index f1a6e0d6dfa5..781308ea7b88 100644 --- a/trunk/arch/ia64/include/asm/machvec_sn2.h +++ b/trunk/arch/ia64/include/asm/machvec_sn2.h @@ -67,7 +67,6 @@ 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; @@ -124,7 +123,6 @@ 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 diff --git a/trunk/arch/ia64/include/asm/unistd.h b/trunk/arch/ia64/include/asm/unistd.h index 9015979ebe0f..f791576355ad 100644 --- a/trunk/arch/ia64/include/asm/unistd.h +++ b/trunk/arch/ia64/include/asm/unistd.h @@ -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_ia64_pipe(void); +asmlinkage long sys_pipe(void); asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, struct sigaction __user *oact, diff --git a/trunk/arch/ia64/kernel/entry.S b/trunk/arch/ia64/kernel/entry.S index e5341e2c1175..d435f4a7a96c 100644 --- a/trunk/arch/ia64/kernel/entry.S +++ b/trunk/arch/ia64/kernel/entry.S @@ -1442,7 +1442,7 @@ sys_call_table: data8 sys_mkdir // 1055 data8 sys_rmdir data8 sys_dup - data8 sys_ia64_pipe + data8 sys_pipe data8 sys_times data8 ia64_brk // 1060 data8 sys_setgid diff --git a/trunk/arch/ia64/kernel/kprobes.c b/trunk/arch/ia64/kernel/kprobes.c index 9adac441ac9b..f90be51b1123 100644 --- a/trunk/arch/ia64/kernel/kprobes.c +++ b/trunk/arch/ia64/kernel/kprobes.c @@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args) return 1; ss_probe: -#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) +#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { /* Boost up -- we can execute copied instructions directly */ ia64_psr(regs)->ri = p->ainsn.slot; diff --git a/trunk/arch/ia64/kernel/sys_ia64.c b/trunk/arch/ia64/kernel/sys_ia64.c index 92ed83f34036..bcbb6d8792d3 100644 --- a/trunk/arch/ia64/kernel/sys_ia64.c +++ b/trunk/arch/ia64/kernel/sys_ia64.c @@ -154,7 +154,7 @@ ia64_brk (unsigned long brk) * and r9) as this is faster than doing a copy_to_user(). */ asmlinkage long -sys_ia64_pipe (void) +sys_pipe (void) { struct pt_regs *regs = task_pt_regs(current); int fd[2]; diff --git a/trunk/arch/ia64/kernel/unaligned.c b/trunk/arch/ia64/kernel/unaligned.c index 6db08599ebbc..ff0e7c10faa7 100644 --- a/trunk/arch/ia64/kernel/unaligned.c +++ b/trunk/arch/ia64/kernel/unaligned.c @@ -59,7 +59,6 @@ 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; /* @@ -1372,12 +1371,9 @@ 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); } diff --git a/trunk/arch/ia64/pci/pci.c b/trunk/arch/ia64/pci/pci.c index 61f1af5c23c1..211fcfd115f9 100644 --- a/trunk/arch/ia64/pci/pci.c +++ b/trunk/arch/ia64/pci/pci.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -749,32 +748,6 @@ 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(); diff --git a/trunk/arch/ia64/sn/pci/pci_dma.c b/trunk/arch/ia64/sn/pci/pci_dma.c index 863f5017baae..53ebb6484495 100644 --- a/trunk/arch/ia64/sn/pci/pci_dma.c +++ b/trunk/arch/ia64/sn/pci/pci_dma.c @@ -356,12 +356,6 @@ 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)) diff --git a/trunk/arch/ia64/xen/time.c b/trunk/arch/ia64/xen/time.c index 68d6204c3f16..d15a94c330fb 100644 --- a/trunk/arch/ia64/xen/time.c +++ b/trunk/arch/ia64/xen/time.c @@ -129,8 +129,8 @@ consider_steal_time(unsigned long new_itm) blocked = stolentick; if (stolen > 0 || blocked > 0) { - account_steal_ticks(stolen); - account_idle_ticks(blocked); + account_steal_time(NULL, jiffies_to_cputime(stolen)); + account_steal_time(idle_task(cpu), jiffies_to_cputime(blocked)); run_local_timers(); if (rcu_pending(cpu)) diff --git a/trunk/arch/m68k/kernel/entry.S b/trunk/arch/m68k/kernel/entry.S index 5c332f2b9b83..5b780826647c 100644 --- a/trunk/arch/m68k/kernel/entry.S +++ b/trunk/arch/m68k/kernel/entry.S @@ -513,7 +513,7 @@ sys_call_table: .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/m68knommu/include/asm/Kbuild b/trunk/arch/m68knommu/include/asm/Kbuild index c68e1680da01..58c02a454130 100644 --- a/trunk/arch/m68knommu/include/asm/Kbuild +++ b/trunk/arch/m68knommu/include/asm/Kbuild @@ -1 +1,3 @@ include include/asm-generic/Kbuild.asm + +unifdef-y += swab.h diff --git a/trunk/arch/m68knommu/include/asm/byteorder.h b/trunk/arch/m68knommu/include/asm/byteorder.h index 9c6c76a15041..a6f0b8f7f622 100644 --- a/trunk/arch/m68knommu/include/asm/byteorder.h +++ b/trunk/arch/m68knommu/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _M68KNOMMU_BYTEORDER_H #define _M68KNOMMU_BYTEORDER_H +#include #include #endif /* _M68KNOMMU_BYTEORDER_H */ diff --git a/trunk/arch/m68knommu/kernel/syscalltable.S b/trunk/arch/m68knommu/kernel/syscalltable.S index 5c3e3f62194a..812f8d8b7a85 100644 --- a/trunk/arch/m68knommu/kernel/syscalltable.S +++ b/trunk/arch/m68knommu/kernel/syscalltable.S @@ -107,7 +107,7 @@ ENTRY(sys_call_table) .long sys_uselib .long sys_ni_syscall /* sys_swapon */ .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/mips/include/asm/Kbuild b/trunk/arch/mips/include/asm/Kbuild index 7897f05e3165..023866c0c102 100644 --- a/trunk/arch/mips/include/asm/Kbuild +++ b/trunk/arch/mips/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm header-y += cachectl.h sgidefs.h sysmips.h +header-y += swab.h diff --git a/trunk/arch/mips/include/asm/byteorder.h b/trunk/arch/mips/include/asm/byteorder.h index 9579051ff1c7..607b71830707 100644 --- a/trunk/arch/mips/include/asm/byteorder.h +++ b/trunk/arch/mips/include/asm/byteorder.h @@ -8,6 +8,8 @@ #ifndef _ASM_BYTEORDER_H #define _ASM_BYTEORDER_H +#include + #if defined(__MIPSEB__) #include #elif defined(__MIPSEL__) diff --git a/trunk/arch/mips/kernel/scall32-o32.S b/trunk/arch/mips/kernel/scall32-o32.S index 51d1ba415b90..d0916a55cd77 100644 --- a/trunk/arch/mips/kernel/scall32-o32.S +++ b/trunk/arch/mips/kernel/scall32-o32.S @@ -398,7 +398,7 @@ einval: li v0, -ENOSYS sys sys_uselib 1 sys sys_swapon 2 sys sys_reboot 3 - sys sys_old_readdir 3 + sys old_readdir 3 sys old_mmap 6 /* 4090 */ sys sys_munmap 2 sys sys_truncate 2 diff --git a/trunk/arch/mn10300/kernel/entry.S b/trunk/arch/mn10300/kernel/entry.S index ceeaaaa359e2..62fba8aa9b6e 100644 --- a/trunk/arch/mn10300/kernel/entry.S +++ b/trunk/arch/mn10300/kernel/entry.S @@ -478,7 +478,7 @@ ENTRY(sys_call_table) .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/parisc/include/asm/Kbuild b/trunk/arch/parisc/include/asm/Kbuild index f88b252e419c..2121d99f8364 100644 --- a/trunk/arch/parisc/include/asm/Kbuild +++ b/trunk/arch/parisc/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm unifdef-y += pdc.h +unifdef-y += swab.h diff --git a/trunk/arch/parisc/include/asm/byteorder.h b/trunk/arch/parisc/include/asm/byteorder.h index 58af2c5f5d61..da66029c4cb2 100644 --- a/trunk/arch/parisc/include/asm/byteorder.h +++ b/trunk/arch/parisc/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _PARISC_BYTEORDER_H #define _PARISC_BYTEORDER_H +#include #include #endif /* _PARISC_BYTEORDER_H */ diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig index e39b73bc0ff8..84b861316ce7 100644 --- a/trunk/arch/powerpc/Kconfig +++ b/trunk/arch/powerpc/Kconfig @@ -123,7 +123,6 @@ 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 diff --git a/trunk/arch/powerpc/boot/dts/mpc8315erdb.dts b/trunk/arch/powerpc/boot/dts/mpc8315erdb.dts index 71784165b77e..072c9b0f8c8e 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8315erdb.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8315erdb.dts @@ -255,7 +255,7 @@ device_type = "serial"; compatible = "ns16550"; reg = <0x4500 0x100>; - clock-frequency = <133333333>; + clock-frequency = <0>; interrupts = <9 0x8>; interrupt-parent = <&ipic>; }; @@ -265,7 +265,7 @@ device_type = "serial"; compatible = "ns16550"; reg = <0x4600 0x100>; - clock-frequency = <133333333>; + clock-frequency = <0>; interrupts = <10 0x8>; interrupt-parent = <&ipic>; }; diff --git a/trunk/arch/powerpc/boot/dts/mpc8544ds.dts b/trunk/arch/powerpc/boot/dts/mpc8544ds.dts index 0668d1048779..b9da42105066 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8544ds.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8544ds.dts @@ -313,7 +313,7 @@ 0x1000000 0x0 0x0 0xe1010000 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 */ @@ -350,7 +350,7 @@ 0x1000000 0x0 0x0 0xe1020000 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 */ diff --git a/trunk/arch/powerpc/boot/dts/mpc8572ds.dts b/trunk/arch/powerpc/boot/dts/mpc8572ds.dts index 3dcc001b8ed3..21459e161d02 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8572ds.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8572ds.dts @@ -724,7 +724,7 @@ 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; clock-frequency = <33333333>; interrupt-parent = <&mpic>; - interrupts = <25 2>; + interrupts = <26 2>; interrupt-map-mask = <0xf800 0x0 0x0 0x7>; interrupt-map = < /* IDSEL 0x0 */ @@ -761,7 +761,7 @@ 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; clock-frequency = <33333333>; interrupt-parent = <&mpic>; - interrupts = <26 2>; + interrupts = <27 2>; interrupt-map-mask = <0xf800 0x0 0x0 0x7>; interrupt-map = < /* IDSEL 0x0 */ diff --git a/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts index fd462efa9e61..c114c4ee9931 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts @@ -457,7 +457,7 @@ 0x1000000 0x0 0x0 0xffc10000 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 */ diff --git a/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts index e35230f2ac93..04ecda18d206 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts @@ -208,7 +208,7 @@ 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>; clock-frequency = <33333333>; interrupt-parent = <&mpic>; - interrupts = <26 2>; + interrupts = <27 2>; interrupt-map-mask = <0xf800 0x0 0x0 0x7>; interrupt-map = < /* IDSEL 0x0 */ diff --git a/trunk/arch/powerpc/configs/ppc64_defconfig b/trunk/arch/powerpc/configs/ppc64_defconfig index d4685d1c0be8..069ae1bbac29 100644 --- a/trunk/arch/powerpc/configs/ppc64_defconfig +++ b/trunk/arch/powerpc/configs/ppc64_defconfig @@ -211,28 +211,11 @@ 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=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_PS3 is not set 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 @@ -998,9 +981,6 @@ 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 @@ -1390,8 +1370,6 @@ 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 @@ -1514,8 +1492,6 @@ 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 diff --git a/trunk/arch/powerpc/include/asm/Kbuild b/trunk/arch/powerpc/include/asm/Kbuild index 5ab7d7fe198c..9268602de5d0 100644 --- a/trunk/arch/powerpc/include/asm/Kbuild +++ b/trunk/arch/powerpc/include/asm/Kbuild @@ -35,3 +35,4 @@ unifdef-y += spu_info.h unifdef-y += termios.h unifdef-y += types.h unifdef-y += unistd.h +unifdef-y += swab.h diff --git a/trunk/arch/powerpc/include/asm/byteorder.h b/trunk/arch/powerpc/include/asm/byteorder.h index aa6cc4fac965..5cca27a41532 100644 --- a/trunk/arch/powerpc/include/asm/byteorder.h +++ b/trunk/arch/powerpc/include/asm/byteorder.h @@ -7,6 +7,8 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#include #include #endif /* _ASM_POWERPC_BYTEORDER_H */ diff --git a/trunk/arch/powerpc/include/asm/ps3.h b/trunk/arch/powerpc/include/asm/ps3.h index 67f1812698d2..eead5c67197a 100644 --- a/trunk/arch/powerpc/include/asm/ps3.h +++ b/trunk/arch/powerpc/include/asm/ps3.h @@ -103,10 +103,10 @@ struct ps3_dma_region_ops { int (*map)(struct ps3_dma_region *, unsigned long virt_addr, unsigned long len, - dma_addr_t *bus_addr, + unsigned long *bus_addr, u64 iopte_pp); int (*unmap)(struct ps3_dma_region *, - dma_addr_t bus_addr, + unsigned long bus_addr, unsigned long len); }; /** @@ -124,9 +124,9 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev, int ps3_dma_region_create(struct ps3_dma_region *r); int ps3_dma_region_free(struct ps3_dma_region *r); int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, - unsigned long len, dma_addr_t *bus_addr, + unsigned long len, unsigned long *bus_addr, u64 iopte_pp); -int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr, +int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, unsigned long len); /* mmio routines */ diff --git a/trunk/arch/powerpc/include/asm/qe.h b/trunk/arch/powerpc/include/asm/qe.h index 2701753d9937..a0a15311d0d8 100644 --- a/trunk/arch/powerpc/include/asm/qe.h +++ b/trunk/arch/powerpc/include/asm/qe.h @@ -624,7 +624,7 @@ struct ucc_slow_pram { #define UCC_GETH_UCCE_RXF1 0x00000002 #define UCC_GETH_UCCE_RXF0 0x00000001 -/* UCC Protocol Specific Mode Register (UPSMR), when used for UART */ +/* UPSMR, when used as a UART */ #define UCC_UART_UPSMR_FLC 0x8000 #define UCC_UART_UPSMR_SL 0x4000 #define UCC_UART_UPSMR_CL_MASK 0x3000 @@ -652,23 +652,6 @@ 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 diff --git a/trunk/arch/powerpc/include/asm/rtas.h b/trunk/arch/powerpc/include/asm/rtas.h index 0aa0315fb7e8..e0175beb4462 100644 --- a/trunk/arch/powerpc/include/asm/rtas.h +++ b/trunk/arch/powerpc/include/asm/rtas.h @@ -18,7 +18,7 @@ */ #define RTAS_UNKNOWN_SERVICE (-1) -#define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */ +#define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */ /* Buffer size for ppc_rtas system call. */ #define RTAS_RMOBUF_MAX (64 * 1024) diff --git a/trunk/arch/powerpc/include/asm/systbl.h b/trunk/arch/powerpc/include/asm/systbl.h index 72353f6070a4..803def236654 100644 --- a/trunk/arch/powerpc/include/asm/systbl.h +++ b/trunk/arch/powerpc/include/asm/systbl.h @@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink) SYSCALL(uselib) SYSCALL(swapon) SYSCALL(reboot) -SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir) +SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) SYSCALL_SPU(mmap) SYSCALL_SPU(munmap) SYSCALL_SPU(truncate) diff --git a/trunk/arch/powerpc/include/asm/types.h b/trunk/arch/powerpc/include/asm/types.h index 7ce27a52bb34..c004c13f291e 100644 --- a/trunk/arch/powerpc/include/asm/types.h +++ b/trunk/arch/powerpc/include/asm/types.h @@ -1,12 +1,7 @@ #ifndef _ASM_POWERPC_TYPES_H #define _ASM_POWERPC_TYPES_H -/* - * 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__) +#ifdef __powerpc64__ # include #else # include diff --git a/trunk/arch/powerpc/kernel/asm-offsets.c b/trunk/arch/powerpc/kernel/asm-offsets.c index 19ee491e9e23..9937fe44555f 100644 --- a/trunk/arch/powerpc/kernel/asm-offsets.c +++ b/trunk/arch/powerpc/kernel/asm-offsets.c @@ -56,10 +56,6 @@ #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)); @@ -386,9 +382,6 @@ 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, diff --git a/trunk/arch/powerpc/kernel/cacheinfo.c b/trunk/arch/powerpc/kernel/cacheinfo.c index bb37b1d19a58..b33f0417a4bf 100644 --- a/trunk/arch/powerpc/kernel/cacheinfo.c +++ b/trunk/arch/powerpc/kernel/cacheinfo.c @@ -113,7 +113,7 @@ struct cache { struct cache *next_local; /* next cache of >= level */ }; -static DEFINE_PER_CPU(struct cache_dir *, cache_dir_pcpu); +static DEFINE_PER_CPU(struct cache_dir *, cache_dir); /* 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_pcpu, cpu_id) != NULL); + WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL); - per_cpu(cache_dir_pcpu, cpu_id) = cache_dir; + per_cpu(cache_dir, 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_pcpu, cpu_id); + cache_dir = per_cpu(cache_dir, cpu_id); /* careful, sysfs population may have failed */ if (cache_dir) remove_cache_dir(cache_dir); - per_cpu(cache_dir_pcpu, cpu_id) = NULL; + per_cpu(cache_dir, cpu_id) = NULL; /* clear the CPU's bit in its cache chain, possibly freeing * cache objects */ diff --git a/trunk/arch/powerpc/kernel/dma-iommu.c b/trunk/arch/powerpc/kernel/dma-iommu.c index 2983adac8cc3..14183af1b3fb 100644 --- a/trunk/arch/powerpc/kernel/dma-iommu.c +++ b/trunk/arch/powerpc/kernel/dma-iommu.c @@ -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%08llx, table offset: 0x%08lx\n", + "mask: 0x%08lx, table offset: 0x%08lx\n", mask, tbl->it_offset); else - printk(KERN_INFO "mask: 0x%08llx, table unavailable\n", + printk(KERN_INFO "mask: 0x%08lx, table unavailable\n", mask); return 0; } else diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S index ebaedafc8e67..b4bcf5a930fa 100644 --- a/trunk/arch/powerpc/kernel/head_64.S +++ b/trunk/arch/powerpc/kernel/head_64.S @@ -1518,15 +1518,6 @@ _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 diff --git a/trunk/arch/powerpc/kernel/head_fsl_booke.S b/trunk/arch/powerpc/kernel/head_fsl_booke.S index 36ffb3504a4f..11b549acc034 100644 --- a/trunk/arch/powerpc/kernel/head_fsl_booke.S +++ b/trunk/arch/powerpc/kernel/head_fsl_booke.S @@ -389,6 +389,10 @@ 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. */ @@ -707,7 +711,7 @@ interrupt_base: EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) #ifdef CONFIG_PPC_E500MC - EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD) + EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_EE) #endif /* Debug Interrupt */ @@ -905,7 +909,7 @@ KernelSPE: _GLOBAL(loadcam_entry) lis r4,TLBCAM@ha addi r4,r4,TLBCAM@l - mulli r5,r3,TLBCAM_SIZE + mulli r5,r3,20 add r3,r5,r4 lwz r4,0(r3) mtspr SPRN_MAS0,r4 diff --git a/trunk/arch/powerpc/kernel/iommu.c b/trunk/arch/powerpc/kernel/iommu.c index fd51578e29dd..1bfa706b96e7 100644 --- a/trunk/arch/powerpc/kernel/iommu.c +++ b/trunk/arch/powerpc/kernel/iommu.c @@ -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%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); + 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); WARN_ON(1); } return; diff --git a/trunk/arch/powerpc/kernel/lparcfg.c b/trunk/arch/powerpc/kernel/lparcfg.c index 182e0f642f36..d051e8cbcd03 100644 --- a/trunk/arch/powerpc/kernel/lparcfg.c +++ b/trunk/arch/powerpc/kernel/lparcfg.c @@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m) if (rc) return; - seq_printf(m, "partition_entitled_capacity=%lld\n", + seq_printf(m, "partition_entitled_capacity=%ld\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=%lld\n", + seq_printf(m, "unallocated_capacity=%ld\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 = %llu, current_weight = %u\n", + pr_debug("%s: current_entitled = %lu, current_weight = %u\n", __func__, ppp_data.entitlement, ppp_data.weight); - pr_debug("%s: new_entitled = %llu, new_weight = %u\n", + pr_debug("%s: new_entitled = %lu, 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 = %llu, new_weight = %u\n", + pr_debug("%s: new_entitled = %lu, new_weight = %u\n", __func__, new_entitled, new_weight); rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight); diff --git a/trunk/arch/powerpc/kernel/machine_kexec.c b/trunk/arch/powerpc/kernel/machine_kexec.c index d59e2b1bdcba..b3abebb7ee64 100644 --- a/trunk/arch/powerpc/kernel/machine_kexec.c +++ b/trunk/arch/powerpc/kernel/machine_kexec.c @@ -93,35 +93,10 @@ 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; diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index ea8eda8c87cf..586962f65c2a 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -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%016llx...0x%016llx\n", + pr_debug(" virt=0x%016lx...0x%016lx\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%016llx, virt=0x%p (alloc=0x%p)\n", + pr_debug(" phys=0x%016lx, 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%016llx...0x%016llx\n", + pr_debug(" hose->io_resource=0x%016lx...0x%016lx\n", hose->io_resource.start, hose->io_resource.end); return 0; diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index f00f83109ab3..c09cffafb6ee 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -590,11 +590,6 @@ static void __init check_cpu_slb_size(unsigned long node) { u32 *slb_size_ptr; - slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL); - if (slb_size_ptr != NULL) { - mmu_slb_size = *slb_size_ptr; - return; - } slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL); if (slb_size_ptr != NULL) { mmu_slb_size = *slb_size_ptr; diff --git a/trunk/arch/powerpc/kernel/setup_64.c b/trunk/arch/powerpc/kernel/setup_64.c index 2d34196bba8c..d8bd2161e738 100644 --- a/trunk/arch/powerpc/kernel/setup_64.c +++ b/trunk/arch/powerpc/kernel/setup_64.c @@ -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%llx\n", ppc64_pft_size); - printk("physicalMemorySize = 0x%llx\n", lmb_phys_mem_size()); + printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); + printk("physicalMemorySize = 0x%lx\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(0x10000000ULL, lmb.rmo_size); + limit = min(0x10000000UL, lmb.rmo_size); for_each_possible_cpu(i) { unsigned long sp; diff --git a/trunk/arch/powerpc/kernel/vmlinux.lds.S b/trunk/arch/powerpc/kernel/vmlinux.lds.S index 161b9b9691f0..47bf15cd2c9e 100644 --- a/trunk/arch/powerpc/kernel/vmlinux.lds.S +++ b/trunk/arch/powerpc/kernel/vmlinux.lds.S @@ -87,9 +87,7 @@ SECTIONS /* The dummy segment contents for the bug workaround mentioned above near PHDRS. */ .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { - LONG(0) - LONG(0) - LONG(0) + LONG(0xf177) } :kernel :dummy /* diff --git a/trunk/arch/powerpc/mm/fsl_booke_mmu.c b/trunk/arch/powerpc/mm/fsl_booke_mmu.c index 1971e4ee3d6e..23cee39534fd 100644 --- a/trunk/arch/powerpc/mm/fsl_booke_mmu.c +++ b/trunk/arch/powerpc/mm/fsl_booke_mmu.c @@ -56,11 +56,18 @@ 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 TLBCAM[NUM_TLBCAMS]; +struct tlbcam { + u32 MAS0; + u32 MAS1; + u32 MAS2; + u32 MAS3; + u32 MAS7; +} TLBCAM[NUM_TLBCAMS]; struct tlbcamrange { unsigned long start; diff --git a/trunk/arch/powerpc/mm/mmu_decl.h b/trunk/arch/powerpc/mm/mmu_decl.h index d1f9c62dc177..ad123bced404 100644 --- a/trunk/arch/powerpc/mm/mmu_decl.h +++ b/trunk/arch/powerpc/mm/mmu_decl.h @@ -75,15 +75,6 @@ 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, @@ -99,6 +90,8 @@ 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; diff --git a/trunk/arch/powerpc/mm/slice.c b/trunk/arch/powerpc/mm/slice.c index ba5194817f8a..db44e02e045b 100644 --- a/trunk/arch/powerpc/mm/slice.c +++ b/trunk/arch/powerpc/mm/slice.c @@ -710,18 +710,9 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, unsigned long len) { struct slice_mask mask, available; - unsigned int psize = mm->context.user_psize; mask = slice_range_to_mask(addr, len); - available = slice_mask_for_size(mm, psize); -#ifdef CONFIG_PPC_64K_PAGES - /* We need to account for 4k slices too */ - if (psize == MMU_PAGE_64K) { - struct slice_mask compat_mask; - compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K); - or_mask(available, compat_mask); - } -#endif + available = slice_mask_for_size(mm, mm->context.user_psize); #if 0 /* too verbose */ slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n", diff --git a/trunk/arch/powerpc/mm/stab.c b/trunk/arch/powerpc/mm/stab.c index 98cd1dc2ae75..60e6032a8088 100644 --- a/trunk/arch/powerpc/mm/stab.c +++ b/trunk/arch/powerpc/mm/stab.c @@ -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%llx " - "virtual, 0x%llx absolute\n", + printk(KERN_INFO "Segment table for CPU %d at 0x%lx " + "virtual, 0x%lx absolute\n", cpu, paca[cpu].stab_addr, paca[cpu].stab_real); } } diff --git a/trunk/arch/powerpc/oprofile/op_model_pa6t.c b/trunk/arch/powerpc/oprofile/op_model_pa6t.c index 42f778dff919..c40de461fd4e 100644 --- a/trunk/arch/powerpc/oprofile/op_model_pa6t.c +++ b/trunk/arch/powerpc/oprofile/op_model_pa6t.c @@ -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%llx\n", + pr_debug("reset_value for pmc%u inited to 0x%lx\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 %llx\n", smp_processor_id(), mmcr0); + pr_debug("start on cpu %d, mmcr0 %lx\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 %llx\n", smp_processor_id(), mmcr0); + pr_debug("stop on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); } /* handle the perfmon overflow vector */ diff --git a/trunk/arch/powerpc/platforms/512x/clock.c b/trunk/arch/powerpc/platforms/512x/clock.c index 1bcff94eb924..f416014ee727 100644 --- a/trunk/arch/powerpc/platforms/512x/clock.c +++ b/trunk/arch/powerpc/platforms/512x/clock.c @@ -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 == p->dev) + if (dev && dev == p->dev) dev_match++; if (strcmp(id, p->name) == 0) id_match++; diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c index 07f89ae46d04..8a455ebce98d 100644 --- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c +++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_gpio.c @@ -363,8 +363,11 @@ 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(®s->status) & (1 << (31 - 23))) ? 1 : 0; + + return ret; } static void diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 0a093f03c758..72865e8e4b51 100644 --- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c @@ -196,7 +196,6 @@ 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; @@ -223,11 +222,6 @@ 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))); @@ -237,7 +231,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) } static struct irq_chip mpc52xx_extirq_irqchip = { - .typename = "MPC52xx External", + .typename = " MPC52xx IRQ[0-3] ", .mask = mpc52xx_extirq_mask, .unmask = mpc52xx_extirq_unmask, .ack = mpc52xx_extirq_ack, diff --git a/trunk/arch/powerpc/platforms/83xx/Makefile b/trunk/arch/powerpc/platforms/83xx/Makefile index 051777c542c7..ba5028e29890 100644 --- a/trunk/arch/powerpc/platforms/83xx/Makefile +++ b/trunk/arch/powerpc/platforms/83xx/Makefile @@ -3,7 +3,6 @@ # 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 diff --git a/trunk/arch/powerpc/platforms/Kconfig b/trunk/arch/powerpc/platforms/Kconfig index 200b9cb900ea..47fe2bea9865 100644 --- a/trunk/arch/powerpc/platforms/Kconfig +++ b/trunk/arch/powerpc/platforms/Kconfig @@ -323,15 +323,4 @@ 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 diff --git a/trunk/arch/powerpc/platforms/cell/beat_interrupt.c b/trunk/arch/powerpc/platforms/cell/beat_interrupt.c index 72254848a228..192a93509372 100644 --- a/trunk/arch/powerpc/platforms/cell/beat_interrupt.c +++ b/trunk/arch/powerpc/platforms/cell/beat_interrupt.c @@ -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 = %16llx", err); + panic("Failed to downcount IRQ! Error = %16lx", err); printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); } diff --git a/trunk/arch/powerpc/platforms/cell/celleb_scc_epci.c b/trunk/arch/powerpc/platforms/cell/celleb_scc_epci.c index 48ec88a38a12..08c285b10e30 100644 --- a/trunk/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ b/trunk/arch/powerpc/platforms/cell/celleb_scc_epci.c @@ -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%016llx->0x%016lx + 0x%016llx\n", + pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\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%016llx->0x%016lx + 0x%016llx\n", + pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n", r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); hose->ops = &celleb_epci_ops; diff --git a/trunk/arch/powerpc/platforms/cell/iommu.c b/trunk/arch/powerpc/platforms/cell/iommu.c index ee5033eddf01..88d94b59a7cb 100644 --- a/trunk/arch/powerpc/platforms/cell/iommu.c +++ b/trunk/arch/powerpc/platforms/cell/iommu.c @@ -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 (%lldMB)\n", + " (%ldMB) smaller than total memory (%ldMB)\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 = %llx\n", addr); + dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); } static void insert_16M_pte(unsigned long addr, unsigned long *ptab, diff --git a/trunk/arch/powerpc/platforms/cell/ras.c b/trunk/arch/powerpc/platforms/cell/ras.c index 5f961c464cc4..7b4cefa2199b 100644 --- a/trunk/arch/powerpc/platforms/cell/ras.c +++ b/trunk/arch/powerpc/platforms/cell/ras.c @@ -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%016llx\n", + printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n", in_be64(&pregs->checkstop_fir)); - printk(KERN_ERR "Global Recoverable FIR : 0x%016llx\n", + printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n", in_be64(&pregs->checkstop_fir)); - printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n", + printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n", in_be64(&pregs->spec_att_mchk_fir)); if (iregs == NULL) return; - printk(KERN_ERR "IOC FIR : 0x%016llx\n", + printk(KERN_ERR "IOC FIR : 0x%016lx\n", in_be64(&iregs->ioc_fir)); } diff --git a/trunk/arch/powerpc/platforms/cell/spu_base.c b/trunk/arch/powerpc/platforms/cell/spu_base.c index e487ad68ac11..a5bdb89a17c3 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_base.c +++ b/trunk/arch/powerpc/platforms/cell/spu_base.c @@ -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%016llx 0x%016llx\n", + pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\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, %llx, %lx\n", __func__, dsisr, ea); + pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea); /* * Handle kernel space hash faults immediately. User hash diff --git a/trunk/arch/powerpc/platforms/cell/spu_callbacks.c b/trunk/arch/powerpc/platforms/cell/spu_callbacks.c index fec1495e6b12..19f6bfdbb933 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/trunk/arch/powerpc/platforms/cell/spu_callbacks.c @@ -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 #%lld", __func__, s->nr_ret); + pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret); return -ENOSYS; } diff --git a/trunk/arch/powerpc/platforms/cell/spufs/coredump.c b/trunk/arch/powerpc/platforms/cell/spufs/coredump.c index c4d4a19235e0..af116aadba10 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/coredump.c @@ -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%.16llx", data); + ret = snprintf(buffer, size, "0x%.16lx", data); if (ret >= size) return size; return ++ret; /* count trailing NULL */ diff --git a/trunk/arch/powerpc/platforms/cell/spufs/fault.c b/trunk/arch/powerpc/platforms/cell/spufs/fault.c index a4dd3ae7223a..f093a581ac74 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/fault.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/fault.c @@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx) spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); - pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea, + pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea, dsisr, ctx->state); ctx->stats.hash_flt++; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/file.c b/trunk/arch/powerpc/platforms/cell/spufs/file.c index 0da7f2bf5ee1..7106b63d401b 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/file.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/file.c @@ -1654,7 +1654,7 @@ static ssize_t spufs_mfc_read(struct file *file, char __user *buffer, static int spufs_check_valid_dma(struct mfc_dma_command *cmd) { - pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa, + pr_debug("queueing DMA %x %lx %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 %llx lsa %x\n", + pr_debug("invalid DMA alignment, ea %lx 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 %llx %llx %llx %llx %x %x\n", + " %c %lx %lx %lx %lx %x %x\n", ctx->state == SPU_STATE_SAVED ? 'S' : 'R', ctx->flags, ctx->sched_flags, diff --git a/trunk/arch/powerpc/platforms/fsl_uli1575.c b/trunk/arch/powerpc/platforms/fsl_uli1575.c index 1db6b9e037fc..8c619963becc 100644 --- a/trunk/arch/powerpc/platforms/fsl_uli1575.c +++ b/trunk/arch/powerpc/platforms/fsl_uli1575.c @@ -249,7 +249,6 @@ 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) { diff --git a/trunk/arch/powerpc/platforms/iseries/iommu.c b/trunk/arch/powerpc/platforms/iseries/iommu.c index 6ed75bffc8ab..bbe828f1b885 100644 --- a/trunk/arch/powerpc/platforms/iseries/iommu.c +++ b/trunk/arch/powerpc/platforms/iseries/iommu.c @@ -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%llx\n", + panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\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%llx\n", + panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", rc); index++; } diff --git a/trunk/arch/powerpc/platforms/powermac/smp.c b/trunk/arch/powerpc/platforms/powermac/smp.c index bd8817b00fa4..6b0711c15eca 100644 --- a/trunk/arch/powerpc/platforms/powermac/smp.c +++ b/trunk/arch/powerpc/platforms/powermac/smp.c @@ -53,7 +53,7 @@ #include #include -#undef DEBUG +#define DEBUG #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) diff --git a/trunk/arch/powerpc/platforms/ps3/device-init.c b/trunk/arch/powerpc/platforms/ps3/device-init.c index bb028f165fb3..ca71a12b764c 100644 --- a/trunk/arch/powerpc/platforms/ps3/device-init.c +++ b/trunk/arch/powerpc/platforms/ps3/device-init.c @@ -82,7 +82,7 @@ static int __init ps3_register_lpm_devices(void) goto fail_rights; } - pr_debug("%s:%d: pu_id %llu, rights %llu(%llxh)\n", + pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n", __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights, dev->lpm.rights); @@ -348,7 +348,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo, return -ENODEV; } - pr_debug("%s:%u: (%u:%u:%u): port %llu blk_size %llu num_blocks %llu " + pr_debug("%s:%u: (%u:%u:%u): port %lu blk_size %lu num_blocks %lu " "num_regions %u\n", __func__, __LINE__, repo->bus_index, repo->dev_index, repo->dev_type, port, blk_size, num_blocks, num_regions); @@ -394,7 +394,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo, result = -ENODEV; goto fail_read_region; } - pr_debug("%s:%u: region %u: id %u start %llu size %llu\n", + pr_debug("%s:%u: region %u: id %u start %lu size %lu\n", __func__, __LINE__, i, id, start, size); p->regions[i].id = id; @@ -662,13 +662,13 @@ static void ps3_find_and_add_device(u64 bus_id, u64 dev_id) if (rem) break; } - pr_warning("%s:%u: device %llu:%llu not found\n", __func__, __LINE__, + pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__, bus_id, dev_id); return; found: if (retries) - pr_debug("%s:%u: device %llu:%llu found after %u retries\n", + pr_debug("%s:%u: device %lu:%lu found after %u retries\n", __func__, __LINE__, bus_id, dev_id, retries); ps3_setup_dynamic_device(&repo); @@ -715,14 +715,14 @@ static irqreturn_t ps3_notification_interrupt(int irq, void *data) res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag, &status); if (tag != dev->tag) - pr_err("%s:%u: tag mismatch, got %llx, expected %llx\n", + pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n", __func__, __LINE__, tag, dev->tag); if (res) { - pr_err("%s:%u: res %d status 0x%llx\n", __func__, __LINE__, res, + pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res, status); } else { - pr_debug("%s:%u: completed, status 0x%llx\n", __func__, + pr_debug("%s:%u: completed, status 0x%lx\n", __func__, __LINE__, status); dev->lv1_status = status; complete(&dev->done); @@ -761,7 +761,7 @@ static int ps3_notification_read_write(struct ps3_notification_device *dev, } if (dev->lv1_status) { - pr_err("%s:%u: %s not completed, status 0x%llx\n", __func__, + pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__, __LINE__, op, dev->lv1_status); return -EIO; } @@ -850,16 +850,16 @@ static int ps3_probe_thread(void *data) if (res) break; - pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu" - " type %llu port %llu\n", __func__, __LINE__, + pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu" + " type %lu port %lu\n", __func__, __LINE__, notify_event->event_type, notify_event->bus_id, notify_event->dev_id, notify_event->dev_type, notify_event->dev_port); if (notify_event->event_type != notify_region_probe || notify_event->bus_id != dev.sbd.bus_id) { - pr_warning("%s:%u: bad notify_event: event %llu, " - "dev_id %llu, dev_type %llu\n", + pr_warning("%s:%u: bad notify_event: event %lu, " + "dev_id %lu, dev_type %lu\n", __func__, __LINE__, notify_event->event_type, notify_event->dev_id, notify_event->dev_type); diff --git a/trunk/arch/powerpc/platforms/ps3/htab.c b/trunk/arch/powerpc/platforms/ps3/htab.c index 1e8a1e39dfe8..6eb1d4d182c9 100644 --- a/trunk/arch/powerpc/platforms/ps3/htab.c +++ b/trunk/arch/powerpc/platforms/ps3/htab.c @@ -75,7 +75,7 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va, if (result) { /* all entries bolted !*/ - pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%llx r=%llx\n", + pr_info("%s:result=%d va=%lx pa=%lx ix=%lx v=%lx r=%lx\n", __func__, result, va, pa, hpte_group, hpte_v, hpte_r); BUG(); } diff --git a/trunk/arch/powerpc/platforms/ps3/interrupt.c b/trunk/arch/powerpc/platforms/ps3/interrupt.c index 8ec5ccf76b19..e59634f7af96 100644 --- a/trunk/arch/powerpc/platforms/ps3/interrupt.c +++ b/trunk/arch/powerpc/platforms/ps3/interrupt.c @@ -60,8 +60,6 @@ * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note * that there is no constraint on how many in this set an individual thread * can acquire. - * - * The mask is declared as unsigned long so we can use set/clear_bit on it. */ #define PS3_BMP_MINALIGN 64 @@ -70,7 +68,7 @@ struct ps3_bmp { struct { u64 status; u64 unused_1[3]; - unsigned long mask; + u64 mask; u64 unused_2[3]; }; u64 ipi_debug_brk_mask; @@ -104,7 +102,7 @@ static void ps3_chip_mask(unsigned int virq) struct ps3_private *pd = get_irq_chip_data(virq); unsigned long flags; - pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__, + pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, pd->thread_id, virq); local_irq_save(flags); @@ -125,7 +123,7 @@ static void ps3_chip_unmask(unsigned int virq) struct ps3_private *pd = get_irq_chip_data(virq); unsigned long flags; - pr_debug("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__, + pr_debug("%s:%d: thread_id %lu, virq %d\n", __func__, __LINE__, pd->thread_id, virq); local_irq_save(flags); @@ -223,7 +221,7 @@ static int ps3_virq_destroy(unsigned int virq) { const struct ps3_private *pd = get_irq_chip_data(virq); - pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__, + pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, __LINE__, pd->ppe_id, pd->thread_id, virq); set_irq_chip_data(virq, NULL); @@ -293,7 +291,7 @@ int ps3_irq_plug_destroy(unsigned int virq) int result; const struct ps3_private *pd = get_irq_chip_data(virq); - pr_debug("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__, + pr_debug("%s:%d: ppe_id %lu, thread_id %lu, virq %u\n", __func__, __LINE__, pd->ppe_id, pd->thread_id, virq); ps3_chip_mask(virq); @@ -324,7 +322,7 @@ EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy); int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq) { int result; - u64 outlet; + unsigned long outlet; result = lv1_construct_event_receive_port(&outlet); @@ -470,7 +468,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id, unsigned int *virq) { int result; - u64 outlet; + unsigned long outlet; result = lv1_construct_io_irq_outlet(interrupt_id, &outlet); @@ -527,7 +525,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp, unsigned int *virq) { int result; - u64 outlet; + unsigned long outlet; u64 lpar_addr; BUG_ON(!is_kernel_addr((u64)virt_addr_bmp)); @@ -583,7 +581,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id, unsigned int class, unsigned int *virq) { int result; - u64 outlet; + unsigned long outlet; BUG_ON(class > 2); @@ -693,7 +691,7 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq) pd->bmp.ipi_debug_brk_mask = 0x8000000000000000UL >> virq; - pr_debug("%s:%d: cpu %u, virq %u, mask %llxh\n", __func__, __LINE__, + pr_debug("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__, cpu, virq, pd->bmp.ipi_debug_brk_mask); } @@ -712,7 +710,7 @@ static unsigned int ps3_get_irq(void) plug &= 0x3f; if (unlikely(plug == NO_IRQ)) { - pr_debug("%s:%d: no plug found: thread_id %llu\n", __func__, + pr_debug("%s:%d: no plug found: thread_id %lu\n", __func__, __LINE__, pd->thread_id); dump_bmp(&per_cpu(ps3_private, 0)); dump_bmp(&per_cpu(ps3_private, 1)); @@ -747,7 +745,7 @@ void __init ps3_init_IRQ(void) pd->thread_id = get_hard_smp_processor_id(cpu); spin_lock_init(&pd->bmp.lock); - pr_debug("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n", + pr_debug("%s:%d: ppe_id %lu, thread_id %lu, bmp %lxh\n", __func__, __LINE__, pd->ppe_id, pd->thread_id, ps3_mm_phys_to_lpar(__pa(&pd->bmp))); @@ -772,6 +770,6 @@ void ps3_shutdown_IRQ(int cpu) lv1_get_logical_ppe_id(&ppe_id); result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0); - DBG("%s:%d: lv1_configure_irq_state_bitmap (%llu:%llu/%d) %s\n", __func__, + DBG("%s:%d: lv1_configure_irq_state_bitmap (%lu:%lu/%d) %s\n", __func__, __LINE__, ppe_id, thread_id, cpu, ps3_result(result)); } diff --git a/trunk/arch/powerpc/platforms/ps3/mm.c b/trunk/arch/powerpc/platforms/ps3/mm.c index 67de6bf3db3d..a4d49dd9e8a9 100644 --- a/trunk/arch/powerpc/platforms/ps3/mm.c +++ b/trunk/arch/powerpc/platforms/ps3/mm.c @@ -79,8 +79,8 @@ enum { */ struct mem_region { - u64 base; - u64 size; + unsigned long base; + unsigned long size; unsigned long offset; }; @@ -103,9 +103,9 @@ struct mem_region { */ struct map { - u64 total; - u64 vas_id; - u64 htab_size; + unsigned long total; + unsigned long vas_id; + unsigned long htab_size; struct mem_region rm; struct mem_region r1; }; @@ -114,13 +114,13 @@ struct map { static void __maybe_unused _debug_dump_map(const struct map *m, const char *func, int line) { - DBG("%s:%d: map.total = %llxh\n", func, line, m->total); - DBG("%s:%d: map.rm.size = %llxh\n", func, line, m->rm.size); - DBG("%s:%d: map.vas_id = %llu\n", func, line, m->vas_id); - DBG("%s:%d: map.htab_size = %llxh\n", func, line, m->htab_size); - DBG("%s:%d: map.r1.base = %llxh\n", func, line, m->r1.base); + DBG("%s:%d: map.total = %lxh\n", func, line, m->total); + DBG("%s:%d: map.rm.size = %lxh\n", func, line, m->rm.size); + DBG("%s:%d: map.vas_id = %lu\n", func, line, m->vas_id); + DBG("%s:%d: map.htab_size = %lxh\n", func, line, m->htab_size); + DBG("%s:%d: map.r1.base = %lxh\n", func, line, m->r1.base); DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset); - DBG("%s:%d: map.r1.size = %llxh\n", func, line, m->r1.size); + DBG("%s:%d: map.r1.size = %lxh\n", func, line, m->r1.size); } static struct map map; @@ -146,11 +146,11 @@ EXPORT_SYMBOL(ps3_mm_phys_to_lpar); void __init ps3_mm_vas_create(unsigned long* htab_size) { int result; - u64 start_address; - u64 size; - u64 access_right; - u64 max_page_size; - u64 flags; + unsigned long start_address; + unsigned long size; + unsigned long access_right; + unsigned long max_page_size; + unsigned long flags; result = lv1_query_logical_partition_address_region_info(0, &start_address, &size, &access_right, &max_page_size, @@ -164,7 +164,7 @@ void __init ps3_mm_vas_create(unsigned long* htab_size) } if (max_page_size < PAGE_SHIFT_16M) { - DBG("%s:%d: bad max_page_size %llxh\n", __func__, __LINE__, + DBG("%s:%d: bad max_page_size %lxh\n", __func__, __LINE__, max_page_size); goto fail; } @@ -208,7 +208,7 @@ void ps3_mm_vas_destroy(void) { int result; - DBG("%s:%d: map.vas_id = %llu\n", __func__, __LINE__, map.vas_id); + DBG("%s:%d: map.vas_id = %lu\n", __func__, __LINE__, map.vas_id); if (map.vas_id) { result = lv1_select_virtual_address_space(0); @@ -235,14 +235,15 @@ void ps3_mm_vas_destroy(void) static int ps3_mm_region_create(struct mem_region *r, unsigned long size) { int result; - u64 muid; + unsigned long muid; r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M); DBG("%s:%d requested %lxh\n", __func__, __LINE__, size); - DBG("%s:%d actual %llxh\n", __func__, __LINE__, r->size); - DBG("%s:%d difference %llxh (%lluMB)\n", __func__, __LINE__, - size - r->size, (size - r->size) / 1024 / 1024); + DBG("%s:%d actual %lxh\n", __func__, __LINE__, r->size); + DBG("%s:%d difference %lxh (%luMB)\n", __func__, __LINE__, + (unsigned long)(size - r->size), + (size - r->size) / 1024 / 1024); if (r->size == 0) { DBG("%s:%d: size == 0\n", __func__, __LINE__); @@ -276,7 +277,7 @@ static void ps3_mm_region_destroy(struct mem_region *r) { int result; - DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base); + DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base); if (r->base) { result = lv1_release_memory(r->base); BUG_ON(result); @@ -354,7 +355,7 @@ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r, static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, const char *func, int line) { - DBG("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id, + DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, r->dev->dev_id); DBG("%s:%d: page_size %u\n", func, line, r->page_size); DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); @@ -389,7 +390,7 @@ struct dma_chunk { static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, int line) { - DBG("%s:%d: r.dev %llu:%llu\n", func, line, + DBG("%s:%d: r.dev %lu:%lu\n", func, line, c->region->dev->bus_id, c->region->dev->dev_id); DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); @@ -595,7 +596,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr, /* build ioptes for the area */ pages = len >> r->page_size; - DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#llx\n", __func__, + DBG("%s: pgsize=%#x len=%#lx pages=%#x iopteflag=%#lx\n", __func__, r->page_size, r->len, pages, iopte_flag); for (iopage = 0; iopage < pages; iopage++) { offset = (1 << r->page_size) * iopage; @@ -647,14 +648,13 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr, static int dma_sb_region_create(struct ps3_dma_region *r) { int result; - u64 bus_addr; DBG(" -> %s:%d:\n", __func__, __LINE__); BUG_ON(!r); if (!r->dev->bus_id) { - pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__, + pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, r->dev->bus_id, r->dev->dev_id); return 0; } @@ -671,8 +671,7 @@ static int dma_sb_region_create(struct ps3_dma_region *r) result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id, roundup_pow_of_two(r->len), r->page_size, r->region_type, - &bus_addr); - r->bus_addr = bus_addr; + &r->bus_addr); if (result) { DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n", @@ -686,7 +685,6 @@ static int dma_sb_region_create(struct ps3_dma_region *r) static int dma_ioc0_region_create(struct ps3_dma_region *r) { int result; - u64 bus_addr; INIT_LIST_HEAD(&r->chunk_list.head); spin_lock_init(&r->chunk_list.lock); @@ -694,8 +692,7 @@ static int dma_ioc0_region_create(struct ps3_dma_region *r) result = lv1_allocate_io_segment(0, r->len, r->page_size, - &bus_addr); - r->bus_addr = bus_addr; + &r->bus_addr); if (result) { DBG("%s:%d: lv1_allocate_io_segment failed: %s\n", __func__, __LINE__, ps3_result(result)); @@ -723,7 +720,7 @@ static int dma_sb_region_free(struct ps3_dma_region *r) BUG_ON(!r); if (!r->dev->bus_id) { - pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__, + pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, r->dev->bus_id, r->dev->dev_id); return 0; } @@ -780,7 +777,7 @@ static int dma_ioc0_region_free(struct ps3_dma_region *r) */ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr, - unsigned long len, dma_addr_t *bus_addr, + unsigned long len, unsigned long *bus_addr, u64 iopte_flag) { int result; @@ -803,7 +800,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr, DBG("%s:%d lpar_addr %lxh\n", __func__, __LINE__, lpar_addr); DBG("%s:%d len %lxh\n", __func__, __LINE__, len); - DBG("%s:%d bus_addr %llxh (%lxh)\n", __func__, __LINE__, + DBG("%s:%d bus_addr %lxh (%lxh)\n", __func__, __LINE__, *bus_addr, len); } @@ -835,7 +832,7 @@ static int dma_sb_map_area(struct ps3_dma_region *r, unsigned long virt_addr, } static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, - unsigned long len, dma_addr_t *bus_addr, + unsigned long len, unsigned long *bus_addr, u64 iopte_flag) { int result; @@ -875,7 +872,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, return result; } *bus_addr = c->bus_addr + phys_addr - aligned_phys; - DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#llx\n", __func__, + DBG("%s: va=%#lx pa=%#lx a_pa=%#lx bus=%#lx\n", __func__, virt_addr, phys_addr, aligned_phys, *bus_addr); c->usage_count = 1; @@ -892,7 +889,7 @@ static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, * This is the common dma unmap routine. */ -static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, +static int dma_sb_unmap_area(struct ps3_dma_region *r, unsigned long bus_addr, unsigned long len) { unsigned long flags; @@ -906,7 +903,7 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, 1 << r->page_size); unsigned long aligned_len = _ALIGN_UP(len + bus_addr - aligned_bus, 1 << r->page_size); - DBG("%s:%d: not found: bus_addr %llxh\n", + DBG("%s:%d: not found: bus_addr %lxh\n", __func__, __LINE__, bus_addr); DBG("%s:%d: not found: len %lxh\n", __func__, __LINE__, len); @@ -929,12 +926,12 @@ static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, } static int dma_ioc0_unmap_area(struct ps3_dma_region *r, - dma_addr_t bus_addr, unsigned long len) + unsigned long bus_addr, unsigned long len) { unsigned long flags; struct dma_chunk *c; - DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len); + DBG("%s: start a=%#lx l=%#lx\n", __func__, bus_addr, len); spin_lock_irqsave(&r->chunk_list.lock, flags); c = dma_find_chunk(r, bus_addr, len); @@ -944,7 +941,7 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r, unsigned long aligned_len = _ALIGN_UP(len + bus_addr - aligned_bus, 1 << r->page_size); - DBG("%s:%d: not found: bus_addr %llxh\n", + DBG("%s:%d: not found: bus_addr %lxh\n", __func__, __LINE__, bus_addr); DBG("%s:%d: not found: len %lxh\n", __func__, __LINE__, len); @@ -978,8 +975,7 @@ static int dma_ioc0_unmap_area(struct ps3_dma_region *r, static int dma_sb_region_create_linear(struct ps3_dma_region *r) { int result; - unsigned long virt_addr, len; - dma_addr_t tmp; + unsigned long virt_addr, len, tmp; if (r->len > 16*1024*1024) { /* FIXME: need proper fix */ /* force 16M dma pages for linear mapping */ @@ -1031,8 +1027,7 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r) static int dma_sb_region_free_linear(struct ps3_dma_region *r) { int result; - dma_addr_t bus_addr; - unsigned long len, lpar_addr; + unsigned long bus_addr, len, lpar_addr; if (r->offset < map.rm.size) { /* Unmap (part of) 1st RAM chunk */ @@ -1077,7 +1072,7 @@ static int dma_sb_region_free_linear(struct ps3_dma_region *r) */ static int dma_sb_map_area_linear(struct ps3_dma_region *r, - unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr, + unsigned long virt_addr, unsigned long len, unsigned long *bus_addr, u64 iopte_flag) { unsigned long phys_addr = is_kernel_addr(virt_addr) ? __pa(virt_addr) @@ -1096,7 +1091,7 @@ static int dma_sb_map_area_linear(struct ps3_dma_region *r, */ static int dma_sb_unmap_area_linear(struct ps3_dma_region *r, - dma_addr_t bus_addr, unsigned long len) + unsigned long bus_addr, unsigned long len) { return 0; }; @@ -1174,13 +1169,13 @@ int ps3_dma_region_free(struct ps3_dma_region *r) EXPORT_SYMBOL(ps3_dma_region_free); int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, - unsigned long len, dma_addr_t *bus_addr, + unsigned long len, unsigned long *bus_addr, u64 iopte_flag) { return r->region_ops->map(r, virt_addr, len, bus_addr, iopte_flag); } -int ps3_dma_unmap(struct ps3_dma_region *r, dma_addr_t bus_addr, +int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, unsigned long len) { return r->region_ops->unmap(r, bus_addr, len); diff --git a/trunk/arch/powerpc/platforms/ps3/os-area.c b/trunk/arch/powerpc/platforms/ps3/os-area.c index e1c83c23b435..1d201782d4e5 100644 --- a/trunk/arch/powerpc/platforms/ps3/os-area.c +++ b/trunk/arch/powerpc/platforms/ps3/os-area.c @@ -306,7 +306,7 @@ static void _dump_params(const struct os_area_params *p, const char *func, { pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag); pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params); - pr_debug("%s:%d: p.rtc_diff %lld\n", func, line, p->rtc_diff); + pr_debug("%s:%d: p.rtc_diff %ld\n", func, line, p->rtc_diff); pr_debug("%s:%d: p.av_multi_out %u\n", func, line, p->av_multi_out); pr_debug("%s:%d: p.ctrl_button: %u\n", func, line, p->ctrl_button); pr_debug("%s:%d: p.static_ip_addr: %u.%u.%u.%u\n", func, line, diff --git a/trunk/arch/powerpc/platforms/ps3/repository.c b/trunk/arch/powerpc/platforms/ps3/repository.c index 5e304c292f68..22063adeb38b 100644 --- a/trunk/arch/powerpc/platforms/ps3/repository.c +++ b/trunk/arch/powerpc/platforms/ps3/repository.c @@ -44,7 +44,7 @@ static void _dump_field(const char *hdr, u64 n, const char *func, int line) s[i] = (in[i] <= 126 && in[i] >= 32) ? in[i] : '.'; s[i] = 0; - pr_debug("%s:%d: %s%016llx : %s\n", func, line, hdr, n, s); + pr_debug("%s:%d: %s%016lx : %s\n", func, line, hdr, n, s); #endif } @@ -70,8 +70,8 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, _dump_field("n2: ", n2, func, line); _dump_field("n3: ", n3, func, line); _dump_field("n4: ", n4, func, line); - pr_debug("%s:%d: v1: %016llx\n", func, line, v1); - pr_debug("%s:%d: v2: %016llx\n", func, line, v2); + pr_debug("%s:%d: v1: %016lx\n", func, line, v1); + pr_debug("%s:%d: v2: %016lx\n", func, line, v2); } /** @@ -149,10 +149,10 @@ static int read_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, *_v2 = v2; if (v1 && !_v1) - pr_debug("%s:%d: warning: discarding non-zero v1: %016llx\n", + pr_debug("%s:%d: warning: discarding non-zero v1: %016lx\n", __func__, __LINE__, v1); if (v2 && !_v2) - pr_debug("%s:%d: warning: discarding non-zero v2: %016llx\n", + pr_debug("%s:%d: warning: discarding non-zero v2: %016lx\n", __func__, __LINE__, v2); return 0; @@ -327,7 +327,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo) return result; } - pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %llu, num_dev %u\n", + pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n", __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, num_dev); @@ -353,7 +353,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo) return result; } - pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %llu\n", + pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n", __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); *repo = tmp; @@ -367,7 +367,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, struct ps3_repository_device tmp; unsigned int num_dev; - pr_debug(" -> %s:%u: find device by id %llu:%llu\n", __func__, __LINE__, + pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__, bus_id, dev_id); for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) { @@ -382,7 +382,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, if (tmp.bus_id == bus_id) goto found_bus; - pr_debug("%s:%u: skip, bus_id %llu\n", __func__, __LINE__, + pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__, tmp.bus_id); } pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__); @@ -416,7 +416,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, if (tmp.dev_id == dev_id) goto found_dev; - pr_debug("%s:%u: skip, dev_id %llu\n", __func__, __LINE__, + pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__, tmp.dev_id); } pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__); @@ -430,7 +430,7 @@ int ps3_repository_find_device_by_id(struct ps3_repository_device *repo, return result; } - pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%llu:%llu)\n", + pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n", __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index, tmp.dev_index, tmp.bus_id, tmp.dev_id); *repo = tmp; diff --git a/trunk/arch/powerpc/platforms/ps3/setup.c b/trunk/arch/powerpc/platforms/ps3/setup.c index 3331ccbb8d38..35f3e85cf60e 100644 --- a/trunk/arch/powerpc/platforms/ps3/setup.c +++ b/trunk/arch/powerpc/platforms/ps3/setup.c @@ -186,7 +186,7 @@ early_param("ps3flash", early_parse_ps3flash); #define prealloc_ps3flash_bounce_buffer() do { } while (0) #endif -static int ps3_set_dabr(unsigned long dabr) +static int ps3_set_dabr(u64 dabr) { enum {DABR_USER = 1, DABR_KERNEL = 2,}; diff --git a/trunk/arch/powerpc/platforms/ps3/spu.c b/trunk/arch/powerpc/platforms/ps3/spu.c index b3c6a993f9f3..ccae3d446b98 100644 --- a/trunk/arch/powerpc/platforms/ps3/spu.c +++ b/trunk/arch/powerpc/platforms/ps3/spu.c @@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ps3_get_spe_id); static unsigned long get_vas_id(void) { - u64 id; + unsigned long id; lv1_get_logical_ppe_id(&id); lv1_get_virtual_address_space_id_of_ppe(id, &id); @@ -160,18 +160,14 @@ static unsigned long get_vas_id(void) static int __init construct_spu(struct spu *spu) { int result; - u64 unused; - u64 problem_phys; - u64 local_store_phys; + unsigned long unused; result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL, - &spu_pdata(spu)->priv2_addr, &problem_phys, - &local_store_phys, &unused, + &spu_pdata(spu)->priv2_addr, &spu->problem_phys, + &spu->local_store_phys, &unused, &spu_pdata(spu)->shadow_addr, &spu_pdata(spu)->spe_id); - spu->problem_phys = problem_phys; - spu->local_store_phys = local_store_phys; if (result) { pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n", diff --git a/trunk/arch/powerpc/platforms/ps3/system-bus.c b/trunk/arch/powerpc/platforms/ps3/system-bus.c index 58311a867851..ee0d22911621 100644 --- a/trunk/arch/powerpc/platforms/ps3/system-bus.c +++ b/trunk/arch/powerpc/platforms/ps3/system-bus.c @@ -182,7 +182,7 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev) case PS3_MATCH_ID_SYSTEM_MANAGER: pr_debug("%s:%d: unsupported match_id: %u\n", __func__, __LINE__, dev->match_id); - pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__, + pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, dev->bus_id); BUG(); return -EINVAL; @@ -220,7 +220,7 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev) case PS3_MATCH_ID_SYSTEM_MANAGER: pr_debug("%s:%d: unsupported match_id: %u\n", __func__, __LINE__, dev->match_id); - pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__, + pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, dev->bus_id); BUG(); return -EINVAL; @@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device); static void _dump_mmio_region(const struct ps3_mmio_region* r, const char* func, int line) { - pr_debug("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id, + pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, r->dev->dev_id); pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); pr_debug("%s:%d: len %lxh\n", func, line, r->len); @@ -250,11 +250,9 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r, static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r) { int result; - u64 lpar_addr; result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id, - r->bus_addr, r->len, r->page_size, &lpar_addr); - r->lpar_addr = lpar_addr; + r->bus_addr, r->len, r->page_size, &r->lpar_addr); if (result) { pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n", @@ -570,7 +568,7 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page, { struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); int result; - dma_addr_t bus_addr; + unsigned long bus_addr; void *ptr = page_address(page) + offset; result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, @@ -592,7 +590,7 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page, { struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); int result; - dma_addr_t bus_addr; + unsigned long bus_addr; u64 iopte_flag; void *ptr = page_address(page) + offset; diff --git a/trunk/arch/powerpc/platforms/pseries/iommu.c b/trunk/arch/powerpc/platforms/pseries/iommu.c index 3ee01b4f4257..c90817acb472 100644 --- a/trunk/arch/powerpc/platforms/pseries/iommu.c +++ b/trunk/arch/powerpc/platforms/pseries/iommu.c @@ -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=%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 ); + 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 ); 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=%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]); + 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]); 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=%lld\n", rc); - printk("\tindex = 0x%llx\n", (u64)tbl->it_index); - printk("\ttcenum = 0x%llx\n", (u64)tcenum); + 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); 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 = %lld\n", rc); - printk("\tindex = 0x%llx\n", (u64)tbl->it_index); - printk("\tnpages = 0x%llx\n", (u64)npages); + printk("\trc = %ld\n", rc); + printk("\tindex = 0x%lx\n", (u64)tbl->it_index); + printk("\tnpages = 0x%lx\n", (u64)npages); show_stack(current, (unsigned long *)__get_SP()); } } @@ -261,9 +261,10 @@ 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=%lld\n", rc); - printk("\tindex = 0x%llx\n", (u64)tbl->it_index); - printk("\ttcenum = 0x%llx\n", (u64)tcenum); + 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); show_stack(current, (unsigned long *)__get_SP()); } diff --git a/trunk/arch/powerpc/sysdev/fsl_pci.c b/trunk/arch/powerpc/sysdev/fsl_pci.c index 9817f63723dd..f611d0369cc8 100644 --- a/trunk/arch/powerpc/sysdev/fsl_pci.c +++ b/trunk/arch/powerpc/sysdev/fsl_pci.c @@ -28,104 +28,63 @@ #include #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, j, n; + int i; 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 it's ignored) */ + /* Disable all windows (except powar0 since its 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, 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; - } + 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)); + } /* Setup outbound IO window */ - 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)); - } + 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)); } /* 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) diff --git a/trunk/arch/powerpc/sysdev/mpic.c b/trunk/arch/powerpc/sysdev/mpic.c index a35297dbac28..3e0d89dcdba2 100644 --- a/trunk/arch/powerpc/sysdev/mpic.c +++ b/trunk/arch/powerpc/sysdev/mpic.c @@ -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%llx\n", + printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%lx\n", PCI_SLOT(devfn), PCI_FUNC(devfn), flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr); diff --git a/trunk/arch/s390/Kconfig b/trunk/arch/s390/Kconfig index 6b0a3538dc63..a94a3c3ae932 100644 --- a/trunk/arch/s390/Kconfig +++ b/trunk/arch/s390/Kconfig @@ -77,7 +77,6 @@ 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 diff --git a/trunk/arch/s390/include/asm/Kbuild b/trunk/arch/s390/include/asm/Kbuild index 63a23415fba6..f2af4167bd5f 100644 --- a/trunk/arch/s390/include/asm/Kbuild +++ b/trunk/arch/s390/include/asm/Kbuild @@ -13,3 +13,4 @@ unifdef-y += cmb.h unifdef-y += debug.h unifdef-y += chpid.h unifdef-y += schid.h +unifdef-y += swab.h diff --git a/trunk/arch/s390/include/asm/byteorder.h b/trunk/arch/s390/include/asm/byteorder.h index a332e59e26fc..b95a2b2933fb 100644 --- a/trunk/arch/s390/include/asm/byteorder.h +++ b/trunk/arch/s390/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _S390_BYTEORDER_H #define _S390_BYTEORDER_H +#include #include #endif /* _S390_BYTEORDER_H */ diff --git a/trunk/arch/s390/kernel/compat_wrapper.S b/trunk/arch/s390/kernel/compat_wrapper.S index 6035cd20c7a7..fc2c97197a53 100644 --- a/trunk/arch/s390/kernel/compat_wrapper.S +++ b/trunk/arch/s390/kernel/compat_wrapper.S @@ -547,7 +547,7 @@ sys32_setdomainname_wrapper: .globl sys32_newuname_wrapper sys32_newuname_wrapper: llgtr %r2,%r2 # struct new_utsname * - jg sys_s390_newuname # branch to system call + jg s390x_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 sys_s390_personality # branch to system call + jg s390x_personality # branch to system call .globl sys32_setfsuid16_wrapper sys32_setfsuid16_wrapper: diff --git a/trunk/arch/s390/kernel/entry.h b/trunk/arch/s390/kernel/entry.h index 950c59c6688b..a65afc91e8aa 100644 --- a/trunk/arch/s390/kernel/entry.h +++ b/trunk/arch/s390/kernel/entry.h @@ -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 sys_s390_old_mmap(struct mmap_arg_struct __user *arg); +long 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 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, +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, size_t len, int advice); -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 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_fork(void); long sys_clone(void); long sys_vfork(void); void execve_tail(void); long sys_execve(void); -long sys_sigsuspend(int history0, int history1, old_sigset_t mask); +int 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); diff --git a/trunk/arch/s390/kernel/process.c b/trunk/arch/s390/kernel/process.c index 5cd38a90e64d..b6110bdf8dc2 100644 --- a/trunk/arch/s390/kernel/process.c +++ b/trunk/arch/s390/kernel/process.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -226,13 +225,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, return 0; } -SYSCALL_DEFINE0(fork) +asmlinkage long sys_fork(void) { struct pt_regs *regs = task_pt_regs(current); return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); } -SYSCALL_DEFINE0(clone) +asmlinkage long sys_clone(void) { struct pt_regs *regs = task_pt_regs(current); unsigned long clone_flags; @@ -259,7 +258,7 @@ SYSCALL_DEFINE0(clone) * do not have enough call-clobbered registers to hold all * the information you need. */ -SYSCALL_DEFINE0(vfork) +asmlinkage long sys_vfork(void) { struct pt_regs *regs = task_pt_regs(current); return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, @@ -279,7 +278,7 @@ asmlinkage void execve_tail(void) /* * sys_execve() executes a new program. */ -SYSCALL_DEFINE0(execve) +asmlinkage long sys_execve(void) { struct pt_regs *regs = task_pt_regs(current); char *filename; diff --git a/trunk/arch/s390/kernel/signal.c b/trunk/arch/s390/kernel/signal.c index 3cf74c3ccb69..8e6812a22670 100644 --- a/trunk/arch/s390/kernel/signal.c +++ b/trunk/arch/s390/kernel/signal.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +53,8 @@ typedef struct /* * Atomically swap in the new signal mask, and wait for a signal. */ -SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) +asmlinkage int +sys_sigsuspend(int history0, int history1, old_sigset_t mask) { mask &= _BLOCKABLE; spin_lock_irq(¤t->sighand->siglock); @@ -70,8 +70,9 @@ SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) return -ERESTARTNOHAND; } -SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, - struct old_sigaction __user *, oact) +asmlinkage long +sys_sigaction(int sig, const struct old_sigaction __user *act, + struct old_sigaction __user *oact) { struct k_sigaction new_ka, old_ka; int ret; @@ -101,13 +102,15 @@ SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, return ret; } -SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, - stack_t __user *, uoss) +asmlinkage long +sys_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) { @@ -161,7 +164,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) return 0; } -SYSCALL_DEFINE0(sigreturn) +asmlinkage long sys_sigreturn(void) { struct pt_regs *regs = task_pt_regs(current); sigframe __user *frame = (sigframe __user *)regs->gprs[15]; @@ -188,7 +191,7 @@ SYSCALL_DEFINE0(sigreturn) return 0; } -SYSCALL_DEFINE0(rt_sigreturn) +asmlinkage long sys_rt_sigreturn(void) { struct pt_regs *regs = task_pt_regs(current); rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15]; diff --git a/trunk/arch/s390/kernel/sys_s390.c b/trunk/arch/s390/kernel/sys_s390.c index c7ae4b17e0e3..c34be4568b80 100644 --- a/trunk/arch/s390/kernel/sys_s390.c +++ b/trunk/arch/s390/kernel/sys_s390.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include "entry.h" @@ -75,7 +74,7 @@ struct mmap_arg_struct { unsigned long offset; }; -SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) +asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg) { struct mmap_arg_struct a; int error = -EFAULT; @@ -87,7 +86,7 @@ SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) return error; } -SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) +asmlinkage long old_mmap(struct mmap_arg_struct __user *arg) { struct mmap_arg_struct a; long error = -EFAULT; @@ -109,8 +108,8 @@ SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) * * This is really horribly ugly. */ -SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, - unsigned long, third, void __user *, ptr) +asmlinkage long sys_ipc(uint call, int first, unsigned long second, + unsigned long third, void __user *ptr) { struct ipc_kludge tmp; int ret; @@ -176,7 +175,7 @@ SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, } #ifdef CONFIG_64BIT -SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) +asmlinkage long s390x_newuname(struct new_utsname __user *name) { int ret = sys_newuname(name); @@ -187,7 +186,7 @@ SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) return ret; } -SYSCALL_DEFINE1(s390_personality, unsigned long, personality) +asmlinkage long s390x_personality(unsigned long personality) { int ret; @@ -206,13 +205,15 @@ SYSCALL_DEFINE1(s390_personality, unsigned long, personality) */ #ifndef CONFIG_64BIT -SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low, - size_t, len, int, advice) +asmlinkage long +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; @@ -220,7 +221,8 @@ struct fadvise64_64_args { int advice; }; -SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) +asmlinkage long +s390_fadvise64_64(struct fadvise64_64_args __user *args) { struct fadvise64_64_args a; @@ -229,6 +231,7 @@ SYSCALL_DEFINE1(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 @@ -241,19 +244,9 @@ SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) * to * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len */ -SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, +asmlinkage long 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 diff --git a/trunk/arch/s390/kernel/syscalls.S b/trunk/arch/s390/kernel/syscalls.S index 76d16e0140bb..2d61787949d5 100644 --- a/trunk/arch/s390/kernel/syscalls.S +++ b/trunk/arch/s390/kernel/syscalls.S @@ -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(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */ +SYSCALL(old_mmap,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,sys_s390_newuname,sys32_newuname_wrapper) +SYSCALL(sys_newuname,s390x_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,sys_s390_personality,sys32_personality_wrapper) +SYSCALL(sys_personality,s390x_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(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) +SYSCALL(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(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) +SYSCALL(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(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) +SYSCALL(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 */ diff --git a/trunk/arch/sh/include/asm/Kbuild b/trunk/arch/sh/include/asm/Kbuild index 43910cdf78a5..f1a2a0d1c79c 100644 --- a/trunk/arch/sh/include/asm/Kbuild +++ b/trunk/arch/sh/include/asm/Kbuild @@ -6,3 +6,4 @@ 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 diff --git a/trunk/arch/sh/include/asm/byteorder.h b/trunk/arch/sh/include/asm/byteorder.h index db2f5d7cb17d..e95c41a5c8cc 100644 --- a/trunk/arch/sh/include/asm/byteorder.h +++ b/trunk/arch/sh/include/asm/byteorder.h @@ -1,6 +1,8 @@ #ifndef __ASM_SH_BYTEORDER_H #define __ASM_SH_BYTEORDER_H +#include + #ifdef __LITTLE_ENDIAN__ #include #else diff --git a/trunk/arch/sh/include/asm/syscalls_32.h b/trunk/arch/sh/include/asm/syscalls_32.h index 8b30200305c3..104c5e686106 100644 --- a/trunk/arch/sh/include/asm/syscalls_32.h +++ b/trunk/arch/sh/include/asm/syscalls_32.h @@ -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_sh_pipe(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 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, diff --git a/trunk/arch/sh/kernel/sys_sh32.c b/trunk/arch/sh/kernel/sys_sh32.c index 63ba12836eae..dbba1e1833d4 100644 --- a/trunk/arch/sh/kernel/sys_sh32.c +++ b/trunk/arch/sh/kernel/sys_sh32.c @@ -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_sh_pipe(unsigned long r4, unsigned long r5, +asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs __regs) { diff --git a/trunk/arch/sh/kernel/syscalls_32.S b/trunk/arch/sh/kernel/syscalls_32.S index e67c1733e1b9..0af693e65764 100644 --- a/trunk/arch/sh/kernel/syscalls_32.S +++ b/trunk/arch/sh/kernel/syscalls_32.S @@ -58,7 +58,7 @@ ENTRY(sys_call_table) .long sys_mkdir .long sys_rmdir /* 40 */ .long sys_dup - .long sys_sh_pipe + .long sys_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 sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/sh/kernel/syscalls_64.S b/trunk/arch/sh/kernel/syscalls_64.S index 557cb91f5caf..0b436aa3cad7 100644 --- a/trunk/arch/sh/kernel/syscalls_64.S +++ b/trunk/arch/sh/kernel/syscalls_64.S @@ -109,7 +109,7 @@ sys_call_table: .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/sparc/include/asm/Kbuild b/trunk/arch/sparc/include/asm/Kbuild index deeb0fba8029..95e38a43dff0 100644 --- a/trunk/arch/sparc/include/asm/Kbuild +++ b/trunk/arch/sparc/include/asm/Kbuild @@ -17,3 +17,4 @@ header-y += traps.h header-y += uctx.h header-y += utrap.h header-y += watchdog.h +header-y += swab.h diff --git a/trunk/arch/sparc/include/asm/byteorder.h b/trunk/arch/sparc/include/asm/byteorder.h index ccc1b6b7de6c..48a047cd6fa9 100644 --- a/trunk/arch/sparc/include/asm/byteorder.h +++ b/trunk/arch/sparc/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _SPARC_BYTEORDER_H #define _SPARC_BYTEORDER_H +#include #include #endif /* _SPARC_BYTEORDER_H */ diff --git a/trunk/arch/sparc/kernel/entry.S b/trunk/arch/sparc/kernel/entry.S index f41ecc5ac0b4..faf9ccd9ef5d 100644 --- a/trunk/arch/sparc/kernel/entry.S +++ b/trunk/arch/sparc/kernel/entry.S @@ -1088,8 +1088,8 @@ sunos_execv: ld [%sp + STACKFRAME_SZ + PT_I0], %o0 .align 4 - .globl sys_sparc_pipe -sys_sparc_pipe: + .globl sys_pipe +sys_pipe: mov %o7, %l5 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg call sparc_pipe diff --git a/trunk/arch/sparc/kernel/sparc_ksyms_64.c b/trunk/arch/sparc/kernel/sparc_ksyms_64.c index 0f26066a08d9..da8f804feb49 100644 --- a/trunk/arch/sparc/kernel/sparc_ksyms_64.c +++ b/trunk/arch/sparc/kernel/sparc_ksyms_64.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -22,6 +23,16 @@ struct poll { short revents; }; +/* used by various drivers */ +#ifdef CONFIG_SMP +/* Out of line rw-locking implementation. */ +EXPORT_SYMBOL(__read_lock); +EXPORT_SYMBOL(__read_unlock); +EXPORT_SYMBOL(__write_lock); +EXPORT_SYMBOL(__write_unlock); +EXPORT_SYMBOL(__write_trylock); +#endif /* CONFIG_SMP */ + /* from helpers.S */ EXPORT_SYMBOL(__flushw_user); EXPORT_SYMBOL_GPL(real_hard_smp_processor_id); diff --git a/trunk/arch/sparc/kernel/syscalls.S b/trunk/arch/sparc/kernel/syscalls.S index 87f5a3b8a253..7a6786a71363 100644 --- a/trunk/arch/sparc/kernel/syscalls.S +++ b/trunk/arch/sparc/kernel/syscalls.S @@ -20,7 +20,7 @@ execve_merge: add %sp, PTREGS_OFF, %o0 .align 32 -sys_sparc_pipe: +sys_pipe: ba,pt %xcc, sparc_pipe add %sp, PTREGS_OFF, %o0 sys_nis_syscall: diff --git a/trunk/arch/sparc/kernel/systbls_32.S b/trunk/arch/sparc/kernel/systbls_32.S index dccc95df0c7f..7d0807586442 100644 --- a/trunk/arch/sparc/kernel/systbls_32.S +++ b/trunk/arch/sparc/kernel/systbls_32.S @@ -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_sparc_pipe, sys_times, sys_getuid +/*40*/ .long sys_newlstat, sys_dup, sys_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, sys_old_readdir +/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, 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 diff --git a/trunk/arch/sparc/kernel/systbls_64.S b/trunk/arch/sparc/kernel/systbls_64.S index e6007bb37046..9fc78cf354bd 100644 --- a/trunk/arch/sparc/kernel/systbls_64.S +++ b/trunk/arch/sparc/kernel/systbls_64.S @@ -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_sparc_pipe, compat_sys_times, sys_getuid +/*40*/ .word compat_sys_newlstat, sys_dup, sys_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_sparc_pipe, sys_times, sys_nis_syscall +/*40*/ .word sys_newlstat, sys_dup, sys_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 diff --git a/trunk/arch/x86/include/asm/Kbuild b/trunk/arch/x86/include/asm/Kbuild index 4a8e80cdcfa5..a9f8a814a1f7 100644 --- a/trunk/arch/x86/include/asm/Kbuild +++ b/trunk/arch/x86/include/asm/Kbuild @@ -22,3 +22,4 @@ unifdef-y += unistd_32.h unifdef-y += unistd_64.h unifdef-y += vm86.h unifdef-y += vsyscall.h +unifdef-y += swab.h diff --git a/trunk/arch/x86/include/asm/byteorder.h b/trunk/arch/x86/include/asm/byteorder.h index b13a7a88f3eb..7c49917e3d9d 100644 --- a/trunk/arch/x86/include/asm/byteorder.h +++ b/trunk/arch/x86/include/asm/byteorder.h @@ -1,6 +1,7 @@ #ifndef _ASM_X86_BYTEORDER_H #define _ASM_X86_BYTEORDER_H +#include #include #endif /* _ASM_X86_BYTEORDER_H */ diff --git a/trunk/arch/x86/include/asm/pgtable.h b/trunk/arch/x86/include/asm/pgtable.h index 06bbcbd66e9c..83e69f4a37f0 100644 --- a/trunk/arch/x86/include/asm/pgtable.h +++ b/trunk/arch/x86/include/asm/pgtable.h @@ -341,25 +341,6 @@ 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 diff --git a/trunk/arch/x86/kernel/entry_32.S b/trunk/arch/x86/kernel/entry_32.S index 46469029e9d3..d6f0490a7391 100644 --- a/trunk/arch/x86/kernel/entry_32.S +++ b/trunk/arch/x86/kernel/entry_32.S @@ -1203,6 +1203,7 @@ 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 @@ -1243,6 +1244,7 @@ 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 diff --git a/trunk/arch/x86/kernel/kprobes.c b/trunk/arch/x86/kernel/kprobes.c index e948b28a5a9a..884d985b8b82 100644 --- a/trunk/arch/x86/kernel/kprobes.c +++ b/trunk/arch/x86/kernel/kprobes.c @@ -446,7 +446,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb) { -#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) +#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) if (p->ainsn.boostable == 1 && !p->post_handler) { /* Boost up -- we can execute copied instructions directly */ reset_current_kprobe(); diff --git a/trunk/arch/x86/kernel/syscall_table_32.S b/trunk/arch/x86/kernel/syscall_table_32.S index e2e86a08f31d..d44395ff34c3 100644 --- a/trunk/arch/x86/kernel/syscall_table_32.S +++ b/trunk/arch/x86/kernel/syscall_table_32.S @@ -88,7 +88,7 @@ ENTRY(sys_call_table) .long sys_uselib .long sys_swapon .long sys_reboot - .long sys_old_readdir + .long old_readdir .long old_mmap /* 90 */ .long sys_munmap .long sys_truncate diff --git a/trunk/arch/x86/mm/pat.c b/trunk/arch/x86/mm/pat.c index 8b08fb955274..85cbd3cd3723 100644 --- a/trunk/arch/x86/mm/pat.c +++ b/trunk/arch/x86/mm/pat.c @@ -601,13 +601,12 @@ 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, - int strict_prot) +static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t vma_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); @@ -626,24 +625,15 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, return ret; if (flags != want_flags) { - 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); + 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; } /* Need to keep identity mapping in sync */ @@ -699,7 +689,6 @@ 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; @@ -713,8 +702,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) WARN_ON_ONCE(1); return -EINVAL; } - pgprot = __pgprot(prot); - return reserve_pfn_range(paddr, vma_size, &pgprot, 1); + return reserve_pfn_range(paddr, vma_size, __pgprot(prot)); } /* reserve entire vma page by page, using pfn and prot from pte */ @@ -722,8 +710,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) if (follow_phys(vma, vma_start + i, 0, &prot, &paddr)) continue; - pgprot = __pgprot(prot); - retval = reserve_pfn_range(paddr, PAGE_SIZE, &pgprot, 1); + retval = reserve_pfn_range(paddr, PAGE_SIZE, __pgprot(prot)); if (retval) goto cleanup_ret; } @@ -754,7 +741,7 @@ int track_pfn_vma_copy(struct vm_area_struct *vma) * 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; @@ -771,14 +758,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, 0); + return reserve_pfn_range(paddr, vma_size, prot); } /* 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, 0); + retval = reserve_pfn_range(paddr, PAGE_SIZE, prot); if (retval) goto cleanup_ret; } diff --git a/trunk/arch/x86/pci/i386.c b/trunk/arch/x86/pci/i386.c index 5ead808dd70c..f884740da318 100644 --- a/trunk/arch/x86/pci/i386.c +++ b/trunk/arch/x86/pci/i386.c @@ -314,7 +314,17 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, return retval; if (flags != new_flags) { - if (!is_new_memtype_allowed(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)) { free_memtype(addr, addr+len); return -EINVAL; } diff --git a/trunk/arch/xtensa/include/asm/Kbuild b/trunk/arch/xtensa/include/asm/Kbuild index c68e1680da01..58c02a454130 100644 --- a/trunk/arch/xtensa/include/asm/Kbuild +++ b/trunk/arch/xtensa/include/asm/Kbuild @@ -1 +1,3 @@ include include/asm-generic/Kbuild.asm + +unifdef-y += swab.h diff --git a/trunk/arch/xtensa/include/asm/byteorder.h b/trunk/arch/xtensa/include/asm/byteorder.h index 54eb6315349c..329b94591ca4 100644 --- a/trunk/arch/xtensa/include/asm/byteorder.h +++ b/trunk/arch/xtensa/include/asm/byteorder.h @@ -1,6 +1,8 @@ #ifndef _XTENSA_BYTEORDER_H #define _XTENSA_BYTEORDER_H +#include + #ifdef __XTENSA_EL__ #include #elif defined(__XTENSA_EB__) diff --git a/trunk/drivers/acpi/Makefile b/trunk/drivers/acpi/Makefile index 65d90c720b5a..d80f4cc2e0da 100644 --- a/trunk/drivers/acpi/Makefile +++ b/trunk/drivers/acpi/Makefile @@ -19,7 +19,7 @@ obj-y += osl.o utils.o reboot.o\ # sleep related files obj-y += wakeup.o -obj-y += sleep.o +obj-y += main.o obj-$(CONFIG_ACPI_SLEEP) += proc.o diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index a2b82c90a683..8dfcbb8aff73 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -120,6 +120,31 @@ static struct acpi_ec { spinlock_t curr_lock; } *boot_ec, *first_ec; +/* + * Some Asus system have exchanged ECDT data/command IO addresses. + */ +static int print_ecdt_error(const struct dmi_system_id *id) +{ + printk(KERN_NOTICE PREFIX "%s detected - " + "ECDT has exchanged control/data I/O address\n", + id->ident); + return 0; +} + +static struct dmi_system_id __cpuinitdata ec_dmi_table[] = { + { + print_ecdt_error, "Asus L4R", { + DMI_MATCH(DMI_BIOS_VERSION, "1008.006"), + DMI_MATCH(DMI_PRODUCT_NAME, "L4R"), + DMI_MATCH(DMI_BOARD_NAME, "L4R") }, NULL}, + { + print_ecdt_error, "Asus M6R", { + DMI_MATCH(DMI_BIOS_VERSION, "0207"), + DMI_MATCH(DMI_PRODUCT_NAME, "M6R"), + DMI_MATCH(DMI_BOARD_NAME, "M6R") }, NULL}, + {}, +}; + /* -------------------------------------------------------------------------- Transaction Management -------------------------------------------------------------------------- */ @@ -958,8 +983,8 @@ static const struct acpi_device_id ec_device_ids[] = { int __init acpi_ec_ecdt_probe(void) { acpi_status status; - struct acpi_ec *saved_ec = NULL; struct acpi_table_ecdt *ecdt_ptr; + acpi_handle dummy; boot_ec = make_acpi_ec(); if (!boot_ec) @@ -973,16 +998,21 @@ int __init acpi_ec_ecdt_probe(void) pr_info(PREFIX "EC description table is found, configuring boot EC\n"); boot_ec->command_addr = ecdt_ptr->control.address; boot_ec->data_addr = ecdt_ptr->data.address; + if (dmi_check_system(ec_dmi_table)) { + /* + * If the board falls into ec_dmi_table, it means + * that ECDT table gives the incorrect command/status + * & data I/O address. Just fix it. + */ + boot_ec->data_addr = ecdt_ptr->control.address; + boot_ec->command_addr = ecdt_ptr->data.address; + } boot_ec->gpe = ecdt_ptr->gpe; boot_ec->handle = ACPI_ROOT_OBJECT; acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle); - /* Don't trust ECDT, which comes from ASUSTek */ - if (!dmi_name_in_vendors("ASUS")) + /* Add some basic check against completely broken table */ + if (boot_ec->data_addr != boot_ec->command_addr) goto install; - saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); - if (!saved_ec) - return -ENOMEM; - memcpy(&saved_ec, boot_ec, sizeof(saved_ec)); /* fall through */ } /* This workaround is needed only on some broken machines, @@ -993,29 +1023,12 @@ int __init acpi_ec_ecdt_probe(void) /* Check that acpi_get_devices actually find something */ if (ACPI_FAILURE(status) || !boot_ec->handle) goto error; - if (saved_ec) { - /* try to find good ECDT from ASUSTek */ - if (saved_ec->command_addr != boot_ec->command_addr || - saved_ec->data_addr != boot_ec->data_addr || - saved_ec->gpe != boot_ec->gpe || - saved_ec->handle != boot_ec->handle) - pr_info(PREFIX "ASUSTek keeps feeding us with broken " - "ECDT tables, which are very hard to workaround. " - "Trying to use DSDT EC info instead. Please send " - "output of acpidump to linux-acpi@vger.kernel.org\n"); - kfree(saved_ec); - saved_ec = NULL; - } else { - /* We really need to limit this workaround, the only ASUS, - * which needs it, has fake EC._INI method, so use it as flag. - * Keep boot_ec struct as it will be needed soon. - */ - acpi_handle dummy; - if (!dmi_name_in_vendors("ASUS") || - ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", - &dummy))) - return -ENODEV; - } + /* We really need to limit this workaround, the only ASUS, + * which needs it, has fake EC._INI method, so use it as flag. + * Keep boot_ec struct as it will be needed soon. + */ + if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy))) + return -ENODEV; install: if (!ec_install_handlers(boot_ec)) { first_ec = boot_ec; diff --git a/trunk/drivers/acpi/sleep.c b/trunk/drivers/acpi/main.c similarity index 100% rename from trunk/drivers/acpi/sleep.c rename to trunk/drivers/acpi/main.c diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 99e6f1f8ea45..073ff09218a9 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -416,8 +416,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) } /* Passive (optional) */ - if (((flag & ACPI_TRIPS_PASSIVE) && tz->trips.passive.flags.valid) || - (flag == ACPI_TRIPS_INIT)) { + if (flag & ACPI_TRIPS_PASSIVE) { valid = tz->trips.passive.flags.valid; if (psv == -1) { status = AE_SUPPORT; @@ -463,11 +462,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) memset(&devices, 0, sizeof(struct acpi_handle_list)); status = acpi_evaluate_reference(tz->device->handle, "_PSL", NULL, &devices); - if (ACPI_FAILURE(status)) { - printk(KERN_WARNING PREFIX - "Invalid passive threshold\n"); + if (ACPI_FAILURE(status)) tz->trips.passive.flags.valid = 0; - } else tz->trips.passive.flags.valid = 1; @@ -491,8 +487,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) if (act == -1) break; /* disable all active trip points */ - if ((flag == ACPI_TRIPS_INIT) || ((flag & ACPI_TRIPS_ACTIVE) && - tz->trips.active[i].flags.valid)) { + if (flag & ACPI_TRIPS_ACTIVE) { status = acpi_evaluate_integer(tz->device->handle, name, NULL, &tmp); if (ACPI_FAILURE(status)) { @@ -526,11 +521,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) memset(&devices, 0, sizeof(struct acpi_handle_list)); status = acpi_evaluate_reference(tz->device->handle, name, NULL, &devices); - if (ACPI_FAILURE(status)) { - printk(KERN_WARNING PREFIX - "Invalid active%d threshold\n", i); + if (ACPI_FAILURE(status)) tz->trips.active[i].flags.valid = 0; - } else tz->trips.active[i].flags.valid = 1; diff --git a/trunk/drivers/ata/Kconfig b/trunk/drivers/ata/Kconfig index 503a908afc80..1a7be96d627b 100644 --- a/trunk/drivers/ata/Kconfig +++ b/trunk/drivers/ata/Kconfig @@ -698,15 +698,6 @@ config PATA_IXP4XX_CF If unsure, say N. -config PATA_OCTEON_CF - tristate "OCTEON Boot Bus Compact Flash support" - depends on CPU_CAVIUM_OCTEON - help - This option enables a polled compact flash driver for use with - compact flash cards attached to the OCTEON boot bus. - - If unsure, say N. - config PATA_SCC tristate "Toshiba's Cell Reference Set IDE support" depends on PCI && PPC_CELLEB diff --git a/trunk/drivers/ata/Makefile b/trunk/drivers/ata/Makefile index 7f1ecf99528c..674965fa326d 100644 --- a/trunk/drivers/ata/Makefile +++ b/trunk/drivers/ata/Makefile @@ -69,7 +69,6 @@ obj-$(CONFIG_PATA_IXP4XX_CF) += pata_ixp4xx_cf.o obj-$(CONFIG_PATA_SCC) += pata_scc.o obj-$(CONFIG_PATA_SCH) += pata_sch.o obj-$(CONFIG_PATA_BF54X) += pata_bf54x.o -obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o obj-$(CONFIG_PATA_ICSIDE) += pata_icside.o diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c index 88c242856dae..71218d76d75e 100644 --- a/trunk/drivers/ata/libata-core.c +++ b/trunk/drivers/ata/libata-core.c @@ -3029,33 +3029,33 @@ int sata_set_spd(struct ata_link *link) */ static const struct ata_timing ata_timing[] = { -/* { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 0, 960, 0 }, */ - { XFER_PIO_0, 70, 290, 240, 600, 165, 150, 0, 600, 0 }, - { XFER_PIO_1, 50, 290, 93, 383, 125, 100, 0, 383, 0 }, - { XFER_PIO_2, 30, 290, 40, 330, 100, 90, 0, 240, 0 }, - { XFER_PIO_3, 30, 80, 70, 180, 80, 70, 0, 180, 0 }, - { XFER_PIO_4, 25, 70, 25, 120, 70, 25, 0, 120, 0 }, - { XFER_PIO_5, 15, 65, 25, 100, 65, 25, 0, 100, 0 }, - { XFER_PIO_6, 10, 55, 20, 80, 55, 20, 0, 80, 0 }, - - { XFER_SW_DMA_0, 120, 0, 0, 0, 480, 480, 50, 960, 0 }, - { XFER_SW_DMA_1, 90, 0, 0, 0, 240, 240, 30, 480, 0 }, - { XFER_SW_DMA_2, 60, 0, 0, 0, 120, 120, 20, 240, 0 }, - - { XFER_MW_DMA_0, 60, 0, 0, 0, 215, 215, 20, 480, 0 }, - { XFER_MW_DMA_1, 45, 0, 0, 0, 80, 50, 5, 150, 0 }, - { XFER_MW_DMA_2, 25, 0, 0, 0, 70, 25, 5, 120, 0 }, - { XFER_MW_DMA_3, 25, 0, 0, 0, 65, 25, 5, 100, 0 }, - { XFER_MW_DMA_4, 25, 0, 0, 0, 55, 20, 5, 80, 0 }, - -/* { XFER_UDMA_SLOW, 0, 0, 0, 0, 0, 0, 0, 0, 150 }, */ - { XFER_UDMA_0, 0, 0, 0, 0, 0, 0, 0, 0, 120 }, - { XFER_UDMA_1, 0, 0, 0, 0, 0, 0, 0, 0, 80 }, - { XFER_UDMA_2, 0, 0, 0, 0, 0, 0, 0, 0, 60 }, - { XFER_UDMA_3, 0, 0, 0, 0, 0, 0, 0, 0, 45 }, - { XFER_UDMA_4, 0, 0, 0, 0, 0, 0, 0, 0, 30 }, - { XFER_UDMA_5, 0, 0, 0, 0, 0, 0, 0, 0, 20 }, - { XFER_UDMA_6, 0, 0, 0, 0, 0, 0, 0, 0, 15 }, +/* { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 960, 0 }, */ + { XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0 }, + { XFER_PIO_1, 50, 290, 93, 383, 125, 100, 383, 0 }, + { XFER_PIO_2, 30, 290, 40, 330, 100, 90, 240, 0 }, + { XFER_PIO_3, 30, 80, 70, 180, 80, 70, 180, 0 }, + { XFER_PIO_4, 25, 70, 25, 120, 70, 25, 120, 0 }, + { XFER_PIO_5, 15, 65, 25, 100, 65, 25, 100, 0 }, + { XFER_PIO_6, 10, 55, 20, 80, 55, 20, 80, 0 }, + + { XFER_SW_DMA_0, 120, 0, 0, 0, 480, 480, 960, 0 }, + { XFER_SW_DMA_1, 90, 0, 0, 0, 240, 240, 480, 0 }, + { XFER_SW_DMA_2, 60, 0, 0, 0, 120, 120, 240, 0 }, + + { XFER_MW_DMA_0, 60, 0, 0, 0, 215, 215, 480, 0 }, + { XFER_MW_DMA_1, 45, 0, 0, 0, 80, 50, 150, 0 }, + { XFER_MW_DMA_2, 25, 0, 0, 0, 70, 25, 120, 0 }, + { XFER_MW_DMA_3, 25, 0, 0, 0, 65, 25, 100, 0 }, + { XFER_MW_DMA_4, 25, 0, 0, 0, 55, 20, 80, 0 }, + +/* { XFER_UDMA_SLOW, 0, 0, 0, 0, 0, 0, 0, 150 }, */ + { XFER_UDMA_0, 0, 0, 0, 0, 0, 0, 0, 120 }, + { XFER_UDMA_1, 0, 0, 0, 0, 0, 0, 0, 80 }, + { XFER_UDMA_2, 0, 0, 0, 0, 0, 0, 0, 60 }, + { XFER_UDMA_3, 0, 0, 0, 0, 0, 0, 0, 45 }, + { XFER_UDMA_4, 0, 0, 0, 0, 0, 0, 0, 30 }, + { XFER_UDMA_5, 0, 0, 0, 0, 0, 0, 0, 20 }, + { XFER_UDMA_6, 0, 0, 0, 0, 0, 0, 0, 15 }, { 0xFF } }; @@ -3065,15 +3065,14 @@ static const struct ata_timing ata_timing[] = { static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) { - q->setup = EZ(t->setup * 1000, T); - q->act8b = EZ(t->act8b * 1000, T); - q->rec8b = EZ(t->rec8b * 1000, T); - q->cyc8b = EZ(t->cyc8b * 1000, T); - q->active = EZ(t->active * 1000, T); - q->recover = EZ(t->recover * 1000, T); - q->dmack_hold = EZ(t->dmack_hold * 1000, T); - q->cycle = EZ(t->cycle * 1000, T); - q->udma = EZ(t->udma * 1000, UT); + q->setup = EZ(t->setup * 1000, T); + q->act8b = EZ(t->act8b * 1000, T); + q->rec8b = EZ(t->rec8b * 1000, T); + q->cyc8b = EZ(t->cyc8b * 1000, T); + q->active = EZ(t->active * 1000, T); + q->recover = EZ(t->recover * 1000, T); + q->cycle = EZ(t->cycle * 1000, T); + q->udma = EZ(t->udma * 1000, UT); } void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, @@ -3085,7 +3084,6 @@ void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, if (what & ATA_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); if (what & ATA_TIMING_ACTIVE ) m->active = max(a->active, b->active); if (what & ATA_TIMING_RECOVER) m->recover = max(a->recover, b->recover); - if (what & ATA_TIMING_DMACK_HOLD) m->dmack_hold = max(a->dmack_hold, b->dmack_hold); if (what & ATA_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); if (what & ATA_TIMING_UDMA ) m->udma = max(a->udma, b->udma); } @@ -6640,6 +6638,7 @@ EXPORT_SYMBOL_GPL(ata_dev_pair); EXPORT_SYMBOL_GPL(ata_port_disable); EXPORT_SYMBOL_GPL(ata_ratelimit); EXPORT_SYMBOL_GPL(ata_wait_register); +EXPORT_SYMBOL_GPL(ata_scsi_ioctl); EXPORT_SYMBOL_GPL(ata_scsi_queuecmd); EXPORT_SYMBOL_GPL(ata_scsi_slave_config); EXPORT_SYMBOL_GPL(ata_scsi_slave_destroy); diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c index a1a6e6298c33..9e92107691f2 100644 --- a/trunk/drivers/ata/libata-scsi.c +++ b/trunk/drivers/ata/libata-scsi.c @@ -423,9 +423,9 @@ int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev, * RETURNS: * Zero on success, negative errno on error. */ -static int ata_get_identity(struct ata_port *ap, struct scsi_device *sdev, - void __user *arg) +static int ata_get_identity(struct scsi_device *sdev, void __user *arg) { + struct ata_port *ap = ata_shost_to_port(sdev->host); struct ata_device *dev = ata_scsi_find_dev(ap, sdev); u16 __user *dst = arg; char buf[40]; @@ -645,8 +645,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) return rc; } -int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, - int cmd, void __user *arg) +int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) { int val = -EINVAL, rc = -EINVAL; @@ -664,7 +663,7 @@ int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, return 0; case HDIO_GET_IDENTITY: - return ata_get_identity(ap, scsidev, arg); + return ata_get_identity(scsidev, arg); case HDIO_DRIVE_CMD: if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) @@ -683,14 +682,6 @@ int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, return rc; } -EXPORT_SYMBOL_GPL(ata_sas_scsi_ioctl); - -int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) -{ - return ata_sas_scsi_ioctl(ata_shost_to_port(scsidev->host), - scsidev, cmd, arg); -} -EXPORT_SYMBOL_GPL(ata_scsi_ioctl); /** * ata_scsi_qc_new - acquire new ata_queued_cmd reference diff --git a/trunk/drivers/ata/libata-sff.c b/trunk/drivers/ata/libata-sff.c index 5a4aad123c42..0eae9b453556 100644 --- a/trunk/drivers/ata/libata-sff.c +++ b/trunk/drivers/ata/libata-sff.c @@ -1013,12 +1013,9 @@ static int __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes) qc->cursg_ofs = 0; } - /* - * 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. - */ + /* consumed can be larger than count only for the last transfer */ + WARN_ON_ONCE(qc->cursg && count != consumed); + if (bytes) goto next_sg; return 0; diff --git a/trunk/drivers/ata/pata_ali.c b/trunk/drivers/ata/pata_ali.c index eb99dbe78081..a7999c19f0c9 100644 --- a/trunk/drivers/ata/pata_ali.c +++ b/trunk/drivers/ata/pata_ali.c @@ -41,7 +41,7 @@ static int ali_atapi_dma = 0; module_param_named(atapi_dma, ali_atapi_dma, int, 0644); MODULE_PARM_DESC(atapi_dma, "Enable ATAPI DMA (0=disable, 1=enable)"); -static struct pci_dev *ali_isa_bridge; +static struct pci_dev *isa_bridge; /* * Cable special cases @@ -346,13 +346,13 @@ static void ali_c2_c3_postreset(struct ata_link *link, unsigned int *classes) int port_bit = 4 << link->ap->port_no; /* If our bridge is an ALI 1533 then do the extra work */ - if (ali_isa_bridge) { + if (isa_bridge) { /* Tristate and re-enable the bus signals */ - pci_read_config_byte(ali_isa_bridge, 0x58, &r); + pci_read_config_byte(isa_bridge, 0x58, &r); r &= ~port_bit; - pci_write_config_byte(ali_isa_bridge, 0x58, r); + pci_write_config_byte(isa_bridge, 0x58, r); r |= port_bit; - pci_write_config_byte(ali_isa_bridge, 0x58, r); + pci_write_config_byte(isa_bridge, 0x58, r); } ata_sff_postreset(link, classes); } @@ -467,14 +467,14 @@ static void ali_init_chipset(struct pci_dev *pdev) pci_write_config_byte(pdev, 0x53, tmp); } north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0)); - if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) { + if (north && north->vendor == PCI_VENDOR_ID_AL && isa_bridge) { /* Configure the ALi bridge logic. For non ALi rely on BIOS. Set the south bridge enable bit */ - pci_read_config_byte(ali_isa_bridge, 0x79, &tmp); + pci_read_config_byte(isa_bridge, 0x79, &tmp); if (pdev->revision == 0xC2) - pci_write_config_byte(ali_isa_bridge, 0x79, tmp | 0x04); + pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); else if (pdev->revision > 0xC2 && pdev->revision < 0xC5) - pci_write_config_byte(ali_isa_bridge, 0x79, tmp | 0x02); + pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); } pci_dev_put(north); ata_pci_bmdma_clear_simplex(pdev); @@ -571,9 +571,9 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ali_init_chipset(pdev); - if (ali_isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) { + if (isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) { /* Are we paired with a UDMA capable chip */ - pci_read_config_byte(ali_isa_bridge, 0x5E, &tmp); + pci_read_config_byte(isa_bridge, 0x5E, &tmp); if ((tmp & 0x1E) == 0x12) ppi[0] = &info_20_udma; } @@ -617,11 +617,11 @@ static struct pci_driver ali_pci_driver = { static int __init ali_init(void) { int ret; - ali_isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); + isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); ret = pci_register_driver(&ali_pci_driver); if (ret < 0) - pci_dev_put(ali_isa_bridge); + pci_dev_put(isa_bridge); return ret; } @@ -629,7 +629,7 @@ static int __init ali_init(void) static void __exit ali_exit(void) { pci_unregister_driver(&ali_pci_driver); - pci_dev_put(ali_isa_bridge); + pci_dev_put(isa_bridge); } diff --git a/trunk/drivers/ata/pata_atiixp.c b/trunk/drivers/ata/pata_atiixp.c index 506adde8ebb3..0e2cde8f9973 100644 --- a/trunk/drivers/ata/pata_atiixp.c +++ b/trunk/drivers/ata/pata_atiixp.c @@ -32,6 +32,21 @@ enum { ATIIXP_IDE_UDMA_MODE = 0x56 }; +static int atiixp_pre_reset(struct ata_link *link, unsigned long deadline) +{ + struct ata_port *ap = link->ap; + static const struct pci_bits atiixp_enable_bits[] = { + { 0x48, 1, 0x01, 0x00 }, + { 0x48, 1, 0x08, 0x00 } + }; + struct pci_dev *pdev = to_pci_dev(ap->host->dev); + + if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) + return -ENOENT; + + return ata_sff_prereset(link, deadline); +} + static int atiixp_cable_detect(struct ata_port *ap) { struct pci_dev *pdev = to_pci_dev(ap->host->dev); @@ -214,9 +229,10 @@ static struct ata_port_operations atiixp_port_ops = { .cable_detect = atiixp_cable_detect, .set_piomode = atiixp_set_piomode, .set_dmamode = atiixp_set_dmamode, + .prereset = atiixp_pre_reset, }; -static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id) +static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id) { static const struct ata_port_info info = { .flags = ATA_FLAG_SLAVE_POSS, @@ -225,18 +241,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id) .udma_mask = 0x3F, .port_ops = &atiixp_port_ops }; - static const struct pci_bits atiixp_enable_bits[] = { - { 0x48, 1, 0x01, 0x00 }, - { 0x48, 1, 0x08, 0x00 } - }; - const struct ata_port_info *ppi[] = { &info, &info }; - int i; - - for (i = 0; i < 2; i++) - if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i])) - ppi[i] = &ata_dummy_port_info; - - return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL); + const struct ata_port_info *ppi[] = { &info, NULL }; + return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL); } static const struct pci_device_id atiixp[] = { diff --git a/trunk/drivers/ata/pata_it821x.c b/trunk/drivers/ata/pata_it821x.c index f1bb2f9fecbf..f828a29d7756 100644 --- a/trunk/drivers/ata/pata_it821x.c +++ b/trunk/drivers/ata/pata_it821x.c @@ -80,7 +80,7 @@ #define DRV_NAME "pata_it821x" -#define DRV_VERSION "0.4.2" +#define DRV_VERSION "0.4.0" struct it821x_dev { @@ -494,6 +494,8 @@ 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) @@ -885,13 +887,6 @@ 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, @@ -908,11 +903,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) return rc; if (pdev->vendor == PCI_VENDOR_ID_RDC) { - /* Deal with Vortex86SX */ - if (pdev->revision == 0x11) - ppi[0] = &info_rdc_11; - else - ppi[0] = &info_rdc; + ppi[0] = &info_rdc; } else { /* Force the card into bypass mode if so requested */ if (it8212_noraid) { diff --git a/trunk/drivers/ata/pata_octeon_cf.c b/trunk/drivers/ata/pata_octeon_cf.c deleted file mode 100644 index 0fe4ef309c62..000000000000 --- a/trunk/drivers/ata/pata_octeon_cf.c +++ /dev/null @@ -1,965 +0,0 @@ -/* - * Driver for the Octeon bootbus compact flash. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2005 - 2009 Cavium Networks - * Copyright (C) 2008 Wind River Systems - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * The Octeon bootbus compact flash interface is connected in at least - * 3 different configurations on various evaluation boards: - * - * -- 8 bits no irq, no DMA - * -- 16 bits no irq, no DMA - * -- 16 bits True IDE mode with DMA, but no irq. - * - * In the last case the DMA engine can generate an interrupt when the - * transfer is complete. For the first two cases only PIO is supported. - * - */ - -#define DRV_NAME "pata_octeon_cf" -#define DRV_VERSION "2.1" - - -struct octeon_cf_port { - struct workqueue_struct *wq; - struct delayed_work delayed_finish; - struct ata_port *ap; - int dma_finished; -}; - -static struct scsi_host_template octeon_cf_sht = { - ATA_PIO_SHT(DRV_NAME), -}; - -/** - * Convert nanosecond based time to setting used in the - * boot bus timing register, based on timing multiple - */ -static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs) -{ - unsigned int val; - - /* - * Compute # of eclock periods to get desired duration in - * nanoseconds. - */ - val = DIV_ROUND_UP(nsecs * (octeon_get_clock_rate() / 1000000), - 1000 * tim_mult); - - return val; -} - -static void octeon_cf_set_boot_reg_cfg(int cs) -{ - union cvmx_mio_boot_reg_cfgx reg_cfg; - reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(cs)); - reg_cfg.s.dmack = 0; /* Don't assert DMACK on access */ - reg_cfg.s.tim_mult = 2; /* Timing mutiplier 2x */ - reg_cfg.s.rd_dly = 0; /* Sample on falling edge of BOOT_OE */ - reg_cfg.s.sam = 0; /* Don't combine write and output enable */ - reg_cfg.s.we_ext = 0; /* No write enable extension */ - reg_cfg.s.oe_ext = 0; /* No read enable extension */ - reg_cfg.s.en = 1; /* Enable this region */ - reg_cfg.s.orbit = 0; /* Don't combine with previous region */ - reg_cfg.s.ale = 0; /* Don't do address multiplexing */ - cvmx_write_csr(CVMX_MIO_BOOT_REG_CFGX(cs), reg_cfg.u64); -} - -/** - * Called after libata determines the needed PIO mode. This - * function programs the Octeon bootbus regions to support the - * timing requirements of the PIO mode. - * - * @ap: ATA port information - * @dev: ATA device - */ -static void octeon_cf_set_piomode(struct ata_port *ap, struct ata_device *dev) -{ - struct octeon_cf_data *ocd = ap->dev->platform_data; - union cvmx_mio_boot_reg_timx reg_tim; - int cs = ocd->base_region; - int T; - struct ata_timing timing; - - int use_iordy; - int trh; - int pause; - /* These names are timing parameters from the ATA spec */ - int t1; - int t2; - int t2i; - - T = (int)(2000000000000LL / octeon_get_clock_rate()); - - if (ata_timing_compute(dev, dev->pio_mode, &timing, T, T)) - BUG(); - - t1 = timing.setup; - if (t1) - t1--; - t2 = timing.active; - if (t2) - t2--; - t2i = timing.act8b; - if (t2i) - t2i--; - - trh = ns_to_tim_reg(2, 20); - if (trh) - trh--; - - pause = timing.cycle - timing.active - timing.setup - trh; - if (pause) - pause--; - - octeon_cf_set_boot_reg_cfg(cs); - if (ocd->dma_engine >= 0) - /* True IDE mode, program both chip selects. */ - octeon_cf_set_boot_reg_cfg(cs + 1); - - - use_iordy = ata_pio_need_iordy(dev); - - reg_tim.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_TIMX(cs)); - /* Disable page mode */ - reg_tim.s.pagem = 0; - /* Enable dynamic timing */ - reg_tim.s.waitm = use_iordy; - /* Pages are disabled */ - reg_tim.s.pages = 0; - /* We don't use multiplexed address mode */ - reg_tim.s.ale = 0; - /* Not used */ - reg_tim.s.page = 0; - /* Time after IORDY to coninue to assert the data */ - reg_tim.s.wait = 0; - /* Time to wait to complete the cycle. */ - reg_tim.s.pause = pause; - /* How long to hold after a write to de-assert CE. */ - reg_tim.s.wr_hld = trh; - /* How long to wait after a read to de-assert CE. */ - reg_tim.s.rd_hld = trh; - /* How long write enable is asserted */ - reg_tim.s.we = t2; - /* How long read enable is asserted */ - reg_tim.s.oe = t2; - /* Time after CE that read/write starts */ - reg_tim.s.ce = ns_to_tim_reg(2, 5); - /* Time before CE that address is valid */ - reg_tim.s.adr = 0; - - /* Program the bootbus region timing for the data port chip select. */ - cvmx_write_csr(CVMX_MIO_BOOT_REG_TIMX(cs), reg_tim.u64); - if (ocd->dma_engine >= 0) - /* True IDE mode, program both chip selects. */ - cvmx_write_csr(CVMX_MIO_BOOT_REG_TIMX(cs + 1), reg_tim.u64); -} - -static void octeon_cf_set_dmamode(struct ata_port *ap, struct ata_device *dev) -{ - struct octeon_cf_data *ocd = dev->link->ap->dev->platform_data; - union cvmx_mio_boot_dma_timx dma_tim; - unsigned int oe_a; - unsigned int oe_n; - unsigned int dma_ackh; - unsigned int dma_arq; - unsigned int pause; - unsigned int T0, Tkr, Td; - unsigned int tim_mult; - - const struct ata_timing *timing; - - timing = ata_timing_find_mode(dev->dma_mode); - T0 = timing->cycle; - Td = timing->active; - Tkr = timing->recover; - dma_ackh = timing->dmack_hold; - - dma_tim.u64 = 0; - /* dma_tim.s.tim_mult = 0 --> 4x */ - tim_mult = 4; - - /* not spec'ed, value in eclocks, not affected by tim_mult */ - dma_arq = 8; - pause = 25 - dma_arq * 1000 / - (octeon_get_clock_rate() / 1000000); /* Tz */ - - oe_a = Td; - /* Tkr from cf spec, lengthened to meet T0 */ - oe_n = max(T0 - oe_a, Tkr); - - dma_tim.s.dmack_pi = 1; - - dma_tim.s.oe_n = ns_to_tim_reg(tim_mult, oe_n); - dma_tim.s.oe_a = ns_to_tim_reg(tim_mult, oe_a); - - /* - * This is tI, C.F. spec. says 0, but Sony CF card requires - * more, we use 20 nS. - */ - dma_tim.s.dmack_s = ns_to_tim_reg(tim_mult, 20);; - dma_tim.s.dmack_h = ns_to_tim_reg(tim_mult, dma_ackh); - - dma_tim.s.dmarq = dma_arq; - dma_tim.s.pause = ns_to_tim_reg(tim_mult, pause); - - dma_tim.s.rd_dly = 0; /* Sample right on edge */ - - /* writes only */ - dma_tim.s.we_n = ns_to_tim_reg(tim_mult, oe_n); - dma_tim.s.we_a = ns_to_tim_reg(tim_mult, oe_a); - - pr_debug("ns to ticks (mult %d) of %d is: %d\n", tim_mult, 60, - ns_to_tim_reg(tim_mult, 60)); - pr_debug("oe_n: %d, oe_a: %d, dmack_s: %d, dmack_h: " - "%d, dmarq: %d, pause: %d\n", - dma_tim.s.oe_n, dma_tim.s.oe_a, dma_tim.s.dmack_s, - dma_tim.s.dmack_h, dma_tim.s.dmarq, dma_tim.s.pause); - - cvmx_write_csr(CVMX_MIO_BOOT_DMA_TIMX(ocd->dma_engine), - dma_tim.u64); - -} - -/** - * Handle an 8 bit I/O request. - * - * @dev: Device to access - * @buffer: Data buffer - * @buflen: Length of the buffer. - * @rw: True to write. - */ -static unsigned int octeon_cf_data_xfer8(struct ata_device *dev, - unsigned char *buffer, - unsigned int buflen, - int rw) -{ - struct ata_port *ap = dev->link->ap; - void __iomem *data_addr = ap->ioaddr.data_addr; - unsigned long words; - int count; - - words = buflen; - if (rw) { - count = 16; - while (words--) { - iowrite8(*buffer, data_addr); - buffer++; - /* - * Every 16 writes do a read so the bootbus - * FIFO doesn't fill up. - */ - if (--count == 0) { - ioread8(ap->ioaddr.altstatus_addr); - count = 16; - } - } - } else { - ioread8_rep(data_addr, buffer, words); - } - return buflen; -} - -/** - * Handle a 16 bit I/O request. - * - * @dev: Device to access - * @buffer: Data buffer - * @buflen: Length of the buffer. - * @rw: True to write. - */ -static unsigned int octeon_cf_data_xfer16(struct ata_device *dev, - unsigned char *buffer, - unsigned int buflen, - int rw) -{ - struct ata_port *ap = dev->link->ap; - void __iomem *data_addr = ap->ioaddr.data_addr; - unsigned long words; - int count; - - words = buflen / 2; - if (rw) { - count = 16; - while (words--) { - iowrite16(*(uint16_t *)buffer, data_addr); - buffer += sizeof(uint16_t); - /* - * Every 16 writes do a read so the bootbus - * FIFO doesn't fill up. - */ - if (--count == 0) { - ioread8(ap->ioaddr.altstatus_addr); - count = 16; - } - } - } else { - while (words--) { - *(uint16_t *)buffer = ioread16(data_addr); - buffer += sizeof(uint16_t); - } - } - /* Transfer trailing 1 byte, if any. */ - if (unlikely(buflen & 0x01)) { - __le16 align_buf[1] = { 0 }; - - if (rw == READ) { - align_buf[0] = cpu_to_le16(ioread16(data_addr)); - memcpy(buffer, align_buf, 1); - } else { - memcpy(align_buf, buffer, 1); - iowrite16(le16_to_cpu(align_buf[0]), data_addr); - } - words++; - } - return buflen; -} - -/** - * Read the taskfile for 16bit non-True IDE only. - */ -static void octeon_cf_tf_read16(struct ata_port *ap, struct ata_taskfile *tf) -{ - u16 blob; - /* The base of the registers is at ioaddr.data_addr. */ - void __iomem *base = ap->ioaddr.data_addr; - - blob = __raw_readw(base + 0xc); - tf->feature = blob >> 8; - - blob = __raw_readw(base + 2); - tf->nsect = blob & 0xff; - tf->lbal = blob >> 8; - - blob = __raw_readw(base + 4); - tf->lbam = blob & 0xff; - tf->lbah = blob >> 8; - - blob = __raw_readw(base + 6); - tf->device = blob & 0xff; - tf->command = blob >> 8; - - if (tf->flags & ATA_TFLAG_LBA48) { - if (likely(ap->ioaddr.ctl_addr)) { - iowrite8(tf->ctl | ATA_HOB, ap->ioaddr.ctl_addr); - - blob = __raw_readw(base + 0xc); - tf->hob_feature = blob >> 8; - - blob = __raw_readw(base + 2); - tf->hob_nsect = blob & 0xff; - tf->hob_lbal = blob >> 8; - - blob = __raw_readw(base + 4); - tf->hob_lbam = blob & 0xff; - tf->hob_lbah = blob >> 8; - - iowrite8(tf->ctl, ap->ioaddr.ctl_addr); - ap->last_ctl = tf->ctl; - } else { - WARN_ON(1); - } - } -} - -static u8 octeon_cf_check_status16(struct ata_port *ap) -{ - u16 blob; - void __iomem *base = ap->ioaddr.data_addr; - - blob = __raw_readw(base + 6); - return blob >> 8; -} - -static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes, - unsigned long deadline) -{ - struct ata_port *ap = link->ap; - void __iomem *base = ap->ioaddr.data_addr; - int rc; - u8 err; - - DPRINTK("about to softreset\n"); - __raw_writew(ap->ctl, base + 0xe); - udelay(20); - __raw_writew(ap->ctl | ATA_SRST, base + 0xe); - udelay(20); - __raw_writew(ap->ctl, base + 0xe); - - rc = ata_sff_wait_after_reset(link, 1, deadline); - if (rc) { - ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); - return rc; - } - - /* determine by signature whether we have ATA or ATAPI devices */ - classes[0] = ata_sff_dev_classify(&link->device[0], 1, &err); - DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); - return 0; -} - -/** - * Load the taskfile for 16bit non-True IDE only. The device_addr is - * not loaded, we do this as part of octeon_cf_exec_command16. - */ -static void octeon_cf_tf_load16(struct ata_port *ap, - const struct ata_taskfile *tf) -{ - unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; - /* The base of the registers is at ioaddr.data_addr. */ - void __iomem *base = ap->ioaddr.data_addr; - - if (tf->ctl != ap->last_ctl) { - iowrite8(tf->ctl, ap->ioaddr.ctl_addr); - ap->last_ctl = tf->ctl; - ata_wait_idle(ap); - } - if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) { - __raw_writew(tf->hob_feature << 8, base + 0xc); - __raw_writew(tf->hob_nsect | tf->hob_lbal << 8, base + 2); - __raw_writew(tf->hob_lbam | tf->hob_lbah << 8, base + 4); - VPRINTK("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n", - tf->hob_feature, - tf->hob_nsect, - tf->hob_lbal, - tf->hob_lbam, - tf->hob_lbah); - } - if (is_addr) { - __raw_writew(tf->feature << 8, base + 0xc); - __raw_writew(tf->nsect | tf->lbal << 8, base + 2); - __raw_writew(tf->lbam | tf->lbah << 8, base + 4); - VPRINTK("feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n", - tf->feature, - tf->nsect, - tf->lbal, - tf->lbam, - tf->lbah); - } - ata_wait_idle(ap); -} - - -static void octeon_cf_dev_select(struct ata_port *ap, unsigned int device) -{ -/* There is only one device, do nothing. */ - return; -} - -/* - * Issue ATA command to host controller. The device_addr is also sent - * as it must be written in a combined write with the command. - */ -static void octeon_cf_exec_command16(struct ata_port *ap, - const struct ata_taskfile *tf) -{ - /* The base of the registers is at ioaddr.data_addr. */ - void __iomem *base = ap->ioaddr.data_addr; - u16 blob; - - if (tf->flags & ATA_TFLAG_DEVICE) { - VPRINTK("device 0x%X\n", tf->device); - blob = tf->device; - } else { - blob = 0; - } - - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); - blob |= (tf->command << 8); - __raw_writew(blob, base + 6); - - - ata_wait_idle(ap); -} - -static u8 octeon_cf_irq_on(struct ata_port *ap) -{ - return 0; -} - -static void octeon_cf_irq_clear(struct ata_port *ap) -{ - return; -} - -static void octeon_cf_dma_setup(struct ata_queued_cmd *qc) -{ - struct ata_port *ap = qc->ap; - struct octeon_cf_port *cf_port; - - cf_port = (struct octeon_cf_port *)ap->private_data; - DPRINTK("ENTER\n"); - /* issue r/w command */ - qc->cursg = qc->sg; - cf_port->dma_finished = 0; - ap->ops->sff_exec_command(ap, &qc->tf); - DPRINTK("EXIT\n"); -} - -/** - * Start a DMA transfer that was already setup - * - * @qc: Information about the DMA - */ -static void octeon_cf_dma_start(struct ata_queued_cmd *qc) -{ - struct octeon_cf_data *ocd = qc->ap->dev->platform_data; - union cvmx_mio_boot_dma_cfgx mio_boot_dma_cfg; - union cvmx_mio_boot_dma_intx mio_boot_dma_int; - struct scatterlist *sg; - - VPRINTK("%d scatterlists\n", qc->n_elem); - - /* Get the scatter list entry we need to DMA into */ - sg = qc->cursg; - BUG_ON(!sg); - - /* - * Clear the DMA complete status. - */ - mio_boot_dma_int.u64 = 0; - mio_boot_dma_int.s.done = 1; - cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine), - mio_boot_dma_int.u64); - - /* Enable the interrupt. */ - cvmx_write_csr(CVMX_MIO_BOOT_DMA_INT_ENX(ocd->dma_engine), - mio_boot_dma_int.u64); - - /* Set the direction of the DMA */ - mio_boot_dma_cfg.u64 = 0; - mio_boot_dma_cfg.s.en = 1; - mio_boot_dma_cfg.s.rw = ((qc->tf.flags & ATA_TFLAG_WRITE) != 0); - - /* - * Don't stop the DMA if the device deasserts DMARQ. Many - * compact flashes deassert DMARQ for a short time between - * sectors. Instead of stopping and restarting the DMA, we'll - * let the hardware do it. If the DMA is really stopped early - * due to an error condition, a later timeout will force us to - * stop. - */ - mio_boot_dma_cfg.s.clr = 0; - - /* Size is specified in 16bit words and minus one notation */ - mio_boot_dma_cfg.s.size = sg_dma_len(sg) / 2 - 1; - - /* We need to swap the high and low bytes of every 16 bits */ - mio_boot_dma_cfg.s.swap8 = 1; - - mio_boot_dma_cfg.s.adr = sg_dma_address(sg); - - VPRINTK("%s %d bytes address=%p\n", - (mio_boot_dma_cfg.s.rw) ? "write" : "read", sg->length, - (void *)(unsigned long)mio_boot_dma_cfg.s.adr); - - cvmx_write_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine), - mio_boot_dma_cfg.u64); -} - -/** - * - * LOCKING: - * spin_lock_irqsave(host lock) - * - */ -static unsigned int octeon_cf_dma_finished(struct ata_port *ap, - struct ata_queued_cmd *qc) -{ - struct ata_eh_info *ehi = &ap->link.eh_info; - struct octeon_cf_data *ocd = ap->dev->platform_data; - union cvmx_mio_boot_dma_cfgx dma_cfg; - union cvmx_mio_boot_dma_intx dma_int; - struct octeon_cf_port *cf_port; - u8 status; - - VPRINTK("ata%u: protocol %d task_state %d\n", - ap->print_id, qc->tf.protocol, ap->hsm_task_state); - - - if (ap->hsm_task_state != HSM_ST_LAST) - return 0; - - cf_port = (struct octeon_cf_port *)ap->private_data; - - dma_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine)); - if (dma_cfg.s.size != 0xfffff) { - /* Error, the transfer was not complete. */ - qc->err_mask |= AC_ERR_HOST_BUS; - ap->hsm_task_state = HSM_ST_ERR; - } - - /* Stop and clear the dma engine. */ - dma_cfg.u64 = 0; - dma_cfg.s.size = -1; - cvmx_write_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine), dma_cfg.u64); - - /* Disable the interrupt. */ - dma_int.u64 = 0; - cvmx_write_csr(CVMX_MIO_BOOT_DMA_INT_ENX(ocd->dma_engine), dma_int.u64); - - /* Clear the DMA complete status */ - dma_int.s.done = 1; - cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine), dma_int.u64); - - status = ap->ops->sff_check_status(ap); - - ata_sff_hsm_move(ap, qc, status, 0); - - if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA)) - ata_ehi_push_desc(ehi, "DMA stat 0x%x", status); - - return 1; -} - -/* - * Check if any queued commands have more DMAs, if so start the next - * transfer, else do end of transfer handling. - */ -static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance) -{ - struct ata_host *host = dev_instance; - struct octeon_cf_port *cf_port; - int i; - unsigned int handled = 0; - unsigned long flags; - - spin_lock_irqsave(&host->lock, flags); - - DPRINTK("ENTER\n"); - for (i = 0; i < host->n_ports; i++) { - u8 status; - struct ata_port *ap; - struct ata_queued_cmd *qc; - union cvmx_mio_boot_dma_intx dma_int; - union cvmx_mio_boot_dma_cfgx dma_cfg; - struct octeon_cf_data *ocd; - - ap = host->ports[i]; - ocd = ap->dev->platform_data; - if (!ap || (ap->flags & ATA_FLAG_DISABLED)) - continue; - - ocd = ap->dev->platform_data; - cf_port = (struct octeon_cf_port *)ap->private_data; - dma_int.u64 = - cvmx_read_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine)); - dma_cfg.u64 = - cvmx_read_csr(CVMX_MIO_BOOT_DMA_CFGX(ocd->dma_engine)); - - qc = ata_qc_from_tag(ap, ap->link.active_tag); - - if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) && - (qc->flags & ATA_QCFLAG_ACTIVE)) { - if (dma_int.s.done && !dma_cfg.s.en) { - if (!sg_is_last(qc->cursg)) { - qc->cursg = sg_next(qc->cursg); - handled = 1; - octeon_cf_dma_start(qc); - continue; - } else { - cf_port->dma_finished = 1; - } - } - if (!cf_port->dma_finished) - continue; - status = ioread8(ap->ioaddr.altstatus_addr); - if (status & (ATA_BUSY | ATA_DRQ)) { - /* - * We are busy, try to handle it - * later. This is the DMA finished - * interrupt, and it could take a - * little while for the card to be - * ready for more commands. - */ - /* Clear DMA irq. */ - dma_int.u64 = 0; - dma_int.s.done = 1; - cvmx_write_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine), - dma_int.u64); - - queue_delayed_work(cf_port->wq, - &cf_port->delayed_finish, 1); - handled = 1; - } else { - handled |= octeon_cf_dma_finished(ap, qc); - } - } - } - spin_unlock_irqrestore(&host->lock, flags); - DPRINTK("EXIT\n"); - return IRQ_RETVAL(handled); -} - -static void octeon_cf_delayed_finish(struct work_struct *work) -{ - struct octeon_cf_port *cf_port = container_of(work, - struct octeon_cf_port, - delayed_finish.work); - struct ata_port *ap = cf_port->ap; - struct ata_host *host = ap->host; - struct ata_queued_cmd *qc; - unsigned long flags; - u8 status; - - spin_lock_irqsave(&host->lock, flags); - - /* - * If the port is not waiting for completion, it must have - * handled it previously. The hsm_task_state is - * protected by host->lock. - */ - if (ap->hsm_task_state != HSM_ST_LAST || !cf_port->dma_finished) - goto out; - - status = ioread8(ap->ioaddr.altstatus_addr); - if (status & (ATA_BUSY | ATA_DRQ)) { - /* Still busy, try again. */ - queue_delayed_work(cf_port->wq, - &cf_port->delayed_finish, 1); - goto out; - } - qc = ata_qc_from_tag(ap, ap->link.active_tag); - if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) && - (qc->flags & ATA_QCFLAG_ACTIVE)) - octeon_cf_dma_finished(ap, qc); -out: - spin_unlock_irqrestore(&host->lock, flags); -} - -static void octeon_cf_dev_config(struct ata_device *dev) -{ - /* - * A maximum of 2^20 - 1 16 bit transfers are possible with - * the bootbus DMA. So we need to throttle max_sectors to - * (2^12 - 1 == 4095) to assure that this can never happen. - */ - dev->max_sectors = min(dev->max_sectors, 4095U); -} - -/* - * Trap if driver tries to do standard bmdma commands. They are not - * supported. - */ -static void unreachable_qc(struct ata_queued_cmd *qc) -{ - BUG(); -} - -static u8 unreachable_port(struct ata_port *ap) -{ - BUG(); -} - -/* - * We don't do ATAPI DMA so return 0. - */ -static int octeon_cf_check_atapi_dma(struct ata_queued_cmd *qc) -{ - return 0; -} - -static unsigned int octeon_cf_qc_issue(struct ata_queued_cmd *qc) -{ - struct ata_port *ap = qc->ap; - - switch (qc->tf.protocol) { - case ATA_PROT_DMA: - WARN_ON(qc->tf.flags & ATA_TFLAG_POLLING); - - ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ - octeon_cf_dma_setup(qc); /* set up dma */ - octeon_cf_dma_start(qc); /* initiate dma */ - ap->hsm_task_state = HSM_ST_LAST; - break; - - case ATAPI_PROT_DMA: - dev_err(ap->dev, "Error, ATAPI not supported\n"); - BUG(); - - default: - return ata_sff_qc_issue(qc); - } - - return 0; -} - -static struct ata_port_operations octeon_cf_ops = { - .inherits = &ata_sff_port_ops, - .check_atapi_dma = octeon_cf_check_atapi_dma, - .qc_prep = ata_noop_qc_prep, - .qc_issue = octeon_cf_qc_issue, - .sff_dev_select = octeon_cf_dev_select, - .sff_irq_on = octeon_cf_irq_on, - .sff_irq_clear = octeon_cf_irq_clear, - .bmdma_setup = unreachable_qc, - .bmdma_start = unreachable_qc, - .bmdma_stop = unreachable_qc, - .bmdma_status = unreachable_port, - .cable_detect = ata_cable_40wire, - .set_piomode = octeon_cf_set_piomode, - .set_dmamode = octeon_cf_set_dmamode, - .dev_config = octeon_cf_dev_config, -}; - -static int __devinit octeon_cf_probe(struct platform_device *pdev) -{ - struct resource *res_cs0, *res_cs1; - - void __iomem *cs0; - void __iomem *cs1 = NULL; - struct ata_host *host; - struct ata_port *ap; - struct octeon_cf_data *ocd; - int irq = 0; - irq_handler_t irq_handler = NULL; - void __iomem *base; - struct octeon_cf_port *cf_port; - - res_cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); - - if (!res_cs0) - return -EINVAL; - - ocd = pdev->dev.platform_data; - - cs0 = devm_ioremap_nocache(&pdev->dev, res_cs0->start, - res_cs0->end - res_cs0->start + 1); - - if (!cs0) - return -ENOMEM; - - /* Determine from availability of DMA if True IDE mode or not */ - if (ocd->dma_engine >= 0) { - res_cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (!res_cs1) - return -EINVAL; - - cs1 = devm_ioremap_nocache(&pdev->dev, res_cs1->start, - res_cs0->end - res_cs1->start + 1); - - if (!cs1) - return -ENOMEM; - } - - cf_port = kzalloc(sizeof(*cf_port), GFP_KERNEL); - if (!cf_port) - return -ENOMEM; - - /* allocate host */ - host = ata_host_alloc(&pdev->dev, 1); - if (!host) - goto free_cf_port; - - ap = host->ports[0]; - ap->private_data = cf_port; - cf_port->ap = ap; - ap->ops = &octeon_cf_ops; - ap->pio_mask = 0x7f; /* Support PIO 0-6 */ - ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY - | ATA_FLAG_NO_ATAPI | ATA_FLAG_PIO_POLLING; - - base = cs0 + ocd->base_region_bias; - if (!ocd->is16bit) { - ap->ioaddr.cmd_addr = base; - ata_sff_std_ports(&ap->ioaddr); - - ap->ioaddr.altstatus_addr = base + 0xe; - ap->ioaddr.ctl_addr = base + 0xe; - octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer8; - } else if (cs1) { - /* Presence of cs1 indicates True IDE mode. */ - ap->ioaddr.cmd_addr = base + (ATA_REG_CMD << 1) + 1; - ap->ioaddr.data_addr = base + (ATA_REG_DATA << 1); - ap->ioaddr.error_addr = base + (ATA_REG_ERR << 1) + 1; - ap->ioaddr.feature_addr = base + (ATA_REG_FEATURE << 1) + 1; - ap->ioaddr.nsect_addr = base + (ATA_REG_NSECT << 1) + 1; - ap->ioaddr.lbal_addr = base + (ATA_REG_LBAL << 1) + 1; - ap->ioaddr.lbam_addr = base + (ATA_REG_LBAM << 1) + 1; - ap->ioaddr.lbah_addr = base + (ATA_REG_LBAH << 1) + 1; - ap->ioaddr.device_addr = base + (ATA_REG_DEVICE << 1) + 1; - ap->ioaddr.status_addr = base + (ATA_REG_STATUS << 1) + 1; - ap->ioaddr.command_addr = base + (ATA_REG_CMD << 1) + 1; - ap->ioaddr.altstatus_addr = cs1 + (6 << 1) + 1; - ap->ioaddr.ctl_addr = cs1 + (6 << 1) + 1; - octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer16; - - ap->mwdma_mask = 0x1f; /* Support MWDMA 0-4 */ - irq = platform_get_irq(pdev, 0); - irq_handler = octeon_cf_interrupt; - - /* True IDE mode needs delayed work to poll for not-busy. */ - cf_port->wq = create_singlethread_workqueue(DRV_NAME); - if (!cf_port->wq) - goto free_cf_port; - INIT_DELAYED_WORK(&cf_port->delayed_finish, - octeon_cf_delayed_finish); - - } else { - /* 16 bit but not True IDE */ - octeon_cf_ops.sff_data_xfer = octeon_cf_data_xfer16; - octeon_cf_ops.softreset = octeon_cf_softreset16; - octeon_cf_ops.sff_check_status = octeon_cf_check_status16; - octeon_cf_ops.sff_tf_read = octeon_cf_tf_read16; - octeon_cf_ops.sff_tf_load = octeon_cf_tf_load16; - octeon_cf_ops.sff_exec_command = octeon_cf_exec_command16; - - ap->ioaddr.data_addr = base + ATA_REG_DATA; - ap->ioaddr.nsect_addr = base + ATA_REG_NSECT; - ap->ioaddr.lbal_addr = base + ATA_REG_LBAL; - ap->ioaddr.ctl_addr = base + 0xe; - ap->ioaddr.altstatus_addr = base + 0xe; - } - - ata_port_desc(ap, "cmd %p ctl %p", base, ap->ioaddr.ctl_addr); - - - dev_info(&pdev->dev, "version " DRV_VERSION" %d bit%s.\n", - (ocd->is16bit) ? 16 : 8, - (cs1) ? ", True IDE" : ""); - - - return ata_host_activate(host, irq, irq_handler, 0, &octeon_cf_sht); - -free_cf_port: - kfree(cf_port); - return -ENOMEM; -} - -static struct platform_driver octeon_cf_driver = { - .probe = octeon_cf_probe, - .driver = { - .name = DRV_NAME, - .owner = THIS_MODULE, - }, -}; - -static int __init octeon_cf_init(void) -{ - return platform_driver_register(&octeon_cf_driver); -} - - -MODULE_AUTHOR("David Daney "); -MODULE_DESCRIPTION("low-level driver for Cavium OCTEON Compact Flash PATA"); -MODULE_LICENSE("GPL"); -MODULE_VERSION(DRV_VERSION); -MODULE_ALIAS("platform:" DRV_NAME); - -module_init(octeon_cf_init); diff --git a/trunk/drivers/ata/sata_fsl.c b/trunk/drivers/ata/sata_fsl.c index 55bc88c1707b..1a56db92ff7a 100644 --- a/trunk/drivers/ata/sata_fsl.c +++ b/trunk/drivers/ata/sata_fsl.c @@ -1288,7 +1288,7 @@ static const struct ata_port_info sata_fsl_port_info[] = { static int sata_fsl_probe(struct of_device *ofdev, const struct of_device_id *match) { - int retval = -ENXIO; + int retval = 0; void __iomem *hcr_base = NULL; void __iomem *ssr_base = NULL; void __iomem *csr_base = NULL; diff --git a/trunk/drivers/ata/sata_via.c b/trunk/drivers/ata/sata_via.c index 5c62da9cd491..c18935f0bda2 100644 --- a/trunk/drivers/ata/sata_via.c +++ b/trunk/drivers/ata/sata_via.c @@ -92,8 +92,6 @@ static const struct pci_device_id svia_pci_tbl[] = { { PCI_VDEVICE(VIA, 0x5372), vt6420 }, { PCI_VDEVICE(VIA, 0x7372), vt6420 }, { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ - { PCI_VDEVICE(VIA, 0x9000), vt8251 }, - { PCI_VDEVICE(VIA, 0x9040), vt8251 }, { } /* terminate list */ }; diff --git a/trunk/drivers/block/nbd.c b/trunk/drivers/block/nbd.c index 34f80fa6fed1..7bcc1d8bc967 100644 --- a/trunk/drivers/block/nbd.c +++ b/trunk/drivers/block/nbd.c @@ -406,7 +406,6 @@ 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; } @@ -414,7 +413,6 @@ 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; } @@ -650,8 +648,6 @@ 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); diff --git a/trunk/drivers/block/ps3disk.c b/trunk/drivers/block/ps3disk.c index bccc42bb9212..936466f62afd 100644 --- a/trunk/drivers/block/ps3disk.c +++ b/trunk/drivers/block/ps3disk.c @@ -141,7 +141,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev, start_sector = req->sector * priv->blocking_factor; sectors = req->nr_sectors * priv->blocking_factor; - dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n", + dev_dbg(&dev->sbd.core, "%s:%u: %s %lu sectors starting at %lu\n", __func__, __LINE__, op, sectors, start_sector); if (write) { @@ -178,7 +178,7 @@ static int ps3disk_submit_flush_request(struct ps3_storage_device *dev, LV1_STORAGE_ATA_HDDOUT, 0, 0, 0, 0, &dev->tag); if (res) { - dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%lx\n", __func__, __LINE__, res); end_request(req, 0); return 0; @@ -238,11 +238,11 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data) if (tag != dev->tag) dev_err(&dev->sbd.core, - "%s:%u: tag mismatch, got %llx, expected %llx\n", + "%s:%u: tag mismatch, got %lx, expected %lx\n", __func__, __LINE__, tag, dev->tag); if (res) { - dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n", __func__, __LINE__, res, status); return IRQ_HANDLED; } @@ -269,7 +269,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data) op = read ? "read" : "write"; } if (status) { - dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__, + dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__, __LINE__, op, status); error = -EIO; } else { @@ -297,7 +297,7 @@ static int ps3disk_sync_cache(struct ps3_storage_device *dev) res = ps3stor_send_command(dev, LV1_STORAGE_ATA_HDDOUT, 0, 0, 0, 0); if (res) { - dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%lx\n", __func__, __LINE__, res); return -EIO; } @@ -388,7 +388,7 @@ static int ps3disk_identify(struct ps3_storage_device *dev) sizeof(ata_cmnd), ata_cmnd.buffer, ata_cmnd.arglen); if (res) { - dev_err(&dev->sbd.core, "%s:%u: identify disk failed 0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: identify disk failed 0x%lx\n", __func__, __LINE__, res); return -EIO; } @@ -426,7 +426,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) if (dev->blk_size < 512) { dev_err(&dev->sbd.core, - "%s:%u: cannot handle block size %llu\n", __func__, + "%s:%u: cannot handle block size %lu\n", __func__, __LINE__, dev->blk_size); return -EINVAL; } @@ -512,7 +512,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev) dev->regions[dev->region_idx].size*priv->blocking_factor); dev_info(&dev->sbd.core, - "%s is a %s (%llu MiB total, %lu MiB for OtherOS)\n", + "%s is a %s (%lu MiB total, %lu MiB for OtherOS)\n", gendisk->disk_name, priv->model, priv->raw_capacity >> 11, get_capacity(gendisk) >> 11); diff --git a/trunk/drivers/block/xsysace.c b/trunk/drivers/block/xsysace.c index 381d686fc1a3..29e1dfafb7c6 100644 --- a/trunk/drivers/block/xsysace.c +++ b/trunk/drivers/block/xsysace.c @@ -1206,7 +1206,6 @@ 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); diff --git a/trunk/drivers/char/bsr.c b/trunk/drivers/char/bsr.c index f6094ae0ef33..977dfb1096a0 100644 --- a/trunk/drivers/char/bsr.c +++ b/trunk/drivers/char/bsr.c @@ -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, "%llu\n", bsr_dev->bsr_len); + return sprintf(buf, "%lu\n", bsr_dev->bsr_len); } static struct device_attribute bsr_dev_attrs[] = { diff --git a/trunk/drivers/char/hvc_console.c b/trunk/drivers/char/hvc_console.c index 94e7e3c8c05a..5a8a4c28c867 100644 --- a/trunk/drivers/char/hvc_console.c +++ b/trunk/drivers/char/hvc_console.c @@ -318,6 +318,7 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) } /* else count == 0 */ tty->driver_data = hp; + tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ hp->tty = tty; @@ -763,11 +764,13 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, return ERR_PTR(err); } - hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, + hp = kmalloc(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; @@ -873,11 +876,8 @@ static int hvc_init(void) goto stop_thread; } - /* - * Make sure tty is fully registered before allowing it to be - * found by hvc_console_device. - */ - smp_mb(); + /* FIXME: This mb() seems completely random. Remove it. */ + mb(); hvc_driver = drv; return 0; diff --git a/trunk/drivers/char/hvc_irq.c b/trunk/drivers/char/hvc_irq.c index 2623e177e8d6..d09e5688d449 100644 --- a/trunk/drivers/char/hvc_irq.c +++ b/trunk/drivers/char/hvc_irq.c @@ -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 (!hp->irq_requested) + if (!irq) return; free_irq(irq, hp); hp->irq_requested = 0; diff --git a/trunk/drivers/char/ps3flash.c b/trunk/drivers/char/ps3flash.c index afbe45676d71..79b6f461be75 100644 --- a/trunk/drivers/char/ps3flash.c +++ b/trunk/drivers/char/ps3flash.c @@ -44,7 +44,7 @@ static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev, u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors, write); if (res) { - dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__, + dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__, __LINE__, write ? "write" : "read", res); return -EIO; } @@ -59,7 +59,7 @@ static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev, max_sectors = dev->bounce_size / dev->blk_size; if (sectors > max_sectors) { - dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %llu\n", + dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %lu\n", __func__, __LINE__, max_sectors); sectors = max_sectors; } @@ -144,7 +144,7 @@ static ssize_t ps3flash_read(struct file *file, char __user *buf, size_t count, goto fail; } - n = min_t(u64, remaining, sectors_read*dev->blk_size-offset); + n = min(remaining, sectors_read*dev->blk_size-offset); dev_dbg(&dev->sbd.core, "%s:%u: copy %lu bytes from 0x%p to user 0x%p\n", __func__, __LINE__, n, dev->bounce_buf+offset, buf); @@ -225,7 +225,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, if (end_read_sector >= start_read_sector) { /* Merge head and tail */ dev_dbg(&dev->sbd.core, - "Merged head and tail: %llu sectors at %llu\n", + "Merged head and tail: %lu sectors at %lu\n", chunk_sectors, start_write_sector); res = ps3flash_read_sectors(dev, start_write_sector, chunk_sectors, 0); @@ -235,7 +235,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, if (head) { /* Read head */ dev_dbg(&dev->sbd.core, - "head: %llu sectors at %llu\n", head, + "head: %lu sectors at %lu\n", head, start_write_sector); res = ps3flash_read_sectors(dev, start_write_sector, @@ -247,7 +247,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, start_write_sector+chunk_sectors) { /* Read tail */ dev_dbg(&dev->sbd.core, - "tail: %llu sectors at %llu\n", tail, + "tail: %lu sectors at %lu\n", tail, start_read_sector); sec_off = start_read_sector-start_write_sector; res = ps3flash_read_sectors(dev, @@ -258,7 +258,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, } } - n = min_t(u64, remaining, dev->bounce_size-offset); + n = min(remaining, dev->bounce_size-offset); dev_dbg(&dev->sbd.core, "%s:%u: copy %lu bytes from user 0x%p to 0x%p\n", __func__, __LINE__, n, buf, dev->bounce_buf+offset); @@ -299,11 +299,11 @@ static irqreturn_t ps3flash_interrupt(int irq, void *data) if (tag != dev->tag) dev_err(&dev->sbd.core, - "%s:%u: tag mismatch, got %llx, expected %llx\n", + "%s:%u: tag mismatch, got %lx, expected %lx\n", __func__, __LINE__, tag, dev->tag); if (res) { - dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n", __func__, __LINE__, res, status); } else { dev->lv1_status = status; diff --git a/trunk/drivers/char/synclink_gt.c b/trunk/drivers/char/synclink_gt.c index f329f459817c..53544e21f191 100644 --- a/trunk/drivers/char/synclink_gt.c +++ b/trunk/drivers/char/synclink_gt.c @@ -1,4 +1,6 @@ /* + * $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 @@ -89,6 +91,7 @@ * 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"); @@ -1306,7 +1309,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\n"); + len += sprintf(page, "synclink_gt driver:%s\n", driver_version); info = slgt_device_list; while( info ) { @@ -2438,7 +2441,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 | IRQ_RI); + slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR); get_signals(info); if (info->netcount || @@ -3573,7 +3576,7 @@ static void slgt_cleanup(void) struct slgt_info *info; struct slgt_info *tmp; - printk(KERN_INFO "unload %s\n", driver_name); + printk("unload %s %s\n", driver_name, driver_version); if (serial_driver) { for (info=slgt_device_list ; info != NULL ; info=info->next_device) @@ -3616,7 +3619,7 @@ static int __init slgt_init(void) { int rc; - printk(KERN_INFO "%s\n", driver_name); + printk("%s %s\n", driver_name, driver_version); serial_driver = alloc_tty_driver(MAX_DEVICES); if (!serial_driver) { @@ -3647,8 +3650,9 @@ static int __init slgt_init(void) goto error; } - printk(KERN_INFO "%s, tty major#%d\n", - driver_name, serial_driver->major); + printk("%s %s, tty major#%d\n", + driver_name, driver_version, + serial_driver->major); slgt_device_count = 0; if ((rc = pci_register_driver(&pci_driver)) < 0) { diff --git a/trunk/drivers/char/sysrq.c b/trunk/drivers/char/sysrq.c index 33a9351c896d..d41b9f6f7903 100644 --- a/trunk/drivers/char/sysrq.c +++ b/trunk/drivers/char/sysrq.c @@ -473,12 +473,6 @@ 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 : "); diff --git a/trunk/drivers/char/tty_ioctl.c b/trunk/drivers/char/tty_ioctl.c index 6f4c7d0a53bf..a408c8e487ec 100644 --- a/trunk/drivers/char/tty_ioctl.c +++ b/trunk/drivers/char/tty_ioctl.c @@ -1057,7 +1057,7 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg) if (retval) return retval; - ld = tty_ldisc_ref_wait(tty); + ld = tty_ldisc_ref(tty); switch (arg) { case TCIFLUSH: if (ld && ld->ops->flush_buffer) diff --git a/trunk/drivers/gpio/max7301.c b/trunk/drivers/gpio/max7301.c index 3e7f4e06386e..8b24d784db93 100644 --- a/trunk/drivers/gpio/max7301.c +++ b/trunk/drivers/gpio/max7301.c @@ -217,10 +217,8 @@ static int __devinit max7301_probe(struct spi_device *spi) int i, ret; pdata = spi->dev.platform_data; - if (!pdata || !pdata->base) { - dev_dbg(&spi->dev, "incorrect or missing platform data\n"); - return -EINVAL; - } + if (!pdata || !pdata->base) + return -ENODEV; /* * bits_per_word cannot be configured in platform data diff --git a/trunk/drivers/gpio/max732x.c b/trunk/drivers/gpio/max732x.c index f7868243af89..55ae9a41897a 100644 --- a/trunk/drivers/gpio/max732x.c +++ b/trunk/drivers/gpio/max732x.c @@ -267,10 +267,8 @@ static int __devinit max732x_probe(struct i2c_client *client, int ret, nr_port; pdata = client->dev.platform_data; - if (pdata == NULL) { - dev_dbg(&client->dev, "no platform data\n"); - return -EINVAL; - } + if (pdata == NULL) + return -ENODEV; chip = kzalloc(sizeof(struct max732x_chip), GFP_KERNEL); if (chip == NULL) diff --git a/trunk/drivers/gpio/mcp23s08.c b/trunk/drivers/gpio/mcp23s08.c index f6fae0e50e65..89c1d222e9d1 100644 --- a/trunk/drivers/gpio/mcp23s08.c +++ b/trunk/drivers/gpio/mcp23s08.c @@ -310,10 +310,8 @@ static int mcp23s08_probe(struct spi_device *spi) unsigned base; pdata = spi->dev.platform_data; - if (!pdata || !gpio_is_valid(pdata->base)) { - dev_dbg(&spi->dev, "invalid or missing platform data\n"); - return -EINVAL; - } + if (!pdata || !gpio_is_valid(pdata->base)) + return -ENODEV; for (addr = 0; addr < 4; addr++) { if (!pdata->chip[addr].is_present) diff --git a/trunk/drivers/gpio/pca953x.c b/trunk/drivers/gpio/pca953x.c index 8dc0164bd51e..37f35388a2ae 100644 --- a/trunk/drivers/gpio/pca953x.c +++ b/trunk/drivers/gpio/pca953x.c @@ -202,10 +202,8 @@ static int __devinit pca953x_probe(struct i2c_client *client, int ret; pdata = client->dev.platform_data; - if (pdata == NULL) { - dev_dbg(&client->dev, "no platform data\n"); - return -EINVAL; - } + if (pdata == NULL) + return -ENODEV; chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL); if (chip == NULL) diff --git a/trunk/drivers/gpio/pcf857x.c b/trunk/drivers/gpio/pcf857x.c index 9525724be731..4bc2070dd4a1 100644 --- a/trunk/drivers/gpio/pcf857x.c +++ b/trunk/drivers/gpio/pcf857x.c @@ -188,10 +188,8 @@ static int pcf857x_probe(struct i2c_client *client, int status; pdata = client->dev.platform_data; - if (!pdata) { - dev_dbg(&client->dev, "no platform data\n"); - return -EINVAL; - } + if (!pdata) + return -ENODEV; /* Allocate, initialize, and register this gpio_chip. */ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); @@ -250,10 +248,8 @@ static int pcf857x_probe(struct i2c_client *client, else status = i2c_read_le16(client); - } else { - dev_dbg(&client->dev, "unsupported number of gpios\n"); - status = -EINVAL; - } + } else + status = -ENODEV; if (status < 0) goto fail; diff --git a/trunk/drivers/gpu/drm/drm_crtc_helper.c b/trunk/drivers/gpu/drm/drm_crtc_helper.c index 964c5eb1fada..d8a982b71296 100644 --- a/trunk/drivers/gpu/drm/drm_crtc_helper.c +++ b/trunk/drivers/gpu/drm/drm_crtc_helper.c @@ -36,7 +36,7 @@ /* * Detailed mode info for 800x600@60Hz */ -static struct drm_display_mode std_modes[] = { +static struct drm_display_mode std_mode[] = { { DRM_MODE("800x600", DRM_MODE_TYPE_DEFAULT, 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) }, @@ -60,18 +60,15 @@ static struct drm_display_mode std_modes[] = { * changes have occurred. * * FIXME: take into account monitor limits - * - * RETURNS: - * Number of modes found on @connector. */ -int drm_helper_probe_single_connector_modes(struct drm_connector *connector, - uint32_t maxX, uint32_t maxY) +void drm_helper_probe_single_connector_modes(struct drm_connector *connector, + uint32_t maxX, uint32_t maxY) { struct drm_device *dev = connector->dev; struct drm_display_mode *mode, *t; struct drm_connector_helper_funcs *connector_funcs = connector->helper_private; - int count = 0; + int ret; DRM_DEBUG("%s\n", drm_get_connector_name(connector)); /* set all modes to the unverified state */ @@ -84,14 +81,14 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, DRM_DEBUG("%s is disconnected\n", drm_get_connector_name(connector)); /* TODO set EDID to NULL */ - return 0; + return; } - count = (*connector_funcs->get_modes)(connector); - if (!count) - return 0; + ret = (*connector_funcs->get_modes)(connector); - drm_mode_connector_list_update(connector); + if (ret) { + drm_mode_connector_list_update(connector); + } if (maxX && maxY) drm_mode_validate_size(dev, &connector->modes, maxX, @@ -105,8 +102,25 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, drm_mode_prune_invalid(dev, &connector->modes, true); - if (list_empty(&connector->modes)) - return 0; + if (list_empty(&connector->modes)) { + struct drm_display_mode *stdmode; + + DRM_DEBUG("No valid modes on %s\n", + drm_get_connector_name(connector)); + + /* Should we do this here ??? + * When no valid EDID modes are available we end up + * here and bailed in the past, now we add a standard + * 640x480@60Hz mode and carry on. + */ + stdmode = drm_mode_duplicate(dev, &std_mode[0]); + drm_mode_probed_add(connector, stdmode); + drm_mode_list_concat(&connector->probed_modes, + &connector->modes); + + DRM_DEBUG("Adding standard 640x480 @ 60Hz to %s\n", + drm_get_connector_name(connector)); + } drm_mode_sort(&connector->modes); @@ -117,58 +131,20 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); drm_mode_debug_printmodeline(mode); } - - return count; } EXPORT_SYMBOL(drm_helper_probe_single_connector_modes); -int drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX, +void drm_helper_probe_connector_modes(struct drm_device *dev, uint32_t maxX, uint32_t maxY) { struct drm_connector *connector; - int count = 0; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - count += drm_helper_probe_single_connector_modes(connector, - maxX, maxY); + drm_helper_probe_single_connector_modes(connector, maxX, maxY); } - - return count; } EXPORT_SYMBOL(drm_helper_probe_connector_modes); -static void drm_helper_add_std_modes(struct drm_device *dev, - struct drm_connector *connector) -{ - struct drm_display_mode *mode, *t; - int i; - - for (i = 0; i < ARRAY_SIZE(std_modes); i++) { - struct drm_display_mode *stdmode; - - /* - * When no valid EDID modes are available we end up - * here and bailed in the past, now we add some standard - * modes and move on. - */ - stdmode = drm_mode_duplicate(dev, &std_modes[i]); - drm_mode_probed_add(connector, stdmode); - drm_mode_list_concat(&connector->probed_modes, - &connector->modes); - - DRM_DEBUG("Adding mode %s to %s\n", stdmode->name, - drm_get_connector_name(connector)); - } - drm_mode_sort(&connector->modes); - - DRM_DEBUG("Added std modes on %s\n", drm_get_connector_name(connector)); - list_for_each_entry_safe(mode, t, &connector->modes, head) { - mode->vrefresh = drm_mode_vrefresh(mode); - - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); - drm_mode_debug_printmodeline(mode); - } -} /** * drm_helper_crtc_in_use - check if a given CRTC is in a mode_config @@ -261,8 +237,6 @@ static void drm_enable_connectors(struct drm_device *dev, bool *enabled) list_for_each_entry(connector, &dev->mode_config.connector_list, head) { enabled[i] = drm_connector_enabled(connector, true); - DRM_DEBUG("connector %d enabled? %s\n", connector->base.id, - enabled[i] ? "yes" : "no"); any_enabled |= enabled[i]; i++; } @@ -291,17 +265,11 @@ static bool drm_target_preferred(struct drm_device *dev, continue; } - DRM_DEBUG("looking for preferred mode on connector %d\n", - connector->base.id); - modes[i] = drm_has_preferred_mode(connector, width, height); - /* No preferred modes, pick one off the list */ - if (!modes[i] && !list_empty(&connector->modes)) { + if (!modes[i]) { list_for_each_entry(modes[i], &connector->modes, head) break; } - DRM_DEBUG("found mode %s\n", modes[i] ? modes[i]->name : - "none"); i++; } return true; @@ -401,8 +369,6 @@ static void drm_setup_crtcs(struct drm_device *dev) int width, height; int i, ret; - DRM_DEBUG("\n"); - width = dev->mode_config.max_width; height = dev->mode_config.max_height; @@ -424,8 +390,6 @@ static void drm_setup_crtcs(struct drm_device *dev) if (!ret) DRM_ERROR("Unable to find initial modes\n"); - DRM_DEBUG("picking CRTCs for %dx%d config\n", width, height); - drm_pick_crtcs(dev, crtcs, modes, 0, width, height); i = 0; @@ -439,8 +403,6 @@ static void drm_setup_crtcs(struct drm_device *dev) } if (mode && crtc) { - DRM_DEBUG("desired mode %s set on crtc %d\n", - mode->name, crtc->base.id); crtc->desired_mode = mode; connector->encoder->crtc = crtc; } else @@ -480,7 +442,6 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, int saved_x, saved_y; struct drm_encoder *encoder; bool ret = true; - bool depth_changed, bpp_changed; adjusted_mode = drm_mode_duplicate(dev, mode); @@ -489,15 +450,6 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, if (!crtc->enabled) return true; - if (old_fb && crtc->fb) { - depth_changed = (old_fb->depth != crtc->fb->depth); - bpp_changed = (old_fb->bits_per_pixel != - crtc->fb->bits_per_pixel); - } else { - depth_changed = true; - bpp_changed = true; - } - saved_mode = crtc->mode; saved_x = crtc->x; saved_y = crtc->y; @@ -510,8 +462,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, crtc->y = y; if (drm_mode_equal(&saved_mode, &crtc->mode)) { - if (saved_x != crtc->x || saved_y != crtc->y || - depth_changed || bpp_changed) { + if (saved_x != crtc->x || saved_y != crtc->y) { crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y, old_fb); goto done; @@ -617,8 +568,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) struct drm_encoder **save_encoders, *new_encoder; struct drm_framebuffer *old_fb; bool save_enabled; - bool mode_changed = false; - bool fb_changed = false; + bool changed = false; + bool flip_or_move = false; struct drm_connector *connector; int count = 0, ro, fail = 0; struct drm_crtc_helper_funcs *crtc_funcs; @@ -646,10 +597,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) /* save previous config */ save_enabled = set->crtc->enabled; - /* - * We do mode_config.num_connectors here since we'll look at the - * CRTC and encoder associated with each connector later. - */ + /* this is meant to be num_connector not num_crtc */ save_crtcs = kzalloc(dev->mode_config.num_connector * sizeof(struct drm_crtc *), GFP_KERNEL); if (!save_crtcs) @@ -665,25 +613,21 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) /* We should be able to check here if the fb has the same properties * and then just flip_or_move it */ if (set->crtc->fb != set->fb) { - /* If we have no fb then treat it as a full mode set */ + /* if we have no fb then its a change not a flip */ if (set->crtc->fb == NULL) - mode_changed = true; - else if ((set->fb->bits_per_pixel != - set->crtc->fb->bits_per_pixel) || - set->fb->depth != set->crtc->fb->depth) - fb_changed = true; + changed = true; else - fb_changed = true; + flip_or_move = true; } if (set->x != set->crtc->x || set->y != set->crtc->y) - fb_changed = true; + flip_or_move = true; if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) { DRM_DEBUG("modes are different\n"); drm_mode_debug_printmodeline(&set->crtc->mode); drm_mode_debug_printmodeline(set->mode); - mode_changed = true; + changed = true; } /* a) traverse passed in connector list and get encoders for them */ @@ -706,7 +650,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) } if (new_encoder != connector->encoder) { - mode_changed = true; + changed = true; connector->encoder = new_encoder; } } @@ -733,16 +677,16 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) new_crtc = set->crtc; } if (new_crtc != connector->encoder->crtc) { - mode_changed = true; + changed = true; connector->encoder->crtc = new_crtc; } } /* mode_set_base is not a required function */ - if (fb_changed && !crtc_funcs->mode_set_base) - mode_changed = true; + if (flip_or_move && !crtc_funcs->mode_set_base) + changed = true; - if (mode_changed) { + if (changed) { old_fb = set->crtc->fb; set->crtc->fb = set->fb; set->crtc->enabled = (set->mode != NULL); @@ -761,7 +705,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) set->crtc->desired_mode = set->mode; } drm_helper_disable_unused_functions(dev); - } else if (fb_changed) { + } else if (flip_or_move) { old_fb = set->crtc->fb; if (set->crtc->fb != set->fb) set->crtc->fb = set->fb; @@ -820,31 +764,10 @@ bool drm_helper_plugged_event(struct drm_device *dev) */ bool drm_helper_initial_config(struct drm_device *dev, bool can_grow) { - struct drm_connector *connector; - int count = 0; - - count = drm_helper_probe_connector_modes(dev, - dev->mode_config.max_width, - dev->mode_config.max_height); - - /* - * None of the available connectors had any modes, so add some - * and try to light them up anyway - */ - if (!count) { - DRM_ERROR("connectors have no modes, using standard modes\n"); - list_for_each_entry(connector, - &dev->mode_config.connector_list, - head) - drm_helper_add_std_modes(dev, connector); - } + int ret = false; - drm_setup_crtcs(dev); - - /* alert the driver fb layer */ - dev->mode_config.funcs->fb_changed(dev); - - return 0; + drm_helper_plugged_event(dev); + return ret; } EXPORT_SYMBOL(drm_helper_initial_config); diff --git a/trunk/drivers/gpu/drm/drm_irq.c b/trunk/drivers/gpu/drm/drm_irq.c index 477caa1b1e4b..724e505873cf 100644 --- a/trunk/drivers/gpu/drm/drm_irq.c +++ b/trunk/drivers/gpu/drm/drm_irq.c @@ -267,8 +267,7 @@ EXPORT_SYMBOL(drm_irq_install); */ int drm_irq_uninstall(struct drm_device * dev) { - unsigned long irqflags; - int irq_enabled, i; + int irq_enabled; if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) return -EINVAL; @@ -278,16 +277,6 @@ int drm_irq_uninstall(struct drm_device * dev) dev->irq_enabled = 0; mutex_unlock(&dev->struct_mutex); - /* - * Wake up any waiters so they don't hang. - */ - spin_lock_irqsave(&dev->vbl_lock, irqflags); - for (i = 0; i < dev->num_crtcs; i++) { - DRM_WAKEUP(&dev->vbl_queue[i]); - dev->vblank_enabled[i] = 0; - } - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); - if (!irq_enabled) return -EINVAL; @@ -663,9 +652,8 @@ int drm_wait_vblank(struct drm_device *dev, void *data, vblwait->request.sequence, crtc); dev->last_vblank_wait[crtc] = vblwait->request.sequence; DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, - (((drm_vblank_count(dev, crtc) - - vblwait->request.sequence) <= (1 << 23)) || - !dev->irq_enabled)); + ((drm_vblank_count(dev, crtc) + - vblwait->request.sequence) <= (1 << 23))); if (ret != -EINTR) { struct timeval now; diff --git a/trunk/drivers/gpu/drm/i915/i915_dma.c b/trunk/drivers/gpu/drm/i915/i915_dma.c index bbadf1c04142..62a4bf7b49df 100644 --- a/trunk/drivers/gpu/drm/i915/i915_dma.c +++ b/trunk/drivers/gpu/drm/i915/i915_dma.c @@ -177,14 +177,6 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) drm_i915_private_t *dev_priv = dev->dev_private; struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; - master_priv->sarea = drm_getsarea(dev); - if (master_priv->sarea) { - master_priv->sarea_priv = (drm_i915_sarea_t *) - ((u8 *)master_priv->sarea->handle + init->sarea_priv_offset); - } else { - DRM_DEBUG("sarea not found assuming DRI2 userspace\n"); - } - if (init->ring_size != 0) { if (dev_priv->ring.ring_obj != NULL) { i915_dma_cleanup(dev); @@ -1160,8 +1152,6 @@ int i915_driver_unload(struct drm_device *dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) { intel_modeset_cleanup(dev); - i915_gem_free_all_phys_object(dev); - mutex_lock(&dev->struct_mutex); i915_gem_cleanup_ringbuffer(dev); mutex_unlock(&dev->struct_mutex); diff --git a/trunk/drivers/gpu/drm/i915/i915_drv.h b/trunk/drivers/gpu/drm/i915/i915_drv.h index e13518252007..563de18063fd 100644 --- a/trunk/drivers/gpu/drm/i915/i915_drv.h +++ b/trunk/drivers/gpu/drm/i915/i915_drv.h @@ -72,18 +72,6 @@ enum pipe { #define WATCH_INACTIVE 0 #define WATCH_PWRITE 0 -#define I915_GEM_PHYS_CURSOR_0 1 -#define I915_GEM_PHYS_CURSOR_1 2 -#define I915_GEM_PHYS_OVERLAY_REGS 3 -#define I915_MAX_PHYS_OBJECT (I915_GEM_PHYS_OVERLAY_REGS) - -struct drm_i915_gem_phys_object { - int id; - struct page **page_list; - drm_dma_handle_t *handle; - struct drm_gem_object *cur_obj; -}; - typedef struct _drm_i915_ring_buffer { int tail_mask; unsigned long Size; @@ -370,9 +358,6 @@ typedef struct drm_i915_private { uint32_t bit_6_swizzle_x; /** Bit 6 swizzling required for Y tiling */ uint32_t bit_6_swizzle_y; - - /* storage for physical objects */ - struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; } mm; } drm_i915_private_t; @@ -451,9 +436,6 @@ struct drm_i915_gem_object { /** User space pin count and filp owning the pin */ uint32_t user_pin_count; struct drm_file *pin_filp; - - /** for phy allocated objects */ - struct drm_i915_gem_phys_object *phys_obj; }; /** @@ -616,11 +598,6 @@ int i915_gem_do_init(struct drm_device *dev, unsigned long start, int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write); -int i915_gem_attach_phys_object(struct drm_device *dev, - struct drm_gem_object *obj, int id); -void i915_gem_detach_phys_object(struct drm_device *dev, - struct drm_gem_object *obj); -void i915_gem_free_all_phys_object(struct drm_device *dev); /* i915_gem_tiling.c */ void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); diff --git a/trunk/drivers/gpu/drm/i915/i915_gem.c b/trunk/drivers/gpu/drm/i915/i915_gem.c index 96316fd47233..1384d6686555 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem.c @@ -55,9 +55,6 @@ static int i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, static void i915_gem_object_get_fence_reg(struct drm_gem_object *obj); static void i915_gem_clear_fence_reg(struct drm_gem_object *obj); static int i915_gem_evict_something(struct drm_device *dev); -static int i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj, - struct drm_i915_gem_pwrite *args, - struct drm_file *file_priv); int i915_gem_do_init(struct drm_device *dev, unsigned long start, unsigned long end) @@ -389,10 +386,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, * pread/pwrite currently are reading and writing from the CPU * perspective, requiring manual detiling by the client. */ - if (obj_priv->phys_obj) - ret = i915_gem_phys_pwrite(dev, obj, args, file_priv); - else if (obj_priv->tiling_mode == I915_TILING_NONE && - dev->gtt_total != 0) + if (obj_priv->tiling_mode == I915_TILING_NONE && + dev->gtt_total != 0) ret = i915_gem_gtt_pwrite(dev, obj, args, file_priv); else ret = i915_gem_shmem_pwrite(dev, obj, args, file_priv); @@ -2863,9 +2858,6 @@ void i915_gem_free_object(struct drm_gem_object *obj) while (obj_priv->pin_count > 0) i915_gem_object_unpin(obj); - if (obj_priv->phys_obj) - i915_gem_detach_phys_object(dev, obj); - i915_gem_object_unbind(obj); list = &obj->map_list; @@ -3301,180 +3293,3 @@ i915_gem_load(struct drm_device *dev) i915_gem_detect_bit_6_swizzle(dev); } - -/* - * Create a physically contiguous memory object for this object - * e.g. for cursor + overlay regs - */ -int i915_gem_init_phys_object(struct drm_device *dev, - int id, int size) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_i915_gem_phys_object *phys_obj; - int ret; - - if (dev_priv->mm.phys_objs[id - 1] || !size) - return 0; - - phys_obj = drm_calloc(1, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER); - if (!phys_obj) - return -ENOMEM; - - phys_obj->id = id; - - phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff); - if (!phys_obj->handle) { - ret = -ENOMEM; - goto kfree_obj; - } -#ifdef CONFIG_X86 - set_memory_wc((unsigned long)phys_obj->handle->vaddr, phys_obj->handle->size / PAGE_SIZE); -#endif - - dev_priv->mm.phys_objs[id - 1] = phys_obj; - - return 0; -kfree_obj: - drm_free(phys_obj, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER); - return ret; -} - -void i915_gem_free_phys_object(struct drm_device *dev, int id) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_i915_gem_phys_object *phys_obj; - - if (!dev_priv->mm.phys_objs[id - 1]) - return; - - phys_obj = dev_priv->mm.phys_objs[id - 1]; - if (phys_obj->cur_obj) { - i915_gem_detach_phys_object(dev, phys_obj->cur_obj); - } - -#ifdef CONFIG_X86 - set_memory_wb((unsigned long)phys_obj->handle->vaddr, phys_obj->handle->size / PAGE_SIZE); -#endif - drm_pci_free(dev, phys_obj->handle); - kfree(phys_obj); - dev_priv->mm.phys_objs[id - 1] = NULL; -} - -void i915_gem_free_all_phys_object(struct drm_device *dev) -{ - int i; - - for (i = 0; i < I915_MAX_PHYS_OBJECT; i++) - i915_gem_free_phys_object(dev, i); -} - -void i915_gem_detach_phys_object(struct drm_device *dev, - struct drm_gem_object *obj) -{ - struct drm_i915_gem_object *obj_priv; - int i; - int ret; - int page_count; - - obj_priv = obj->driver_private; - if (!obj_priv->phys_obj) - return; - - ret = i915_gem_object_get_page_list(obj); - if (ret) - goto out; - - page_count = obj->size / PAGE_SIZE; - - for (i = 0; i < page_count; i++) { - char *dst = kmap_atomic(obj_priv->page_list[i], KM_USER0); - char *src = obj_priv->phys_obj->handle->vaddr + (i * PAGE_SIZE); - - memcpy(dst, src, PAGE_SIZE); - kunmap_atomic(dst, KM_USER0); - } - drm_clflush_pages(obj_priv->page_list, page_count); - drm_agp_chipset_flush(dev); -out: - obj_priv->phys_obj->cur_obj = NULL; - obj_priv->phys_obj = NULL; -} - -int -i915_gem_attach_phys_object(struct drm_device *dev, - struct drm_gem_object *obj, int id) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_i915_gem_object *obj_priv; - int ret = 0; - int page_count; - int i; - - if (id > I915_MAX_PHYS_OBJECT) - return -EINVAL; - - obj_priv = obj->driver_private; - - if (obj_priv->phys_obj) { - if (obj_priv->phys_obj->id == id) - return 0; - i915_gem_detach_phys_object(dev, obj); - } - - - /* create a new object */ - if (!dev_priv->mm.phys_objs[id - 1]) { - ret = i915_gem_init_phys_object(dev, id, - obj->size); - if (ret) { - DRM_ERROR("failed to init phys object %d size: %d\n", id, obj->size); - goto out; - } - } - - /* bind to the object */ - obj_priv->phys_obj = dev_priv->mm.phys_objs[id - 1]; - obj_priv->phys_obj->cur_obj = obj; - - ret = i915_gem_object_get_page_list(obj); - if (ret) { - DRM_ERROR("failed to get page list\n"); - goto out; - } - - page_count = obj->size / PAGE_SIZE; - - for (i = 0; i < page_count; i++) { - char *src = kmap_atomic(obj_priv->page_list[i], KM_USER0); - char *dst = obj_priv->phys_obj->handle->vaddr + (i * PAGE_SIZE); - - memcpy(dst, src, PAGE_SIZE); - kunmap_atomic(src, KM_USER0); - } - - return 0; -out: - return ret; -} - -static int -i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj, - struct drm_i915_gem_pwrite *args, - struct drm_file *file_priv) -{ - struct drm_i915_gem_object *obj_priv = obj->driver_private; - void *obj_addr; - int ret; - char __user *user_data; - - user_data = (char __user *) (uintptr_t) args->data_ptr; - obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset; - - DRM_ERROR("obj_addr %p, %lld\n", obj_addr, args->size); - ret = copy_from_user(obj_addr, user_data, args->size); - if (ret) - return -EFAULT; - - drm_agp_chipset_flush(dev); - return 0; -} diff --git a/trunk/drivers/gpu/drm/i915/i915_irq.c b/trunk/drivers/gpu/drm/i915/i915_irq.c index 6290219de6c8..0cadafbef411 100644 --- a/trunk/drivers/gpu/drm/i915/i915_irq.c +++ b/trunk/drivers/gpu/drm/i915/i915_irq.c @@ -411,12 +411,6 @@ int i915_enable_vblank(struct drm_device *dev, int pipe) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; unsigned long irqflags; - int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; - u32 pipeconf; - - pipeconf = I915_READ(pipeconf_reg); - if (!(pipeconf & PIPEACONF_ENABLE)) - return -EINVAL; spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); if (IS_I965G(dev)) diff --git a/trunk/drivers/gpu/drm/i915/intel_display.c b/trunk/drivers/gpu/drm/i915/intel_display.c index 31c3732b7a69..8ccb9c3ab868 100644 --- a/trunk/drivers/gpu/drm/i915/intel_display.c +++ b/trunk/drivers/gpu/drm/i915/intel_display.c @@ -401,8 +401,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, I915_WRITE(dspstride, crtc->fb->pitch); dspcntr = I915_READ(dspcntr_reg); - /* Mask out pixel format bits in case we change it */ - dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; switch (crtc->fb->bits_per_pixel) { case 8: dspcntr |= DISPPLANE_8BPP; @@ -1016,25 +1014,21 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, if (bo->size < width * height * 4) { DRM_ERROR("buffer is to small\n"); - ret = -ENOMEM; - goto fail; + drm_gem_object_unreference(bo); + return -ENOMEM; } - /* we only need to pin inside GTT if cursor is non-phy */ - if (!dev_priv->cursor_needs_physical) { - ret = i915_gem_object_pin(bo, PAGE_SIZE); - if (ret) { - DRM_ERROR("failed to pin cursor bo\n"); - goto fail; - } - addr = obj_priv->gtt_offset; + if (dev_priv->cursor_needs_physical) { + addr = dev->agp->base + obj_priv->gtt_offset; } else { - ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1); - if (ret) { - DRM_ERROR("failed to attach phys object\n"); - goto fail; - } - addr = obj_priv->phys_obj->handle->busaddr; + addr = obj_priv->gtt_offset; + } + + ret = i915_gem_object_pin(bo, PAGE_SIZE); + if (ret) { + DRM_ERROR("failed to pin cursor bo\n"); + drm_gem_object_unreference(bo); + return ret; } temp = 0; @@ -1047,25 +1041,14 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, I915_WRITE(base, addr); if (intel_crtc->cursor_bo) { - if (dev_priv->cursor_needs_physical) { - if (intel_crtc->cursor_bo != bo) - i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo); - } else - i915_gem_object_unpin(intel_crtc->cursor_bo); - mutex_lock(&dev->struct_mutex); + i915_gem_object_unpin(intel_crtc->cursor_bo); drm_gem_object_unreference(intel_crtc->cursor_bo); - mutex_unlock(&dev->struct_mutex); } intel_crtc->cursor_addr = addr; intel_crtc->cursor_bo = bo; return 0; -fail: - mutex_lock(&dev->struct_mutex); - drm_gem_object_unreference(bo); - mutex_unlock(&dev->struct_mutex); - return ret; } static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) diff --git a/trunk/drivers/gpu/drm/i915/intel_lvds.c b/trunk/drivers/gpu/drm/i915/intel_lvds.c index 2fafdcc108fe..ccecfaf6307b 100644 --- a/trunk/drivers/gpu/drm/i915/intel_lvds.c +++ b/trunk/drivers/gpu/drm/i915/intel_lvds.c @@ -456,13 +456,6 @@ void intel_lvds_init(struct drm_device *dev) dev_priv->panel_fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt_mode); mutex_unlock(&dev->mode_config.mutex); - if (dev_priv->panel_fixed_mode) { - dev_priv->panel_fixed_mode->type |= - DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(connector, - dev_priv->panel_fixed_mode); - goto out; - } } /* diff --git a/trunk/drivers/hwmon/Kconfig b/trunk/drivers/hwmon/Kconfig index b84bf066879b..4b33bc82cc24 100644 --- a/trunk/drivers/hwmon/Kconfig +++ b/trunk/drivers/hwmon/Kconfig @@ -189,16 +189,6 @@ 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 @@ -871,8 +861,6 @@ 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 @@ -884,16 +872,10 @@ 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. 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 modules. If so, the core module - will be called lis3lv02d and a specific module for HP laptops will be - called hp_accel. + the laptop to act as a pinball machine-esque joystick. - Say Y here if you have an applicable laptop and want to experience - the awesome power of lis3lv02d. + This driver can also be built as a module. If so, the module + will be called lis3lv02d. config SENSORS_APPLESMC tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" diff --git a/trunk/drivers/hwmon/Makefile b/trunk/drivers/hwmon/Makefile index 2e80f37f39eb..19cb1ace3eb4 100644 --- a/trunk/drivers/hwmon/Makefile +++ b/trunk/drivers/hwmon/Makefile @@ -28,8 +28,6 @@ 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 diff --git a/trunk/drivers/hwmon/abituguru3.c b/trunk/drivers/hwmon/abituguru3.c index e52b38806d03..70bb854086df 100644 --- a/trunk/drivers/hwmon/abituguru3.c +++ b/trunk/drivers/hwmon/abituguru3.c @@ -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", { + { 0x0011, "AT8 32X(ATI RD580-ULI M1575)", { { "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", { + { 0x0016, "AW9D-MAX (Intel i975-ICH7)", { { "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, "IN9 32X MAX", { + { 0x0019, NULL /* Unknown, need DMI string */, { { "CPU Core", 7, 0, 10, 1, 0 }, { "DDR2", 13, 0, 20, 1, 0 }, { "DDR2 VTT", 14, 0, 10, 1, 0 }, @@ -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", { + { 0x001A, "IP35 Pro(Intel P35-ICH9R)", { { "CPU Core", 0, 0, 10, 1, 0 }, { "DDR2", 1, 0, 20, 1, 0 }, { "DDR2 VTT", 2, 0, 10, 1, 0 }, @@ -1128,7 +1128,6 @@ 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/")) @@ -1138,20 +1137,9 @@ 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 || strlen(dmi_name) != sublen) - continue; - if (!strncasecmp(board_name, dmi_name, sublen)) + if (dmi_name && !strcmp(dmi_name, board_name)) break; } @@ -1165,7 +1153,7 @@ static int __init abituguru3_dmi_detect(void) static inline int abituguru3_dmi_detect(void) { - return 1; + return -ENODEV; } #endif /* CONFIG_DMI */ diff --git a/trunk/drivers/hwmon/adt7475.c b/trunk/drivers/hwmon/adt7475.c deleted file mode 100644 index d39877a7da63..000000000000 --- a/trunk/drivers/hwmon/adt7475.c +++ /dev/null @@ -1,1221 +0,0 @@ -/* - * adt7475 - Thermal sensor driver for the ADT7475 chip and derivatives - * Copyright (C) 2007-2008, Advanced Micro Devices, Inc. - * Copyright (C) 2008 Jordan Crouse - * Copyright (C) 2008 Hans de Goede - - * 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 -#include -#include -#include -#include -#include -#include - -/* 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); diff --git a/trunk/drivers/hwmon/applesmc.c b/trunk/drivers/hwmon/applesmc.c index e30186236588..dca47a591baf 100644 --- a/trunk/drivers/hwmon/applesmc.c +++ b/trunk/drivers/hwmon/applesmc.c @@ -590,11 +590,6 @@ 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; diff --git a/trunk/drivers/hwmon/hp_accel.c b/trunk/drivers/hwmon/hp_accel.c index 03705240000f..bf8d40580577 100644 --- a/trunk/drivers/hwmon/hp_accel.c +++ b/trunk/drivers/hwmon/hp_accel.c @@ -3,7 +3,7 @@ * * Copyright (C) 2007-2008 Yan Burman * Copyright (C) 2008 Eric Piel - * Copyright (C) 2008-2009 Pavel Machek + * 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 @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include "lis3lv02d.h" @@ -44,36 +43,6 @@ #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[] = { @@ -185,33 +154,10 @@ 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; @@ -237,19 +183,7 @@ static int lis3lv02d_add(struct acpi_device *device) adev.ac = lis3lv02d_axis_normal; } - 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; + return lis3lv02d_init_device(&adev); } static int lis3lv02d_remove(struct acpi_device *device, int type) @@ -260,9 +194,6 @@ 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(); } @@ -325,7 +256,7 @@ static void __exit lis3lv02d_exit_module(void) acpi_bus_unregister_driver(&lis3lv02d_driver); } -MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED."); +MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS"); MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/hwmon/k8temp.c b/trunk/drivers/hwmon/k8temp.c index 1fe995111841..bd2bde0ef95e 100644 --- a/trunk/drivers/hwmon/k8temp.c +++ b/trunk/drivers/hwmon/k8temp.c @@ -31,7 +31,6 @@ #include #include #include -#include #define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000) #define REG_TEMP 0xe4 @@ -48,8 +47,6 @@ 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) @@ -117,15 +114,10 @@ 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); - 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); + return sprintf(buf, "%d\n", + TEMP_FROM_REG(data->temp[core][place])); } /* core, place */ @@ -149,47 +141,18 @@ 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); - if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) { - err = -ENOMEM; + /* this feature should be available since SH-C0 core */ + if ((cpuid == 0xf40) || (cpuid == 0xf50) || (cpuid == 0xf51)) { + err = -ENODEV; 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; + if (!(data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; } pci_read_config_byte(pdev, REG_TEMP, &scfg); diff --git a/trunk/drivers/i2c/chips/Kconfig b/trunk/drivers/i2c/chips/Kconfig index b9bef04b7be4..59c3d23f5bdc 100644 --- a/trunk/drivers/i2c/chips/Kconfig +++ b/trunk/drivers/i2c/chips/Kconfig @@ -139,4 +139,15 @@ 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 diff --git a/trunk/drivers/i2c/chips/Makefile b/trunk/drivers/i2c/chips/Makefile index 00fcb5193ac2..83accaaf8164 100644 --- a/trunk/drivers/i2c/chips/Makefile +++ b/trunk/drivers/i2c/chips/Makefile @@ -19,6 +19,7 @@ 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 diff --git a/trunk/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/trunk/drivers/i2c/chips/mcu_mpc8349emitx.c similarity index 100% rename from trunk/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c rename to trunk/drivers/i2c/chips/mcu_mpc8349emitx.c diff --git a/trunk/drivers/ide/Kconfig b/trunk/drivers/ide/Kconfig index b1c6f68d98ce..3f9503867e6b 100644 --- a/trunk/drivers/ide/Kconfig +++ b/trunk/drivers/ide/Kconfig @@ -701,6 +701,11 @@ 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 diff --git a/trunk/drivers/ide/ide-disk.c b/trunk/drivers/ide/ide-disk.c index 806760d24cef..4088a622873e 100644 --- a/trunk/drivers/ide/ide-disk.c +++ b/trunk/drivers/ide/ide-disk.c @@ -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)) + if (ata_id_is_ssd(id) || ata_id_is_cfa(id)) queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q); /* calculate drive capacity, and select LBA if possible */ diff --git a/trunk/drivers/ide/ide-iops.c b/trunk/drivers/ide/ide-iops.c index 753b92ebe0ae..e728cfe7273f 100644 --- a/trunk/drivers/ide/ide-iops.c +++ b/trunk/drivers/ide/ide-iops.c @@ -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_save_flags(flags); + local_irq_save(flags); local_irq_enable_in_hardirq(); timeout += jiffies; while ((stat = tp_ops->read_status(hwif)) & ATA_BUSY) { diff --git a/trunk/drivers/ide/ide-pm.c b/trunk/drivers/ide/ide-pm.c index 60538d9c84ee..4b3bf6a06b70 100644 --- a/trunk/drivers/ide/ide-pm.c +++ b/trunk/drivers/ide/ide-pm.c @@ -186,10 +186,12 @@ 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; @@ -217,8 +219,6 @@ 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,9 +231,5 @@ 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); } } diff --git a/trunk/drivers/ide/ide-probe.c b/trunk/drivers/ide/ide-probe.c index 312127ea443a..0ccbb4459fb9 100644 --- a/trunk/drivers/ide/ide-probe.c +++ b/trunk/drivers/ide/ide-probe.c @@ -796,7 +796,7 @@ static int ide_probe_port(ide_hwif_t *hwif) if (irqd) disable_irq(hwif->irq); - local_save_flags(flags); + local_irq_save(flags); local_irq_enable_in_hardirq(); if (ide_port_wait_ready(hwif) == -EBUSY) diff --git a/trunk/drivers/ide/it821x.c b/trunk/drivers/ide/it821x.c index e1c4f5437396..0be27ac1f077 100644 --- a/trunk/drivers/ide/it821x.c +++ b/trunk/drivers/ide/it821x.c @@ -68,8 +68,6 @@ #define DRV_NAME "it821x" -#define QUIRK_VORTEX86 1 - struct it821x_dev { unsigned int smart:1, /* Are we in smart raid mode */ @@ -81,7 +79,6 @@ 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 @@ -560,7 +557,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif) * this is necessary. */ - if (dev->revision == 0x10) { + pci_read_config_byte(dev, 0x08, &conf); + if (conf == 0x10) { idev->timing10 = 1; hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; if (idev->smart == 0) @@ -579,12 +577,6 @@ 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) @@ -657,8 +649,6 @@ 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); @@ -678,7 +668,6 @@ 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, }, }; diff --git a/trunk/drivers/ide/sl82c105.c b/trunk/drivers/ide/sl82c105.c index 6297956507c0..48cc748c5043 100644 --- a/trunk/drivers/ide/sl82c105.c +++ b/trunk/drivers/ide/sl82c105.c @@ -310,6 +310,10 @@ 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, diff --git a/trunk/drivers/ide/tx4938ide.c b/trunk/drivers/ide/tx4938ide.c index d9095345f7ca..b4ef218072cd 100644 --- a/trunk/drivers/ide/tx4938ide.c +++ b/trunk/drivers/ide/tx4938ide.c @@ -202,6 +202,7 @@ 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, diff --git a/trunk/drivers/ide/via82cxxx.c b/trunk/drivers/ide/via82cxxx.c index 703c3eeb20a8..fecc0e03c3fc 100644 --- a/trunk/drivers/ide/via82cxxx.c +++ b/trunk/drivers/ide/via82cxxx.c @@ -432,6 +432,8 @@ 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; } diff --git a/trunk/drivers/infiniband/hw/ehca/ehca_main.c b/trunk/drivers/infiniband/hw/ehca/ehca_main.c index c7b8a506af65..3b77b674cbf6 100644 --- a/trunk/drivers/infiniband/hw/ehca/ehca_main.c +++ b/trunk/drivers/infiniband/hw/ehca/ehca_main.c @@ -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; - unsigned long flags; + u64 flags; spin_lock_irqsave(&eq->spinlock, flags); q_ofs = eq->ipz_queue.current_q_offset; spin_unlock_irqrestore(&eq->spinlock, flags); diff --git a/trunk/drivers/infiniband/hw/mlx4/main.c b/trunk/drivers/infiniband/hw/mlx4/main.c index 61588bd273bd..dcefe1fceb5c 100644 --- a/trunk/drivers/infiniband/hw/mlx4/main.c +++ b/trunk/drivers/infiniband/hw/mlx4/main.c @@ -543,21 +543,14 @@ 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"); @@ -581,7 +574,9 @@ 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 = num_ports; + ibdev->num_ports = 0; + mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) + ibdev->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; diff --git a/trunk/drivers/infiniband/hw/nes/nes_cm.c b/trunk/drivers/infiniband/hw/nes/nes_cm.c index a01b4488208b..6ba57e91d7ab 100644 --- a/trunk/drivers/infiniband/hw/nes/nes_cm.c +++ b/trunk/drivers/infiniband/hw/nes/nes_cm.c @@ -778,13 +778,12 @@ 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", - &tmp_addr, loc_port, cm_core, hte); + &loc_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); @@ -817,7 +816,6 @@ 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); @@ -835,7 +833,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", - &tmp_addr, dst_port); + &dst_addr, dst_port); /* no listener */ return NULL; @@ -2061,7 +2059,6 @@ 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; @@ -2077,11 +2074,8 @@ 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", - &tmp_daddr, tcph->dest, &tmp_saddr, tcph->source); + &iph->daddr, tcph->dest, &iph->saddr, tcph->source); do { cm_node = find_node(cm_core, diff --git a/trunk/drivers/infiniband/hw/nes/nes_utils.c b/trunk/drivers/infiniband/hw/nes/nes_utils.c index 6f3bc1b6bf22..aa9b7348c728 100644 --- a/trunk/drivers/infiniband/hw/nes/nes_utils.c +++ b/trunk/drivers/infiniband/hw/nes/nes_utils.c @@ -655,7 +655,6 @@ 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) @@ -683,9 +682,8 @@ 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", - &tmp_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); + &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete"); return -1; } diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c index dce0443f9d69..19e06bc38b39 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -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 (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) + 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. + */ 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)) { diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 59d02e0b8df1..a2eb3b9789eb 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -529,9 +529,6 @@ 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"); diff --git a/trunk/drivers/infiniband/ulp/iser/Kconfig b/trunk/drivers/infiniband/ulp/iser/Kconfig index b411c51842da..77dedba829e6 100644 --- a/trunk/drivers/infiniband/ulp/iser/Kconfig +++ b/trunk/drivers/infiniband/ulp/iser/Kconfig @@ -1,6 +1,6 @@ config INFINIBAND_ISER tristate "iSCSI Extensions for RDMA (iSER)" - depends on SCSI && INET && INFINIBAND_ADDR_TRANS + depends on SCSI && INET select SCSI_ISCSI_ATTRS ---help--- Support for the iSCSI Extensions for RDMA (iSER) Protocol diff --git a/trunk/drivers/isdn/i4l/isdn_net.c b/trunk/drivers/isdn/i4l/isdn_net.c index cb8943da4f12..7c5f97033b9f 100644 --- a/trunk/drivers/isdn/i4l/isdn_net.c +++ b/trunk/drivers/isdn/i4l/isdn_net.c @@ -292,9 +292,7 @@ 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; - if (lp->isdn_device != -1 && lp->isdn_channel != -1) - isdn_free_channel(lp->isdn_device, lp->isdn_channel, - ISDN_USAGE_NET); + 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; @@ -2515,6 +2513,7 @@ 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, @@ -2529,8 +2528,12 @@ 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; diff --git a/trunk/drivers/leds/Kconfig b/trunk/drivers/leds/Kconfig index 742713611bc5..a4a1ae214630 100644 --- a/trunk/drivers/leds/Kconfig +++ b/trunk/drivers/leds/Kconfig @@ -119,6 +119,13 @@ 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 diff --git a/trunk/drivers/leds/Makefile b/trunk/drivers/leds/Makefile index 9d76f0f160a4..bc247cb02e82 100644 --- a/trunk/drivers/leds/Makefile +++ b/trunk/drivers/leds/Makefile @@ -23,6 +23,7 @@ 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/trunk/drivers/leds/leds-hp-disk.c b/trunk/drivers/leds/leds-hp-disk.c new file mode 100644 index 000000000000..d786adc8c5e3 --- /dev/null +++ b/trunk/drivers/leds/leds-hp-disk.c @@ -0,0 +1,137 @@ +/* + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 "); +MODULE_LICENSE("GPL"); + +module_init(hpled_init_module); +module_exit(hpled_exit_module); diff --git a/trunk/drivers/message/fusion/lsi/mpi.h b/trunk/drivers/message/fusion/lsi/mpi.h index 11c0f461320e..10b6ef758725 100644 --- a/trunk/drivers/message/fusion/lsi/mpi.h +++ b/trunk/drivers/message/fusion/lsi/mpi.h @@ -6,7 +6,7 @@ * Title: MPI Message independent structures and definitions * Creation Date: July 27, 2000 * - * mpi.h Version: 01.05.16 + * mpi.h Version: 01.05.13 * * Version History * --------------- @@ -79,9 +79,6 @@ * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT. * 05-24-07 01.05.13 Bumped MPI_HEADER_VERSION_UNIT. - * 08-07-07 01.05.14 Bumped MPI_HEADER_VERSION_UNIT. - * 01-15-08 01.05.15 Bumped MPI_HEADER_VERSION_UNIT. - * 03-28-08 01.05.16 Bumped MPI_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- */ @@ -112,7 +109,7 @@ /* Note: The major versions of 0xe0 through 0xff are reserved */ /* versioning for this MPI header set */ -#define MPI_HEADER_VERSION_UNIT (0x13) +#define MPI_HEADER_VERSION_UNIT (0x10) #define MPI_HEADER_VERSION_DEV (0x00) #define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI_HEADER_VERSION_UNIT_SHIFT (8) diff --git a/trunk/drivers/message/fusion/lsi/mpi_cnfg.h b/trunk/drivers/message/fusion/lsi/mpi_cnfg.h index 013c7d881948..b2db3330c591 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_cnfg.h +++ b/trunk/drivers/message/fusion/lsi/mpi_cnfg.h @@ -6,7 +6,7 @@ * Title: MPI Config message, structures, and Pages * Creation Date: July 27, 2000 * - * mpi_cnfg.h Version: 01.05.18 + * mpi_cnfg.h Version: 01.05.15 * * Version History * --------------- @@ -308,20 +308,6 @@ * Expander Page 0 Flags field. * Fixed define for * MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED. - * 08-07-07 01.05.16 Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT - * define. - * Added BIOS Page 4 structure. - * Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID - * Physcial Disk Page 1. - * 01-15-07 01.05.17 Added additional bit defines for ExtFlags field of - * Manufacturing Page 4. - * Added Solid State Drives Supported bit to IOC Page 6 - * Capabilities Flags. - * Added new value for AccessStatus field of SAS Device - * Page 0 (_SATA_NEEDS_INITIALIZATION). - * 03-28-08 01.05.18 Defined new bits in Manufacturing Page 4 ExtFlags field - * to control coercion size and the mixing of SAS and SATA - * SSD drives. * -------------------------------------------------------------------------- */ @@ -700,14 +686,6 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4 #define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) /* defines for the ExtFlags field */ -#define MPI_MANPAGE4_EXTFLAGS_MASK_COERCION_SIZE (0x0180) -#define MPI_MANPAGE4_EXTFLAGS_SHIFT_COERCION_SIZE (7) -#define MPI_MANPAGE4_EXTFLAGS_1GB_COERCION_SIZE (0) -#define MPI_MANPAGE4_EXTFLAGS_128MB_COERCION_SIZE (1) - -#define MPI_MANPAGE4_EXTFLAGS_NO_MIX_SSD_SAS_SATA (0x0040) -#define MPI_MANPAGE4_EXTFLAGS_MIX_SSD_AND_NON_SSD (0x0020) -#define MPI_MANPAGE4_EXTFLAGS_DUAL_PORT_SUPPORT (0x0010) #define MPI_MANPAGE4_EXTFLAGS_HIDE_NON_IR_METADATA (0x0008) #define MPI_MANPAGE4_EXTFLAGS_SAS_CACHE_DISABLE (0x0004) #define MPI_MANPAGE4_EXTFLAGS_SATA_CACHE_DISABLE (0x0002) @@ -1181,8 +1159,6 @@ typedef struct _CONFIG_PAGE_IOC_6 /* IOC Page 6 Capabilities Flags */ -#define MPI_IOCPAGE6_CAP_FLAGS_SSD_SUPPORT (0x00000020) -#define MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT (0x00000010) #define MPI_IOCPAGE6_CAP_FLAGS_DISABLE_SMART_POLLING (0x00000008) #define MPI_IOCPAGE6_CAP_FLAGS_MASK_METADATA_SIZE (0x00000006) @@ -1452,15 +1428,6 @@ typedef struct _CONFIG_PAGE_BIOS_2 #define MPI_BIOSPAGE2_FORM_SAS_WWN (0x05) #define MPI_BIOSPAGE2_FORM_ENCLOSURE_SLOT (0x06) -typedef struct _CONFIG_PAGE_BIOS_4 -{ - CONFIG_PAGE_HEADER Header; /* 00h */ - U64 ReassignmentBaseWWID; /* 04h */ -} CONFIG_PAGE_BIOS_4, MPI_POINTER PTR_CONFIG_PAGE_BIOS_4, - BIOSPage4_t, MPI_POINTER pBIOSPage4_t; - -#define MPI_BIOSPAGE4_PAGEVERSION (0x00) - /**************************************************************************** * SCSI Port Config Pages @@ -2452,15 +2419,6 @@ typedef struct _RAID_PHYS_DISK1_PATH #define MPI_RAID_PHYSDISK1_FLAG_BROKEN (0x0002) #define MPI_RAID_PHYSDISK1_FLAG_INVALID (0x0001) - -/* - * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhysDiskPaths at runtime. - */ -#ifndef MPI_RAID_PHYS_DISK1_PATH_MAX -#define MPI_RAID_PHYS_DISK1_PATH_MAX (1) -#endif - typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1 { CONFIG_PAGE_HEADER Header; /* 00h */ @@ -2468,7 +2426,7 @@ typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1 U8 PhysDiskNum; /* 05h */ U16 Reserved2; /* 06h */ U32 Reserved1; /* 08h */ - RAID_PHYS_DISK1_PATH Path[MPI_RAID_PHYS_DISK1_PATH_MAX];/* 0Ch */ + RAID_PHYS_DISK1_PATH Path[1]; /* 0Ch */ } CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1, RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t; @@ -2886,7 +2844,6 @@ typedef struct _CONFIG_PAGE_SAS_DEVICE_0 #define MPI_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED (0x01) #define MPI_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED (0x02) #define MPI_SAS_DEVICE0_ASTATUS_SATA_AFFILIATION_CONFLICT (0x03) -#define MPI_SAS_DEVICE0_ASTATUS_SATA_NEEDS_INITIALIZATION (0x04) /* specific values for SATA Init failures */ #define MPI_SAS_DEVICE0_ASTATUS_SIF_UNKNOWN (0x10) #define MPI_SAS_DEVICE0_ASTATUS_SIF_AFFILIATION_CONFLICT (0x11) diff --git a/trunk/drivers/message/fusion/lsi/mpi_fc.h b/trunk/drivers/message/fusion/lsi/mpi_fc.h index 7d663ce76f8c..627acfbb8623 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_fc.h +++ b/trunk/drivers/message/fusion/lsi/mpi_fc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2004 LSI Corporation. * * * Name: mpi_fc.h diff --git a/trunk/drivers/message/fusion/lsi/mpi_history.txt b/trunk/drivers/message/fusion/lsi/mpi_history.txt index 693e4b511354..3f15fcfe4a2e 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_history.txt +++ b/trunk/drivers/message/fusion/lsi/mpi_history.txt @@ -3,28 +3,28 @@ MPI Header File Change History ============================== - Copyright (c) 2000-2008 LSI Corporation. + Copyright (c) 2000-2007 LSI Corporation. --------------------------------------- - Header Set Release Version: 01.05.19 - Header Set Release Date: 03-28-08 + Header Set Release Version: 01.05.16 + Header Set Release Date: 05-24-07 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi.h 01.05.16 01.05.15 - mpi_ioc.h 01.05.16 01.05.15 - mpi_cnfg.h 01.05.18 01.05.17 + mpi.h 01.05.13 01.05.12 + mpi_ioc.h 01.05.14 01.05.13 + mpi_cnfg.h 01.05.15 01.05.14 mpi_init.h 01.05.09 01.05.09 mpi_targ.h 01.05.06 01.05.06 mpi_fc.h 01.05.01 01.05.01 mpi_lan.h 01.05.01 01.05.01 - mpi_raid.h 01.05.05 01.05.05 + mpi_raid.h 01.05.03 01.05.03 mpi_tool.h 01.05.03 01.05.03 mpi_inb.h 01.05.01 01.05.01 - mpi_sas.h 01.05.05 01.05.05 + mpi_sas.h 01.05.04 01.05.04 mpi_type.h 01.05.02 01.05.02 - mpi_history.txt 01.05.19 01.05.18 + mpi_history.txt 01.05.14 01.05.14 * Date Version Description @@ -96,9 +96,6 @@ mpi.h * 03-27-06 01.05.11 Bumped MPI_HEADER_VERSION_UNIT. * 10-11-06 01.05.12 Bumped MPI_HEADER_VERSION_UNIT. * 05-24-07 01.05.13 Bumped MPI_HEADER_VERSION_UNIT. - * 08-07-07 01.05.14 Bumped MPI_HEADER_VERSION_UNIT. - * 01-15-08 01.05.15 Bumped MPI_HEADER_VERSION_UNIT. - * 03-28-08 01.05.16 Bumped MPI_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- mpi_ioc.h @@ -130,7 +127,7 @@ mpi_ioc.h * 08-08-01 01.02.01 Original release for v1.2 work. * New format for FWVersion and ProductId in * MSG_IOC_FACTS_REPLY and MPI_FW_HEADER. - * 08-31-01 01.02.02 Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and + * 08-31-01 01.02.02 Added event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and * related structure and defines. * Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED. * Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE. @@ -190,7 +187,7 @@ mpi_ioc.h * 10-11-06 01.05.12 Added MPI_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED. * Added MaxInitiators field to PortFacts reply. * Added SAS Device Status Change ReasonCode for - * asynchronous notificaiton. + * asynchronous notification. * Added MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE and event * data structure. * Added new ImageType values for FWDownload and FWUpload @@ -202,16 +199,6 @@ mpi_ioc.h * added _MULTI_PORT_DOMAIN. * 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request. * Added Common Boot Block type to FWUpload Request. - * 08-07-07 01.05.15 Added MPI_EVENT_SAS_INIT_RC_REMOVED define. - * Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and - * MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data. - * Added SASAddress field to SAS Initiator Device Table - * Overflow event data structure. - * 03-28-08 01.05.16 Added two new ReasonCode values to SAS Device Status - * Change Event data to indicate completion of internally - * generated task management. - * Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define. - * Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define. * -------------------------------------------------------------------------- mpi_cnfg.h @@ -226,7 +213,7 @@ mpi_cnfg.h * Added _RESPONSE_ID_MASK definition to SCSI_PORT_1 * page and updated the page version. * Added Information field and _INFO_PARAMS_NEGOTIATED - * definitionto SCSI_DEVICE_0 page. + * definition to SCSI_DEVICE_0 page. * 06-22-00 01.00.03 Removed batch controls from LAN_0 page and updated the * page version. * Added BucketsRemaining to LAN_1 page, redefined the @@ -509,20 +496,6 @@ mpi_cnfg.h * Expander Page 0 Flags field. * Fixed define for * MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY_DISABLED. - * 08-07-07 01.05.16 Added MPI_IOCPAGE6_CAP_FLAGS_MULTIPORT_DRIVE_SUPPORT - * define. - * Added BIOS Page 4 structure. - * Added MPI_RAID_PHYS_DISK1_PATH_MAX define for RAID - * Physcial Disk Page 1. - * 01-15-07 01.05.17 Added additional bit defines for ExtFlags field of - * Manufacturing Page 4. - * Added Solid State Drives Supported bit to IOC Page 6 - * Capabilities Flags. - * Added new value for AccessStatus field of SAS Device - * Page 0 (_SATA_NEEDS_INITIALIZATION). - * 03-28-08 01.05.18 Defined new bits in Manufacturing Page 4 ExtFlags field - * to control coercion size and the mixing of SAS and SATA - * SSD drives. * -------------------------------------------------------------------------- mpi_init.h @@ -688,9 +661,6 @@ mpi_raid.h * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. * 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and * associated defines. - * 08-07-07 01.05.04 Added Disable Full Rebuild bit to the ActionDataWord - * for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME. - * 01-15-08 01.05.05 Added define for MPI_RAID_ACTION_SET_VOLUME_NAME. * -------------------------------------------------------------------------- mpi_tool.h @@ -724,10 +694,6 @@ mpi_sas.h * reply. * 10-11-06 01.05.04 Fixed the name of a define for Operation field of SAS IO * Unit Control request. - * 01-15-08 01.05.05 Added support for MPI_SAS_OP_SET_IOC_PARAMETER, - * including adding IOCParameter and IOCParameter value - * fields to SAS IO Unit Control Request. - * Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define. * -------------------------------------------------------------------------- mpi_type.h @@ -743,20 +709,20 @@ mpi_type.h mpi_history.txt Parts list history -Filename 01.05.19 01.05.18 01.05.17 01.05.16 01.05.15 ----------- -------- -------- -------- -------- -------- -mpi.h 01.05.16 01.05.15 01.05.14 01.05.13 01.05.12 -mpi_ioc.h 01.05.16 01.05.15 01.05.15 01.05.14 01.05.13 -mpi_cnfg.h 01.05.18 01.05.17 01.05.16 01.05.15 01.05.14 -mpi_init.h 01.05.09 01.05.09 01.05.09 01.05.09 01.05.09 -mpi_targ.h 01.05.06 01.05.06 01.05.06 01.05.06 01.05.06 -mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_raid.h 01.05.05 01.05.05 01.05.04 01.05.03 01.05.03 -mpi_tool.h 01.05.03 01.05.03 01.05.03 01.05.03 01.05.03 -mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 -mpi_sas.h 01.05.05 01.05.05 01.05.04 01.05.04 01.05.04 -mpi_type.h 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02 +Filename 01.05.15 01.05.15 +---------- -------- -------- +mpi.h 01.05.12 01.05.13 +mpi_ioc.h 01.05.13 01.05.14 +mpi_cnfg.h 01.05.14 01.05.15 +mpi_init.h 01.05.09 01.05.09 +mpi_targ.h 01.05.06 01.05.06 +mpi_fc.h 01.05.01 01.05.01 +mpi_lan.h 01.05.01 01.05.01 +mpi_raid.h 01.05.03 01.05.03 +mpi_tool.h 01.05.03 01.05.03 +mpi_inb.h 01.05.01 01.05.01 +mpi_sas.h 01.05.04 01.05.04 +mpi_type.h 01.05.02 01.05.02 Filename 01.05.14 01.05.13 01.05.12 01.05.11 01.05.10 01.05.09 ---------- -------- -------- -------- -------- -------- -------- diff --git a/trunk/drivers/message/fusion/lsi/mpi_init.h b/trunk/drivers/message/fusion/lsi/mpi_init.h index 4295d062caa7..a9e3693601a7 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_init.h +++ b/trunk/drivers/message/fusion/lsi/mpi_init.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2007 LSI Corporation. * * * Name: mpi_init.h diff --git a/trunk/drivers/message/fusion/lsi/mpi_ioc.h b/trunk/drivers/message/fusion/lsi/mpi_ioc.h index 8faa4fab7b89..5cbb6bd048e1 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_ioc.h +++ b/trunk/drivers/message/fusion/lsi/mpi_ioc.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2007 LSI Corporation. * * * Name: mpi_ioc.h * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.16 + * mpi_ioc.h Version: 01.05.14 * * Version History * --------------- @@ -113,16 +113,6 @@ * added _MULTI_PORT_DOMAIN. * 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request. * Added Common Boot Block type to FWUpload Request. - * 08-07-07 01.05.15 Added MPI_EVENT_SAS_INIT_RC_REMOVED define. - * Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and - * MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data. - * Added SASAddress field to SAS Initiator Device Table - * Overflow event data structure. - * 03-28-08 01.05.16 Added two new ReasonCode values to SAS Device Status - * Change Event data to indicate completion of internally - * generated task management. - * Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define. - * Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define. * -------------------------------------------------------------------------- */ @@ -622,8 +612,6 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE #define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) #define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) #define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) -#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET (0x0E) -#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL (0x0F) /* SCSI Event data for Queue Full event */ @@ -720,8 +708,6 @@ typedef struct _MPI_EVENT_DATA_IR2 #define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) -#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED (0x08) -#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED (0x09) /* defines for logical disk states */ #define MPI_LD_STATE_OPTIMAL (0x00) @@ -881,7 +867,6 @@ typedef struct _EVENT_DATA_DISCOVERY_ERROR #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN (0x00002000) -#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE (0x00004000) /* SAS SMP Error Event data */ @@ -917,8 +902,6 @@ typedef struct _EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE /* defines for the ReasonCode field of the SAS Initiator Device Status Change event */ #define MPI_EVENT_SAS_INIT_RC_ADDED (0x01) -#define MPI_EVENT_SAS_INIT_RC_REMOVED (0x02) -#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE (0x03) /* SAS Initiator Device Table Overflow Event data */ @@ -927,7 +910,6 @@ typedef struct _EVENT_DATA_SAS_INIT_TABLE_OVERFLOW U8 MaxInit; /* 00h */ U8 CurrentInit; /* 01h */ U16 Reserved1; /* 02h */ - U64 SASAddress; /* 04h */ } EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MpiEventDataSasInitTableOverflow_t, diff --git a/trunk/drivers/message/fusion/lsi/mpi_lan.h b/trunk/drivers/message/fusion/lsi/mpi_lan.h index f41fcb69b359..03253b53b785 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_lan.h +++ b/trunk/drivers/message/fusion/lsi/mpi_lan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2004 LSI Corporation. * * * Name: mpi_lan.h diff --git a/trunk/drivers/message/fusion/lsi/mpi_log_fc.h b/trunk/drivers/message/fusion/lsi/mpi_log_fc.h index face6e7acc72..e4dafcefeecd 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_log_fc.h +++ b/trunk/drivers/message/fusion/lsi/mpi_log_fc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. All rights reserved. + * Copyright (c) 2000-2001 LSI Corporation. All rights reserved. * * NAME: fc_log.h * SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips diff --git a/trunk/drivers/message/fusion/lsi/mpi_log_sas.h b/trunk/drivers/message/fusion/lsi/mpi_log_sas.h index 691620dbedd2..af9da03e95e5 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_log_sas.h +++ b/trunk/drivers/message/fusion/lsi/mpi_log_sas.h @@ -1,6 +1,6 @@ /*************************************************************************** * * - * Copyright (c) 2000-2008 LSI Corporation. All rights reserved. * + * Copyright 2003 LSI Corporation. All rights reserved. * * * * Description * * ------------ * @@ -73,8 +73,6 @@ #define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO (0x00070004) #define IOP_LOGINFO_CODE_TARGET_MODE_ABORT_EXACT_IO_REQ (0x00070005) -#define IOP_LOGINFO_CODE_LOG_TIMESTAMP_EVENT (0x00080000) - /****************************************************************************/ /* PL LOGINFO_CODE defines, valid if IOC_LOGINFO_ORIGINATOR = PL */ /****************************************************************************/ @@ -94,7 +92,7 @@ #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_OPEN_TIMEOUT_EXP (0x0000000C) #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_UNUSED_0D (0x0000000D) #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_DVTBLE_ACCSS_FAIL (0x0000000E) -#define PL_LOGINFO_SUB_CODE_OPEN_FAIL_BAD_DEST (0x00000011) +#define PL_LOGINFO_SUB CODE_OPEN_FAIL_BAD_DEST (0x00000011) #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RATE_NOT_SUPP (0x00000012) #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_PROT_NOT_SUPP (0x00000013) #define PL_LOGINFO_SUB_CODE_OPEN_FAIL_RESERVED_ABANDON0 (0x00000014) @@ -161,11 +159,10 @@ #define PL_LOGINFO_SUB_CODE_INVALID_SGL (0x00000200) #define PL_LOGINFO_SUB_CODE_WRONG_REL_OFF_OR_FRAME_LENGTH (0x00000300) -#define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR (0x00000400) -/* Bits 0-3 encode Transport Status Register (offset 0x08) */ -/* Bit 0 is Status Bit 0: FrameXferErr */ -/* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */ -/* Bit 3 is Status Bit 18 WriteDataLenghtGTDataLengthErr */ +#define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR (0x00000400) /* Bits 0-3 encode Transport Status Register (offset 0x08) */ + /* Bit 0 is Status Bit 0: FrameXferErr */ + /* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */ + /* Bit 3 is Status Bit 18 WriteDataLengthGTDataLengthErr */ #define PL_LOGINFO_SUB_CODE_TX_FM_CONNECTED_LOW (0x00000500) #define PL_LOGINFO_SUB_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET (0x00000600) @@ -180,11 +177,6 @@ #define PL_LOGINFO_SUB_CODE_DISCOVERY_REMOTE_SEP_RESET (0x00000E01) #define PL_LOGINFO_SUB_CODE_SECOND_OPEN (0x00000F00) #define PL_LOGINFO_SUB_CODE_DSCVRY_SATA_INIT_TIMEOUT (0x00001000) -#define PL_LOGINFO_SUB_CODE_BREAK_ON_SATA_CONNECTION (0x00002000) -/* not currently used in mainline */ -#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK (0x00003000) -#define PL_LOGINFO_SUB_CODE_BREAK_ON_STUCK_LINK_AIP (0x00004000) -#define PL_LOGINFO_SUB_CODE_BREAK_ON_INCOMPLETE_BREAK_RCVD (0x00005000) #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_FRAME_FAILURE (0x00200000) /* Can't get SMP Frame */ #define PL_LOGINFO_CODE_ENCL_MGMT_SMP_READ_ERROR (0x00200010) /* Error occured on SMP Read */ @@ -251,8 +243,6 @@ #define IR_LOGINFO_VOLUME_ACTIVATE_VOLUME_FAILED (0x00010014) /* Activation failed trying to import the volume */ #define IR_LOGINFO_VOLUME_ACTIVATING_IMPORT_VOLUME_FAILED (0x00010015) -/* Activation failed trying to import the volume */ -#define IR_LOGINFO_VOLUME_ACTIVATING_TOO_MANY_PHYS_DISKS (0x00010016) /* Phys Disk failed, too many phys disks */ #define IR_LOGINFO_PHYSDISK_CREATE_TOO_MANY_DISKS (0x00010020) @@ -295,21 +285,6 @@ /* Compatibility Error : IME size limited to < 2TB */ #define IR_LOGINFO_COMPAT_ERROR_IME_VOL_NOT_CURRENTLY_SUPPORTED (0x0001003D) -/* Device Firmware Update: DFU can only be started once */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DFU_IN_PROGRESS (0x00010050) -/* Device Firmware Update: Volume must be Optimal/Active/non-Quiesced */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_DEVICE_IN_INVALID_STATE (0x00010051) -/* Device Firmware Update: DFU Timeout cannot be zero */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_INVALID_TIMEOUT (0x00010052) -/* Device Firmware Update: CREATE TIMER FAILED */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_NO_TIMERS (0x00010053) -/* Device Firmware Update: Failed to read SAS_IO_UNIT_PG_1 */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_READING_CFG_PAGE (0x00010054) -/* Device Firmware Update: Invalid SAS_IO_UNIT_PG_1 value(s) */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_PORT_IO_TIMEOUTS_REQUIRED (0x00010055) -/* Device Firmware Update: Unable to allocate memory for page */ -#define IR_LOGINFO_DEV_FW_UPDATE_ERR_ALLOC_CFG_PAGE (0x00010056) - /****************************************************************************/ /* Defines for convenience */ diff --git a/trunk/drivers/message/fusion/lsi/mpi_raid.h b/trunk/drivers/message/fusion/lsi/mpi_raid.h index add60cc85be1..2856108421d7 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_raid.h +++ b/trunk/drivers/message/fusion/lsi/mpi_raid.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2001-2008 LSI Corporation. + * Copyright (c) 2001-2007 LSI Corporation. * * * Name: mpi_raid.h * Title: MPI RAID message and structures * Creation Date: February 27, 2001 * - * mpi_raid.h Version: 01.05.05 + * mpi_raid.h Version: 01.05.03 * * Version History * --------------- @@ -34,9 +34,6 @@ * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. * 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and * associated defines. - * 08-07-07 01.05.04 Added Disable Full Rebuild bit to the ActionDataWord - * for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME. - * 01-15-08 01.05.05 Added define for MPI_RAID_ACTION_SET_VOLUME_NAME. * -------------------------------------------------------------------------- */ @@ -96,7 +93,6 @@ typedef struct _MSG_RAID_ACTION #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13) #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14) #define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15) -#define MPI_RAID_ACTION_SET_VOLUME_NAME (0x16) /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) @@ -109,9 +105,6 @@ typedef struct _MSG_RAID_ACTION #define MPI_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000) #define MPI_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000002) -/* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */ -#define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD (0x00000001) - /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) diff --git a/trunk/drivers/message/fusion/lsi/mpi_sas.h b/trunk/drivers/message/fusion/lsi/mpi_sas.h index ab410036bbfc..33fca83cefc2 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_sas.h +++ b/trunk/drivers/message/fusion/lsi/mpi_sas.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2004-2008 LSI Corporation. + * Copyright (c) 2004-2006 LSI Corporation. * * * Name: mpi_sas.h * Title: MPI Serial Attached SCSI structures and definitions * Creation Date: August 19, 2004 * - * mpi_sas.h Version: 01.05.05 + * mpi_sas.h Version: 01.05.04 * * Version History * --------------- @@ -23,10 +23,6 @@ * reply. * 10-11-06 01.05.04 Fixed the name of a define for Operation field of SAS IO * Unit Control request. - * 01-15-08 01.05.05 Added support for MPI_SAS_OP_SET_IOC_PARAMETER, - * including adding IOCParameter and IOCParameter value - * fields to SAS IO Unit Control Request. - * Added MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC define. * -------------------------------------------------------------------------- */ @@ -64,8 +60,6 @@ * Values for the SAS DeviceInfo field used in SAS Device Status Change Event * data and SAS IO Unit Configuration pages. */ -#define MPI_SAS_DEVICE_INFO_PRODUCT_SPECIFIC (0xF0000000) - #define MPI_SAS_DEVICE_INFO_SEP (0x00004000) #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000) #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000) @@ -222,7 +216,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST U8 ChainOffset; /* 02h */ U8 Function; /* 03h */ U16 DevHandle; /* 04h */ - U8 IOCParameter; /* 06h */ + U8 Reserved3; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U8 TargetID; /* 0Ch */ @@ -231,7 +225,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST U8 PrimFlags; /* 0Fh */ U32 Primitive; /* 10h */ U64 SASAddress; /* 14h */ - U32 IOCParameterValue; /* 1Ch */ + U32 Reserved4; /* 1Ch */ } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; @@ -247,8 +241,6 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST #define MPI_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) #define MPI_SAS_OP_TRANSMIT_REMOVE_DEVICE (0x0D) /* obsolete name */ #define MPI_SAS_OP_REMOVE_DEVICE (0x0D) -#define MPI_SAS_OP_SET_IOC_PARAMETER (0x0E) -#define MPI_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80) /* values for the PrimFlags field */ #define MPI_SAS_PRIMFLAGS_SINGLE (0x08) @@ -264,7 +256,7 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY U8 MsgLength; /* 02h */ U8 Function; /* 03h */ U16 DevHandle; /* 04h */ - U8 IOCParameter; /* 06h */ + U8 Reserved3; /* 06h */ U8 MsgFlags; /* 07h */ U32 MsgContext; /* 08h */ U16 Reserved4; /* 0Ch */ diff --git a/trunk/drivers/message/fusion/lsi/mpi_targ.h b/trunk/drivers/message/fusion/lsi/mpi_targ.h index c3dea7f6909d..ff8c37d3fdcb 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_targ.h +++ b/trunk/drivers/message/fusion/lsi/mpi_targ.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2004 LSI Corporation. * * * Name: mpi_targ.h diff --git a/trunk/drivers/message/fusion/lsi/mpi_tool.h b/trunk/drivers/message/fusion/lsi/mpi_tool.h index 53cd715aa7e4..8834ae6ce0f2 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_tool.h +++ b/trunk/drivers/message/fusion/lsi/mpi_tool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2008 LSI Corporation. + * Copyright (c) 2001-2005 LSI Corporation. * * * Name: mpi_tool.h diff --git a/trunk/drivers/message/fusion/lsi/mpi_type.h b/trunk/drivers/message/fusion/lsi/mpi_type.h index 888b26dbc413..08dad9c1e446 100644 --- a/trunk/drivers/message/fusion/lsi/mpi_type.h +++ b/trunk/drivers/message/fusion/lsi/mpi_type.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2000-2008 LSI Corporation. + * Copyright (c) 2000-2004 LSI Corporation. * * * Name: mpi_type.h * Title: MPI Basic type definitions * Creation Date: June 6, 2000 * - * mpi_type.h Version: 01.05.02 + * mpi_type.h Version: 01.05.01 * * Version History * --------------- diff --git a/trunk/drivers/message/fusion/mptbase.c b/trunk/drivers/message/fusion/mptbase.c index 96ac88317b8e..c4e8b9aa3827 100644 --- a/trunk/drivers/message/fusion/mptbase.c +++ b/trunk/drivers/message/fusion/mptbase.c @@ -79,22 +79,9 @@ MODULE_VERSION(my_VERSION); /* * cmd line parameters */ - -static int mpt_msi_enable_spi; -module_param(mpt_msi_enable_spi, int, 0); -MODULE_PARM_DESC(mpt_msi_enable_spi, " Enable MSI Support for SPI \ - controllers (default=0)"); - -static int mpt_msi_enable_fc; -module_param(mpt_msi_enable_fc, int, 0); -MODULE_PARM_DESC(mpt_msi_enable_fc, " Enable MSI Support for FC \ - controllers (default=0)"); - -static int mpt_msi_enable_sas; -module_param(mpt_msi_enable_sas, int, 1); -MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \ - controllers (default=1)"); - +static int mpt_msi_enable = -1; +module_param(mpt_msi_enable, int, 0); +MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); static int mpt_channel_mapping; module_param(mpt_channel_mapping, int, 0); @@ -104,17 +91,7 @@ static int mpt_debug_level; static int mpt_set_debug_level(const char *val, struct kernel_param *kp); module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int, &mpt_debug_level, 0600); -MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \ - - (default=0)"); - -int mpt_fwfault_debug; -EXPORT_SYMBOL(mpt_fwfault_debug); -module_param_call(mpt_fwfault_debug, param_set_int, param_get_int, - &mpt_fwfault_debug, 0600); -MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" - " and halt Firmware on fault - (default=0)"); - - +MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)"); #ifdef MFCNT static int mfcounter = 0; @@ -1774,25 +1751,16 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ioc->bus_type = SAS; } + if (mpt_msi_enable == -1) { + /* Enable on SAS, disable on FC and SPI */ + if (ioc->bus_type == SAS) + ioc->msi_enable = 1; + else + ioc->msi_enable = 0; + } else + /* follow flag: 0 - disable; 1 - enable */ + ioc->msi_enable = mpt_msi_enable; - switch (ioc->bus_type) { - - case SAS: - ioc->msi_enable = mpt_msi_enable_sas; - break; - - case SPI: - ioc->msi_enable = mpt_msi_enable_spi; - break; - - case FC: - ioc->msi_enable = mpt_msi_enable_fc; - break; - - default: - ioc->msi_enable = 0; - break; - } if (ioc->errata_flag_1064) pci_disable_io_access(pdev); @@ -6345,33 +6313,6 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh *size = y; } - -/** - * mpt_halt_firmware - Halts the firmware if it is operational and panic - * the kernel - * @ioc: Pointer to MPT_ADAPTER structure - * - **/ -void -mpt_halt_firmware(MPT_ADAPTER *ioc) -{ - u32 ioc_raw_state; - - ioc_raw_state = mpt_GetIocState(ioc, 0); - - if ((ioc_raw_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { - printk(MYIOC_s_ERR_FMT "IOC is in FAULT state (%04xh)!!!\n", - ioc->name, ioc_raw_state & MPI_DOORBELL_DATA_MASK); - panic("%s: IOC Fault (%04xh)!!!\n", ioc->name, - ioc_raw_state & MPI_DOORBELL_DATA_MASK); - } else { - CHIPREG_WRITE32(&ioc->chip->Doorbell, 0xC0FFEE00); - panic("%s: Firmware is halted due to command timeout\n", - ioc->name); - } -} -EXPORT_SYMBOL(mpt_halt_firmware); - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * Reset Handling @@ -6404,8 +6345,6 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name); printk("MF count 0x%x !\n", ioc->mfcnt); #endif - if (mpt_fwfault_debug) - mpt_halt_firmware(ioc); /* Reset the adapter. Prevent more than 1 call to * mpt_do_ioc_recovery at any instant in time. diff --git a/trunk/drivers/message/fusion/mptbase.h b/trunk/drivers/message/fusion/mptbase.h index b3e981d2a506..dff048cfa101 100644 --- a/trunk/drivers/message/fusion/mptbase.h +++ b/trunk/drivers/message/fusion/mptbase.h @@ -922,14 +922,11 @@ extern void mpt_free_fw_memory(MPT_ADAPTER *ioc); extern int mpt_findImVolumes(MPT_ADAPTER *ioc); extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk); -extern void mpt_halt_firmware(MPT_ADAPTER *ioc); - /* * Public data decl's... */ extern struct list_head ioc_list; -extern int mpt_fwfault_debug; /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif /* } __KERNEL__ */ diff --git a/trunk/drivers/message/fusion/mptscsih.c b/trunk/drivers/message/fusion/mptscsih.c index e62c6bc4ad33..ee090413e598 100644 --- a/trunk/drivers/message/fusion/mptscsih.c +++ b/trunk/drivers/message/fusion/mptscsih.c @@ -1846,9 +1846,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) if (hd->timeouts < -1) hd->timeouts++; - if (mpt_fwfault_debug) - mpt_halt_firmware(ioc); - /* Most important! Set TaskMsgContext to SCpnt's MsgContext! * (the IO to be ABORT'd) * diff --git a/trunk/drivers/mfd/twl4030-core.c b/trunk/drivers/mfd/twl4030-core.c index e7ab0035d305..074b11ffbf41 100644 --- a/trunk/drivers/mfd/twl4030-core.c +++ b/trunk/drivers/mfd/twl4030-core.c @@ -649,7 +649,7 @@ static inline int __init unprotect_pm_master(void) return e; } -static void __init clocks_init(struct device *dev) +static void __init clocks_init(void) { int e = 0; struct clk *osc; @@ -658,9 +658,9 @@ static void __init clocks_init(struct device *dev) #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) if (cpu_is_omap2430()) - osc = clk_get(dev, "osc_ck"); + osc = clk_get(NULL, "osc_ck"); else - osc = clk_get(dev, "osc_sys_ck"); + osc = clk_get(NULL, "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(&client->dev); + clocks_init(); /* Maybe init the T2 Interrupt subsystem */ if (client->irq diff --git a/trunk/drivers/misc/Makefile b/trunk/drivers/misc/Makefile index d5749a7bc777..9cf8ae6e4b39 100644 --- a/trunk/drivers/misc/Makefile +++ b/trunk/drivers/misc/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o obj-$(CONFIG_ICS932S401) += ics932s401.o obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o +obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o obj-$(CONFIG_PHANTOM) += phantom.o obj-$(CONFIG_SGI_IOC4) += ioc4.o diff --git a/trunk/drivers/platform/x86/dell-laptop.c b/trunk/drivers/misc/dell-laptop.c similarity index 99% rename from trunk/drivers/platform/x86/dell-laptop.c rename to trunk/drivers/misc/dell-laptop.c index 16e11c2ee19a..4d33a2068b7a 100644 --- a/trunk/drivers/platform/x86/dell-laptop.c +++ b/trunk/drivers/misc/dell-laptop.c @@ -22,7 +22,7 @@ #include #include #include -#include "../../firmware/dcdbas.h" +#include "../firmware/dcdbas.h" #define BRIGHTNESS_TOKEN 0x7d diff --git a/trunk/drivers/misc/sgi-xp/xpc_sn2.c b/trunk/drivers/misc/sgi-xp/xpc_sn2.c index 82fb9958f22f..73b7fb8de47a 100644 --- a/trunk/drivers/misc/sgi-xp/xpc_sn2.c +++ b/trunk/drivers/misc/sgi-xp/xpc_sn2.c @@ -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 - 1; + part->last_heartbeat = remote_vars->heartbeat; dev_dbg(xpc_part, " last_heartbeat = 0x%016lx\n", part->last_heartbeat); diff --git a/trunk/drivers/net/arm/etherh.c b/trunk/drivers/net/arm/etherh.c index d15d8b79d8e5..745ac188babe 100644 --- a/trunk/drivers/net/arm/etherh.c +++ b/trunk/drivers/net/arm/etherh.c @@ -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_address = eth_set_mac_addr, + .ndo_set_mac_addr = eth_set_mac_addr, .ndo_change_mtu = eth_change_mtu, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = ei_poll, diff --git a/trunk/drivers/net/ax88796.c b/trunk/drivers/net/ax88796.c index a4eb6c40678c..337488ec707c 100644 --- a/trunk/drivers/net/ax88796.c +++ b/trunk/drivers/net/ax88796.c @@ -37,10 +37,7 @@ 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 @@ -626,23 +623,6 @@ 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) @@ -758,7 +738,9 @@ 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->netdev_ops = &ax_netdev_ops; + dev->open = ax_open; + dev->stop = ax_close; + dev->do_ioctl = ax_ioctl; dev->ethtool_ops = &ax_ethtool_ops; ax->msg_enable = NETIF_MSG_LINK; @@ -771,6 +753,9 @@ 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) diff --git a/trunk/drivers/net/b44.c b/trunk/drivers/net/b44.c index c38512ebcea6..5ae131c147f9 100644 --- a/trunk/drivers/net/b44.c +++ b/trunk/drivers/net/b44.c @@ -679,7 +679,6 @@ 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; @@ -801,7 +800,7 @@ static int b44_rx(struct b44 *bp, int budget) /* Omit CRC. */ len -= 4; - if (!bp->force_copybreak && len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD) { int skb_size; skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); if (skb_size < 0) @@ -2153,7 +2152,6 @@ 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); diff --git a/trunk/drivers/net/b44.h b/trunk/drivers/net/b44.h index e678498de6db..7db0c84a7950 100644 --- a/trunk/drivers/net/b44.h +++ b/trunk/drivers/net/b44.h @@ -395,7 +395,7 @@ struct b44 { u32 rx_pending; u32 tx_pending; u8 phy_addr; - u8 force_copybreak; + struct mii_if_info mii_if; }; diff --git a/trunk/drivers/net/bnx2x.h b/trunk/drivers/net/bnx2x.h index 6fcccef4cf3d..fd705d1295a7 100644 --- a/trunk/drivers/net/bnx2x.h +++ b/trunk/drivers/net/bnx2x.h @@ -20,11 +20,6 @@ * (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" @@ -83,6 +78,11 @@ #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,9 +150,6 @@ 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 @@ -739,7 +736,7 @@ struct bnx2x { struct bnx2x_fastpath fp[MAX_CONTEXT]; void __iomem *regview; void __iomem *doorbells; -#define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE) +#define BNX2X_DB_SIZE (16*2048) struct net_device *dev; struct pci_dev *pdev; @@ -804,8 +801,6 @@ 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) @@ -816,7 +811,7 @@ struct bnx2x { int pm_cap; int pcie_cap; - struct delayed_work sp_task; + struct work_struct sp_task; struct work_struct reset_task; struct timer_list timer; diff --git a/trunk/drivers/net/bnx2x_main.c b/trunk/drivers/net/bnx2x_main.c index 7c533797c064..4be05847f86f 100644 --- a/trunk/drivers/net/bnx2x_main.c +++ b/trunk/drivers/net/bnx2x_main.c @@ -38,7 +38,9 @@ #include #include #include -#include +#ifdef NETIF_F_HW_VLAN_TX + #include +#endif #include #include #include @@ -93,7 +95,6 @@ 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, @@ -670,8 +671,7 @@ 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_delayed_work(&bp->sp_task); - flush_workqueue(bnx2x_wq); + cancel_work_sync(&bp->sp_task); } /* 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), - SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); + BCM_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, SGE_PAGE_SIZE*PAGES_PER_SGE, + mapping = pci_map_page(bp->pdev, page, 0, BCM_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 = SGE_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - + u16 sge_len = BCM_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - le16_to_cpu(fp_cqe->len_on_bd)) >> - SGE_PAGE_SHIFT; + BCM_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 = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + pages = BCM_PAGE_ALIGN(frag_size) >> BCM_PAGE_SHIFT; /* This is needed in order to enable forwarding support */ if (frag_size) - skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE, + skb_shinfo(skb)->gso_size = min((u32)BCM_PAGE_SIZE, max(frag_size, (u32)len_on_bd)); #ifdef BNX2X_STOP_ON_ERROR - if (pages > - min((u32)8, (u32)MAX_SKB_FRAGS) * SGE_PAGE_SIZE * PAGES_PER_SGE) { + if (pages > 8*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,8 +1234,9 @@ 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)(SGE_PAGE_SIZE*PAGES_PER_SGE)); + frag_len = min(frag_size, (u32)(BCM_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 @@ -1248,7 +1249,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), - SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); + BCM_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); @@ -1281,13 +1282,6 @@ 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); @@ -1312,12 +1306,6 @@ 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); } @@ -1325,8 +1313,9 @@ 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) && is_vlan_cqe && - (!is_not_hwaccel_vlan_cqe)) + if ((bp->vlgrp != NULL) && + (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & + PARSING_FLAGS_VLAN)) vlan_hwaccel_receive_skb(skb, bp->vlgrp, le16_to_cpu(cqe->fast_path_cqe. vlan_tag)); @@ -1366,23 +1355,11 @@ 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); @@ -1438,7 +1415,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, - le32_to_cpu(cqe->fast_path_cqe.rss_hash_result), + 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)); @@ -1570,7 +1547,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) } #ifdef BCM_VLAN - if ((bp->vlgrp != NULL) && (bp->flags & HW_VLAN_RX_FLAG) && + if ((bp->vlgrp != NULL) && (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & PARSING_FLAGS_VLAN)) vlan_hwaccel_receive_skb(skb, bp->vlgrp, @@ -1603,6 +1580,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) /* 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++; @@ -1682,7 +1660,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) if (unlikely(status & 0x1)) { - queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); + schedule_work(&bp->sp_task); status &= ~0x1; if (!status) @@ -1909,8 +1887,7 @@ 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 & - MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { + switch (bp->link_vars.ieee_fc) { case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: bp->port.advertising &= ~(ADVERTISED_Asym_Pause | ADVERTISED_Pause); @@ -1980,11 +1957,10 @@ 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; } @@ -2244,7 +2220,9 @@ 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) { @@ -2493,8 +2471,6 @@ 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); @@ -2550,10 +2526,8 @@ 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) @@ -2821,10 +2795,8 @@ 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 = 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_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_state = bp->attn_state; /* look for changed bits */ @@ -2848,7 +2820,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.work); + struct bnx2x *bp = container_of(work, struct bnx2x, sp_task); u16 status; @@ -2872,7 +2844,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, le16_to_cpu(bp->def_att_idx), + bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, 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); @@ -2903,7 +2875,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) return IRQ_HANDLED; #endif - queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); + schedule_work(&bp->sp_task); return IRQ_HANDLED; } @@ -2920,7 +2892,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 */ @@ -4524,7 +4496,7 @@ static void bnx2x_init_context(struct bnx2x *bp) static void bnx2x_init_ind_table(struct bnx2x *bp) { - int func = BP_FUNC(bp); + int port = BP_PORT(bp); int i; if (!is_multi(bp)) @@ -4533,8 +4505,10 @@ 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(func) + i, - BP_CL_ID(bp) + (i % bp->num_queues)); + TSTORM_INDIRECTION_TABLE_OFFSET(port) + i, + i % bp->num_queues); + + REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); } static void bnx2x_set_client_config(struct bnx2x *bp) @@ -4543,12 +4517,12 @@ static void bnx2x_set_client_config(struct bnx2x *bp) int port = BP_PORT(bp); int i; - tstorm_client.mtu = bp->dev->mtu; + tstorm_client.mtu = bp->dev->mtu + ETH_OVREHEAD; 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 && (bp->flags & HW_VLAN_RX_FLAG)) { + if (bp->rx_mode && bp->vlgrp) { tstorm_client.config_flags |= TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE; DP(NETIF_MSG_IFUP, "vlan removal enabled\n"); @@ -4557,7 +4531,7 @@ static void bnx2x_set_client_config(struct bnx2x *bp) if (bp->flags & TPA_ENABLE_FLAG) { tstorm_client.max_sges_for_packet = - SGE_PAGE_ALIGN(tstorm_client.mtu) >> SGE_PAGE_SHIFT; + BCM_PAGE_ALIGN(tstorm_client.mtu) >> BCM_PAGE_SHIFT; tstorm_client.max_sges_for_packet = ((tstorm_client.max_sges_for_packet + PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> @@ -4740,11 +4714,10 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) bp->e1hov); } - /* 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); + /* 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); for_each_queue(bp, i) { struct bnx2x_fastpath *fp = &bp->fp[i]; @@ -4812,15 +4785,6 @@ 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); } @@ -5170,6 +5134,7 @@ 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); @@ -5247,7 +5212,6 @@ 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)) @@ -6429,8 +6393,17 @@ 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"); @@ -7528,7 +7501,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) mutex_init(&bp->port.phy_mutex); - INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); + INIT_WORK(&bp->sp_task, bnx2x_sp_task); INIT_WORK(&bp->reset_task, bnx2x_reset_task); rc = bnx2x_get_hwinfo(bp); @@ -8754,8 +8727,6 @@ 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 */ @@ -8807,6 +8778,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) /* 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; @@ -9577,14 +9549,11 @@ 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); -#ifdef BCM_VLAN - if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb) && - (bp->flags & HW_VLAN_TX_FLAG)) { + if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb)) { 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) { @@ -9736,15 +9705,6 @@ 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 */ @@ -9758,9 +9718,6 @@ 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) @@ -10030,16 +9987,6 @@ 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); } @@ -10196,7 +10143,6 @@ 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; @@ -10573,20 +10519,12 @@ 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); diff --git a/trunk/drivers/net/ehea/ehea_main.c b/trunk/drivers/net/ehea/ehea_main.c index dfe92264e825..e3131ea629cd 100644 --- a/trunk/drivers/net/ehea/ehea_main.c +++ b/trunk/drivers/net/ehea/ehea_main.c @@ -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 %016llx %016llx\n", msg, + printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\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%llx, token=0x%x", + ehea_error("QP aff_err: entry=0x%lx, 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%llX", ec, eqe); + ehea_error("unknown event code %x, eqe=0x%lX", 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%llx). " + ehea_info("Mcast registration limit reached (0x%lx). " "Use ALLMULTI!", port->adapter->max_mc_mac); goto out; diff --git a/trunk/drivers/net/ehea/ehea_qmr.c b/trunk/drivers/net/ehea/ehea_qmr.c index 49d766ebbcf4..225c692b5d99 100644 --- a/trunk/drivers/net/ehea/ehea_qmr.c +++ b/trunk/drivers/net/ehea/ehea_qmr.c @@ -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=%llx counter=%i act_pages=%i", + "hret=%lx 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=%llx\n", hret); + "complete hret=%lx\n", hret); goto out_kill_hwq; } } else { if (hret != H_PAGE_REGISTERED) { ehea_error("CQ: registration of page failed " - "hret=%llx\n", hret); + "hret=%lx\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=%llX) state: AER=0x%llX, AERR=0x%llX, " - "port=%llX", resource, data[6], data[12], data[22]); + ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " + "port=%lX", resource, data[6], data[12], data[22]); if (type == 0x4) /* Completion Queue */ - ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource, + ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, data[6]); if (type == 0x3) /* Event Queue */ - ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource, + ehea_error("EQ (resource=%lX) state: AER=0x%lX", 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: %llX.", res_handle); + ehea_error("No error data is available: %lX.", res_handle); else if (ret == H_SUCCESS) print_error_data(rblock); else - ehea_error("Error data could not be fetched: %llX", res_handle); + ehea_error("Error data could not be fetched: %lX", res_handle); kfree(rblock); } diff --git a/trunk/drivers/net/fs_enet/fs_enet-main.c b/trunk/drivers/net/fs_enet/fs_enet-main.c index ce900e54d8d1..4e6a9195fe5f 100644 --- a/trunk/drivers/net/fs_enet/fs_enet-main.c +++ b/trunk/drivers/net/fs_enet/fs_enet-main.c @@ -795,7 +795,6 @@ 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; diff --git a/trunk/drivers/net/gianfar.c b/trunk/drivers/net/gianfar.c index ea530673236e..efcbeb6c8673 100644 --- a/trunk/drivers/net/gianfar.c +++ b/trunk/drivers/net/gianfar.c @@ -1622,18 +1622,10 @@ 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 */ diff --git a/trunk/drivers/net/ibm_newemac/mal.c b/trunk/drivers/net/ibm_newemac/mal.c index 2a2fc17b2878..ecf9798987fa 100644 --- a/trunk/drivers/net/ibm_newemac/mal.c +++ b/trunk/drivers/net/ibm_newemac/mal.c @@ -613,9 +613,7 @@ static int __devinit mal_probe(struct of_device *ofdev, INIT_LIST_HEAD(&mal->list); spin_lock_init(&mal->lock); - init_dummy_netdev(&mal->dummy_dev); - - netif_napi_add(&mal->dummy_dev, &mal->napi, mal_poll, + netif_napi_add(NULL, &mal->napi, mal_poll, CONFIG_IBM_NEW_EMAC_POLL_WEIGHT); /* Load power-on reset defaults */ diff --git a/trunk/drivers/net/ibm_newemac/mal.h b/trunk/drivers/net/ibm_newemac/mal.h index 9ededfbf0726..2f0a87360844 100644 --- a/trunk/drivers/net/ibm_newemac/mal.h +++ b/trunk/drivers/net/ibm_newemac/mal.h @@ -214,8 +214,6 @@ struct mal_instance { int index; spinlock_t lock; - struct net_device dummy_dev; - unsigned int features; }; diff --git a/trunk/drivers/net/ibmveth.c b/trunk/drivers/net/ibmveth.c index dfa6348ac1dc..ca3bb9f7321b 100644 --- a/trunk/drivers/net/ibmveth.c +++ b/trunk/drivers/net/ibmveth.c @@ -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%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n", + ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\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: %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); + 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); return 0; } diff --git a/trunk/drivers/net/irda/irda-usb.c b/trunk/drivers/net/irda/irda-usb.c index 3a22dc41b656..29118f58a141 100644 --- a/trunk/drivers/net/irda/irda-usb.c +++ b/trunk/drivers/net/irda/irda-usb.c @@ -1073,7 +1073,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) { unsigned int i; int ret; - char stir421x_fw_name[12]; + char stir421x_fw_name[11]; const struct firmware *fw; const unsigned char *fw_version_ptr; /* pointer to version string */ unsigned long fw_version = 0; diff --git a/trunk/drivers/net/iseries_veth.c b/trunk/drivers/net/iseries_veth.c index cb793c2bade2..c7457f97259d 100644 --- a/trunk/drivers/net/iseries_veth.c +++ b/trunk/drivers/net/iseries_veth.c @@ -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%llX\n", port->mac_addr); +CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr); #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) static struct attribute *veth_port_default_attrs[] = { diff --git a/trunk/drivers/net/korina.c b/trunk/drivers/net/korina.c index 1d6e48e13366..4a5580c1126a 100644 --- a/trunk/drivers/net/korina.c +++ b/trunk/drivers/net/korina.c @@ -84,10 +84,7 @@ #define KORINA_NUM_RDS 64 /* number of receive descriptors */ #define KORINA_NUM_TDS 64 /* number of transmit descriptors */ -/* 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_RBSIZE 536 /* 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)) @@ -199,7 +196,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_prev, chain_next; + u32 chain_index; struct dma_desc *td; spin_lock_irqsave(&lp->lock, flags); @@ -231,8 +228,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_prev = (lp->tx_chain_tail - 1) & KORINA_TDS_MASK; - chain_next = (lp->tx_chain_tail + 1) & KORINA_TDS_MASK; + chain_index = (lp->tx_chain_tail - 1) & + KORINA_TDS_MASK; if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) { if (lp->tx_chain_status == desc_empty) { @@ -240,7 +237,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_next; + lp->tx_chain_tail = chain_index; /* Write to NDPTR */ writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &lp->tx_dma_regs->dmandptr); @@ -251,12 +248,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_prev].control &= + lp->td_ring[chain_index].control &= ~DMA_DESC_COF; /* Link to prev */ - lp->td_ring[chain_prev].link = CPHYSADDR(td); + lp->td_ring[chain_index].link = CPHYSADDR(td); /* Move tail */ - lp->tx_chain_tail = chain_next; + lp->tx_chain_tail = chain_index; /* Write to NDPTR */ writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); @@ -270,16 +267,17 @@ 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_next; + lp->tx_chain_tail = chain_index; 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_prev].control &= + lp->td_ring[chain_index].control &= ~DMA_DESC_COF; - lp->td_ring[chain_prev].link = CPHYSADDR(td); - lp->tx_chain_tail = chain_next; + lp->td_ring[chain_index].link = CPHYSADDR(td); + lp->tx_chain_tail = chain_index; } } dma_cache_wback((u32) td, sizeof(*td)); @@ -329,13 +327,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); @@ -352,20 +350,15 @@ 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; + u32 devcs, pkt_len, dmas, rx_free_desc; 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++; @@ -388,55 +381,63 @@ static int korina_rx(struct net_device *dev, int limit) * in Rc32434 (errata ref #077) */ dev->stats.rx_errors++; dev->stats.rx_dropped++; - } else if ((devcs & ETH_RX_ROK)) { - pkt_len = RCVPKT_LENGTH(devcs); - - /* 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); + 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; + 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); + } } dmas = readl(&lp->rx_dma_regs->dmas); @@ -622,12 +623,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]), @@ -900,8 +901,6 @@ 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", @@ -1000,14 +999,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_DISABLED, "Korina ethernet Rx", dev); + IRQF_SHARED | 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_DISABLED, "Korina ethernet Tx", dev); + IRQF_SHARED | 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); @@ -1016,7 +1015,7 @@ static int korina_open(struct net_device *dev) /* Install handler for overrun error. */ ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt, - IRQF_DISABLED, "Ethernet Overflow", dev); + IRQF_SHARED | 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); @@ -1025,7 +1024,7 @@ static int korina_open(struct net_device *dev) /* Install handler for underflow error. */ ret = request_irq(lp->und_irq, &korina_und_interrupt, - IRQF_DISABLED, "Ethernet Underflow", dev); + IRQF_SHARED | 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); @@ -1068,8 +1067,6 @@ 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); @@ -1092,6 +1089,7 @@ 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; diff --git a/trunk/drivers/net/mlx4/main.c b/trunk/drivers/net/mlx4/main.c index 6ef2490d5c3e..710c79e7a2db 100644 --- a/trunk/drivers/net/mlx4/main.c +++ b/trunk/drivers/net/mlx4/main.c @@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) int i; if (msi_x) { - nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, - num_possible_cpus() + 1); + nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, + num_possible_cpus() + 1); entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); if (!entries) goto no_msi; diff --git a/trunk/drivers/net/netxen/netxen_nic.h b/trunk/drivers/net/netxen/netxen_nic.h index c11c568fd7db..f8e601c51da7 100644 --- a/trunk/drivers/net/netxen/netxen_nic.h +++ b/trunk/drivers/net/netxen/netxen_nic.h @@ -308,16 +308,27 @@ struct netxen_ring_ctx { #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) -#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)) +#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) struct cmd_desc_type0 { u8 tcp_hdr_offset; /* For LSO only */ @@ -499,8 +510,7 @@ 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_TP = 0x0080 + NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 } netxen_brdtype_t; @@ -747,7 +757,7 @@ extern char netxen_nic_driver_name[]; */ struct netxen_skb_frag { u64 dma; - ulong length; + u32 length; }; #define _netxen_set_bits(config_word, start, bits, val) {\ @@ -773,7 +783,13 @@ struct netxen_skb_frag { struct netxen_cmd_buffer { struct sk_buff *skb; struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; - u32 frag_count; + u32 total_length; + u32 mss; + u16 port; + u8 cmd; + u8 frag_count; + unsigned long time_stamp; + u32 state; }; /* In rx_buffer, we do not need multiple fragments as is a single buffer */ @@ -860,6 +876,7 @@ 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; }; /* @@ -978,31 +995,31 @@ struct netxen_recv_context { */ typedef struct { - __le64 host_phys_addr; /* Ring base addr */ - __le32 ring_size; /* Ring entries */ - __le16 msi_index; - __le16 rsvd; /* Padding */ + u64 host_phys_addr; /* Ring base addr */ + u32 ring_size; /* Ring entries */ + u16 msi_index; + u16 rsvd; /* Padding */ } nx_hostrq_sds_ring_t; typedef struct { - __le64 host_phys_addr; /* Ring base addr */ - __le64 buff_size; /* Packet buffer size */ - __le32 ring_size; /* Ring entries */ - __le32 ring_kind; /* Class of ring */ + u64 host_phys_addr; /* Ring base addr */ + u64 buff_size; /* Packet buffer size */ + u32 ring_size; /* Ring entries */ + u32 ring_kind; /* Class of ring */ } nx_hostrq_rds_ring_t; typedef struct { - __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 */ + 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 */ /* These ring offsets are relative to data[0] below */ - __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 */ + 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 */ u8 reserved[128]; /* reserve space for future expansion*/ /* MUST BE 64-bit aligned. The following is packed: @@ -1012,24 +1029,24 @@ typedef struct { } nx_hostrq_rx_ctx_t; typedef struct { - __le32 host_producer_crb; /* Crb to use */ - __le32 rsvd1; /* Padding */ + u32 host_producer_crb; /* Crb to use */ + u32 rsvd1; /* Padding */ } nx_cardrsp_rds_ring_t; typedef struct { - __le32 host_consumer_crb; /* Crb to use */ - __le32 interrupt_crb; /* Crb to use */ + u32 host_consumer_crb; /* Crb to use */ + u32 interrupt_crb; /* Crb to use */ } nx_cardrsp_sds_ring_t; typedef struct { /* These ring offsets are relative to data[0] below */ - __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 */ + 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 */ u8 phys_port; /* Physical id of port */ u8 virt_port; /* Virtual/Logical id of port */ u8 reserved[128]; /* save space for future expansion */ @@ -1055,34 +1072,34 @@ typedef struct { */ typedef struct { - __le64 host_phys_addr; /* Ring base addr */ - __le32 ring_size; /* Ring entries */ - __le32 rsvd; /* Padding */ + u64 host_phys_addr; /* Ring base addr */ + u32 ring_size; /* Ring entries */ + u32 rsvd; /* Padding */ } nx_hostrq_cds_ring_t; typedef struct { - __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 */ + 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 */ nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ u8 reserved[128]; /* future expansion */ } nx_hostrq_tx_ctx_t; typedef struct { - __le32 host_producer_crb; /* Crb to use */ - __le32 interrupt_crb; /* Crb to use */ + u32 host_producer_crb; /* Crb to use */ + u32 interrupt_crb; /* Crb to use */ } nx_cardrsp_cds_ring_t; typedef struct { - __le32 host_ctx_state; /* Starting state */ - __le16 context_id; /* Handle for context */ + u32 host_ctx_state; /* Starting state */ + u16 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 */ @@ -1185,9 +1202,9 @@ enum { #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ typedef struct { - __le64 qhdr; - __le64 req_hdr; - __le64 words[6]; + u64 qhdr; + u64 req_hdr; + u64 words[6]; } nx_nic_req_t; typedef struct { @@ -1469,6 +1486,8 @@ 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, @@ -1477,7 +1496,6 @@ 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); diff --git a/trunk/drivers/net/netxen/netxen_nic_ctx.c b/trunk/drivers/net/netxen/netxen_nic_ctx.c index 746bdb470418..64b51643c626 100644 --- a/trunk/drivers/net/netxen/netxen_nic_ctx.c +++ b/trunk/drivers/net/netxen/netxen_nic_ctx.c @@ -76,7 +76,7 @@ netxen_api_unlock(struct netxen_adapter *adapter) static u32 netxen_poll_rsp(struct netxen_adapter *adapter) { - u32 rsp = NX_CDRP_RSP_OK; + u32 raw_rsp, rsp = NX_CDRP_RSP_OK; int timeout = 0; do { @@ -86,7 +86,10 @@ 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, &rsp); + netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, + &raw_rsp); + + rsp = le32_to_cpu(raw_rsp); } while (!NX_CDRP_IS_RSP(rsp)); return rsp; @@ -106,16 +109,20 @@ 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, signature); + netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, + cpu_to_le32(signature)); - netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, arg1); + netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, + cpu_to_le32(arg1)); - netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, arg2); + netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, + cpu_to_le32(arg2)); - netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, arg3); + netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, + cpu_to_le32(arg3)); netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, - NX_CDRP_FORM_CMD(cmd)); + cpu_to_le32(NX_CDRP_FORM_CMD(cmd))); rsp = netxen_poll_rsp(adapter); @@ -126,6 +133,7 @@ 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); @@ -175,7 +183,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, val; + u32 cap, reg; int err; @@ -217,14 +225,11 @@ 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 = cpu_to_le32(0); - - val = le32_to_cpu(prq->rds_ring_offset) + + prq->rds_ring_offset = 0; + prq->sds_ring_offset = 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 + - le32_to_cpu(prq->rds_ring_offset)); + prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + prq->rds_ring_offset); for (i = 0; i < nrds_rings; i++) { @@ -236,14 +241,17 @@ 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 + - le32_to_cpu(prq->sds_ring_offset)); + prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + 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_le16(0); + 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); phys_addr = hostrq_phys_addr; err = netxen_issue_cmd(adapter, @@ -261,9 +269,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) prsp_rds = ((nx_cardrsp_rds_ring_t *) - &prsp->data[le32_to_cpu(prsp->rds_ring_offset)]); + &prsp->data[prsp->rds_ring_offset]); - for (i = 0; i < le16_to_cpu(prsp->num_rds_rings); i++) { + for (i = 0; i < le32_to_cpu(prsp->num_rds_rings); i++) { rds_ring = &recv_ctx->rds_rings[i]; reg = le32_to_cpu(prsp_rds[i].host_producer_crb); @@ -271,7 +279,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) } prsp_sds = ((nx_cardrsp_sds_ring_t *) - &prsp->data[le32_to_cpu(prsp->sds_ring_offset)]); + &prsp->data[prsp->sds_ring_offset]); reg = le32_to_cpu(prsp_sds[0].host_consumer_crb); recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200); @@ -280,7 +288,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 = prsp->virt_port; + recv_ctx->virt_port = le16_to_cpu(prsp->virt_port); out_free_rsp: pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr); diff --git a/trunk/drivers/net/netxen/netxen_nic_ethtool.c b/trunk/drivers/net/netxen/netxen_nic_ethtool.c index c0bd40fcf708..e45ce2951729 100644 --- a/trunk/drivers/net/netxen/netxen_nic_ethtool.c +++ b/trunk/drivers/net/netxen/netxen_nic_ethtool.c @@ -136,9 +136,11 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) ecmd->port = PORT_TP; - ecmd->speed = adapter->link_speed; - ecmd->duplex = adapter->link_duplex; - ecmd->autoneg = adapter->link_autoneg; + if (netif_running(dev)) { + 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; @@ -169,7 +171,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) } else return -EIO; - ecmd->phy_address = adapter->physical_port; + ecmd->phy_address = adapter->portnum; ecmd->transceiver = XCVR_EXTERNAL; switch ((netxen_brdtype_t) boardinfo->board_type) { @@ -178,13 +180,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; @@ -202,33 +204,16 @@ 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); diff --git a/trunk/drivers/net/netxen/netxen_nic_hw.c b/trunk/drivers/net/netxen/netxen_nic_hw.c index 821cff68b3f3..aa6e603bfcbf 100644 --- a/trunk/drivers/net/netxen/netxen_nic_hw.c +++ b/trunk/drivers/net/netxen/netxen_nic_hw.c @@ -503,15 +503,17 @@ 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], @@ -529,8 +531,6 @@ 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,19 +539,16 @@ 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; - u64 word; + nx_mac_req_t mac_req; int rv; memset(&req, 0, sizeof(nx_nic_req_t)); - 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); + 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); rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); if (rv != 0) { @@ -615,35 +612,18 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) 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 = 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.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.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 /* @@ -652,15 +632,13 @@ void netxen_p3_free_mac_list(struct netxen_adapter *adapter) 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 = cpu_to_le64(NX_NIC_REQUEST << 23); - - word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); - req.req_hdr = cpu_to_le64(word); + req.qhdr |= (NX_NIC_REQUEST << 23); + req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; + req.req_hdr |= ((u64)adapter->portnum << 16); memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); @@ -794,10 +772,13 @@ 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 = le64_to_cpu((mac_lo >> 16) | ((u64)mac_hi << 16)); + *mac = ((mac_lo >> 16) | ((u64)mac_hi << 16)); else - *mac = le64_to_cpu((u64)mac_lo | ((u64)mac_hi << 32)); + *mac = ((mac_lo) | ((u64)mac_hi << 32)); return 0; } @@ -956,7 +937,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter) { int i; u32 data, size = 0; - u32 flashaddr = NETXEN_BOOTLD_START; + u32 flashaddr = NETXEN_BOOTLD_START, memaddr = NETXEN_BOOTLD_START; size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4; @@ -968,8 +949,10 @@ 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, flashaddr, &data, 4); + adapter->pci_mem_write(adapter, memaddr, &data, 4); flashaddr += 4; + memaddr += 4; + cond_resched(); } msleep(1); @@ -2051,13 +2034,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) rv = -1; } - 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; - } - + DPRINTK(INFO, "Discovered board type:0x%x ", boardinfo->board_type); switch ((netxen_brdtype_t) boardinfo->board_type) { case NETXEN_BRDTYPE_P2_SB35_4G: adapter->ahw.board_type = NETXEN_NIC_GBE; @@ -2076,6 +2053,7 @@ 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: @@ -2085,12 +2063,9 @@ 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); @@ -2135,16 +2110,12 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) { __u32 status; __u32 autoneg; + __u32 mode; __u32 port_mode; - if (!netif_carrier_ok(adapter->netdev)) { - adapter->link_speed = 0; - adapter->link_duplex = -1; - adapter->link_autoneg = AUTONEG_ENABLE; - return; - } + netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); + if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ - 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) { @@ -2170,7 +2141,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) adapter->link_speed = SPEED_1000; break; default: - adapter->link_speed = 0; + adapter->link_speed = -1; break; } switch (netxen_get_phy_duplex(status)) { @@ -2193,7 +2164,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) goto link_down; } else { link_down: - adapter->link_speed = 0; + adapter->link_speed = -1; adapter->link_duplex = -1; } } diff --git a/trunk/drivers/net/netxen/netxen_nic_init.c b/trunk/drivers/net/netxen/netxen_nic_init.c index ca7c8d8050c9..d924468e506e 100644 --- a/trunk/drivers/net/netxen/netxen_nic_init.c +++ b/trunk/drivers/net/netxen/netxen_nic_init.c @@ -308,6 +308,7 @@ 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. @@ -438,8 +439,6 @@ 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; @@ -534,9 +533,12 @@ 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_DUMMY_BYTE_CNT, 0); 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_INSTR_OPCODE, 0xb); if (netxen_wait_rom_done(adapter)) { printk("Error waiting for rom done\n"); @@ -544,7 +546,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(10); + udelay(100); /* prevent bursting on CRB */ netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); @@ -882,16 +884,14 @@ int netxen_flash_unlock(struct netxen_adapter *adapter) int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) { int addr, val; - int i, n, init_delay = 0; + int i, init_delay = 0; struct crb_addr_pair *buf; - unsigned offset; + unsigned offset, n; 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 != 0xcafecafe) || + (n != 0xcafecafeUL) || 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,14 +975,6 @@ 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 */ @@ -1000,21 +992,23 @@ 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 = 1000; + init_delay = 1; 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); - msleep(init_delay); + if (init_delay == 1) { + msleep(1000); + init_delay = 0; + } + msleep(1); } kfree(buf); @@ -1283,7 +1277,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 = le16_to_cpu(frag_desc->frag_handles[i]); + index = frag_desc->frag_handles[i]; skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); if (skb) @@ -1434,6 +1428,7 @@ 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; @@ -1441,6 +1436,7 @@ 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. */ @@ -1448,37 +1444,39 @@ 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); - - producer = get_next_index(producer, rds_ring->max_rx_desc_count); + 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); } /* 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, @@ -1517,50 +1515,49 @@ 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 = dma; + buffer->dma = pci_map_single(pdev, skb->data, + rds_ring->dma_size, + PCI_DMA_FROMDEVICE); /* 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); + 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]; } /* 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, diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c index d854f07ef4d3..ba01524b5531 100644 --- a/trunk/drivers/net/netxen/netxen_nic_main.c +++ b/trunk/drivers/net/netxen/netxen_nic_main.c @@ -39,9 +39,7 @@ #include "netxen_nic_phan_reg.h" #include -#include #include -#include MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); MODULE_LICENSE("GPL"); @@ -244,7 +242,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_1G; + adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; break; case NETXEN_BRDTYPE_P2_SB35_4G: @@ -253,14 +251,6 @@ 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; @@ -281,15 +271,10 @@ static void netxen_check_options(struct netxen_adapter *adapter) static int netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) { - u32 val, timeout; + int ret = 0; 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, @@ -309,26 +294,18 @@ 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); - return -EIO; + ret = -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); + 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); + } } - return 0; + return ret; } static void netxen_set_port_mode(struct netxen_adapter *adapter) @@ -807,8 +784,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); @@ -824,6 +801,13 @@ 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; @@ -837,9 +821,7 @@ 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. */ - err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); - if (err) - goto err_out_free_offload; + netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); } /* first_driver */ @@ -943,7 +925,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (adapter->flags & NETXEN_NIC_MSI_ENABLED) pci_disable_msi(pdev); -err_out_free_offload: if (first_driver) netxen_free_adapter_offload(adapter); @@ -987,9 +968,6 @@ 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) @@ -1005,10 +983,8 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) iounmap(adapter->ahw.db_base); iounmap(adapter->ahw.pci_base0); - if (adapter->ahw.pci_base1 != NULL) - iounmap(adapter->ahw.pci_base1); - if (adapter->ahw.pci_base2 != NULL) - iounmap(adapter->ahw.pci_base2); + iounmap(adapter->ahw.pci_base1); + iounmap(adapter->ahw.pci_base2); pci_release_regions(pdev); pci_disable_device(pdev); @@ -1161,64 +1137,29 @@ static int netxen_nic_close(struct net_device *netdev) return 0; } -static bool netxen_tso_check(struct net_device *netdev, +void netxen_tso_check(struct netxen_adapter *adapter, struct cmd_desc_type0 *desc, struct sk_buff *skb) { - bool tso = false; - u8 opcode = TX_ETHER_PKT; + if (desc->mss) { + desc->total_hdr_length = (sizeof(struct ethhdr) + + ip_hdrlen(skb) + tcp_hdrlen(skb)); - 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; + 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); } else if (skb->ip_summed == CHECKSUM_PARTIAL) { - 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; - } + 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; } 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) @@ -1226,22 +1167,33 @@ 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; - struct cmd_desc_type0 *hwdesc; - struct pci_dev *pdev = adapter->pdev; - dma_addr_t temp_dma; - int i, k; + unsigned int i; u32 producer, consumer; - int frag_count, no_of_desc; + u32 saved_producer = 0; + struct cmd_desc_type0 *hwdesc; + int k; + struct netxen_cmd_buffer *pbuf = NULL; + int frag_count; + int 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(); @@ -1253,26 +1205,34 @@ 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]; - - is_tso = netxen_tso_check(netdev, hwdesc, skb); - + 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; pbuf->skb = skb; + pbuf->cmd = TX_ETHER_PKT; pbuf->frag_count = frag_count; + pbuf->port = adapter->portnum; buffrag = &pbuf->frag_array[0]; - temp_dma = pci_map_single(pdev, skb->data, first_seg_len, + buffrag->dma = pci_map_single(adapter->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_tx_frags_len(hwdesc, frag_count, skb->len); - netxen_set_tx_port(hwdesc, adapter->portnum); + 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_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); @@ -1280,6 +1240,7 @@ 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) { @@ -1295,12 +1256,8 @@ 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(pdev, frag->page, offset, + temp_dma = pci_map_page(adapter->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; @@ -1328,12 +1285,16 @@ 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 (is_tso) { + if (netxen_get_cmd_desc_opcode(&hw->cmd_desc_head[saved_producer]) + == TX_TCP_LSO) { int hdr_len, first_hdr_len, more_hdr; - hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); + hdr_len = hw->cmd_desc_head[saved_producer].total_hdr_length; if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { first_hdr_len = sizeof(struct cmd_desc_type0) - 2; more_hdr = 1; @@ -1375,11 +1336,6 @@ 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) @@ -1451,8 +1407,6 @@ 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); @@ -1461,8 +1415,6 @@ 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); } } diff --git a/trunk/drivers/net/pasemi_mac.c b/trunk/drivers/net/pasemi_mac.c index d0349e7d73ea..5b7a574ce571 100644 --- a/trunk/drivers/net/pasemi_mac.c +++ b/trunk/drivers/net/pasemi_mac.c @@ -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 %016llx, rx status %llx\n", + printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\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%016llx, "\ - "tx status 0x%016llx\n", mactx, *chan->status); + printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\ + "tx status 0x%016lx\n", mactx, *chan->status); printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); } diff --git a/trunk/drivers/net/phy/phy_device.c b/trunk/drivers/net/phy/phy_device.c index 0a06e4fd37d9..e35460165bf7 100644 --- a/trunk/drivers/net/phy/phy_device.c +++ b/trunk/drivers/net/phy/phy_device.c @@ -231,6 +231,15 @@ 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; diff --git a/trunk/drivers/net/ppp_generic.c b/trunk/drivers/net/ppp_generic.c index 7b2728b8f1b7..06b448285eb5 100644 --- a/trunk/drivers/net/ppp_generic.c +++ b/trunk/drivers/net/ppp_generic.c @@ -250,7 +250,6 @@ 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); @@ -2433,18 +2432,11 @@ ppp_create_interface(int unit, int *retp) } else { if (unit_find(&ppp_units_idr, unit)) goto out2; /* unit already exists */ - /* - * 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) + else { + /* darn, someone is cheating us? */ + *retp = -EINVAL; goto out2; + } } /* Initialize the new ppp unit */ @@ -2685,37 +2677,14 @@ 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)) { - printk(KERN_ERR "PPP: No free memory for idr\n"); + if (idr_pre_get(p, GFP_KERNEL) == 0) { + printk(KERN_ERR "Out of memory expanding drawable idr\n"); return -ENOMEM; } diff --git a/trunk/drivers/net/sis900.c b/trunk/drivers/net/sis900.c index be4465bc0a69..6cbefcae9ac2 100644 --- a/trunk/drivers/net/sis900.c +++ b/trunk/drivers/net/sis900.c @@ -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 || !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); + if (ret == 0) { + printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name); + ret = -ENODEV; + goto err_unmap_rx; } /* 630ET : set the mii access mode as software-mode */ diff --git a/trunk/drivers/net/usb/hso.c b/trunk/drivers/net/usb/hso.c index 0d0fa91c0251..c4918b86ed19 100644 --- a/trunk/drivers/net/usb/hso.c +++ b/trunk/drivers/net/usb/hso.c @@ -1297,7 +1297,6 @@ 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); @@ -1793,8 +1792,8 @@ static int mux_device_request(struct hso_serial *serial, u8 type, u16 port, /* initialize */ ctrl_req->wValue = 0; - ctrl_req->wIndex = cpu_to_le16(hso_port_to_mux(port)); - ctrl_req->wLength = cpu_to_le16(size); + ctrl_req->wIndex = hso_port_to_mux(port); + ctrl_req->wLength = size; if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) { /* Reading command */ @@ -2044,8 +2043,9 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) return -2; } - /* All callers to put_rxbuf_data hold serial_lock */ + spin_lock(&serial->serial_lock); tty = tty_kref_get(serial->tty); + spin_unlock(&serial->serial_lock); /* Push data to tty */ if (tty) { @@ -2053,10 +2053,8 @@ 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)) { - tty_kref_put(tty); + if (test_bit(TTY_THROTTLED, &tty->flags)) return -1; - } curr_write_len = tty_insert_flip_string (tty, urb->transfer_buffer + serial->curr_rx_urb_offset, diff --git a/trunk/drivers/net/wan/ixp4xx_hss.c b/trunk/drivers/net/wan/ixp4xx_hss.c index 0dbd85b0162d..2dc241689d37 100644 --- a/trunk/drivers/net/wan/ixp4xx_hss.c +++ b/trunk/drivers/net/wan/ixp4xx_hss.c @@ -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(&port->napi); + netif_rx_schedule(dev, &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(napi); + netif_rx_complete(dev, 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(&port->napi); + netif_rx_schedule(dev, &port->napi); return 0; err_unlock: diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index e4f9f747de88..ea543fcf2687 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -111,7 +111,7 @@ config WLAN_80211 lets you choose drivers. config PCMCIA_RAYCS - tristate "Aviator/Raytheon 2.4GHz wireless support" + tristate "Aviator/Raytheon 2.4MHz wireless support" depends on PCMCIA && WLAN_80211 select WIRELESS_EXT ---help--- diff --git a/trunk/drivers/net/wireless/ath5k/base.c b/trunk/drivers/net/wireless/ath5k/base.c index 8ef87356e083..4af2607deec0 100644 --- a/trunk/drivers/net/wireless/ath5k/base.c +++ b/trunk/drivers/net/wireless/ath5k/base.c @@ -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 NETDEV_TX_BUSY; + return -1; } 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 NETDEV_TX_BUSY; + return -1; } 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 NETDEV_TX_OK; + return 0; } - return NETDEV_TX_OK; + return 0; } static int diff --git a/trunk/drivers/net/wireless/ath5k/pcu.c b/trunk/drivers/net/wireless/ath5k/pcu.c index 75eb9f43c741..0cac05c6a9ce 100644 --- a/trunk/drivers/net/wireless/ath5k/pcu.c +++ b/trunk/drivers/net/wireless/ath5k/pcu.c @@ -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_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); + AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); 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_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); + AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); break; case NL80211_IFTYPE_STATION: diff --git a/trunk/drivers/net/wireless/ath5k/reg.h b/trunk/drivers/net/wireless/ath5k/reg.h index 9189ab13286c..91aaeaf88199 100644 --- a/trunk/drivers/net/wireless/ath5k/reg.h +++ b/trunk/drivers/net/wireless/ath5k/reg.h @@ -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_IBSS 0x00000020 /* 0-BSS, 1-IBSS [5211+] */ +#define AR5K_CFG_ADHOC 0x00000020 /* AP/Adhoc indication [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) */ diff --git a/trunk/drivers/net/wireless/ath9k/Kconfig b/trunk/drivers/net/wireless/ath9k/Kconfig index 90a8dd873786..c43bd321f97f 100644 --- a/trunk/drivers/net/wireless/ath9k/Kconfig +++ b/trunk/drivers/net/wireless/ath9k/Kconfig @@ -1,7 +1,6 @@ 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 diff --git a/trunk/drivers/net/wireless/ath9k/main.c b/trunk/drivers/net/wireless/ath9k/main.c index 727f067aca4f..191eec50dc75 100644 --- a/trunk/drivers/net/wireless/ath9k/main.c +++ b/trunk/drivers/net/wireless/ath9k/main.c @@ -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) diff --git a/trunk/drivers/net/wireless/ath9k/xmit.c b/trunk/drivers/net/wireless/ath9k/xmit.c index c92f0c6e4adc..3bfc3b90f256 100644 --- a/trunk/drivers/net/wireless/ath9k/xmit.c +++ b/trunk/drivers/net/wireless/ath9k/xmit.c @@ -126,7 +126,15 @@ 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 + 1; + 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; + } hdrlen = ieee80211_get_hdrlen_from_skb(skb); padsize = hdrlen & 3; @@ -256,22 +264,25 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb, } /* Get seqno */ - /* 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); + + 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); + } } static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, @@ -1707,10 +1718,11 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, /* Assign seqno, tidno */ - if (ieee80211_is_data_qos(fc) && (sc->sc_flags & SC_OP_TXAGGR)) + if (bf_isht(bf) && (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, diff --git a/trunk/drivers/net/wireless/b43/main.c b/trunk/drivers/net/wireless/b43/main.c index c788bad10661..7b31a327b24a 100644 --- a/trunk/drivers/net/wireless/b43/main.c +++ b/trunk/drivers/net/wireless/b43/main.c @@ -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 uninitialized_var(gmode); + bool gmode; int prev_status; /* Find a device and PHY which supports the band. */ diff --git a/trunk/drivers/net/wireless/b43legacy/main.c b/trunk/drivers/net/wireless/b43legacy/main.c index fb996c27a19b..c1324e31d2f6 100644 --- a/trunk/drivers/net/wireless/b43legacy/main.c +++ b/trunk/drivers/net/wireless/b43legacy/main.c @@ -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 *uninitialized_var(up_dev); + struct b43legacy_wldev *up_dev; struct b43legacy_wldev *down_dev; int err; bool gmode = 0; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c b/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c index 45cfa1cf194a..8fdb34222c0a 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c @@ -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 uninitialized_var(power_idx); + s32 power_idx; int rc; /* use channel group's clip-power table, diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h b/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h index ba997204c8d4..52966ffbef6e 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h @@ -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"): - * 6-0: 10) 1 Mbps + * 3-0: 10) 1 Mbps * 20) 2 Mbps * 55) 5.5 Mbps * 110) 11 Mbps diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 8c71ad4f88c5..01a2169cecec 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c @@ -51,7 +51,6 @@ 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); diff --git a/trunk/drivers/net/wireless/libertas_tf/main.c b/trunk/drivers/net/wireless/libertas_tf/main.c index e7289e2e7f16..d1fc305de5fe 100644 --- a/trunk/drivers/net/wireless/libertas_tf/main.c +++ b/trunk/drivers/net/wireless/libertas_tf/main.c @@ -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 NETDEV_TX_OK; + return 0; } static void lbtf_tx_work(struct work_struct *work) diff --git a/trunk/drivers/net/wireless/orinoco/orinoco.c b/trunk/drivers/net/wireless/orinoco/orinoco.c index c3bb85e0251e..bc84e2792f8a 100644 --- a/trunk/drivers/net/wireless/orinoco/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco/orinoco.c @@ -1610,16 +1610,6 @@ 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) { @@ -1632,8 +1622,6 @@ static void orinoco_rx_isr_tasklet(unsigned long data) kfree(desc); } - - orinoco_unlock(priv, &flags); } /********************************************************************/ @@ -3657,22 +3645,12 @@ struct net_device void free_orinocodev(struct net_device *dev) { struct orinoco_private *priv = netdev_priv(dev); - struct orinoco_rx_data *rx_data, *temp; - /* 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. */ + /* 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 */ 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); diff --git a/trunk/drivers/net/wireless/orinoco/orinoco_cs.c b/trunk/drivers/net/wireless/orinoco/orinoco_cs.c index 0b32215d3f5d..f127602670ec 100644 --- a/trunk/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/trunk/drivers/net/wireless/orinoco/orinoco_cs.c @@ -435,7 +435,6 @@ 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 */ diff --git a/trunk/drivers/net/wireless/p54/p54common.c b/trunk/drivers/net/wireless/p54/p54common.c index c6a370fa9bcb..82354b974a04 100644 --- a/trunk/drivers/net/wireless/p54/p54common.c +++ b/trunk/drivers/net/wireless/p54/p54common.c @@ -138,7 +138,6 @@ 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; @@ -196,16 +195,6 @@ 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: @@ -586,7 +575,6 @@ 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 @@ -615,11 +603,8 @@ 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; - 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.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ? + hdr->rate : (hdr->rate - 4)) & 0xf; rx_status.freq = freq; rx_status.band = dev->conf.channel->band; rx_status.antenna = hdr->antenna; @@ -813,16 +798,6 @@ 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; @@ -1408,6 +1383,7 @@ 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); @@ -1421,8 +1397,6 @@ 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; @@ -1850,7 +1824,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev, static int p54_config(struct ieee80211_hw *dev, u32 changed) { - int ret = 0; + int ret; struct p54_common *priv = dev->priv; struct ieee80211_conf *conf = &dev->conf; diff --git a/trunk/drivers/net/wireless/p54/p54usb.c b/trunk/drivers/net/wireless/p54/p54usb.c index 6a6a72f6f82c..c44a200059d2 100644 --- a/trunk/drivers/net/wireless/p54/p54usb.c +++ b/trunk/drivers/net/wireless/p54/p54usb.c @@ -56,7 +56,6 @@ 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) */ @@ -285,7 +284,6 @@ 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)) { diff --git a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c index af6b5847be5c..30028e2422fc 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c @@ -38,7 +38,7 @@ /* * Allow hardware encryption to be disabled. */ -static int modparam_nohwcrypt = 0; +static int modparam_nohwcrypt = 1; 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 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 + * 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 * 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,7 +1334,14 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, /* ICV is located at the end of frame */ - rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; + /* + * 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; if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) rxdesc->flags |= RX_FLAG_DECRYPTED; else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c index 87c0f2c83077..6d92542fcf0d 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -807,11 +807,13 @@ static void rt2x00lib_rate(struct ieee80211_rate *entry, { entry->flags = 0; entry->bitrate = rate->bitrate; - entry->hw_value =index; - entry->hw_value_short = index; + entry->hw_value = rt2x00_create_rate_hw_value(index, 0); + entry->hw_value_short = entry->hw_value; - 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, diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00leds.c b/trunk/drivers/net/wireless/rt2x00/rt2x00leds.c index a0cd35b6beb5..68f4e0fc35b9 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00leds.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00leds.c @@ -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_RADIO) + if (rt2x00dev->led_radio.type == LED_TYPE_ASSOC) rt2x00led_led_simple(&rt2x00dev->led_radio, enabled); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00lib.h b/trunk/drivers/net/wireless/rt2x00/rt2x00lib.h index 86cd26fbf769..03024327767b 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00lib.h +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00lib.h @@ -52,11 +52,22 @@ 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. */ diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c index 746a8f36b931..eaec6bd93ed5 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c @@ -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 (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) + if (rt2x00_get_rate_preamble(rate->hw_value)) txdesc->signal |= 0x08; } } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c index 0b29d767a258..83df312ac56f 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -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) && - (queue != queue_end(rt2x00dev))) { + } else if (usb_endpoint_is_bulk_out(ep_desc)) { rt2x00usb_assign_endpoint(queue, ep_desc); - queue = queue_next(queue); + if (queue != queue_end(rt2x00dev)) + queue = queue_next(queue); tx_ep_desc = ep_desc; } } diff --git a/trunk/drivers/net/wireless/rt2x00/rt73usb.c b/trunk/drivers/net/wireless/rt2x00/rt73usb.c index 96a8d69f8790..d638a8a59370 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt73usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt73usb.c @@ -2321,7 +2321,6 @@ 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) }, diff --git a/trunk/drivers/net/wireless/rtl818x/rtl8180_dev.c b/trunk/drivers/net/wireless/rtl818x/rtl8180_dev.c index 387c133ec0f2..5f887fb137a9 100644 --- a/trunk/drivers/net/wireless/rtl818x/rtl8180_dev.c +++ b/trunk/drivers/net/wireless/rtl818x/rtl8180_dev.c @@ -897,7 +897,6 @@ 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; diff --git a/trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c b/trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c index 6ad6bac37706..00ce3ef39abe 100644 --- a/trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c @@ -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 NETDEV_TX_OK; + return -ENOMEM; } flags = skb->len; @@ -281,7 +281,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) } usb_free_urb(urb); - return NETDEV_TX_OK; + return rc; } static void rtl8187_rx_cb(struct urb *urb) @@ -1471,7 +1471,6 @@ 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); } diff --git a/trunk/drivers/of/of_i2c.c b/trunk/drivers/of/of_i2c.c index fa65a2b2ae2e..e1b0ad6e918f 100644 --- a/trunk/drivers/of/of_i2c.c +++ b/trunk/drivers/of/of_i2c.c @@ -66,23 +66,4 @@ 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"); diff --git a/trunk/drivers/parisc/superio.c b/trunk/drivers/parisc/superio.c index 4fa3bb2ddfe4..1e93c837514f 100644 --- a/trunk/drivers/parisc/superio.c +++ b/trunk/drivers/parisc/superio.c @@ -405,6 +405,7 @@ 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; diff --git a/trunk/drivers/pci/hotplug/acpiphp_glue.c b/trunk/drivers/pci/hotplug/acpiphp_glue.c index 803d9ddd6e75..f09b1010d477 100644 --- a/trunk/drivers/pci/hotplug/acpiphp_glue.c +++ b/trunk/drivers/pci/hotplug/acpiphp_glue.c @@ -266,8 +266,6 @@ static int detect_ejectable_slots(struct pci_bus *pbus) int found = acpi_pci_detect_ejectable(pbus); if (!found) { acpi_handle bridge_handle = acpi_pci_get_bridge_handle(pbus); - if (!bridge_handle) - return 0; acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1, is_pci_dock_device, (void *)&found, NULL); } diff --git a/trunk/drivers/pci/intel-iommu.c b/trunk/drivers/pci/intel-iommu.c index 3dfecb20d5e7..235fb7a5a8a5 100644 --- a/trunk/drivers/pci/intel-iommu.c +++ b/trunk/drivers/pci/intel-iommu.c @@ -438,8 +438,7 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn) continue; for (i = 0; i < drhd->devices_cnt; i++) - if (drhd->devices[i] && - drhd->devices[i]->bus->number == bus && + if (drhd->devices[i]->bus->number == bus && drhd->devices[i]->devfn == devfn) return drhd->iommu; diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index e491fdedf705..c12f6c790698 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -1260,14 +1260,15 @@ void pci_pm_init(struct pci_dev *dev) /* find PCI PM capability in list */ pm = pci_find_capability(dev, PCI_CAP_ID_PM); if (!pm) - return; + goto Exit; + /* Check device's ability to generate PME# */ pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc); if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n", pmc & PCI_PM_CAP_VER_MASK); - return; + goto Exit; } dev->pm_cap = pm; @@ -1306,6 +1307,9 @@ void pci_pm_init(struct pci_dev *dev) } else { dev->pme_support = 0; } + + Exit: + pci_update_current_state(dev, PCI_D0); } /** diff --git a/trunk/drivers/pci/syscall.c b/trunk/drivers/pci/syscall.c index ec22284eed30..645d7a60e412 100644 --- a/trunk/drivers/pci/syscall.c +++ b/trunk/drivers/pci/syscall.c @@ -14,8 +14,10 @@ #include #include "pci.h" -SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, - unsigned long, off, unsigned long, len, void __user *, buf) +asmlinkage long +sys_pciconfig_read(unsigned long bus, unsigned long dfn, + unsigned long off, unsigned long len, + void __user *buf) { struct pci_dev *dev; u8 byte; @@ -84,8 +86,10 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, return err; } -SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, - unsigned long, off, unsigned long, len, void __user *, buf) +asmlinkage long +sys_pciconfig_write(unsigned long bus, unsigned long dfn, + unsigned long off, unsigned long len, + void __user *buf) { struct pci_dev *dev; u8 byte; diff --git a/trunk/drivers/pcmcia/electra_cf.c b/trunk/drivers/pcmcia/electra_cf.c index d187ba4c5e0e..a34284b1482a 100644 --- a/trunk/drivers/pcmcia/electra_cf.c +++ b/trunk/drivers/pcmcia/electra_cf.c @@ -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%llx irq %d\n", + dev_info(device, "at mem 0x%lx io 0x%lx irq %d\n", cf->mem_phys, io.start, cf->irq); cf->active = 1; diff --git a/trunk/drivers/platform/x86/Kconfig b/trunk/drivers/platform/x86/Kconfig index 1a266d4ab5f1..e65448e99b48 100644 --- a/trunk/drivers/platform/x86/Kconfig +++ b/trunk/drivers/platform/x86/Kconfig @@ -54,18 +54,6 @@ config ASUS_LAPTOP If you have an ACPI-compatible ASUS laptop, say Y or M here. -config DELL_LAPTOP - tristate "Dell Laptop Extras (EXPERIMENTAL)" - depends on X86 - depends on DCDBAS - depends on EXPERIMENTAL - depends on BACKLIGHT_CLASS_DEVICE - depends on RFKILL - default n - ---help--- - This driver adds support for rfkill and backlight control to Dell - laptops. - config FUJITSU_LAPTOP tristate "Fujitsu Laptop Extras" depends on ACPI @@ -204,17 +192,6 @@ config THINKPAD_ACPI If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. -config THINKPAD_ACPI_DEBUGFACILITIES - bool "Maintainer debug facilities" - depends on THINKPAD_ACPI - default n - ---help--- - Enables extra stuff in the thinkpad-acpi which is completely useless - for normal use. Read the driver source to find out what it does. - - Say N here, unless you were told by a kernel maintainer to do - otherwise. - config THINKPAD_ACPI_DEBUG bool "Verbose debug mode" depends on THINKPAD_ACPI diff --git a/trunk/drivers/platform/x86/Makefile b/trunk/drivers/platform/x86/Makefile index e29065120be9..1e9de2ae0de5 100644 --- a/trunk/drivers/platform/x86/Makefile +++ b/trunk/drivers/platform/x86/Makefile @@ -6,7 +6,6 @@ obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o -obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o obj-$(CONFIG_ACER_WMI) += acer-wmi.o obj-$(CONFIG_HP_WMI) += hp-wmi.o obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o diff --git a/trunk/drivers/platform/x86/eeepc-laptop.c b/trunk/drivers/platform/x86/eeepc-laptop.c index 9d93cb971e59..02fe2b8b8939 100644 --- a/trunk/drivers/platform/x86/eeepc-laptop.c +++ b/trunk/drivers/platform/x86/eeepc-laptop.c @@ -90,7 +90,7 @@ enum { }; static const char *cm_getv[] = { - "WLDG", "BTHG", NULL, NULL, + "WLDG", NULL, NULL, NULL, "CAMG", NULL, NULL, NULL, NULL, "PBLG", NULL, NULL, "CFVG", NULL, NULL, NULL, @@ -99,7 +99,7 @@ static const char *cm_getv[] = { }; static const char *cm_setv[] = { - "WLDS", "BTHS", NULL, NULL, + "WLDS", NULL, NULL, NULL, "CAMS", NULL, NULL, NULL, "SDSP", "PBLS", "HDPS", NULL, "CFVS", NULL, NULL, NULL, diff --git a/trunk/drivers/platform/x86/thinkpad_acpi.c b/trunk/drivers/platform/x86/thinkpad_acpi.c index bcbc05107ba8..3478453eba7a 100644 --- a/trunk/drivers/platform/x86/thinkpad_acpi.c +++ b/trunk/drivers/platform/x86/thinkpad_acpi.c @@ -21,7 +21,7 @@ * 02110-1301, USA. */ -#define TPACPI_VERSION "0.22" +#define TPACPI_VERSION "0.21" #define TPACPI_SYSFS_VERSION 0x020200 /* @@ -122,27 +122,6 @@ enum { #define TPACPI_HKEY_INPUT_PRODUCT 0x5054 /* "TP" */ #define TPACPI_HKEY_INPUT_VERSION 0x4101 -/* ACPI \WGSV commands */ -enum { - TP_ACPI_WGSV_GET_STATE = 0x01, /* Get state information */ - TP_ACPI_WGSV_PWR_ON_ON_RESUME = 0x02, /* Resume WWAN powered on */ - TP_ACPI_WGSV_PWR_OFF_ON_RESUME = 0x03, /* Resume WWAN powered off */ - TP_ACPI_WGSV_SAVE_STATE = 0x04, /* Save state for S4/S5 */ -}; - -/* TP_ACPI_WGSV_GET_STATE bits */ -enum { - TP_ACPI_WGSV_STATE_WWANEXIST = 0x0001, /* WWAN hw available */ - TP_ACPI_WGSV_STATE_WWANPWR = 0x0002, /* WWAN radio enabled */ - TP_ACPI_WGSV_STATE_WWANPWRRES = 0x0004, /* WWAN state at resume */ - TP_ACPI_WGSV_STATE_WWANBIOSOFF = 0x0008, /* WWAN disabled in BIOS */ - TP_ACPI_WGSV_STATE_BLTHEXIST = 0x0001, /* BLTH hw available */ - TP_ACPI_WGSV_STATE_BLTHPWR = 0x0002, /* BLTH radio enabled */ - TP_ACPI_WGSV_STATE_BLTHPWRRES = 0x0004, /* BLTH state at resume */ - TP_ACPI_WGSV_STATE_BLTHBIOSOFF = 0x0008, /* BLTH disabled in BIOS */ - TP_ACPI_WGSV_STATE_UWBEXIST = 0x0010, /* UWB hw available */ - TP_ACPI_WGSV_STATE_UWBPWR = 0x0020, /* UWB radio enabled */ -}; /**************************************************************************** * Main driver @@ -169,17 +148,14 @@ enum { enum { TPACPI_RFK_BLUETOOTH_SW_ID = 0, TPACPI_RFK_WWAN_SW_ID, - TPACPI_RFK_UWB_SW_ID, }; /* Debugging */ #define TPACPI_LOG TPACPI_FILE ": " -#define TPACPI_ALERT KERN_ALERT TPACPI_LOG -#define TPACPI_CRIT KERN_CRIT TPACPI_LOG -#define TPACPI_ERR KERN_ERR TPACPI_LOG -#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG -#define TPACPI_INFO KERN_INFO TPACPI_LOG -#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG +#define TPACPI_ERR KERN_ERR TPACPI_LOG +#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG +#define TPACPI_INFO KERN_INFO TPACPI_LOG +#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG #define TPACPI_DBG_ALL 0xffff #define TPACPI_DBG_INIT 0x0001 @@ -225,7 +201,6 @@ struct ibm_struct { void (*exit) (void); void (*resume) (void); void (*suspend) (pm_message_t state); - void (*shutdown) (void); struct list_head all_drivers; @@ -264,7 +239,6 @@ static struct { u32 bright_16levels:1; u32 bright_acpimode:1; u32 wan:1; - u32 uwb:1; u32 fan_ctrl_status_undef:1; u32 input_device_registered:1; u32 platform_drv_registered:1; @@ -314,18 +288,6 @@ struct tpacpi_led_classdev { unsigned int led; }; -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES -static int dbg_wlswemul; -static int tpacpi_wlsw_emulstate; -static int dbg_bluetoothemul; -static int tpacpi_bluetooth_emulstate; -static int dbg_wwanemul; -static int tpacpi_wwan_emulstate; -static int dbg_uwbemul; -static int tpacpi_uwb_emulstate; -#endif - - /**************************************************************************** **************************************************************************** * @@ -766,18 +728,6 @@ static int tpacpi_resume_handler(struct platform_device *pdev) return 0; } -static void tpacpi_shutdown_handler(struct platform_device *pdev) -{ - struct ibm_struct *ibm, *itmp; - - list_for_each_entry_safe(ibm, itmp, - &tpacpi_all_drivers, - all_drivers) { - if (ibm->shutdown) - (ibm->shutdown)(); - } -} - static struct platform_driver tpacpi_pdriver = { .driver = { .name = TPACPI_DRVR_NAME, @@ -785,7 +735,6 @@ static struct platform_driver tpacpi_pdriver = { }, .suspend = tpacpi_suspend_handler, .resume = tpacpi_resume_handler, - .shutdown = tpacpi_shutdown_handler, }; static struct platform_driver tpacpi_hwmon_pdriver = { @@ -973,27 +922,11 @@ static int __init tpacpi_new_rfkill(const unsigned int id, struct rfkill **rfk, const enum rfkill_type rfktype, const char *name, - const bool set_default, int (*toggle_radio)(void *, enum rfkill_state), int (*get_state)(void *, enum rfkill_state *)) { int res; - enum rfkill_state initial_state = RFKILL_STATE_SOFT_BLOCKED; - - res = get_state(NULL, &initial_state); - if (res < 0) { - printk(TPACPI_ERR - "failed to read initial state for %s, error %d; " - "will turn radio off\n", name, res); - } else if (set_default) { - /* try to set the initial state as the default for the rfkill - * type, since we ask the firmware to preserve it across S5 in - * NVRAM */ - rfkill_set_default(rfktype, - (initial_state == RFKILL_STATE_UNBLOCKED) ? - RFKILL_STATE_UNBLOCKED : - RFKILL_STATE_SOFT_BLOCKED); - } + enum rfkill_state initial_state; *rfk = rfkill_allocate(&tpacpi_pdev->dev, rfktype); if (!*rfk) { @@ -1005,7 +938,9 @@ static int __init tpacpi_new_rfkill(const unsigned int id, (*rfk)->name = name; (*rfk)->get_state = get_state; (*rfk)->toggle_radio = toggle_radio; - (*rfk)->state = initial_state; + + if (!get_state(NULL, &initial_state)) + (*rfk)->state = initial_state; res = rfkill_register(*rfk); if (res < 0) { @@ -1071,119 +1006,6 @@ static DRIVER_ATTR(version, S_IRUGO, /* --------------------------------------------------------------------- */ -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - -static void tpacpi_send_radiosw_update(void); - -/* wlsw_emulstate ------------------------------------------------------ */ -static ssize_t tpacpi_driver_wlsw_emulstate_show(struct device_driver *drv, - char *buf) -{ - return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wlsw_emulstate); -} - -static ssize_t tpacpi_driver_wlsw_emulstate_store(struct device_driver *drv, - const char *buf, size_t count) -{ - unsigned long t; - - if (parse_strtoul(buf, 1, &t)) - return -EINVAL; - - if (tpacpi_wlsw_emulstate != t) { - tpacpi_wlsw_emulstate = !!t; - tpacpi_send_radiosw_update(); - } else - tpacpi_wlsw_emulstate = !!t; - - return count; -} - -static DRIVER_ATTR(wlsw_emulstate, S_IWUSR | S_IRUGO, - tpacpi_driver_wlsw_emulstate_show, - tpacpi_driver_wlsw_emulstate_store); - -/* bluetooth_emulstate ------------------------------------------------- */ -static ssize_t tpacpi_driver_bluetooth_emulstate_show( - struct device_driver *drv, - char *buf) -{ - return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_bluetooth_emulstate); -} - -static ssize_t tpacpi_driver_bluetooth_emulstate_store( - struct device_driver *drv, - const char *buf, size_t count) -{ - unsigned long t; - - if (parse_strtoul(buf, 1, &t)) - return -EINVAL; - - tpacpi_bluetooth_emulstate = !!t; - - return count; -} - -static DRIVER_ATTR(bluetooth_emulstate, S_IWUSR | S_IRUGO, - tpacpi_driver_bluetooth_emulstate_show, - tpacpi_driver_bluetooth_emulstate_store); - -/* wwan_emulstate ------------------------------------------------- */ -static ssize_t tpacpi_driver_wwan_emulstate_show( - struct device_driver *drv, - char *buf) -{ - return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wwan_emulstate); -} - -static ssize_t tpacpi_driver_wwan_emulstate_store( - struct device_driver *drv, - const char *buf, size_t count) -{ - unsigned long t; - - if (parse_strtoul(buf, 1, &t)) - return -EINVAL; - - tpacpi_wwan_emulstate = !!t; - - return count; -} - -static DRIVER_ATTR(wwan_emulstate, S_IWUSR | S_IRUGO, - tpacpi_driver_wwan_emulstate_show, - tpacpi_driver_wwan_emulstate_store); - -/* uwb_emulstate ------------------------------------------------- */ -static ssize_t tpacpi_driver_uwb_emulstate_show( - struct device_driver *drv, - char *buf) -{ - return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_uwb_emulstate); -} - -static ssize_t tpacpi_driver_uwb_emulstate_store( - struct device_driver *drv, - const char *buf, size_t count) -{ - unsigned long t; - - if (parse_strtoul(buf, 1, &t)) - return -EINVAL; - - tpacpi_uwb_emulstate = !!t; - - return count; -} - -static DRIVER_ATTR(uwb_emulstate, S_IWUSR | S_IRUGO, - tpacpi_driver_uwb_emulstate_show, - tpacpi_driver_uwb_emulstate_store); -#endif - -/* --------------------------------------------------------------------- */ - static struct driver_attribute *tpacpi_driver_attributes[] = { &driver_attr_debug_level, &driver_attr_version, &driver_attr_interface_version, @@ -1200,17 +1022,6 @@ static int __init tpacpi_create_driver_attributes(struct device_driver *drv) i++; } -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (!res && dbg_wlswemul) - res = driver_create_file(drv, &driver_attr_wlsw_emulstate); - if (!res && dbg_bluetoothemul) - res = driver_create_file(drv, &driver_attr_bluetooth_emulstate); - if (!res && dbg_wwanemul) - res = driver_create_file(drv, &driver_attr_wwan_emulstate); - if (!res && dbg_uwbemul) - res = driver_create_file(drv, &driver_attr_uwb_emulstate); -#endif - return res; } @@ -1220,13 +1031,6 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv) for (i = 0; i < ARRAY_SIZE(tpacpi_driver_attributes); i++) driver_remove_file(drv, tpacpi_driver_attributes[i]); - -#ifdef THINKPAD_ACPI_DEBUGFACILITIES - driver_remove_file(drv, &driver_attr_wlsw_emulstate); - driver_remove_file(drv, &driver_attr_bluetooth_emulstate); - driver_remove_file(drv, &driver_attr_wwan_emulstate); - driver_remove_file(drv, &driver_attr_uwb_emulstate); -#endif } /**************************************************************************** @@ -1412,12 +1216,6 @@ static struct attribute_set *hotkey_dev_attributes; static int hotkey_get_wlsw(int *status) { -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_wlswemul) { - *status = !!tpacpi_wlsw_emulstate; - return 0; - } -#endif if (!acpi_evalf(hkey_handle, status, "WLSW", "d")) return -EIO; return 0; @@ -1880,7 +1678,7 @@ static ssize_t hotkey_mask_show(struct device *dev, { int res; - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; res = hotkey_mask_get(); mutex_unlock(&hotkey_mutex); @@ -1899,7 +1697,7 @@ static ssize_t hotkey_mask_store(struct device *dev, if (parse_strtoul(buf, 0xffffffffUL, &t)) return -EINVAL; - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; res = hotkey_mask_set(t); @@ -1985,7 +1783,7 @@ static ssize_t hotkey_source_mask_store(struct device *dev, ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0)) return -EINVAL; - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; HOTKEY_CONFIG_CRITICAL_START @@ -2020,7 +1818,7 @@ static ssize_t hotkey_poll_freq_store(struct device *dev, if (parse_strtoul(buf, 25, &t)) return -EINVAL; - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; hotkey_poll_freq = t; @@ -2160,7 +1958,6 @@ static struct attribute *hotkey_mask_attributes[] __initdata = { static void bluetooth_update_rfk(void); static void wan_update_rfk(void); -static void uwb_update_rfk(void); static void tpacpi_send_radiosw_update(void) { int wlsw; @@ -2170,8 +1967,6 @@ static void tpacpi_send_radiosw_update(void) bluetooth_update_rfk(); if (tp_features.wan) wan_update_rfk(); - if (tp_features.uwb) - uwb_update_rfk(); if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { mutex_lock(&tpacpi_inputdev_send_mutex); @@ -2427,13 +2222,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) hotkey_source_mask, hotkey_poll_freq); #endif -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_wlswemul) { - tp_features.hotkey_wlsw = 1; - printk(TPACPI_INFO - "radio switch emulation enabled\n"); - } else -#endif /* Not all thinkpads have a hardware radio switch */ if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { tp_features.hotkey_wlsw = 1; @@ -2573,154 +2361,13 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) return (res < 0)? res : 1; } -static bool hotkey_notify_hotkey(const u32 hkey, - bool *send_acpi_ev, - bool *ignore_acpi_ev) -{ - /* 0x1000-0x1FFF: key presses */ - unsigned int scancode = hkey & 0xfff; - *send_acpi_ev = true; - *ignore_acpi_ev = false; - - if (scancode > 0 && scancode < 0x21) { - scancode--; - if (!(hotkey_source_mask & (1 << scancode))) { - tpacpi_input_send_key(scancode); - *send_acpi_ev = false; - } else { - *ignore_acpi_ev = true; - } - return true; - } - return false; -} - -static bool hotkey_notify_wakeup(const u32 hkey, - bool *send_acpi_ev, - bool *ignore_acpi_ev) -{ - /* 0x2000-0x2FFF: Wakeup reason */ - *send_acpi_ev = true; - *ignore_acpi_ev = false; - - switch (hkey) { - case 0x2304: /* suspend, undock */ - case 0x2404: /* hibernation, undock */ - hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK; - *ignore_acpi_ev = true; - break; - - case 0x2305: /* suspend, bay eject */ - case 0x2405: /* hibernation, bay eject */ - hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ; - *ignore_acpi_ev = true; - break; - - case 0x2313: /* Battery on critical low level (S3) */ - case 0x2413: /* Battery on critical low level (S4) */ - printk(TPACPI_ALERT - "EMERGENCY WAKEUP: battery almost empty\n"); - /* how to auto-heal: */ - /* 2313: woke up from S3, go to S4/S5 */ - /* 2413: woke up from S4, go to S5 */ - break; - - default: - return false; - } - - if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { - printk(TPACPI_INFO - "woke up due to a hot-unplug " - "request...\n"); - hotkey_wakeup_reason_notify_change(); - } - return true; -} - -static bool hotkey_notify_usrevent(const u32 hkey, - bool *send_acpi_ev, - bool *ignore_acpi_ev) -{ - /* 0x5000-0x5FFF: human interface helpers */ - *send_acpi_ev = true; - *ignore_acpi_ev = false; - - switch (hkey) { - case 0x5010: /* Lenovo new BIOS: brightness changed */ - case 0x500b: /* X61t: tablet pen inserted into bay */ - case 0x500c: /* X61t: tablet pen removed from bay */ - return true; - - case 0x5009: /* X41t-X61t: swivel up (tablet mode) */ - case 0x500a: /* X41t-X61t: swivel down (normal mode) */ - tpacpi_input_send_tabletsw(); - hotkey_tablet_mode_notify_change(); - *send_acpi_ev = false; - return true; - - case 0x5001: - case 0x5002: - /* LID switch events. Do not propagate */ - *ignore_acpi_ev = true; - return true; - - default: - return false; - } -} - -static bool hotkey_notify_thermal(const u32 hkey, - bool *send_acpi_ev, - bool *ignore_acpi_ev) -{ - /* 0x6000-0x6FFF: thermal alarms */ - *send_acpi_ev = true; - *ignore_acpi_ev = false; - - switch (hkey) { - case 0x6011: - printk(TPACPI_CRIT - "THERMAL ALARM: battery is too hot!\n"); - /* recommended action: warn user through gui */ - return true; - case 0x6012: - printk(TPACPI_ALERT - "THERMAL EMERGENCY: battery is extremely hot!\n"); - /* recommended action: immediate sleep/hibernate */ - return true; - case 0x6021: - printk(TPACPI_CRIT - "THERMAL ALARM: " - "a sensor reports something is too hot!\n"); - /* recommended action: warn user through gui, that */ - /* some internal component is too hot */ - return true; - case 0x6022: - printk(TPACPI_ALERT - "THERMAL EMERGENCY: " - "a sensor reports something is extremely hot!\n"); - /* recommended action: immediate sleep/hibernate */ - return true; - case 0x6030: - printk(TPACPI_INFO - "EC reports that Thermal Table has changed\n"); - /* recommended action: do nothing, we don't have - * Lenovo ATM information */ - return true; - default: - printk(TPACPI_ALERT - "THERMAL ALERT: unknown thermal alarm received\n"); - return false; - } -} - static void hotkey_notify(struct ibm_struct *ibm, u32 event) { u32 hkey; - bool send_acpi_ev; - bool ignore_acpi_ev; - bool known_ev; + unsigned int scancode; + int send_acpi_ev; + int ignore_acpi_ev; + int unk_ev; if (event != 0x80) { printk(TPACPI_ERR @@ -2728,7 +2375,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) /* forward it to userspace, maybe it knows how to handle it */ acpi_bus_generate_netlink_event( ibm->acpi->device->pnp.device_class, - dev_name(&ibm->acpi->device->dev), + ibm->acpi->device->dev.bus_id, event, 0); return; } @@ -2744,72 +2391,107 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) return; } - send_acpi_ev = true; - ignore_acpi_ev = false; + send_acpi_ev = 1; + ignore_acpi_ev = 0; + unk_ev = 0; switch (hkey >> 12) { case 1: /* 0x1000-0x1FFF: key presses */ - known_ev = hotkey_notify_hotkey(hkey, &send_acpi_ev, - &ignore_acpi_ev); + scancode = hkey & 0xfff; + if (scancode > 0 && scancode < 0x21) { + scancode--; + if (!(hotkey_source_mask & (1 << scancode))) { + tpacpi_input_send_key(scancode); + send_acpi_ev = 0; + } else { + ignore_acpi_ev = 1; + } + } else { + unk_ev = 1; + } break; case 2: - /* 0x2000-0x2FFF: Wakeup reason */ - known_ev = hotkey_notify_wakeup(hkey, &send_acpi_ev, - &ignore_acpi_ev); + /* Wakeup reason */ + switch (hkey) { + case 0x2304: /* suspend, undock */ + case 0x2404: /* hibernation, undock */ + hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK; + ignore_acpi_ev = 1; + break; + case 0x2305: /* suspend, bay eject */ + case 0x2405: /* hibernation, bay eject */ + hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ; + ignore_acpi_ev = 1; + break; + default: + unk_ev = 1; + } + if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { + printk(TPACPI_INFO + "woke up due to a hot-unplug " + "request...\n"); + hotkey_wakeup_reason_notify_change(); + } break; case 3: - /* 0x3000-0x3FFF: bay-related wakeups */ + /* bay-related wakeups */ if (hkey == 0x3003) { hotkey_autosleep_ack = 1; printk(TPACPI_INFO "bay ejected\n"); hotkey_wakeup_hotunplug_complete_notify_change(); - known_ev = true; } else { - known_ev = false; + unk_ev = 1; } break; case 4: - /* 0x4000-0x4FFF: dock-related wakeups */ + /* dock-related wakeups */ if (hkey == 0x4003) { hotkey_autosleep_ack = 1; printk(TPACPI_INFO "undocked\n"); hotkey_wakeup_hotunplug_complete_notify_change(); - known_ev = true; } else { - known_ev = false; + unk_ev = 1; } break; case 5: /* 0x5000-0x5FFF: human interface helpers */ - known_ev = hotkey_notify_usrevent(hkey, &send_acpi_ev, - &ignore_acpi_ev); - break; - case 6: - /* 0x6000-0x6FFF: thermal alarms */ - known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev, - &ignore_acpi_ev); + switch (hkey) { + case 0x5010: /* Lenovo new BIOS: brightness changed */ + case 0x500b: /* X61t: tablet pen inserted into bay */ + case 0x500c: /* X61t: tablet pen removed from bay */ + break; + case 0x5009: /* X41t-X61t: swivel up (tablet mode) */ + case 0x500a: /* X41t-X61t: swivel down (normal mode) */ + tpacpi_input_send_tabletsw(); + hotkey_tablet_mode_notify_change(); + send_acpi_ev = 0; + break; + case 0x5001: + case 0x5002: + /* LID switch events. Do not propagate */ + ignore_acpi_ev = 1; + break; + default: + unk_ev = 1; + } break; case 7: /* 0x7000-0x7FFF: misc */ if (tp_features.hotkey_wlsw && hkey == 0x7000) { tpacpi_send_radiosw_update(); send_acpi_ev = 0; - known_ev = true; break; } /* fallthrough to default */ default: - known_ev = false; + unk_ev = 1; } - if (!known_ev) { + if (unk_ev) { printk(TPACPI_NOTICE "unhandled HKEY event 0x%04x\n", hkey); - printk(TPACPI_NOTICE - "please report the conditions when this " - "event happened to %s\n", TPACPI_MAIL); } /* Legacy events */ @@ -2823,7 +2505,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) if (!ignore_acpi_ev && send_acpi_ev) { acpi_bus_generate_netlink_event( ibm->acpi->device->pnp.device_class, - dev_name(&ibm->acpi->device->dev), + ibm->acpi->device->dev.bus_id, event, hkey); } } @@ -2862,7 +2544,7 @@ static int hotkey_read(char *p) return len; } - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; res = hotkey_status_get(&status); if (!res) @@ -2893,7 +2575,7 @@ static int hotkey_write(char *buf) if (!tp_features.hotkey) return -ENODEV; - if (mutex_lock_killable(&hotkey_mutex)) + if (mutex_lock_interruptible(&hotkey_mutex)) return -ERESTARTSYS; status = -1; @@ -2958,28 +2640,11 @@ enum { /* ACPI GBDC/SBDC bits */ TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */ - TP_ACPI_BLUETOOTH_RESUMECTRL = 0x04, /* Bluetooth state at resume: - off / last state */ -}; - -enum { - /* ACPI \BLTH commands */ - TP_ACPI_BLTH_GET_ULTRAPORT_ID = 0x00, /* Get Ultraport BT ID */ - TP_ACPI_BLTH_GET_PWR_ON_RESUME = 0x01, /* Get power-on-resume state */ - TP_ACPI_BLTH_PWR_ON_ON_RESUME = 0x02, /* Resume powered on */ - TP_ACPI_BLTH_PWR_OFF_ON_RESUME = 0x03, /* Resume powered off */ - TP_ACPI_BLTH_SAVE_STATE = 0x05, /* Save state for S4/S5 */ + TP_ACPI_BLUETOOTH_UNK = 0x04, /* unknown function */ }; static struct rfkill *tpacpi_bluetooth_rfkill; -static void bluetooth_suspend(pm_message_t state) -{ - /* Try to make sure radio will resume powered off */ - acpi_evalf(NULL, NULL, "\\BLTH", "vd", - TP_ACPI_BLTH_PWR_OFF_ON_RESUME); -} - static int bluetooth_get_radiosw(void) { int status; @@ -2991,12 +2656,6 @@ static int bluetooth_get_radiosw(void) if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) return RFKILL_STATE_HARD_BLOCKED; -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_bluetoothemul) - return (tpacpi_bluetooth_emulstate) ? - RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; -#endif - if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) return -EIO; @@ -3030,20 +2689,12 @@ static int bluetooth_set_radiosw(int radio_on, int update_rfk) && radio_on) return -EPERM; -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_bluetoothemul) { - tpacpi_bluetooth_emulstate = !!radio_on; - if (update_rfk) - bluetooth_update_rfk(); - return 0; - } -#endif - - /* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */ + if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) + return -EIO; if (radio_on) - status = TP_ACPI_BLUETOOTH_RADIOSSW; + status |= TP_ACPI_BLUETOOTH_RADIOSSW; else - status = 0; + status &= ~TP_ACPI_BLUETOOTH_RADIOSSW; if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status)) return -EIO; @@ -3114,19 +2765,8 @@ static int tpacpi_bluetooth_rfk_set(void *data, enum rfkill_state state) return bluetooth_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); } -static void bluetooth_shutdown(void) -{ - /* Order firmware to save current state to NVRAM */ - if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd", - TP_ACPI_BLTH_SAVE_STATE)) - printk(TPACPI_NOTICE - "failed to save bluetooth state to NVRAM\n"); -} - static void bluetooth_exit(void) { - bluetooth_shutdown(); - if (tpacpi_bluetooth_rfkill) rfkill_unregister(tpacpi_bluetooth_rfkill); @@ -3152,13 +2792,6 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm) str_supported(tp_features.bluetooth), status); -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_bluetoothemul) { - tp_features.bluetooth = 1; - printk(TPACPI_INFO - "bluetooth switch emulation enabled\n"); - } else -#endif if (tp_features.bluetooth && !(status & TP_ACPI_BLUETOOTH_HWPRESENT)) { /* no bluetooth hardware present in system */ @@ -3179,7 +2812,6 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm) &tpacpi_bluetooth_rfkill, RFKILL_TYPE_BLUETOOTH, "tpacpi_bluetooth_sw", - true, tpacpi_bluetooth_rfk_set, tpacpi_bluetooth_rfk_get); if (res) { @@ -3232,8 +2864,6 @@ static struct ibm_struct bluetooth_driver_data = { .read = bluetooth_read, .write = bluetooth_write, .exit = bluetooth_exit, - .suspend = bluetooth_suspend, - .shutdown = bluetooth_shutdown, }; /************************************************************************* @@ -3244,19 +2874,11 @@ enum { /* ACPI GWAN/SWAN bits */ TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ TP_ACPI_WANCARD_RADIOSSW = 0x02, /* Wan radio enabled */ - TP_ACPI_WANCARD_RESUMECTRL = 0x04, /* Wan state at resume: - off / last state */ + TP_ACPI_WANCARD_UNK = 0x04, /* unknown function */ }; static struct rfkill *tpacpi_wan_rfkill; -static void wan_suspend(pm_message_t state) -{ - /* Try to make sure radio will resume powered off */ - acpi_evalf(NULL, NULL, "\\WGSV", "qvd", - TP_ACPI_WGSV_PWR_OFF_ON_RESUME); -} - static int wan_get_radiosw(void) { int status; @@ -3268,12 +2890,6 @@ static int wan_get_radiosw(void) if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) return RFKILL_STATE_HARD_BLOCKED; -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_wwanemul) - return (tpacpi_wwan_emulstate) ? - RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; -#endif - if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) return -EIO; @@ -3307,20 +2923,12 @@ static int wan_set_radiosw(int radio_on, int update_rfk) && radio_on) return -EPERM; -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_wwanemul) { - tpacpi_wwan_emulstate = !!radio_on; - if (update_rfk) - wan_update_rfk(); - return 0; - } -#endif - - /* We make sure to keep TP_ACPI_WANCARD_RESUMECTRL off */ + if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) + return -EIO; if (radio_on) - status = TP_ACPI_WANCARD_RADIOSSW; + status |= TP_ACPI_WANCARD_RADIOSSW; else - status = 0; + status &= ~TP_ACPI_WANCARD_RADIOSSW; if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status)) return -EIO; @@ -3391,19 +2999,8 @@ static int tpacpi_wan_rfk_set(void *data, enum rfkill_state state) return wan_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); } -static void wan_shutdown(void) -{ - /* Order firmware to save current state to NVRAM */ - if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd", - TP_ACPI_WGSV_SAVE_STATE)) - printk(TPACPI_NOTICE - "failed to save WWAN state to NVRAM\n"); -} - static void wan_exit(void) { - wan_shutdown(); - if (tpacpi_wan_rfkill) rfkill_unregister(tpacpi_wan_rfkill); @@ -3427,13 +3024,6 @@ static int __init wan_init(struct ibm_init_struct *iibm) str_supported(tp_features.wan), status); -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_wwanemul) { - tp_features.wan = 1; - printk(TPACPI_INFO - "wwan switch emulation enabled\n"); - } else -#endif if (tp_features.wan && !(status & TP_ACPI_WANCARD_HWPRESENT)) { /* no wan hardware present in system */ @@ -3454,7 +3044,6 @@ static int __init wan_init(struct ibm_init_struct *iibm) &tpacpi_wan_rfkill, RFKILL_TYPE_WWAN, "tpacpi_wwan_sw", - true, tpacpi_wan_rfk_set, tpacpi_wan_rfk_get); if (res) { @@ -3507,164 +3096,6 @@ static struct ibm_struct wan_driver_data = { .read = wan_read, .write = wan_write, .exit = wan_exit, - .suspend = wan_suspend, - .shutdown = wan_shutdown, -}; - -/************************************************************************* - * UWB subdriver - */ - -enum { - /* ACPI GUWB/SUWB bits */ - TP_ACPI_UWB_HWPRESENT = 0x01, /* UWB hw available */ - TP_ACPI_UWB_RADIOSSW = 0x02, /* UWB radio enabled */ -}; - -static struct rfkill *tpacpi_uwb_rfkill; - -static int uwb_get_radiosw(void) -{ - int status; - - if (!tp_features.uwb) - return -ENODEV; - - /* WLSW overrides UWB in firmware/hardware, reflect that */ - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) - return RFKILL_STATE_HARD_BLOCKED; - -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_uwbemul) - return (tpacpi_uwb_emulstate) ? - RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; -#endif - - if (!acpi_evalf(hkey_handle, &status, "GUWB", "d")) - return -EIO; - - return ((status & TP_ACPI_UWB_RADIOSSW) != 0) ? - RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; -} - -static void uwb_update_rfk(void) -{ - int status; - - if (!tpacpi_uwb_rfkill) - return; - - status = uwb_get_radiosw(); - if (status < 0) - return; - rfkill_force_state(tpacpi_uwb_rfkill, status); -} - -static int uwb_set_radiosw(int radio_on, int update_rfk) -{ - int status; - - if (!tp_features.uwb) - return -ENODEV; - - /* WLSW overrides UWB in firmware/hardware, but there is no - * reason to risk weird behaviour. */ - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status - && radio_on) - return -EPERM; - -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_uwbemul) { - tpacpi_uwb_emulstate = !!radio_on; - if (update_rfk) - uwb_update_rfk(); - return 0; - } -#endif - - status = (radio_on) ? TP_ACPI_UWB_RADIOSSW : 0; - if (!acpi_evalf(hkey_handle, NULL, "SUWB", "vd", status)) - return -EIO; - - if (update_rfk) - uwb_update_rfk(); - - return 0; -} - -/* --------------------------------------------------------------------- */ - -static int tpacpi_uwb_rfk_get(void *data, enum rfkill_state *state) -{ - int uwbs = uwb_get_radiosw(); - - if (uwbs < 0) - return uwbs; - - *state = uwbs; - return 0; -} - -static int tpacpi_uwb_rfk_set(void *data, enum rfkill_state state) -{ - return uwb_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); -} - -static void uwb_exit(void) -{ - if (tpacpi_uwb_rfkill) - rfkill_unregister(tpacpi_uwb_rfkill); -} - -static int __init uwb_init(struct ibm_init_struct *iibm) -{ - int res; - int status = 0; - - vdbg_printk(TPACPI_DBG_INIT, "initializing uwb subdriver\n"); - - TPACPI_ACPIHANDLE_INIT(hkey); - - tp_features.uwb = hkey_handle && - acpi_evalf(hkey_handle, &status, "GUWB", "qd"); - - vdbg_printk(TPACPI_DBG_INIT, "uwb is %s, status 0x%02x\n", - str_supported(tp_features.uwb), - status); - -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES - if (dbg_uwbemul) { - tp_features.uwb = 1; - printk(TPACPI_INFO - "uwb switch emulation enabled\n"); - } else -#endif - if (tp_features.uwb && - !(status & TP_ACPI_UWB_HWPRESENT)) { - /* no uwb hardware present in system */ - tp_features.uwb = 0; - dbg_printk(TPACPI_DBG_INIT, - "uwb hardware not installed\n"); - } - - if (!tp_features.uwb) - return 1; - - res = tpacpi_new_rfkill(TPACPI_RFK_UWB_SW_ID, - &tpacpi_uwb_rfkill, - RFKILL_TYPE_UWB, - "tpacpi_uwb_sw", - false, - tpacpi_uwb_rfk_set, - tpacpi_uwb_rfk_get); - - return res; -} - -static struct ibm_struct uwb_driver_data = { - .name = "uwb", - .exit = uwb_exit, - .flags.experimental = 1, }; /************************************************************************* @@ -4293,7 +3724,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) } acpi_bus_generate_proc_event(ibm->acpi->device, event, data); acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, - dev_name(&ibm->acpi->device->dev), + ibm->acpi->device->dev.bus_id, event, data); } @@ -4395,7 +3826,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event) { acpi_bus_generate_proc_event(ibm->acpi->device, event, 0); acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, - dev_name(&ibm->acpi->device->dev), + ibm->acpi->device->dev.bus_id, event, 0); } @@ -5419,7 +4850,7 @@ static int brightness_set(int value) value < 0) return -EINVAL; - res = mutex_lock_killable(&brightness_mutex); + res = mutex_lock_interruptible(&brightness_mutex); if (res < 0) return res; @@ -5902,60 +5333,6 @@ TPACPI_HANDLE(sfan, ec, "SFAN", /* 570 */ "JFNS", /* 770x-JL */ ); /* all others */ -/* - * Unitialized HFSP quirk: ACPI DSDT and EC fail to initialize the - * HFSP register at boot, so it contains 0x07 but the Thinkpad could - * be in auto mode (0x80). - * - * This is corrected by any write to HFSP either by the driver, or - * by the firmware. - * - * We assume 0x07 really means auto mode while this quirk is active, - * as this is far more likely than the ThinkPad being in level 7, - * which is only used by the firmware during thermal emergencies. - */ - -static void fan_quirk1_detect(void) -{ - /* In some ThinkPads, neither the EC nor the ACPI - * DSDT initialize the HFSP register, and it ends up - * being initially set to 0x07 when it *could* be - * either 0x07 or 0x80. - * - * Enable for TP-1Y (T43), TP-78 (R51e), - * TP-76 (R52), TP-70 (T43, R52), which are known - * to be buggy. */ - if (fan_control_initial_status == 0x07) { - switch (thinkpad_id.ec_model) { - case 0x5931: /* TP-1Y */ - case 0x3837: /* TP-78 */ - case 0x3637: /* TP-76 */ - case 0x3037: /* TP-70 */ - printk(TPACPI_NOTICE - "fan_init: initial fan status is unknown, " - "assuming it is in auto mode\n"); - tp_features.fan_ctrl_status_undef = 1; - ;; - } - } -} - -static void fan_quirk1_handle(u8 *fan_status) -{ - if (unlikely(tp_features.fan_ctrl_status_undef)) { - if (*fan_status != fan_control_initial_status) { - /* something changed the HFSP regisnter since - * driver init time, so it is not undefined - * anymore */ - tp_features.fan_ctrl_status_undef = 0; - } else { - /* Return most likely status. In fact, it - * might be the only possible status */ - *fan_status = TP_EC_FAN_AUTO; - } - } -} - /* * Call with fan_mutex held */ @@ -5994,10 +5371,8 @@ static int fan_get_status(u8 *status) if (unlikely(!acpi_ec_read(fan_status_offset, &s))) return -EIO; - if (likely(status)) { + if (likely(status)) *status = s; - fan_quirk1_handle(status); - } break; @@ -6013,7 +5388,7 @@ static int fan_get_status_safe(u8 *status) int rc; u8 s; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; rc = fan_get_status(&s); if (!rc) @@ -6096,7 +5471,7 @@ static int fan_set_level_safe(int level) if (!fan_control_allowed) return -EPERM; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; if (level == TPACPI_FAN_LAST_LEVEL) @@ -6118,7 +5493,7 @@ static int fan_set_enable(void) if (!fan_control_allowed) return -EPERM; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; switch (fan_control_access_mode) { @@ -6173,7 +5548,7 @@ static int fan_set_disable(void) if (!fan_control_allowed) return -EPERM; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; rc = 0; @@ -6211,7 +5586,7 @@ static int fan_set_speed(int speed) if (!fan_control_allowed) return -EPERM; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; rc = 0; @@ -6307,6 +5682,16 @@ static ssize_t fan_pwm1_enable_show(struct device *dev, if (res) return res; + if (unlikely(tp_features.fan_ctrl_status_undef)) { + if (status != fan_control_initial_status) { + tp_features.fan_ctrl_status_undef = 0; + } else { + /* Return most likely status. In fact, it + * might be the only possible status */ + status = TP_EC_FAN_AUTO; + } + } + if (status & TP_EC_FAN_FULLSPEED) { mode = 0; } else if (status & TP_EC_FAN_AUTO) { @@ -6371,6 +5756,14 @@ static ssize_t fan_pwm1_show(struct device *dev, if (res) return res; + if (unlikely(tp_features.fan_ctrl_status_undef)) { + if (status != fan_control_initial_status) { + tp_features.fan_ctrl_status_undef = 0; + } else { + status = TP_EC_FAN_AUTO; + } + } + if ((status & (TP_EC_FAN_AUTO | TP_EC_FAN_FULLSPEED)) != 0) status = fan_control_desired_level; @@ -6395,7 +5788,7 @@ static ssize_t fan_pwm1_store(struct device *dev, /* scale down from 0-255 to 0-7 */ newlevel = (s >> 5) & 0x07; - if (mutex_lock_killable(&fan_mutex)) + if (mutex_lock_interruptible(&fan_mutex)) return -ERESTARTSYS; rc = fan_get_status(&status); @@ -6502,7 +5895,29 @@ static int __init fan_init(struct ibm_init_struct *iibm) if (likely(acpi_ec_read(fan_status_offset, &fan_control_initial_status))) { fan_status_access_mode = TPACPI_FAN_RD_TPEC; - fan_quirk1_detect(); + + /* In some ThinkPads, neither the EC nor the ACPI + * DSDT initialize the fan status, and it ends up + * being set to 0x07 when it *could* be either + * 0x07 or 0x80. + * + * Enable for TP-1Y (T43), TP-78 (R51e), + * TP-76 (R52), TP-70 (T43, R52), which are known + * to be buggy. */ + if (fan_control_initial_status == 0x07) { + switch (thinkpad_id.ec_model) { + case 0x5931: /* TP-1Y */ + case 0x3837: /* TP-78 */ + case 0x3637: /* TP-76 */ + case 0x3037: /* TP-70 */ + printk(TPACPI_NOTICE + "fan_init: initial fan status " + "is unknown, assuming it is " + "in auto mode\n"); + tp_features.fan_ctrl_status_undef = 1; + ;; + } + } } else { printk(TPACPI_ERR "ThinkPad ACPI EC access misbehaving, " @@ -6691,6 +6106,15 @@ static int fan_read(char *p) if (rc < 0) return rc; + if (unlikely(tp_features.fan_ctrl_status_undef)) { + if (status != fan_control_initial_status) + tp_features.fan_ctrl_status_undef = 0; + else + /* Return most likely status. In fact, it + * might be the only possible status */ + status = TP_EC_FAN_AUTO; + } + len += sprintf(p + len, "status:\t\t%s\n", (status != 0) ? "enabled" : "disabled"); @@ -7139,10 +6563,6 @@ static struct ibm_init_struct ibms_init[] __initdata = { .init = wan_init, .data = &wan_driver_data, }, - { - .init = uwb_init, - .data = &uwb_driver_data, - }, #ifdef CONFIG_THINKPAD_ACPI_VIDEO { .init = video_init, @@ -7281,32 +6701,6 @@ TPACPI_PARAM(brightness); TPACPI_PARAM(volume); TPACPI_PARAM(fan); -#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES -module_param(dbg_wlswemul, uint, 0); -MODULE_PARM_DESC(dbg_wlswemul, "Enables WLSW emulation"); -module_param_named(wlsw_state, tpacpi_wlsw_emulstate, bool, 0); -MODULE_PARM_DESC(wlsw_state, - "Initial state of the emulated WLSW switch"); - -module_param(dbg_bluetoothemul, uint, 0); -MODULE_PARM_DESC(dbg_bluetoothemul, "Enables bluetooth switch emulation"); -module_param_named(bluetooth_state, tpacpi_bluetooth_emulstate, bool, 0); -MODULE_PARM_DESC(bluetooth_state, - "Initial state of the emulated bluetooth switch"); - -module_param(dbg_wwanemul, uint, 0); -MODULE_PARM_DESC(dbg_wwanemul, "Enables WWAN switch emulation"); -module_param_named(wwan_state, tpacpi_wwan_emulstate, bool, 0); -MODULE_PARM_DESC(wwan_state, - "Initial state of the emulated WWAN switch"); - -module_param(dbg_uwbemul, uint, 0); -MODULE_PARM_DESC(dbg_uwbemul, "Enables UWB switch emulation"); -module_param_named(uwb_state, tpacpi_uwb_emulstate, bool, 0); -MODULE_PARM_DESC(uwb_state, - "Initial state of the emulated UWB switch"); -#endif - static void thinkpad_acpi_module_exit(void) { struct ibm_struct *ibm, *itmp; diff --git a/trunk/drivers/ps3/ps3-lpm.c b/trunk/drivers/ps3/ps3-lpm.c index fe96793e3f08..204158cf7a55 100644 --- a/trunk/drivers/ps3/ps3-lpm.c +++ b/trunk/drivers/ps3/ps3-lpm.c @@ -732,7 +732,7 @@ static u64 pm_signal_group_to_ps3_lv1_signal_group(u64 group) case 8: return pm_translate_signal_group_number_on_island8(subgroup); default: - dev_dbg(sbd_core(), "%s:%u: island not found: %llu\n", __func__, + dev_dbg(sbd_core(), "%s:%u: island not found: %lu\n", __func__, __LINE__, group); BUG(); break; @@ -765,7 +765,7 @@ static int __ps3_set_signal(u64 lv1_signal_group, u64 bus_select, signal_select, attr1, attr2, attr3); if (ret) dev_err(sbd_core(), - "%s:%u: error:%d 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx 0x%llx\n", + "%s:%u: error:%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n", __func__, __LINE__, ret, lv1_signal_group, bus_select, signal_select, attr1, attr2, attr3); @@ -908,7 +908,7 @@ void ps3_disable_pm(u32 cpu) lpm_priv->tb_count = tmp; - dev_dbg(sbd_core(), "%s:%u: tb_count %llu (%llxh)\n", __func__, __LINE__, + dev_dbg(sbd_core(), "%s:%u: tb_count %lu (%lxh)\n", __func__, __LINE__, lpm_priv->tb_count, lpm_priv->tb_count); } EXPORT_SYMBOL_GPL(ps3_disable_pm); @@ -938,7 +938,7 @@ int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count, if (offset >= lpm_priv->tb_count) return 0; - count = min_t(u64, count, lpm_priv->tb_count - offset); + count = min(count, lpm_priv->tb_count - offset); while (*bytes_copied < count) { const unsigned long request = count - *bytes_copied; @@ -993,7 +993,7 @@ int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf, if (offset >= lpm_priv->tb_count) return 0; - count = min_t(u64, count, lpm_priv->tb_count - offset); + count = min(count, lpm_priv->tb_count - offset); while (*bytes_copied < count) { const unsigned long request = count - *bytes_copied; @@ -1013,7 +1013,7 @@ int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf, result = copy_to_user(buf, lpm_priv->tb_cache, tmp); if (result) { - dev_dbg(sbd_core(), "%s:%u: 0x%llx bytes at 0x%p\n", + dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%p\n", __func__, __LINE__, tmp, buf); dev_err(sbd_core(), "%s:%u: copy_to_user failed: %d\n", __func__, __LINE__, result); @@ -1148,8 +1148,8 @@ int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache, lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT; lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT; - dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%llx, outlet_id 0x%llx, " - "tb_size 0x%llx\n", __func__, __LINE__, lpm_priv->lpm_id, + dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%lx, outlet_id 0x%lx, " + "tb_size 0x%lx\n", __func__, __LINE__, lpm_priv->lpm_id, lpm_priv->outlet_id, tb_size); return 0; diff --git a/trunk/drivers/ps3/ps3-vuart.c b/trunk/drivers/ps3/ps3-vuart.c index e4ad5ba5d0a3..90c097a7a47a 100644 --- a/trunk/drivers/ps3/ps3-vuart.c +++ b/trunk/drivers/ps3/ps3-vuart.c @@ -114,7 +114,7 @@ struct ports_bmp { static void __maybe_unused _dump_ports_bmp( const struct ports_bmp *bmp, const char *func, int line) { - pr_debug("%s:%d: ports_bmp: %016llxh\n", func, line, bmp->status); + pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status); } #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__) @@ -159,13 +159,11 @@ int ps3_vuart_get_triggers(struct ps3_system_bus_device *dev, struct vuart_triggers *trig) { int result; - u64 size; - u64 val; - u64 tx; + unsigned long size; + unsigned long val; result = lv1_get_virtual_uart_param(dev->port_number, - PARAM_TX_TRIGGER, &tx); - trig->tx = tx; + PARAM_TX_TRIGGER, &trig->tx); if (result) { dev_dbg(&dev->core, "%s:%d: tx_trigger failed: %s\n", @@ -203,7 +201,7 @@ int ps3_vuart_set_triggers(struct ps3_system_bus_device *dev, unsigned int tx, unsigned int rx) { int result; - u64 size; + unsigned long size; result = lv1_set_virtual_uart_param(dev->port_number, PARAM_TX_TRIGGER, tx); @@ -250,7 +248,7 @@ static int ps3_vuart_get_rx_bytes_waiting(struct ps3_system_bus_device *dev, dev_dbg(&dev->core, "%s:%d: rx_bytes failed: %s\n", __func__, __LINE__, ps3_result(result)); - dev_dbg(&dev->core, "%s:%d: %llxh\n", __func__, __LINE__, + dev_dbg(&dev->core, "%s:%d: %lxh\n", __func__, __LINE__, *bytes_waiting); return result; } @@ -297,7 +295,7 @@ static int ps3_vuart_get_interrupt_status(struct ps3_system_bus_device *dev, *status = tmp & priv->interrupt_mask; - dev_dbg(&dev->core, "%s:%d: m %llxh, s %llxh, m&s %lxh\n", + dev_dbg(&dev->core, "%s:%d: m %lxh, s %lxh, m&s %lxh\n", __func__, __LINE__, priv->interrupt_mask, tmp, *status); return result; @@ -365,7 +363,7 @@ int ps3_vuart_disable_interrupt_disconnect(struct ps3_system_bus_device *dev) */ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev, - const void *buf, unsigned int bytes, u64 *bytes_written) + const void *buf, unsigned int bytes, unsigned long *bytes_written) { int result; struct ps3_vuart_port_priv *priv = to_port_priv(dev); @@ -381,7 +379,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev, priv->stats.bytes_written += *bytes_written; - dev_dbg(&dev->core, "%s:%d: wrote %llxh/%xh=>%lxh\n", __func__, __LINE__, + dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__, __LINE__, *bytes_written, bytes, priv->stats.bytes_written); return result; @@ -395,7 +393,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev, */ static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf, - unsigned int bytes, u64 *bytes_read) + unsigned int bytes, unsigned long *bytes_read) { int result; struct ps3_vuart_port_priv *priv = to_port_priv(dev); @@ -413,7 +411,7 @@ static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf, priv->stats.bytes_read += *bytes_read; - dev_dbg(&dev->core, "%s:%d: read %llxh/%xh=>%lxh\n", __func__, __LINE__, + dev_dbg(&dev->core, "%s:%d: read %lxh/%xh=>%lxh\n", __func__, __LINE__, *bytes_read, bytes, priv->stats.bytes_read); return result; @@ -502,7 +500,7 @@ int ps3_vuart_write(struct ps3_system_bus_device *dev, const void *buf, spin_lock_irqsave(&priv->tx_list.lock, flags); if (list_empty(&priv->tx_list.head)) { - u64 bytes_written; + unsigned long bytes_written; result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written); @@ -594,7 +592,7 @@ static int ps3_vuart_queue_rx_bytes(struct ps3_system_bus_device *dev, list_add_tail(&lb->link, &priv->rx_list.head); priv->rx_list.bytes_held += bytes; - dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %llxh bytes\n", + dev_dbg(&dev->core, "%s:%d: buf_%lu: queued %lxh bytes\n", __func__, __LINE__, lb->dbg_number, bytes); *bytes_queued = bytes; @@ -747,7 +745,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev) list_for_each_entry_safe(lb, n, &priv->tx_list.head, link) { - u64 bytes_written; + unsigned long bytes_written; result = ps3_vuart_raw_write(dev, lb->head, lb->tail - lb->head, &bytes_written); @@ -764,7 +762,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev) if (bytes_written < lb->tail - lb->head) { lb->head += bytes_written; dev_dbg(&dev->core, - "%s:%d cleared buf_%lu, %llxh bytes\n", + "%s:%d cleared buf_%lu, %lxh bytes\n", __func__, __LINE__, lb->dbg_number, bytes_written); goto port_full; diff --git a/trunk/drivers/ps3/ps3stor_lib.c b/trunk/drivers/ps3/ps3stor_lib.c index 18066d555397..55955f16ad91 100644 --- a/trunk/drivers/ps3/ps3stor_lib.c +++ b/trunk/drivers/ps3/ps3stor_lib.c @@ -70,7 +70,7 @@ static int ps3stor_probe_access(struct ps3_storage_device *dev) __func__, __LINE__, n); dev->region_idx = __ffs(dev->accessible_regions); dev_info(&dev->sbd.core, - "First accessible region has index %u start %llu size %llu\n", + "First accessible region has index %u start %lu size %lu\n", dev->region_idx, dev->regions[dev->region_idx].start, dev->regions[dev->region_idx].size); @@ -220,7 +220,7 @@ u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar, const char *op = write ? "write" : "read"; int res; - dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n", + dev_dbg(&dev->sbd.core, "%s:%u: %s %lu sectors starting at %lu\n", __func__, __LINE__, op, sectors, start_sector); init_completion(&dev->done); @@ -238,7 +238,7 @@ u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar, wait_for_completion(&dev->done); if (dev->lv1_status) { - dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__, + dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__, __LINE__, op, dev->lv1_status); return dev->lv1_status; } @@ -268,7 +268,7 @@ u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd, u64 arg1, { int res; - dev_dbg(&dev->sbd.core, "%s:%u: send device command 0x%llx\n", __func__, + dev_dbg(&dev->sbd.core, "%s:%u: send device command 0x%lx\n", __func__, __LINE__, cmd); init_completion(&dev->done); @@ -277,19 +277,19 @@ u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd, u64 arg1, arg2, arg3, arg4, &dev->tag); if (res) { dev_err(&dev->sbd.core, - "%s:%u: send_device_command 0x%llx failed %d\n", + "%s:%u: send_device_command 0x%lx failed %d\n", __func__, __LINE__, cmd, res); return -1; } wait_for_completion(&dev->done); if (dev->lv1_status) { - dev_dbg(&dev->sbd.core, "%s:%u: command 0x%llx failed 0x%llx\n", + dev_dbg(&dev->sbd.core, "%s:%u: command 0x%lx failed 0x%lx\n", __func__, __LINE__, cmd, dev->lv1_status); return dev->lv1_status; } - dev_dbg(&dev->sbd.core, "%s:%u: command 0x%llx completed\n", __func__, + dev_dbg(&dev->sbd.core, "%s:%u: command 0x%lx completed\n", __func__, __LINE__, cmd); return 0; diff --git a/trunk/drivers/rtc/rtc-pxa.c b/trunk/drivers/rtc/rtc-pxa.c index bd56a033bfd0..cc7eb8767b82 100644 --- a/trunk/drivers/rtc/rtc-pxa.c +++ b/trunk/drivers/rtc/rtc-pxa.c @@ -27,8 +27,6 @@ #include #include -#include - #define TIMER_FREQ CLOCK_TICK_RATE #define RTC_DEF_DIVIDER (32768 - 1) #define RTC_DEF_TRIM 0 diff --git a/trunk/drivers/rtc/rtc-twl4030.c b/trunk/drivers/rtc/rtc-twl4030.c index ad35f76c46b7..8ce5f74ee45b 100644 --- a/trunk/drivers/rtc/rtc-twl4030.c +++ b/trunk/drivers/rtc/rtc-twl4030.c @@ -120,7 +120,7 @@ static int twl4030_rtc_write_u8(u8 data, u8 reg) static unsigned char rtc_irq_bits; /* - * Enable 1/second update and/or alarm interrupts. + * Enable timer and/or alarm interrupts. */ static int set_rtc_irq_bit(unsigned char bit) { @@ -128,7 +128,6 @@ 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; @@ -137,7 +136,7 @@ static int set_rtc_irq_bit(unsigned char bit) } /* - * Disable update and/or alarm interrupts. + * Disable timer and/or alarm interrupts. */ static int mask_rtc_irq_bit(unsigned char bit) { @@ -152,7 +151,7 @@ static int mask_rtc_irq_bit(unsigned char bit) return ret; } -static int twl4030_rtc_alarm_irq_enable(struct device *dev, unsigned enabled) +static inline int twl4030_rtc_alarm_irq_set_state(int enabled) { int ret; @@ -164,7 +163,7 @@ static int twl4030_rtc_alarm_irq_enable(struct device *dev, unsigned enabled) return ret; } -static int twl4030_rtc_update_irq_enable(struct device *dev, unsigned enabled) +static inline int twl4030_rtc_irq_set_state(int enabled) { int ret; @@ -293,7 +292,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_enable(dev, 0); + ret = twl4030_rtc_alarm_irq_set_state(0); if (ret) goto out; @@ -313,11 +312,35 @@ static int twl4030_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) } if (alm->enabled) - ret = twl4030_rtc_alarm_irq_enable(dev, 1); + ret = twl4030_rtc_alarm_irq_set_state(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; @@ -377,12 +400,11 @@ static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc) } 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, }; /*----------------------------------------------------------------------*/ @@ -400,7 +422,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 = PTR_ERR(rtc); + ret = -EINVAL; dev_err(&pdev->dev, "can't register RTC device, err %ld\n", PTR_ERR(rtc)); goto out0; @@ -410,6 +432,7 @@ 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; @@ -452,6 +475,7 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev) return ret; + out2: free_irq(irq, rtc); out1: @@ -482,9 +506,8 @@ static int __devexit twl4030_rtc_remove(struct platform_device *pdev) static void twl4030_rtc_shutdown(struct platform_device *pdev) { - /* 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); + mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | + BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); } #ifdef CONFIG_PM diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvfc.c b/trunk/drivers/scsi/ibmvscsi/ibmvfc.c index 91ef669d98f6..ee0739b217b6 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvfc.c @@ -933,7 +933,7 @@ static void ibmvfc_get_host_speed(struct Scsi_Host *shost) fc_host_speed(shost) = FC_PORTSPEED_16GBIT; break; default: - ibmvfc_log(vhost, 3, "Unknown port speed: %lld Gbit\n", + ibmvfc_log(vhost, 3, "Unknown port speed: %ld Gbit\n", vhost->login_buf->resp.link_speed / 100); fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; break; @@ -2149,8 +2149,8 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, { const char *desc = ibmvfc_get_ae_desc(crq->event); - ibmvfc_log(vhost, 3, "%s event received. scsi_id: %llx, wwpn: %llx," - " node_name: %llx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name); + ibmvfc_log(vhost, 3, "%s event received. scsi_id: %lx, wwpn: %lx," + " node_name: %lx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name); switch (crq->event) { case IBMVFC_AE_LINK_UP: @@ -2184,7 +2184,7 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, ibmvfc_link_down(vhost, IBMVFC_HALTED); break; default: - dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event); + dev_err(vhost->dev, "Unknown async event received: %ld\n", crq->event); break; }; } @@ -2261,13 +2261,13 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost) * actually sent */ if (unlikely(!ibmvfc_valid_event(&vhost->pool, evt))) { - dev_err(vhost->dev, "Returned correlation_token 0x%08llx is invalid!\n", + dev_err(vhost->dev, "Returned correlation_token 0x%08lx is invalid!\n", crq->ioba); return; } if (unlikely(atomic_read(&evt->free))) { - dev_err(vhost->dev, "Received duplicate correlation_token 0x%08llx!\n", + dev_err(vhost->dev, "Received duplicate correlation_token 0x%08lx!\n", crq->ioba); return; } @@ -3259,7 +3259,7 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, u64 scsi_id) tgt = mempool_alloc(vhost->tgt_pool, GFP_KERNEL); if (!tgt) { - dev_err(vhost->dev, "Target allocation failure for scsi id %08llx\n", + dev_err(vhost->dev, "Target allocation failure for scsi id %08lx\n", scsi_id); return -ENOMEM; } diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvfc.h b/trunk/drivers/scsi/ibmvscsi/ibmvfc.h index 87dafd0f8d44..babdf3db59df 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvfc.h +++ b/trunk/drivers/scsi/ibmvscsi/ibmvfc.h @@ -691,13 +691,13 @@ struct ibmvfc_host { #define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0) #define tgt_dbg(t, fmt, ...) \ - DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)) + DBG_CMD(dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__)) #define tgt_info(t, fmt, ...) \ - dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) + dev_info((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__) #define tgt_err(t, fmt, ...) \ - dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) + dev_err((t)->vhost->dev, "%lX: " fmt, (t)->scsi_id, ##__VA_ARGS__) #define ibmvfc_dbg(vhost, ...) \ DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__)) diff --git a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c index 74d07d137dae..5c541f7850f9 100644 --- a/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/trunk/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1061,7 +1061,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) } sdev_printk(KERN_INFO, cmd->device, - "aborting command. lun 0x%llx, tag 0x%llx\n", + "aborting command. lun 0x%lx, tag 0x%lx\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%llx\n", + "abort code %d for task tag 0x%lx\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%llx completed\n", + sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n", tsk_mgmt->task_tag); return SUCCESS; } - sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n", + sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\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%llx\n", + sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\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%llx\n", + "reset code %d for task tag 0x%lx\n", rsp_rc, tsk_mgmt->task_tag); return FAILED; } diff --git a/trunk/drivers/scsi/ipr.c b/trunk/drivers/scsi/ipr.c index 07829009a8be..841f460edbc4 100644 --- a/trunk/drivers/scsi/ipr.c +++ b/trunk/drivers/scsi/ipr.c @@ -4912,7 +4912,7 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) if (res && ipr_is_gata(res)) { if (cmd == HDIO_GET_IDENTITY) return -ENOTTY; - return ata_sas_scsi_ioctl(res->sata_port->ap, sdev, cmd, arg); + return ata_scsi_ioctl(sdev, cmd, arg); } return -EINVAL; diff --git a/trunk/drivers/scsi/libiscsi_tcp.c b/trunk/drivers/scsi/libiscsi_tcp.c index e7705d3532c9..a745f91d2928 100644 --- a/trunk/drivers/scsi/libiscsi_tcp.c +++ b/trunk/drivers/scsi/libiscsi_tcp.c @@ -177,6 +177,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, struct iscsi_segment *segment, int recv, unsigned copied) { + static unsigned char padbuf[ISCSI_PAD_LEN]; struct scatterlist sg; unsigned int pad; @@ -232,7 +233,7 @@ int iscsi_tcp_segment_done(struct iscsi_tcp_conn *tcp_conn, debug_tcp("consume %d pad bytes\n", pad); segment->total_size += pad; segment->size = pad; - segment->data = segment->padbuf; + segment->data = padbuf; return 0; } } diff --git a/trunk/drivers/scsi/libsas/sas_scsi_host.c b/trunk/drivers/scsi/libsas/sas_scsi_host.c index 1c558d3bce18..744838780ada 100644 --- a/trunk/drivers/scsi/libsas/sas_scsi_host.c +++ b/trunk/drivers/scsi/libsas/sas_scsi_host.c @@ -717,7 +717,7 @@ int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) struct domain_device *dev = sdev_to_domain_dev(sdev); if (dev_is_sata(dev)) - return ata_sas_scsi_ioctl(dev->sata_dev.ap, sdev, cmd, arg); + return ata_scsi_ioctl(sdev, cmd, arg); return -EINVAL; } diff --git a/trunk/drivers/scsi/ps3rom.c b/trunk/drivers/scsi/ps3rom.c index ca0dd33497ec..ce48e2d0193c 100644 --- a/trunk/drivers/scsi/ps3rom.c +++ b/trunk/drivers/scsi/ps3rom.c @@ -290,11 +290,11 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data) if (tag != dev->tag) dev_err(&dev->sbd.core, - "%s:%u: tag mismatch, got %llx, expected %llx\n", + "%s:%u: tag mismatch, got %lx, expected %lx\n", __func__, __LINE__, tag, dev->tag); if (res) { - dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", + dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n", __func__, __LINE__, res, status); return IRQ_HANDLED; } @@ -364,7 +364,7 @@ static int __devinit ps3rom_probe(struct ps3_system_bus_device *_dev) if (dev->blk_size != CD_FRAMESIZE) { dev_err(&dev->sbd.core, - "%s:%u: cannot handle block size %llu\n", __func__, + "%s:%u: cannot handle block size %lu\n", __func__, __LINE__, dev->blk_size); return -EINVAL; } diff --git a/trunk/drivers/scsi/qla2xxx/qla_init.c b/trunk/drivers/scsi/qla2xxx/qla_init.c index 9ad4d0968e5c..2d4f32b4df5c 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_init.c +++ b/trunk/drivers/scsi/qla2xxx/qla_init.c @@ -1258,48 +1258,35 @@ qla2x00_init_rings(scsi_qla_host_t *vha) { int rval; unsigned long flags = 0; - int cnt, que; + int cnt; struct qla_hw_data *ha = vha->hw; - struct req_que *req; - struct rsp_que *rsp; - struct scsi_qla_host *vp; + struct req_que *req = ha->req_q_map[0]; + struct rsp_que *rsp = ha->rsp_q_map[0]; struct mid_init_cb_24xx *mid_init_cb = (struct mid_init_cb_24xx *) ha->init_cb; spin_lock_irqsave(&ha->hardware_lock, flags); /* Clear outstanding commands array. */ - for (que = 0; que < ha->max_queues; que++) { - req = ha->req_q_map[que]; - if (!req) - continue; - for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) - req->outstanding_cmds[cnt] = NULL; + for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) + req->outstanding_cmds[cnt] = NULL; - req->current_outstanding_cmd = 0; + req->current_outstanding_cmd = 0; - /* Initialize firmware. */ - req->ring_ptr = req->ring; - req->ring_index = 0; - req->cnt = req->length; - } + /* Clear RSCN queue. */ + vha->rscn_in_ptr = 0; + vha->rscn_out_ptr = 0; - for (que = 0; que < ha->max_queues; que++) { - rsp = ha->rsp_q_map[que]; - if (!rsp) - continue; - rsp->ring_ptr = rsp->ring; - rsp->ring_index = 0; + /* Initialize firmware. */ + req->ring_ptr = req->ring; + req->ring_index = 0; + req->cnt = req->length; + rsp->ring_ptr = rsp->ring; + rsp->ring_index = 0; - /* Initialize response queue entries */ - qla2x00_init_response_q_entries(rsp); - } + /* Initialize response queue entries */ + qla2x00_init_response_q_entries(rsp); - /* Clear RSCN queue. */ - list_for_each_entry(vp, &ha->vp_list, list) { - vp->rscn_in_ptr = 0; - vp->rscn_out_ptr = 0; - } ha->isp_ops->config_rings(vha); spin_unlock_irqrestore(&ha->hardware_lock, flags); @@ -3225,8 +3212,8 @@ qla2x00_loop_resync(scsi_qla_host_t *vha) int rval = QLA_SUCCESS; uint32_t wait_time; struct qla_hw_data *ha = vha->hw; - struct req_que *req = ha->req_q_map[vha->req_ques[0]]; - struct rsp_que *rsp = req->rsp; + struct req_que *req = ha->req_q_map[0]; + struct rsp_que *rsp = ha->rsp_q_map[0]; atomic_set(&vha->loop_state, LOOP_UPDATE); clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); @@ -3505,7 +3492,6 @@ qla25xx_init_queues(struct qla_hw_data *ha) } req = ha->req_q_map[i]; if (req) { - /* Clear outstanding commands array. */ req->options &= ~BIT_0; ret = qla25xx_init_req_que(base_vha, req, req->options); if (ret != QLA_SUCCESS) @@ -3514,7 +3500,7 @@ qla25xx_init_queues(struct qla_hw_data *ha) req->id)); else DEBUG2_17(printk(KERN_WARNING - "%s Req que:%d inited\n", __func__, + "%s Rsp que:%d inited\n", __func__, req->id)); } } @@ -4165,8 +4151,8 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha) uint16_t mb[MAILBOX_REGISTER_COUNT]; struct qla_hw_data *ha = vha->hw; struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); - struct req_que *req = ha->req_q_map[vha->req_ques[0]]; - struct rsp_que *rsp = req->rsp; + struct req_que *req = ha->req_q_map[0]; + struct rsp_que *rsp = ha->rsp_q_map[0]; if (!vha->vp_idx) return -EINVAL; diff --git a/trunk/drivers/scsi/qla2xxx/qla_mid.c b/trunk/drivers/scsi/qla2xxx/qla_mid.c index f53179c46423..886323130fcc 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_mid.c +++ b/trunk/drivers/scsi/qla2xxx/qla_mid.c @@ -629,7 +629,6 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, req->ring_index = 0; req->cnt = req->length; req->id = que_id; - req->max_q_depth = ha->req_q_map[0]->max_q_depth; mutex_unlock(&ha->vport_lock); ret = qla25xx_init_req_que(base_vha, req, options); diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c index cf32653fe01a..4a71f522f925 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_os.c +++ b/trunk/drivers/scsi/qla2xxx/qla_os.c @@ -1158,8 +1158,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) struct req_que *req; spin_lock_irqsave(&ha->hardware_lock, flags); - for (que = 0; que < ha->max_queues; que++) { - req = ha->req_q_map[que]; + for (que = 0; que < QLA_MAX_HOST_QUES; que++) { + req = ha->req_q_map[vha->req_ques[que]]; if (!req) continue; for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { @@ -1193,7 +1193,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev) scsi_qla_host_t *vha = shost_priv(sdev->host); struct qla_hw_data *ha = vha->hw; struct fc_rport *rport = starget_to_rport(sdev->sdev_target); - struct req_que *req = ha->req_q_map[vha->req_ques[0]]; + struct req_que *req = ha->req_q_map[0]; if (sdev->tagged_supported) scsi_activate_tcq(sdev, req->max_q_depth); @@ -1998,6 +1998,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) return 0; probe_failed: + qla2x00_free_que(ha, req, rsp); qla2x00_free_device(base_vha); scsi_host_put(base_vha->host); diff --git a/trunk/drivers/scsi/scsi.c b/trunk/drivers/scsi/scsi.c index cbcd3f681b62..42e72a2c1f98 100644 --- a/trunk/drivers/scsi/scsi.c +++ b/trunk/drivers/scsi/scsi.c @@ -1095,8 +1095,7 @@ EXPORT_SYMBOL(__starget_for_each_device); * Description: Looks up the scsi_device with the specified @lun for a given * @starget. The returned scsi_device does not have an additional * reference. You must hold the host's host_lock over this call and - * any access to the returned scsi_device. A scsi_device in state - * SDEV_DEL is skipped. + * any access to the returned scsi_device. * * Note: The only reason why drivers should use this is because * they need to access the device list in irq context. Otherwise you @@ -1108,8 +1107,6 @@ struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget, struct scsi_device *sdev; list_for_each_entry(sdev, &starget->devices, same_target_siblings) { - if (sdev->sdev_state == SDEV_DEL) - continue; if (sdev->lun ==lun) return sdev; } diff --git a/trunk/drivers/scsi/scsi_devinfo.c b/trunk/drivers/scsi/scsi_devinfo.c index 099b5455bbce..4969e4ec75ea 100644 --- a/trunk/drivers/scsi/scsi_devinfo.c +++ b/trunk/drivers/scsi/scsi_devinfo.c @@ -224,7 +224,6 @@ static struct { {"SGI", "TP9100", "*", BLIST_REPORTLUN2}, {"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"IBM", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, - {"SUN", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36}, {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN}, {"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */ diff --git a/trunk/drivers/serial/8250.c b/trunk/drivers/serial/8250.c index 0d934bfbdd9b..1889a63ebc22 100644 --- a/trunk/drivers/serial/8250.c +++ b/trunk/drivers/serial/8250.c @@ -2839,8 +2839,6 @@ 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) diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c index 2a3671233b15..c088146b7513 100644 --- a/trunk/drivers/serial/8250_pci.c +++ b/trunk/drivers/serial/8250_pci.c @@ -602,10 +602,6 @@ static int pci_netmos_init(struct pci_dev *dev) /* subdevice 0x00PS means

parallel, 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; @@ -3100,10 +3096,6 @@ 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 diff --git a/trunk/drivers/serial/8250_pnp.c b/trunk/drivers/serial/8250_pnp.c index bbcfc26a3b6d..fde7f9ccf57e 100644 --- a/trunk/drivers/serial/8250_pnp.c +++ b/trunk/drivers/serial/8250_pnp.c @@ -270,8 +270,6 @@ 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 */ diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index 89362d733d62..d5efd6c77904 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -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) && !uart_tx_stopped(port)) { + if (!uart_circ_empty(xmit)) { dma_sync_single_for_device(port->dev, pdc->dma_addr, pdc->dma_size, diff --git a/trunk/drivers/serial/of_serial.c b/trunk/drivers/serial/of_serial.c index 14f8fa9135be..a821e3a3d664 100644 --- a/trunk/drivers/serial/of_serial.c +++ b/trunk/drivers/serial/of_serial.c @@ -163,7 +163,6 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = { { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, - { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL { .type = "serial", .compatible = "ibm,qpace-nwp-serial", .data = (void *)PORT_NWPSERIAL, }, diff --git a/trunk/drivers/serial/pnx8xxx_uart.c b/trunk/drivers/serial/pnx8xxx_uart.c index 1bb8f1b45767..22e30d21225e 100644 --- a/trunk/drivers/serial/pnx8xxx_uart.c +++ b/trunk/drivers/serial/pnx8xxx_uart.c @@ -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) & 0xff; + ch = serial_in(sport, PNX8XXX_FIFO); sport->port.icount.rx++; @@ -198,16 +198,9 @@ 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_RXBRK) | + PNX8XXX_UART_FIFO_RXPAR) | ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) { - 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)) + 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++; @@ -291,8 +284,14 @@ static irqreturn_t pnx8xxx_int(int irq, void *dev_id) /* Get the interrupts */ status = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN); - /* Byte or break signal received */ - if (status & (PNX8XXX_UART_INT_RX | PNX8XXX_UART_INT_BREAK)) + /* 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) pnx8xxx_rx_chars(sport); /* TX holding register empty - transmit a byte */ diff --git a/trunk/drivers/spi/atmel_spi.c b/trunk/drivers/spi/atmel_spi.c index 56ff3e6864ea..5e39bac9c51b 100644 --- a/trunk/drivers/spi/atmel_spi.c +++ b/trunk/drivers/spi/atmel_spi.c @@ -670,7 +670,8 @@ 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))) + if (unlikely(list_empty(&msg->transfers) + || !spi->max_speed_hz)) return -EINVAL; if (as->stopping) diff --git a/trunk/drivers/spi/xilinx_spi.c b/trunk/drivers/spi/xilinx_spi.c index fe7e5f35e5d0..68d6f4988fb5 100644 --- a/trunk/drivers/spi/xilinx_spi.c +++ b/trunk/drivers/spi/xilinx_spi.c @@ -15,15 +15,12 @@ #include #include #include - -#include -#include -#include - #include #include #include +#include + #define XILINX_SPI_NAME "xilinx_spi" /* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) @@ -147,14 +144,23 @@ 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; } @@ -298,38 +304,32 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id) return IRQ_HANDLED; } -static int __init xilinx_spi_of_probe(struct of_device *ofdev, - const struct of_device_id *match) +static int __init xilinx_spi_probe(struct platform_device *dev) { + int ret = 0; struct spi_master *master; struct xilinx_spi *xspi; - 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; + struct xspi_platform_data *pdata; + struct resource *r; /* Get resources(memory, IRQ) associated with the device */ - master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi)); + master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi)); if (master == NULL) { return -ENOMEM; } - dev_set_drvdata(&ofdev->dev, master); + platform_set_drvdata(dev, master); + pdata = dev->dev.platform_data; - rc = of_address_to_resource(ofdev->node, 0, r_mem); - if (rc) { - dev_warn(&ofdev->dev, "invalid address\n"); + if (pdata == NULL) { + ret = -ENODEV; goto put_master; } - rc = of_irq_to_resource(ofdev->node, 0, r_irq); - if (rc == NO_IRQ) { - dev_warn(&ofdev->dev, "no IRQ found\n"); + r = platform_get_resource(dev, IORESOURCE_MEM, 0); + if (r == NULL) { + ret = -ENODEV; goto put_master; } @@ -341,57 +341,47 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, xspi->bitbang.master->setup = xilinx_spi_setup; init_completion(&xspi->done); - 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"); + if (!request_mem_region(r->start, + r->end - r->start + 1, XILINX_SPI_NAME)) { + ret = -ENXIO; goto put_master; } - xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1); + xspi->regs = ioremap(r->start, r->end - r->start + 1); if (xspi->regs == NULL) { - rc = -ENOMEM; - dev_warn(&ofdev->dev, "ioremap failure\n"); + ret = -ENOMEM; goto put_master; } - xspi->irq = r_irq->start; - /* dynamic bus assignment */ - master->bus_num = -1; - - /* 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; + ret = platform_get_irq(dev, 0); + if (ret < 0) { + ret = -ENXIO; + goto unmap_io; } - master->num_chipselect = *prop; + xspi->irq = ret; + + master->bus_num = pdata->bus_num; + master->num_chipselect = pdata->num_chipselect; + xspi->speed_hz = pdata->speed_hz; /* SPI controller initializations */ xspi_init_hw(xspi->regs); /* Register for SPI Interrupt */ - 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); + ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); + if (ret != 0) goto unmap_io; - } - rc = spi_bitbang_start(&xspi->bitbang); - if (rc != 0) { - dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n"); + ret = spi_bitbang_start(&xspi->bitbang); + if (ret != 0) { + dev_err(&dev->dev, "spi_bitbang_start FAILED\n"); goto free_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); + dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", + r->start, (u32)xspi->regs, xspi->irq); - /* Add any subnodes on the SPI bus */ - of_register_spi_devices(master, ofdev->node); - - return rc; + return ret; free_irq: free_irq(xspi->irq, xspi); @@ -399,21 +389,21 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev, iounmap(xspi->regs); put_master: spi_master_put(master); - return rc; + return ret; } -static int __devexit xilinx_spi_remove(struct of_device *ofdev) +static int __devexit xilinx_spi_remove(struct platform_device *dev) { struct xilinx_spi *xspi; struct spi_master *master; - master = platform_get_drvdata(ofdev); + master = platform_get_drvdata(dev); xspi = spi_master_get_devdata(master); spi_bitbang_stop(&xspi->bitbang); free_irq(xspi->irq, xspi); iounmap(xspi->regs); - dev_set_drvdata(&ofdev->dev, 0); + platform_set_drvdata(dev, 0); spi_master_put(xspi->bitbang.master); return 0; @@ -422,42 +412,27 @@ static int __devexit xilinx_spi_remove(struct of_device *ofdev) /* work with hotplug and coldplug */ MODULE_ALIAS("platform:" XILINX_SPI_NAME); -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), +static struct platform_driver xilinx_spi_driver = { + .probe = xilinx_spi_probe, + .remove = __devexit_p(xilinx_spi_remove), .driver = { - .name = "xilinx-xps-spi", + .name = XILINX_SPI_NAME, .owner = THIS_MODULE, }, }; static int __init xilinx_spi_init(void) { - return of_register_platform_driver(&xilinx_spi_of_driver); + return platform_driver_register(&xilinx_spi_driver); } module_init(xilinx_spi_init); static void __exit xilinx_spi_exit(void) { - of_unregister_platform_driver(&xilinx_spi_of_driver); + platform_driver_unregister(&xilinx_spi_driver); } module_exit(xilinx_spi_exit); + MODULE_AUTHOR("MontaVista Software, Inc. "); MODULE_DESCRIPTION("Xilinx SPI driver"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 94d5ee263c20..d5d0e40b1e2d 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -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, PMSG_SUSPEND); + err = usb_port_suspend(udev); if (err < 0) dev_dbg(&udev->dev, "HNP fail, %d\n", err); } diff --git a/trunk/drivers/usb/serial/ftdi_sio.c b/trunk/drivers/usb/serial/ftdi_sio.c index c70a8f667d85..ef6cfa5a447f 100644 --- a/trunk/drivers/usb/serial/ftdi_sio.c +++ b/trunk/drivers/usb/serial/ftdi_sio.c @@ -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__); - goto out; + return; } spin_unlock_irqrestore(&priv->rx_lock, flags); /* if the port is closed stop trying to read */ diff --git a/trunk/drivers/video/bf54x-lq043fb.c b/trunk/drivers/video/bf54x-lq043fb.c index 37e60b1d2ed9..7644ed249564 100644 --- a/trunk/drivers/video/bf54x-lq043fb.c +++ b/trunk/drivers/video/bf54x-lq043fb.c @@ -335,20 +335,7 @@ static int bfin_bf54x_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - 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: + if (var->bits_per_pixel != LCD_BPP) { pr_debug("%s: depth not supported: %u BPP\n", __func__, var->bits_per_pixel); return -EINVAL; diff --git a/trunk/drivers/video/bfin-t350mcqb-fb.c b/trunk/drivers/video/bfin-t350mcqb-fb.c index 2a423d3a2a8e..a9b3ada05d99 100644 --- a/trunk/drivers/video/bfin-t350mcqb-fb.c +++ b/trunk/drivers/video/bfin-t350mcqb-fb.c @@ -254,20 +254,7 @@ static int bfin_t350mcqb_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - 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: + if (var->bits_per_pixel != LCD_BPP) { pr_debug("%s: depth not supported: %u BPP\n", __func__, var->bits_per_pixel); return -EINVAL; diff --git a/trunk/drivers/video/ps3fb.c b/trunk/drivers/video/ps3fb.c index 87f826e4c958..38ac805db97d 100644 --- a/trunk/drivers/video/ps3fb.c +++ b/trunk/drivers/video/ps3fb.c @@ -1006,7 +1006,7 @@ static int ps3fb_xdr_settings(u64 xdr_lpar, struct device *dev) __func__, status); return -ENXIO; } - dev_dbg(dev, "video:%p ioif:%lx lpar:%llx size:%lx\n", + dev_dbg(dev, "video:%p ioif:%lx lpar:%lx size:%lx\n", ps3fb_videomemory.address, GPU_IOIF, xdr_lpar, ps3fb_videomemory.size); @@ -1133,7 +1133,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) __func__, status); goto err; } - dev_dbg(&dev->core, "ddr:lpar:0x%llx\n", ddr_lpar); + dev_dbg(&dev->core, "ddr:lpar:0x%lx\n", ddr_lpar); status = lv1_gpu_context_allocate(ps3fb.memory_handle, 0, &ps3fb.context_handle, diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 8fa77e233944..d6f89d3c15e8 100644 --- a/trunk/fs/aio.c +++ b/trunk/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. */ -SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) +asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp) { struct kioctx *ioctx = NULL; unsigned long ctx; @@ -1308,7 +1308,7 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) * implemented. May fail with -EFAULT if the context pointed to * is invalid. */ -SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) +asmlinkage long sys_io_destroy(aio_context_t ctx) { struct kioctx *ioctx = lookup_ioctx(ctx); if (likely(NULL != ioctx)) { @@ -1662,8 +1662,8 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, * are available to queue any iocbs. Will return 0 if nr is 0. Will * fail with -ENOSYS if not implemented. */ -SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, - struct iocb __user * __user *, iocbpp) +asmlinkage long sys_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. */ -SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, - struct io_event __user *, result) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(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. */ -SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, - long, min_nr, - long, nr, - struct io_event __user *, events, - struct timespec __user *, timeout) +asmlinkage long sys_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; diff --git a/trunk/fs/btrfs/ioctl.h b/trunk/fs/btrfs/ioctl.h index b320b103fa13..78049ea208db 100644 --- a/trunk/fs/btrfs/ioctl.h +++ b/trunk/fs/btrfs/ioctl.h @@ -22,20 +22,13 @@ #define BTRFS_IOCTL_MAGIC 0x94 #define BTRFS_VOL_NAME_MAX 255 -#define BTRFS_PATH_NAME_MAX 4087 +#define BTRFS_PATH_NAME_MAX 3072 -/* this should be 4k */ struct btrfs_ioctl_vol_args { __s64 fd; char name[BTRFS_PATH_NAME_MAX + 1]; }; -struct btrfs_ioctl_clone_range_args { - __s64 src_fd; - __u64 src_offset, src_length; - __u64 dest_offset; -}; - #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ struct btrfs_ioctl_vol_args) #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ @@ -59,6 +52,11 @@ struct btrfs_ioctl_clone_range_args { struct btrfs_ioctl_vol_args) #define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \ struct btrfs_ioctl_vol_args) +struct btrfs_ioctl_clone_range_args { + __s64 src_fd; + __u64 src_offset, src_length; + __u64 dest_offset; +}; #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \ struct btrfs_ioctl_clone_range_args) diff --git a/trunk/fs/btrfs/super.c b/trunk/fs/btrfs/super.c index db9fb3bc1e33..0a14b495532f 100644 --- a/trunk/fs/btrfs/super.c +++ b/trunk/fs/btrfs/super.c @@ -38,7 +38,6 @@ #include #include #include -#include #include "compat.h" #include "ctree.h" #include "disk-io.h" @@ -52,6 +51,7 @@ #include "export.h" #include "compression.h" +#define BTRFS_SUPER_MAGIC 0x9123683E static struct super_operations btrfs_super_ops; @@ -582,7 +582,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, { struct btrfs_ioctl_vol_args *vol; struct btrfs_fs_devices *fs_devices; - int ret = -ENOTTY; + int ret = 0; int len; if (!capable(CAP_SYS_ADMIN)) @@ -594,7 +594,6 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, goto out; } len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); - switch (cmd) { case BTRFS_IOC_SCAN_DEV: ret = btrfs_scan_one_device(vol->name, FMODE_READ, diff --git a/trunk/fs/btrfs/volumes.c b/trunk/fs/btrfs/volumes.c index 3451e1cca2b5..b187b537888e 100644 --- a/trunk/fs/btrfs/volumes.c +++ b/trunk/fs/btrfs/volumes.c @@ -220,7 +220,6 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) tail->bi_next = old_head; else device->pending_bio_tail = tail; - device->running_pending = 0; spin_unlock(&device->io_lock); btrfs_requeue_work(&device->work); diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index b58208f1640a..b6e8b8632e2f 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -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. */ -SYSCALL_DEFINE2(bdflush, int, func, long, data) +asmlinkage long sys_bdflush(int func, long data) { static int msg_count; diff --git a/trunk/fs/compat.c b/trunk/fs/compat.c index 65a070e705ab..30f2faa22f5c 100644 --- a/trunk/fs/compat.c +++ b/trunk/fs/compat.c @@ -1709,7 +1709,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, } #ifdef HAVE_SET_RESTORE_SIGMASK -static long do_compat_pselect(int n, compat_ulong_t __user *inp, +asmlinkage long compat_sys_pselect7(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 do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(up), - sigsetsize); + return compat_sys_pselect7(n, inp, outp, exp, tsp, compat_ptr(up), + sigsetsize); } asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 937df0fb0da5..4547f66884a0 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -2092,7 +2092,7 @@ char *dentry_path(struct dentry *dentry, char *buf, int buflen) * return NULL; * } */ -SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) +asmlinkage long sys_getcwd(char __user *buf, unsigned long size) { int error; struct path pwd, root; diff --git a/trunk/fs/dcookies.c b/trunk/fs/dcookies.c index a21cabdbd87b..180e9fec4ad8 100644 --- a/trunk/fs/dcookies.c +++ b/trunk/fs/dcookies.c @@ -145,7 +145,7 @@ int get_dcookie(struct path *path, unsigned long *cookie) /* And here is where the userspace process can look up the cookie value * to retrieve the path. */ -SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) +asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len) { unsigned long cookie = (unsigned long)cookie64; int err = -EINVAL; @@ -198,13 +198,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) 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) { diff --git a/trunk/fs/eventfd.c b/trunk/fs/eventfd.c index 5de2c2db3aa2..08bf558d0408 100644 --- a/trunk/fs/eventfd.c +++ b/trunk/fs/eventfd.c @@ -198,7 +198,7 @@ struct file *eventfd_fget(int fd) return file; } -SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) +asmlinkage long sys_eventfd2(unsigned int count, int flags) { int fd; struct eventfd_ctx *ctx; @@ -228,7 +228,8 @@ SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) return fd; } -SYSCALL_DEFINE1(eventfd, unsigned int, count) +asmlinkage long sys_eventfd(unsigned int count) { return sys_eventfd2(count, 0); } + diff --git a/trunk/fs/eventpoll.c b/trunk/fs/eventpoll.c index ba2f9ec71192..96355d505347 100644 --- a/trunk/fs/eventpoll.c +++ b/trunk/fs/eventpoll.c @@ -1110,7 +1110,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, /* * Open an eventpoll file descriptor. */ -SYSCALL_DEFINE1(epoll_create1, int, flags) +asmlinkage long sys_epoll_create1(int flags) { int error, fd = -1; struct eventpoll *ep; @@ -1150,7 +1150,7 @@ SYSCALL_DEFINE1(epoll_create1, int, flags) return fd; } -SYSCALL_DEFINE1(epoll_create, int, size) +asmlinkage long sys_epoll_create(int size) { if (size < 0) return -EINVAL; @@ -1163,8 +1163,8 @@ SYSCALL_DEFINE1(epoll_create, int, size) * the eventpoll file that enables the insertion/removal/change of * file descriptors inside the interest set. */ -SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, - struct epoll_event __user *, event) +asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, + struct epoll_event __user *event) { int error; struct file *file, *tfile; @@ -1261,8 +1261,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, * Implement the event wait interface for the eventpoll file. It is the kernel * part of the user space epoll_wait(2). */ -SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, - int, maxevents, int, timeout) +asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, + int maxevents, int timeout) { int error; struct file *file; @@ -1319,9 +1319,9 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, * Implement the event wait interface for the eventpoll file. It is the kernel * part of the user space epoll_pwait(2). */ -SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, - int, maxevents, int, timeout, const sigset_t __user *, sigmask, - size_t, sigsetsize) +asmlinkage long sys_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; diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 0dd60a01f1b4..71a6efe5d8bd 100644 --- a/trunk/fs/exec.c +++ b/trunk/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. */ -SYSCALL_DEFINE1(uselib, const char __user *, library) +asmlinkage long sys_uselib(const char __user * library) { struct file *file; struct nameidata nd; diff --git a/trunk/fs/ext2/dir.c b/trunk/fs/ext2/dir.c index 2999d72153b7..9a0fc400f91c 100644 --- a/trunk/fs/ext2/dir.c +++ b/trunk/fs/ext2/dir.c @@ -95,13 +95,10 @@ 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); - if (!err) - err = ext2_sync_inode(dir); - } else { + else unlock_page(page); - } return err; } diff --git a/trunk/fs/fcntl.c b/trunk/fs/fcntl.c index bd215cc791da..cdc141946724 100644 --- a/trunk/fs/fcntl.c +++ b/trunk/fs/fcntl.c @@ -50,7 +50,7 @@ static int get_close_on_exec(unsigned int fd) return res; } -SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) +asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags) { int err = -EBADF; struct file * file, *tofree; @@ -113,7 +113,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) return err; } -SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) +asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) { if (unlikely(newfd == oldfd)) { /* corner case */ struct files_struct *files = current->files; @@ -126,7 +126,7 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) return sys_dup3(oldfd, newfd, 0); } -SYSCALL_DEFINE1(dup, unsigned int, fildes) +asmlinkage long sys_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; } -SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) +asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) { struct file *filp; long err = -EBADF; @@ -358,8 +358,7 @@ SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) } #if BITS_PER_LONG == 32 -SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, - unsigned long, arg) +asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) { struct file * filp; long err; diff --git a/trunk/fs/filesystems.c b/trunk/fs/filesystems.c index 1aa70260e6d1..d488dcd7f2bb 100644 --- a/trunk/fs/filesystems.c +++ b/trunk/fs/filesystems.c @@ -179,7 +179,7 @@ static int fs_maxindex(void) /* * Whee.. Weird sysv syscall. */ -SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2) +asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2) { int retval = -EINVAL; diff --git a/trunk/fs/ioctl.c b/trunk/fs/ioctl.c index 240ec63984cb..20b0a8a24c6b 100644 --- a/trunk/fs/ioctl.c +++ b/trunk/fs/ioctl.c @@ -542,7 +542,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, return error; } -SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) +asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) { struct file *filp; int error = -EBADF; diff --git a/trunk/fs/ioprio.c b/trunk/fs/ioprio.c index c7c0b28d7d21..1a39ac370942 100644 --- a/trunk/fs/ioprio.c +++ b/trunk/fs/ioprio.c @@ -72,7 +72,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio) } EXPORT_SYMBOL_GPL(set_task_ioprio); -SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) +asmlinkage long sys_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; } -SYSCALL_DEFINE2(ioprio_get, int, which, int, who) +asmlinkage long sys_ioprio_get(int which, int who) { struct task_struct *g, *p; struct user_struct *user; @@ -252,3 +252,4 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) read_unlock(&tasklist_lock); return ret; } + diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index ec3deea29e37..46a2e12f7d42 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -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. */ -SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) +asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) { struct file *filp; struct file_lock *lock; diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index bbc15c237558..f05bed242422 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1962,8 +1962,8 @@ static int may_mknod(mode_t mode) } } -SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, - unsigned, dev) +asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode, + unsigned dev) { int error; char *tmp; @@ -2017,7 +2017,7 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, return error; } -SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev) +asmlinkage long sys_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; } -SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) +asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode) { int error = 0; char * tmp; @@ -2081,7 +2081,7 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) return error; } -SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) +asmlinkage long sys_mkdir(const char __user *pathname, int mode) { return sys_mkdirat(AT_FDCWD, pathname, mode); } @@ -2195,7 +2195,7 @@ static long do_rmdir(int dfd, const char __user *pathname) return error; } -SYSCALL_DEFINE1(rmdir, const char __user *, pathname) +asmlinkage long sys_rmdir(const char __user *pathname) { return do_rmdir(AT_FDCWD, pathname); } @@ -2291,7 +2291,7 @@ static long do_unlinkat(int dfd, const char __user *pathname) goto exit2; } -SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag) +asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) { if ((flag & ~AT_REMOVEDIR) != 0) return -EINVAL; @@ -2302,7 +2302,7 @@ SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag) return do_unlinkat(dfd, pathname); } -SYSCALL_DEFINE1(unlink, const char __user *, pathname) +asmlinkage long sys_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; } -SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, - int, newdfd, const char __user *, newname) +asmlinkage long sys_symlinkat(const char __user *oldname, + int newdfd, const char __user *newname) { int error; char *from; @@ -2370,7 +2370,7 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, return error; } -SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname) +asmlinkage long sys_symlink(const char __user *oldname, const char __user *newname) { return sys_symlinkat(oldname, AT_FDCWD, newname); } @@ -2422,8 +2422,9 @@ 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 */ -SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, - int, newdfd, const char __user *, newname, int, flags) +asmlinkage long sys_linkat(int olddfd, const char __user *oldname, + int newdfd, const char __user *newname, + int flags) { struct dentry *new_dentry; struct nameidata nd; @@ -2472,7 +2473,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, return error; } -SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname) +asmlinkage long sys_link(const char __user *oldname, const char __user *newname) { return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); } @@ -2623,8 +2624,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, return error; } -SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, - int, newdfd, const char __user *, newname) +asmlinkage long sys_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; @@ -2717,7 +2718,7 @@ SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, return error; } -SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname) +asmlinkage long sys_rename(const char __user *oldname, const char __user *newname) { return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); } diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 228d8c4bfd18..a40685d800a8 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -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 */ -SYSCALL_DEFINE2(umount, char __user *, name, int, flags) +asmlinkage long sys_umount(char __user * name, int flags) { struct path path; int retval; @@ -1160,7 +1160,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) /* * The 2.0 compatible umount. No flags. */ -SYSCALL_DEFINE1(oldumount, char __user *, name) +asmlinkage long sys_oldumount(char __user * name) { return sys_umount(name, 0); } @@ -2045,8 +2045,9 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns, return new_ns; } -SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, - char __user *, type, unsigned long, flags, void __user *, data) +asmlinkage long sys_mount(char __user * dev_name, char __user * dir_name, + char __user * type, unsigned long flags, + void __user * data) { int retval; unsigned long data_page; @@ -2171,8 +2172,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. */ -SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, - const char __user *, put_old) +asmlinkage long sys_pivot_root(const char __user * new_root, + const char __user * put_old) { struct vfsmount *tmp; struct path new, old, parent_path, root_parent, root; diff --git a/trunk/fs/nfsctl.c b/trunk/fs/nfsctl.c index 8f9a20556f79..b27451909dff 100644 --- a/trunk/fs/nfsctl.c +++ b/trunk/fs/nfsctl.c @@ -86,8 +86,8 @@ static struct { }, }; -SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg, - void __user *, res) +long +asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res) { struct file *file; void __user *p = &arg->u; diff --git a/trunk/fs/notify/inotify/inotify_user.c b/trunk/fs/notify/inotify/inotify_user.c index d53a1838d6e8..81b8644b0136 100644 --- a/trunk/fs/notify/inotify/inotify_user.c +++ b/trunk/fs/notify/inotify/inotify_user.c @@ -576,7 +576,7 @@ static const struct inotify_operations inotify_user_ops = { .destroy_watch = free_inotify_user_watch, }; -SYSCALL_DEFINE1(inotify_init1, int, flags) +asmlinkage long sys_inotify_init1(int flags) { struct inotify_device *dev; struct inotify_handle *ih; @@ -655,13 +655,12 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) return ret; } -SYSCALL_DEFINE0(inotify_init) +asmlinkage long sys_inotify_init(void) { return sys_inotify_init1(0); } -SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, - u32, mask) +asmlinkage long sys_inotify_add_watch(int fd, const char __user *pathname, u32 mask) { struct inode *inode; struct inotify_device *dev; @@ -705,7 +704,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, return ret; } -SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) +asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd) { struct file *filp; struct inotify_device *dev; diff --git a/trunk/fs/open.c b/trunk/fs/open.c index a3a78ceb2a2b..d882fd2351d6 100644 --- a/trunk/fs/open.c +++ b/trunk/fs/open.c @@ -122,7 +122,7 @@ static int vfs_statfs64(struct dentry *dentry, struct statfs64 *buf) return 0; } -SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) +asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * buf) { struct path path; int error; @@ -138,7 +138,8 @@ SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, b return error; } -SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) + +asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct statfs64 __user *buf) { struct path path; long error; @@ -156,7 +157,8 @@ SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct stat return error; } -SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) + +asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf) { struct file * file; struct statfs tmp; @@ -174,7 +176,7 @@ SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) return error; } -SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) +asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user *buf) { struct file * file; struct statfs64 tmp; @@ -287,7 +289,7 @@ static long do_sys_truncate(const char __user *pathname, loff_t length) return error; } -SYSCALL_DEFINE2(truncate, const char __user *, path, unsigned long, length) +asmlinkage long sys_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); @@ -339,7 +341,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) return error; } -SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) +asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) { long ret = do_sys_ftruncate(fd, length, 1); /* avoid REGPARM breakage on x86: */ @@ -349,35 +351,21 @@ SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) /* LFS versions of truncate are only needed on 32 bit machines */ #if BITS_PER_LONG == 32 -SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) +asmlinkage long sys_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 -SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) +asmlinkage long sys_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 */ -SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) +asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len) { struct file *file; struct inode *inode; @@ -434,20 +422,13 @@ SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) 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. */ -SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) +asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) { const struct cred *old_cred; struct cred *override_cred; @@ -517,12 +498,12 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) return res; } -SYSCALL_DEFINE2(access, const char __user *, filename, int, mode) +asmlinkage long sys_access(const char __user *filename, int mode) { return sys_faccessat(AT_FDCWD, filename, mode); } -SYSCALL_DEFINE1(chdir, const char __user *, filename) +asmlinkage long sys_chdir(const char __user * filename) { struct path path; int error; @@ -543,7 +524,7 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) return error; } -SYSCALL_DEFINE1(fchdir, unsigned int, fd) +asmlinkage long sys_fchdir(unsigned int fd) { struct file *file; struct inode *inode; @@ -569,7 +550,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) return error; } -SYSCALL_DEFINE1(chroot, const char __user *, filename) +asmlinkage long sys_chroot(const char __user * filename) { struct path path; int error; @@ -594,7 +575,7 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) return error; } -SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) { struct inode * inode; struct dentry * dentry; @@ -628,7 +609,8 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) return err; } -SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) +asmlinkage long sys_fchmodat(int dfd, const char __user *filename, + mode_t mode) { struct path path; struct inode *inode; @@ -657,7 +639,7 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) return error; } -SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode) +asmlinkage long sys_chmod(const char __user *filename, mode_t mode) { return sys_fchmodat(AT_FDCWD, filename, mode); } @@ -687,7 +669,7 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group) return error; } -SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) +asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) { struct path path; int error; @@ -706,8 +688,8 @@ SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) return error; } -SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, - gid_t, group, int, flag) +asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, + gid_t group, int flag) { struct path path; int error = -EINVAL; @@ -731,7 +713,7 @@ SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, return error; } -SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group) +asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group) { struct path path; int error; @@ -750,7 +732,8 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group return error; } -SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) + +asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group) { struct file * file; int error = -EBADF; @@ -1046,7 +1029,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode) return fd; } -SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) +asmlinkage long sys_open(const char __user *filename, int flags, int mode) { long ret; @@ -1059,8 +1042,8 @@ SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) return ret; } -SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, - int, mode) +asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, + int mode) { long ret; @@ -1079,7 +1062,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, * For backward compatibility? Maybe this should be moved * into arch/i386 instead? */ -SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) +asmlinkage long sys_creat(const char __user * pathname, int mode) { return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); } @@ -1115,7 +1098,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. */ -SYSCALL_DEFINE1(close, unsigned int, fd) +asmlinkage long sys_close(unsigned int fd) { struct file * filp; struct files_struct *files = current->files; @@ -1148,13 +1131,14 @@ SYSCALL_DEFINE1(close, unsigned int, fd) 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. */ -SYSCALL_DEFINE0(vhangup) +asmlinkage long sys_vhangup(void) { if (capable(CAP_SYS_TTY_CONFIG)) { tty_vhangup_self(); diff --git a/trunk/fs/pipe.c b/trunk/fs/pipe.c index 3a48ba5179d5..891697112f66 100644 --- a/trunk/fs/pipe.c +++ b/trunk/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. */ -SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) +asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) { int fd[2]; int error; @@ -1059,7 +1059,7 @@ SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) return error; } -SYSCALL_DEFINE1(pipe, int __user *, fildes) +asmlinkage long __weak sys_pipe(int __user *fildes) { return sys_pipe2(fildes, 0); } diff --git a/trunk/fs/quota.c b/trunk/fs/quota.c index d76ada914f98..4a8c94f05f76 100644 --- a/trunk/fs/quota.c +++ b/trunk/fs/quota.c @@ -371,8 +371,7 @@ 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. */ -SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, - qid_t, id, void __user *, addr) +asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr) { uint cmds, type; struct super_block *sb = NULL; diff --git a/trunk/fs/read_write.c b/trunk/fs/read_write.c index 400fe81c973e..5cc6924eb158 100644 --- a/trunk/fs/read_write.c +++ b/trunk/fs/read_write.c @@ -147,7 +147,7 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin) } EXPORT_SYMBOL(vfs_llseek); -SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) +asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) { off_t retval; struct file * file; @@ -171,9 +171,9 @@ SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) } #ifdef __ARCH_WANT_SYS_LLSEEK -SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, - unsigned long, offset_low, loff_t __user *, result, - 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) { 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; } -SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) +asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) { struct file *file; ssize_t ret = -EBADF; @@ -386,8 +386,7 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) return ret; } -SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, - size_t, count) +asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count) { struct file *file; ssize_t ret = -EBADF; @@ -404,8 +403,8 @@ SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, return ret; } -SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, - size_t count, loff_t pos) +asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, + size_t count, loff_t pos) { struct file *file; ssize_t ret = -EBADF; @@ -424,17 +423,9 @@ SYSCALL_DEFINE(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 -SYSCALL_DEFINE(pwrite64)(unsigned int fd, const 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) { struct file *file; ssize_t ret = -EBADF; @@ -453,14 +444,6 @@ SYSCALL_DEFINE(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 @@ -689,8 +672,8 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, EXPORT_SYMBOL(vfs_writev); -SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, - unsigned long, vlen) +asmlinkage ssize_t +sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) { struct file *file; ssize_t ret = -EBADF; @@ -710,8 +693,8 @@ SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, return ret; } -SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec, - unsigned long, vlen) +asmlinkage ssize_t +sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) { struct file *file; ssize_t ret = -EBADF; @@ -829,7 +812,7 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, return retval; } -SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) +asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count) { loff_t pos; off_t off; @@ -848,7 +831,7 @@ SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_ return do_sendfile(out_fd, in_fd, NULL, count, 0); } -SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) +asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count) { loff_t pos; ssize_t ret; diff --git a/trunk/fs/readdir.c b/trunk/fs/readdir.c index 7723401f8d8b..b318d9b5af2e 100644 --- a/trunk/fs/readdir.c +++ b/trunk/fs/readdir.c @@ -102,8 +102,7 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset return -EFAULT; } -SYSCALL_DEFINE3(old_readdir, unsigned int, fd, - struct old_linux_dirent __user *, dirent, unsigned int, count) +asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count) { int error; struct file * file; @@ -188,8 +187,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, return -EFAULT; } -SYSCALL_DEFINE3(getdents, unsigned int, fd, - struct linux_dirent __user *, dirent, unsigned int, count) +asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count) { struct file * file; struct linux_dirent __user * lastdirent; @@ -270,8 +268,7 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset, return -EFAULT; } -SYSCALL_DEFINE3(getdents64, unsigned int, fd, - struct linux_dirent64 __user *, dirent, unsigned int, count) +asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count) { struct file * file; struct linux_dirent64 __user * lastdirent; diff --git a/trunk/fs/select.c b/trunk/fs/select.c index 0fe0e1469df3..08b91beed806 100644 --- a/trunk/fs/select.c +++ b/trunk/fs/select.c @@ -557,8 +557,8 @@ int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, return ret; } -SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, - fd_set __user *, exp, struct timeval __user *, tvp) +asmlinkage long sys_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 @@ SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, } #ifdef HAVE_SET_RESTORE_SIGMASK -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) +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) { sigset_t ksigmask, sigsaved; struct timespec ts, end_time, *to = NULL; @@ -610,7 +610,7 @@ static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp, sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); } - ret = core_sys_select(n, inp, outp, exp, to); + ret = core_sys_select(n, inp, outp, exp, &end_time); ret = poll_select_copy_remaining(&end_time, tsp, 0, ret); if (ret == -ERESTARTNOHAND) { @@ -636,9 +636,8 @@ static long do_pselect(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. */ -SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, - fd_set __user *, exp, struct timespec __user *, tsp, - void __user *, sig) +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) { size_t sigsetsize = 0; sigset_t __user *up = NULL; @@ -651,7 +650,7 @@ SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, return -EFAULT; } - return do_pselect(n, inp, outp, exp, tsp, up, sigsetsize); + return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize); } #endif /* HAVE_SET_RESTORE_SIGMASK */ @@ -855,8 +854,8 @@ static long do_restart_poll(struct restart_block *restart_block) return ret; } -SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, - long, timeout_msecs) +asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, + long timeout_msecs) { struct timespec end_time, *to = NULL; int ret; @@ -890,9 +889,9 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, } #ifdef HAVE_SET_RESTORE_SIGMASK -SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds, - struct timespec __user *, tsp, const sigset_t __user *, sigmask, - size_t, sigsetsize) +asmlinkage long sys_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; diff --git a/trunk/fs/signalfd.c b/trunk/fs/signalfd.c index b07565c94386..9c39bc7f8431 100644 --- a/trunk/fs/signalfd.c +++ b/trunk/fs/signalfd.c @@ -205,8 +205,8 @@ static const struct file_operations signalfd_fops = { .read = signalfd_read, }; -SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, - size_t, sizemask, int, flags) +asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, + size_t sizemask, int flags) { sigset_t sigmask; struct signalfd_ctx *ctx; @@ -259,8 +259,8 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, return ufd; } -SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, - size_t, sizemask) +asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, + size_t sizemask) { return sys_signalfd4(ufd, user_mask, sizemask, 0); } diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 4ed0ba44a966..a54b3e3f10a7 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -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(). * */ -SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov, - unsigned long, nr_segs, unsigned int, flags) +asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, + unsigned long nr_segs, unsigned int flags) { struct file *file; long error; @@ -1461,9 +1461,9 @@ SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov, return error; } -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) +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) { 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; } -SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags) +asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags) { struct file *in; int error, fput_in; diff --git a/trunk/fs/squashfs/squashfs_fs.h b/trunk/fs/squashfs/squashfs_fs.h index 283daafc568e..6840da1bf21e 100644 --- a/trunk/fs/squashfs/squashfs_fs.h +++ b/trunk/fs/squashfs/squashfs_fs.h @@ -26,6 +26,7 @@ #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 */ diff --git a/trunk/fs/squashfs/super.c b/trunk/fs/squashfs/super.c index 071df5b5b491..a0466d7467b2 100644 --- a/trunk/fs/squashfs/super.c +++ b/trunk/fs/squashfs/super.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "squashfs_fs.h" #include "squashfs_fs_sb.h" diff --git a/trunk/fs/stat.c b/trunk/fs/stat.c index 2db740a0cfb5..7e12a6f82795 100644 --- a/trunk/fs/stat.c +++ b/trunk/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; } -SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) +asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf) { struct kstat stat; int error = vfs_stat_fd(AT_FDCWD, filename, &stat); @@ -162,8 +162,7 @@ SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user * return error; } - -SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) +asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) { struct kstat stat; int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); @@ -173,8 +172,7 @@ SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user return error; } - -SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf) +asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf) { struct kstat stat; int error = vfs_fstat(fd, &stat); @@ -237,7 +235,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf) return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; } -SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) +asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) { struct kstat stat; int error = vfs_stat_fd(AT_FDCWD, filename, &stat); @@ -248,7 +246,7 @@ SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) return error; } -SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) +asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) { struct kstat stat; int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); @@ -260,8 +258,8 @@ SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf } #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) -SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, - struct stat __user *, statbuf, int, flag) +asmlinkage long sys_newfstatat(int dfd, char __user *filename, + struct stat __user *statbuf, int flag) { struct kstat stat; int error = -EINVAL; @@ -282,7 +280,7 @@ SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, } #endif -SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) +asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) { struct kstat stat; int error = vfs_fstat(fd, &stat); @@ -293,8 +291,8 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) return error; } -SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, - char __user *, buf, int, bufsiz) +asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, + char __user *buf, int bufsiz) { struct path path; int error; @@ -320,8 +318,8 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, return error; } -SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf, - int, bufsiz) +asmlinkage long sys_readlink(const char __user *path, char __user *buf, + int bufsiz) { return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); } @@ -367,7 +365,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf) return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; } -SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) +asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf) { struct kstat stat; int error = vfs_stat(filename, &stat); @@ -377,8 +375,7 @@ SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf return error; } - -SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) +asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf) { struct kstat stat; int error = vfs_lstat(filename, &stat); @@ -388,8 +385,7 @@ SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbu return error; } - -SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) +asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) { struct kstat stat; int error = vfs_fstat(fd, &stat); @@ -400,8 +396,8 @@ SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) return error; } -SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, - struct stat64 __user *, statbuf, int, flag) +asmlinkage long sys_fstatat64(int dfd, char __user *filename, + struct stat64 __user *statbuf, int flag) { struct kstat stat; int error = -EINVAL; diff --git a/trunk/fs/super.c b/trunk/fs/super.c index 645e5403f2a0..ed080c417167 100644 --- a/trunk/fs/super.c +++ b/trunk/fs/super.c @@ -544,7 +544,7 @@ struct super_block * user_get_super(dev_t dev) return NULL; } -SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) +asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) { struct super_block *s; struct ustat tmp; diff --git a/trunk/fs/sync.c b/trunk/fs/sync.c index a16d53e5fe9d..ac02b56548bc 100644 --- a/trunk/fs/sync.c +++ b/trunk/fs/sync.c @@ -36,7 +36,7 @@ static void do_sync(unsigned long wait) laptop_sync_completion(); } -SYSCALL_DEFINE0(sync) +asmlinkage long sys_sync(void) { do_sync(1); return 0; @@ -144,12 +144,12 @@ static int do_fsync(unsigned int fd, int datasync) return ret; } -SYSCALL_DEFINE1(fsync, unsigned int, fd) +asmlinkage long sys_fsync(unsigned int fd) { return do_fsync(fd, 0); } -SYSCALL_DEFINE1(fdatasync, unsigned int, fd) +asmlinkage long sys_fdatasync(unsigned int fd) { return do_fsync(fd, 1); } @@ -201,8 +201,8 @@ SYSCALL_DEFINE1(fdatasync, unsigned int, fd) * already-instantiated disk blocks, there are no guarantees here that the data * will be available after a crash. */ -SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, - unsigned int flags) +asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, + unsigned int flags) { int ret; struct file *file; @@ -262,32 +262,14 @@ SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, 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 */ -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, +asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, loff_t offset, loff_t nbytes) { - return SYSC_sync_file_range2((int) fd, (unsigned int) flags, - offset, nbytes); + return sys_sync_file_range(fd, offset, nbytes, flags); } -SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2); -#endif /* * `endbyte' is inclusive diff --git a/trunk/fs/timerfd.c b/trunk/fs/timerfd.c index 6a123b8ff3f5..0862f0e49d0c 100644 --- a/trunk/fs/timerfd.c +++ b/trunk/fs/timerfd.c @@ -177,7 +177,7 @@ static struct file *timerfd_fget(int fd) return file; } -SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) +asmlinkage long sys_timerfd_create(int clockid, int flags) { int ufd; struct timerfd_ctx *ctx; @@ -208,9 +208,9 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) return ufd; } -SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, - const struct itimerspec __user *, utmr, - struct itimerspec __user *, otmr) +asmlinkage long sys_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 @@ SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, return 0; } -SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr) +asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr) { struct file *file; struct timerfd_ctx *ctx; diff --git a/trunk/fs/utimes.c b/trunk/fs/utimes.c index e4c75db5d373..6929e3e91d05 100644 --- a/trunk/fs/utimes.c +++ b/trunk/fs/utimes.c @@ -24,7 +24,7 @@ * must be owner or have write permission. * Else, update from *times, must be owner or super user. */ -SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times) +asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times) { struct timespec tv[2]; @@ -170,8 +170,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags return error; } -SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, - struct timespec __user *, utimes, int, flags) +asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags) { struct timespec tstimes[2]; @@ -188,8 +187,7 @@ SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); } -SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, - struct timeval __user *, utimes) +asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __user *utimes) { struct timeval times[2]; struct timespec tstimes[2]; @@ -216,8 +214,7 @@ SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); } -SYSCALL_DEFINE2(utimes, char __user *, filename, - struct timeval __user *, utimes) +asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes) { return sys_futimesat(AT_FDCWD, filename, utimes); } diff --git a/trunk/fs/xattr.c b/trunk/fs/xattr.c index 197c4fcac032..237804cd6b56 100644 --- a/trunk/fs/xattr.c +++ b/trunk/fs/xattr.c @@ -251,9 +251,9 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, return error; } -SYSCALL_DEFINE5(setxattr, const char __user *, pathname, - const char __user *, name, const void __user *, value, - size_t, size, int, flags) +asmlinkage long +sys_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 @@ SYSCALL_DEFINE5(setxattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, - const char __user *, name, const void __user *, value, - size_t, size, int, flags) +asmlinkage long +sys_lsetxattr(const char __user *pathname, const char __user *name, + const void __user *value, size_t size, int flags) { struct path path; int error; @@ -289,8 +289,9 @@ SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE5(fsetxattr, int, fd, 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) { struct file *f; struct dentry *dentry; @@ -348,8 +349,9 @@ getxattr(struct dentry *d, const char __user *name, void __user *value, return error; } -SYSCALL_DEFINE4(getxattr, const char __user *, pathname, - const char __user *, name, void __user *, value, size_t, size) +asmlinkage ssize_t +sys_getxattr(const char __user *pathname, const char __user *name, + void __user *value, size_t size) { struct path path; ssize_t error; @@ -362,8 +364,9 @@ SYSCALL_DEFINE4(getxattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname, - const char __user *, name, void __user *, value, size_t, size) +asmlinkage ssize_t +sys_lgetxattr(const char __user *pathname, const char __user *name, void __user *value, + size_t size) { struct path path; ssize_t error; @@ -376,8 +379,8 @@ SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE4(fgetxattr, int, fd, 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) { struct file *f; ssize_t error = -EBADF; @@ -421,8 +424,8 @@ listxattr(struct dentry *d, char __user *list, size_t size) return error; } -SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list, - size_t, size) +asmlinkage ssize_t +sys_listxattr(const char __user *pathname, char __user *list, size_t size) { struct path path; ssize_t error; @@ -435,8 +438,8 @@ SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list, return error; } -SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list, - size_t, size) +asmlinkage ssize_t +sys_llistxattr(const char __user *pathname, char __user *list, size_t size) { struct path path; ssize_t error; @@ -449,7 +452,8 @@ SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list, return error; } -SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size) +asmlinkage ssize_t +sys_flistxattr(int fd, char __user *list, size_t size) { struct file *f; ssize_t error = -EBADF; @@ -481,8 +485,8 @@ removexattr(struct dentry *d, const char __user *name) return vfs_removexattr(d, kname); } -SYSCALL_DEFINE2(removexattr, const char __user *, pathname, - const char __user *, name) +asmlinkage long +sys_removexattr(const char __user *pathname, const char __user *name) { struct path path; int error; @@ -499,8 +503,8 @@ SYSCALL_DEFINE2(removexattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname, - const char __user *, name) +asmlinkage long +sys_lremovexattr(const char __user *pathname, const char __user *name) { struct path path; int error; @@ -517,7 +521,8 @@ SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname, return error; } -SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) +asmlinkage long +sys_fremovexattr(int fd, const char __user *name) { struct file *f; struct dentry *dentry; diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.h b/trunk/fs/xfs/linux-2.6/xfs_aops.h index 1dd528849755..7b26f5ff9692 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.h +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.h @@ -21,6 +21,8 @@ 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. diff --git a/trunk/fs/xfs/linux-2.6/xfs_buf.c b/trunk/fs/xfs/linux-2.6/xfs_buf.c index d71dc44e21ed..cb329edc925b 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_buf.c +++ b/trunk/fs/xfs/linux-2.6/xfs_buf.c @@ -165,6 +165,75 @@ 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 */ @@ -264,7 +333,7 @@ xfs_buf_free( uint i; if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) - vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count); + free_address(bp->b_addr - bp->b_offset); for (i = 0; i < bp->b_page_count; i++) { struct page *page = bp->b_pages[i]; @@ -386,8 +455,10 @@ _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) { - bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, - -1, PAGE_KERNEL); + if (as_list_len > 64) + purge_addresses(); + bp->b_addr = vmap(bp->b_pages, bp->b_page_count, + VM_MAP, PAGE_KERNEL); if (unlikely(bp->b_addr == NULL)) return -ENOMEM; bp->b_addr += bp->b_offset; @@ -1672,6 +1743,8 @@ xfsbufd( count++; } + if (as_list_len > 0) + purge_addresses(); if (count) blk_run_address_space(target->bt_mapping); diff --git a/trunk/fs/xfs/linux-2.6/xfs_export.c b/trunk/fs/xfs/linux-2.6/xfs_export.c index 87b8cbd23d4b..595751f78350 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_export.c +++ b/trunk/fs/xfs/linux-2.6/xfs_export.c @@ -126,26 +126,11 @@ xfs_nfs_get_inode( if (ino == 0) return ERR_PTR(-ESTALE); - /* - * 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; + error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); + if (error) return ERR_PTR(-error); - } + if (!ip) + return ERR_PTR(-EIO); if (ip->i_d.di_gen != generation) { xfs_iput_new(ip, XFS_ILOCK_SHARED); diff --git a/trunk/fs/xfs/xfs_acl.h b/trunk/fs/xfs/xfs_acl.h index 642f1db4def4..a4e293b93efa 100644 --- a/trunk/fs/xfs/xfs_acl.h +++ b/trunk/fs/xfs/xfs_acl.h @@ -22,6 +22,7 @@ * 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; diff --git a/trunk/fs/xfs/xfs_ag.h b/trunk/fs/xfs/xfs_ag.h index d3b3cf742999..f2e21817a226 100644 --- a/trunk/fs/xfs/xfs_ag.h +++ b/trunk/fs/xfs/xfs_ag.h @@ -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))) diff --git a/trunk/fs/xfs/xfs_attr_leaf.c b/trunk/fs/xfs/xfs_attr_leaf.c index 6c323f8a4cd1..79da6b2ea99e 100644 --- a/trunk/fs/xfs/xfs_attr_leaf.c +++ b/trunk/fs/xfs/xfs_attr_leaf.c @@ -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, diff --git a/trunk/fs/xfs/xfs_attr_leaf.h b/trunk/fs/xfs/xfs_attr_leaf.h index 9c7d22fdcf4d..83e9af417ca2 100644 --- a/trunk/fs/xfs/xfs_attr_leaf.h +++ b/trunk/fs/xfs/xfs_attr_leaf.h @@ -151,6 +151,8 @@ 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) { @@ -158,6 +160,8 @@ 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) { @@ -165,6 +169,8 @@ 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)]; @@ -175,18 +181,24 @@ 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)); diff --git a/trunk/fs/xfs/xfs_bit.h b/trunk/fs/xfs/xfs_bit.h index f1e3c907044d..bca7b243c319 100644 --- a/trunk/fs/xfs/xfs_bit.h +++ b/trunk/fs/xfs/xfs_bit.h @@ -23,16 +23,24 @@ */ /* - * masks with n high/low bits set, 64-bit values + * masks with n high/low bits set, 32-bit values & 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; diff --git a/trunk/fs/xfs/xfs_bmap_btree.c b/trunk/fs/xfs/xfs_bmap_btree.c index ba6b08c2fb02..8f1ec73725d3 100644 --- a/trunk/fs/xfs/xfs_bmap_btree.c +++ b/trunk/fs/xfs/xfs_bmap_btree.c @@ -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); } /* diff --git a/trunk/fs/xfs/xfs_btree.c b/trunk/fs/xfs/xfs_btree.c index 2c3ef20f8842..7ed59267420d 100644 --- a/trunk/fs/xfs/xfs_btree.c +++ b/trunk/fs/xfs/xfs_btree.c @@ -730,8 +730,8 @@ xfs_btree_readahead_lblock( struct xfs_btree_block *block) { int rval = 0; - 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); + 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); if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { xfs_btree_reada_bufl(cur->bc_mp, left, 1); diff --git a/trunk/fs/xfs/xfs_dir2_block.c b/trunk/fs/xfs/xfs_dir2_block.c index e1f0a06aaf04..e2fa0a1d8e96 100644 --- a/trunk/fs/xfs/xfs_dir2_block.c +++ b/trunk/fs/xfs/xfs_dir2_block.c @@ -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 & 0x7fffffff, + if (filldir(dirent, dep->name, dep->namelen, cook, ino, DT_UNKNOWN)) { - *offset = cook & 0x7fffffff; + *offset = cook; xfs_da_brelse(NULL, bp); return 0; } @@ -529,8 +529,7 @@ 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) & - 0x7fffffff; + *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); xfs_da_brelse(NULL, bp); return 0; } diff --git a/trunk/fs/xfs/xfs_dir2_leaf.c b/trunk/fs/xfs/xfs_dir2_leaf.c index ef805a374eec..93535992cb60 100644 --- a/trunk/fs/xfs/xfs_dir2_leaf.c +++ b/trunk/fs/xfs/xfs_dir2_leaf.c @@ -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) & 0x7fffffff, + xfs_dir2_byte_to_dataptr(mp, curoff), 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 & 0x7fffffff; + *offset = XFS_DIR2_MAX_DATAPTR; else - *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; + *offset = xfs_dir2_byte_to_dataptr(mp, curoff); kmem_free(map); if (bp) xfs_da_brelse(NULL, bp); diff --git a/trunk/fs/xfs/xfs_dir2_sf.c b/trunk/fs/xfs/xfs_dir2_sf.c index a8a8a6efad5b..b46af0013ec9 100644 --- a/trunk/fs/xfs/xfs_dir2_sf.c +++ b/trunk/fs/xfs/xfs_dir2_sf.c @@ -752,8 +752,8 @@ xfs_dir2_sf_getdents( #if XFS_BIG_INUMS ino += mp->m_inoadd; #endif - if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) { - *offset = dot_offset & 0x7fffffff; + if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) { + *offset = dot_offset; 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 & 0x7fffffff, ino, DT_DIR)) { - *offset = dotdot_offset & 0x7fffffff; + if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) { + *offset = dotdot_offset; return 0; } } @@ -791,15 +791,14 @@ xfs_dir2_sf_getdents( #endif if (filldir(dirent, sfep->name, sfep->namelen, - off & 0x7fffffff, ino, DT_UNKNOWN)) { - *offset = off & 0x7fffffff; + off, ino, DT_UNKNOWN)) { + *offset = off; return 0; } sfep = xfs_dir2_sf_nextentry(sfp, sfep); } - *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & - 0x7fffffff; + *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); return 0; } diff --git a/trunk/fs/xfs/xfs_types.h b/trunk/fs/xfs/xfs_types.h index b2f724502f1b..0f5191644ab2 100644 --- a/trunk/fs/xfs/xfs_types.h +++ b/trunk/fs/xfs/xfs_types.h @@ -45,7 +45,7 @@ typedef __uint32_t prid_t; /* project ID */ typedef __uint32_t inst_t; /* an instruction */ typedef __s64 xfs_off_t; /* type */ -typedef unsigned long long xfs_ino_t; /* type */ +typedef __u64 xfs_ino_t; /* type */ typedef __s64 xfs_daddr_t; /* type */ typedef char * xfs_caddr_t; /* type */ typedef __u32 xfs_dev_t; @@ -111,6 +111,8 @@ 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. */ diff --git a/trunk/include/acpi/actbl.h b/trunk/include/acpi/actbl.h index bf8d4cfd8cf5..813e4b6c2c0d 100644 --- a/trunk/include/acpi/actbl.h +++ b/trunk/include/acpi/actbl.h @@ -245,7 +245,7 @@ struct acpi_table_fadt { #define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: Power button is handled as a generic feature */ #define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: Sleep button is handled as a generic feature, or not present */ #define ACPI_FADT_FIXED_RTC (1<<6) /* 06: RTC wakeup stat not in fixed register space */ -#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup possible from S4 */ +#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup stat not possible from S4 */ #define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: tmr_val is 32 bits 0=24-bits */ #define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: Docking supported */ #define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: System reset via the FADT RESET_REG supported */ diff --git a/trunk/include/asm-frv/Kbuild b/trunk/include/asm-frv/Kbuild index 0f8956def738..1f44e7c76995 100644 --- a/trunk/include/asm-frv/Kbuild +++ b/trunk/include/asm-frv/Kbuild @@ -3,3 +3,4 @@ include include/asm-generic/Kbuild.asm header-y += registers.h unifdef-y += termios.h +unifdef-y += swab.h diff --git a/trunk/include/asm-frv/byteorder.h b/trunk/include/asm-frv/byteorder.h index f29b7593e088..1187e51ecd13 100644 --- a/trunk/include/asm-frv/byteorder.h +++ b/trunk/include/asm-frv/byteorder.h @@ -1,6 +1,7 @@ #ifndef _ASM_BYTEORDER_H #define _ASM_BYTEORDER_H +#include #include #endif /* _ASM_BYTEORDER_H */ diff --git a/trunk/include/asm-generic/Kbuild.asm b/trunk/include/asm-generic/Kbuild.asm index 70d185534b9d..1870d5e05f1c 100644 --- a/trunk/include/asm-generic/Kbuild.asm +++ b/trunk/include/asm-generic/Kbuild.asm @@ -31,7 +31,6 @@ 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 diff --git a/trunk/include/asm-generic/pgtable.h b/trunk/include/asm-generic/pgtable.h index 8e6d0ca70aba..72ebe91005a8 100644 --- a/trunk/include/asm-generic/pgtable.h +++ b/trunk/include/asm-generic/pgtable.h @@ -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, diff --git a/trunk/include/asm-generic/rtc.h b/trunk/include/asm-generic/rtc.h index 763e3b060f43..89061c1a67d4 100644 --- a/trunk/include/asm-generic/rtc.h +++ b/trunk/include/asm-generic/rtc.h @@ -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,12 +108,8 @@ 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; @@ -194,15 +190,11 @@ 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; } diff --git a/trunk/include/asm-m32r/Kbuild b/trunk/include/asm-m32r/Kbuild index c68e1680da01..27b108a86b39 100644 --- a/trunk/include/asm-m32r/Kbuild +++ b/trunk/include/asm-m32r/Kbuild @@ -1 +1,2 @@ include include/asm-generic/Kbuild.asm +unifdef-y += swab.h diff --git a/trunk/include/asm-m32r/byteorder.h b/trunk/include/asm-m32r/byteorder.h index 21855d8b028b..61ff9cfd8451 100644 --- a/trunk/include/asm-m32r/byteorder.h +++ b/trunk/include/asm-m32r/byteorder.h @@ -1,6 +1,8 @@ #ifndef _ASM_M32R_BYTEORDER_H #define _ASM_M32R_BYTEORDER_H +#include + #if defined(__LITTLE_ENDIAN__) # include #else diff --git a/trunk/include/asm-m68k/Kbuild b/trunk/include/asm-m68k/Kbuild index 1a922fad76f7..52fd96b4142a 100644 --- a/trunk/include/asm-m68k/Kbuild +++ b/trunk/include/asm-m68k/Kbuild @@ -1,2 +1,3 @@ include include/asm-generic/Kbuild.asm header-y += cachectl.h +unifdef-y += swab.h diff --git a/trunk/include/asm-m68k/byteorder.h b/trunk/include/asm-m68k/byteorder.h index 31b260a88803..300866523b86 100644 --- a/trunk/include/asm-m68k/byteorder.h +++ b/trunk/include/asm-m68k/byteorder.h @@ -1,6 +1,7 @@ #ifndef _M68K_BYTEORDER_H #define _M68K_BYTEORDER_H +#include #include #endif /* _M68K_BYTEORDER_H */ diff --git a/trunk/include/asm-mn10300/Kbuild b/trunk/include/asm-mn10300/Kbuild index c68e1680da01..27b108a86b39 100644 --- a/trunk/include/asm-mn10300/Kbuild +++ b/trunk/include/asm-mn10300/Kbuild @@ -1 +1,2 @@ include include/asm-generic/Kbuild.asm +unifdef-y += swab.h diff --git a/trunk/include/asm-mn10300/byteorder.h b/trunk/include/asm-mn10300/byteorder.h index 5dd0bdd9feee..45b18ded19e6 100644 --- a/trunk/include/asm-mn10300/byteorder.h +++ b/trunk/include/asm-mn10300/byteorder.h @@ -1,6 +1,7 @@ #ifndef _ASM_BYTEORDER_H #define _ASM_BYTEORDER_H +#include #include #endif /* _ASM_BYTEORDER_H */ diff --git a/trunk/include/drm/drm_crtc.h b/trunk/include/drm/drm_crtc.h index 47809ac94bc3..0acb07f31fa4 100644 --- a/trunk/include/drm/drm_crtc.h +++ b/trunk/include/drm/drm_crtc.h @@ -395,7 +395,7 @@ struct drm_connector_funcs { void (*save)(struct drm_connector *connector); void (*restore)(struct drm_connector *connector); enum drm_connector_status (*detect)(struct drm_connector *connector); - int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); + void (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height); int (*set_property)(struct drm_connector *connector, struct drm_property *property, uint64_t val); void (*destroy)(struct drm_connector *connector); diff --git a/trunk/include/drm/drm_crtc_helper.h b/trunk/include/drm/drm_crtc_helper.h index 0c6f0e11b41b..4bc04cf460a7 100644 --- a/trunk/include/drm/drm_crtc_helper.h +++ b/trunk/include/drm/drm_crtc_helper.h @@ -88,7 +88,7 @@ struct drm_connector_helper_funcs { struct drm_encoder *(*best_encoder)(struct drm_connector *connector); }; -extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); +extern void drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); extern void drm_helper_disable_unused_functions(struct drm_device *dev); extern int drm_helper_hotplug_stage_two(struct drm_device *dev); extern bool drm_helper_initial_config(struct drm_device *dev, bool can_grow); diff --git a/trunk/include/linux/agpgart.h b/trunk/include/linux/agpgart.h index 110c600c885f..c8fdb6e658e1 100644 --- a/trunk/include/linux/agpgart.h +++ b/trunk/include/linux/agpgart.h @@ -52,6 +52,7 @@ #ifndef __KERNEL__ #include +#include struct agp_version { __u16 major; diff --git a/trunk/include/linux/atm_idt77105.h b/trunk/include/linux/atm_idt77105.h index 8b724000aa50..05621cf20709 100644 --- a/trunk/include/linux/atm_idt77105.h +++ b/trunk/include/linux/atm_idt77105.h @@ -7,7 +7,7 @@ #ifndef LINUX_ATM_IDT77105_H #define LINUX_ATM_IDT77105_H -#include +#include #include #include diff --git a/trunk/include/linux/capi.h b/trunk/include/linux/capi.h index 65100d6cb89b..fdebaaa9f66e 100644 --- a/trunk/include/linux/capi.h +++ b/trunk/include/linux/capi.h @@ -12,7 +12,7 @@ #ifndef __LINUX_CAPI_H__ #define __LINUX_CAPI_H__ -#include +#include #include #ifndef __KERNEL__ #include diff --git a/trunk/include/linux/compat.h b/trunk/include/linux/compat.h index 3fd2194ff573..e88f3ecf38b4 100644 --- a/trunk/include/linux/compat.h +++ b/trunk/include/linux/compat.h @@ -280,18 +280,5 @@ 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 */ diff --git a/trunk/include/linux/connector.h b/trunk/include/linux/connector.h index 34f2789d9b9b..5c7f9468f753 100644 --- a/trunk/include/linux/connector.h +++ b/trunk/include/linux/connector.h @@ -22,7 +22,7 @@ #ifndef __CONNECTOR_H #define __CONNECTOR_H -#include +#include #define CN_IDX_CONNECTOR 0xffffffff #define CN_VAL_CONNECTOR 0xffffffff diff --git a/trunk/include/linux/cyclades.h b/trunk/include/linux/cyclades.h index d06fbf286346..2d3d1e04ba92 100644 --- a/trunk/include/linux/cyclades.h +++ b/trunk/include/linux/cyclades.h @@ -150,6 +150,8 @@ struct CYZ_BOOT_CTRL { * architectures and compilers. */ +#include + typedef __u64 ucdouble; /* 64 bits, unsigned */ typedef __u32 uclong; /* 32 bits, unsigned */ typedef __u16 ucshort; /* 16 bits, unsigned */ diff --git a/trunk/include/linux/fb.h b/trunk/include/linux/fb.h index 818fe21257e8..1ee63df5be92 100644 --- a/trunk/include/linux/fb.h +++ b/trunk/include/linux/fb.h @@ -1,7 +1,7 @@ #ifndef _LINUX_FB_H #define _LINUX_FB_H -#include +#include #include struct dentry; diff --git a/trunk/include/linux/ide.h b/trunk/include/linux/ide.h index 194da5a4b0d6..3644f6323384 100644 --- a/trunk/include/linux/ide.h +++ b/trunk/include/linux/ide.h @@ -871,7 +871,7 @@ struct ide_host { ide_hwif_t *cur_port; /* for hosts requiring serialization */ /* used for hosts requiring serialization */ - volatile unsigned long host_busy; + volatile long host_busy; }; #define IDE_HOST_BUSY 0 diff --git a/trunk/include/linux/if_pppol2tp.h b/trunk/include/linux/if_pppol2tp.h index c7a66882b6d0..a7d6a2234b31 100644 --- a/trunk/include/linux/if_pppol2tp.h +++ b/trunk/include/linux/if_pppol2tp.h @@ -15,7 +15,7 @@ #ifndef __LINUX_IF_PPPOL2TP_H #define __LINUX_IF_PPPOL2TP_H -#include +#include #ifdef __KERNEL__ #include diff --git a/trunk/include/linux/if_pppox.h b/trunk/include/linux/if_pppox.h index 30c88b2245ff..6fb7f1788570 100644 --- a/trunk/include/linux/if_pppox.h +++ b/trunk/include/linux/if_pppox.h @@ -17,7 +17,7 @@ #define __LINUX_IF_PPPOX_H -#include +#include #include #ifdef __KERNEL__ diff --git a/trunk/include/linux/input.h b/trunk/include/linux/input.h index 1249a0c20a38..9a6355f74db2 100644 --- a/trunk/include/linux/input.h +++ b/trunk/include/linux/input.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #endif /* diff --git a/trunk/include/linux/ioport.h b/trunk/include/linux/ioport.h index 32e4b2f72294..f6bb2ca8e3ba 100644 --- a/trunk/include/linux/ioport.h +++ b/trunk/include/linux/ioport.h @@ -143,8 +143,7 @@ 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 flags); + resource_size_t n, const char *name, int relaxed); /* Compatibility cruft */ #define release_region(start,n) __release_region(&ioport_resource, (start), (n)) diff --git a/trunk/include/linux/jbd.h b/trunk/include/linux/jbd.h index 64246dce5663..6384b19efe64 100644 --- a/trunk/include/linux/jbd.h +++ b/trunk/include/linux/jbd.h @@ -614,8 +614,6 @@ 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. */ diff --git a/trunk/include/linux/joystick.h b/trunk/include/linux/joystick.h index 9e20c29c1e14..b5e051295a67 100644 --- a/trunk/include/linux/joystick.h +++ b/trunk/include/linux/joystick.h @@ -27,7 +27,7 @@ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic */ -#include +#include #include /* diff --git a/trunk/include/linux/kvm.h b/trunk/include/linux/kvm.h index 5715f1907601..35525ac63337 100644 --- a/trunk/include/linux/kvm.h +++ b/trunk/include/linux/kvm.h @@ -7,7 +7,7 @@ * Note: you must update KVM_API_VERSION if you change this interface. */ -#include +#include #include #include #include diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index 2c6bd66209ff..b6b8a7f3ec66 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -401,14 +401,12 @@ enum { ATA_TIMING_CYC8B, ATA_TIMING_ACTIVE = (1 << 4), ATA_TIMING_RECOVER = (1 << 5), - ATA_TIMING_DMACK_HOLD = (1 << 6), - ATA_TIMING_CYCLE = (1 << 7), - ATA_TIMING_UDMA = (1 << 8), + ATA_TIMING_CYCLE = (1 << 6), + ATA_TIMING_UDMA = (1 << 7), ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B | ATA_TIMING_REC8B | ATA_TIMING_CYC8B | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | - ATA_TIMING_DMACK_HOLD | ATA_TIMING_CYCLE | - ATA_TIMING_UDMA, + ATA_TIMING_CYCLE | ATA_TIMING_UDMA, }; enum ata_xfer_mask { @@ -868,7 +866,6 @@ struct ata_timing { unsigned short cyc8b; /* t0 for 8-bit I/O */ unsigned short active; /* t2 or tD */ unsigned short recover; /* t2i or tK */ - unsigned short dmack_hold; /* tj */ unsigned short cycle; /* t0 */ unsigned short udma; /* t2CYCTYP/2 */ }; @@ -930,8 +927,6 @@ extern void ata_host_init(struct ata_host *, struct device *, extern int ata_scsi_detect(struct scsi_host_template *sht); extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); -extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, - int cmd, void __user *arg); extern void ata_sas_port_destroy(struct ata_port *); extern struct ata_port *ata_sas_port_alloc(struct ata_host *, struct ata_port_info *, struct Scsi_Host *); diff --git a/trunk/include/linux/loop.h b/trunk/include/linux/loop.h index 6ffd6db5bb0d..46169a7b559b 100644 --- a/trunk/include/linux/loop.h +++ b/trunk/include/linux/loop.h @@ -80,7 +80,7 @@ enum { }; #include /* for __kernel_old_dev_t */ -#include /* for __u64 */ +#include /* for __u64 */ /* Backwards compatibility version */ struct loop_info { diff --git a/trunk/include/linux/magic.h b/trunk/include/linux/magic.h index 0b4df7eba852..439f6f3cb0c4 100644 --- a/trunk/include/linux/magic.h +++ b/trunk/include/linux/magic.h @@ -10,13 +10,11 @@ #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 diff --git a/trunk/include/linux/matroxfb.h b/trunk/include/linux/matroxfb.h index 404f678e734b..ae5b09493062 100644 --- a/trunk/include/linux/matroxfb.h +++ b/trunk/include/linux/matroxfb.h @@ -2,7 +2,7 @@ #define __LINUX_MATROXFB_H__ #include -#include +#include #include struct matroxioc_output_mode { diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index e8ddc98b8405..b91a73fd1bcc 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -260,6 +260,7 @@ 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); } diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index ec54785d34f9..f24556813375 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -467,7 +467,7 @@ struct netdev_queue { * This function is called when network device transistions to the down * state. * - * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev); + * int (*ndo_hard_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,7 +795,6 @@ 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 */ @@ -1078,8 +1077,6 @@ 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); diff --git a/trunk/include/linux/netfilter/x_tables.h b/trunk/include/linux/netfilter/x_tables.h index c7ee8744d26b..e52ce475d19f 100644 --- a/trunk/include/linux/netfilter/x_tables.h +++ b/trunk/include/linux/netfilter/x_tables.h @@ -270,7 +270,6 @@ 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. */ @@ -303,6 +302,7 @@ struct xt_match unsigned short proto; unsigned short family; + u_int8_t revision; }; /* Registration hooks for targets. */ diff --git a/trunk/include/linux/of_i2c.h b/trunk/include/linux/of_i2c.h index 34974b5a76f7..bd2a870ec296 100644 --- a/trunk/include/linux/of_i2c.h +++ b/trunk/include/linux/of_i2c.h @@ -17,7 +17,4 @@ 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 */ diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index d56ad9c21c09..d543365518ab 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -2174,7 +2174,6 @@ #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 diff --git a/trunk/include/linux/phantom.h b/trunk/include/linux/phantom.h index 94dd6645c60a..02268c54c250 100644 --- a/trunk/include/linux/phantom.h +++ b/trunk/include/linux/phantom.h @@ -10,7 +10,7 @@ #ifndef __PHANTOM_H #define __PHANTOM_H -#include +#include /* PHN_(G/S)ET_REG param */ struct phm_reg { diff --git a/trunk/include/linux/radeonfb.h b/trunk/include/linux/radeonfb.h index 8c4bbdecc44f..5bd8975ed78e 100644 --- a/trunk/include/linux/radeonfb.h +++ b/trunk/include/linux/radeonfb.h @@ -2,7 +2,7 @@ #define __LINUX_RADEONFB_H__ #include -#include +#include #define ATY_RADEON_LCD_ON 0x00000001 #define ATY_RADEON_CRT_ON 0x00000002 diff --git a/trunk/include/linux/res_counter.h b/trunk/include/linux/res_counter.h index 4c5bcf6ca7e8..dede0a2cfc45 100644 --- a/trunk/include/linux/res_counter.h +++ b/trunk/include/linux/res_counter.h @@ -9,7 +9,7 @@ * * Author: Pavel Emelianov * - * See Documentation/cgroups/resource_counter.txt for more + * See Documentation/controllers/resource_counter.txt for more * info about what this counter is. */ diff --git a/trunk/include/linux/swab.h b/trunk/include/linux/swab.h index ea0c02fd5163..be5284d4a053 100644 --- a/trunk/include/linux/swab.h +++ b/trunk/include/linux/swab.h @@ -3,7 +3,7 @@ #include #include -#include +#include /* * casts are necessary for constants, because we never know how for sure diff --git a/trunk/include/linux/syscalls.h b/trunk/include/linux/syscalls.h index 16875f89e6a7..18d0a243a7b3 100644 --- a/trunk/include/linux/syscalls.h +++ b/trunk/include/linux/syscalls.h @@ -54,7 +54,6 @@ struct compat_stat; struct compat_timeval; struct robust_list_head; struct getcpu_cache; -struct old_linux_dirent; #include #include @@ -66,74 +65,6 @@ struct old_linux_dirent; #include #include -#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, @@ -146,7 +77,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 long sys_alarm(unsigned int seconds); +asmlinkage unsigned long sys_alarm(unsigned int seconds); asmlinkage long sys_getpid(void); asmlinkage long sys_getppid(void); asmlinkage long sys_getuid(void); @@ -235,7 +166,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, unsigned long flags); asmlinkage long sys_exit(int error_code); -asmlinkage long sys_exit_group(int error_code); +asmlinkage void 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, @@ -265,7 +196,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 long sys_signal(int sig, __sighandler_t handler); +asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler); asmlinkage long sys_pause(void); asmlinkage long sys_sync(void); @@ -315,29 +246,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 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 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_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 long sys_brk(unsigned long brk); +asmlinkage unsigned long sys_brk(unsigned long brk); asmlinkage long sys_mprotect(unsigned long start, size_t len, unsigned long prot); -asmlinkage long sys_mremap(unsigned long addr, - unsigned long old_len, unsigned long new_len, - unsigned long flags, unsigned long new_addr); +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_remap_file_pages(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags); @@ -390,10 +321,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 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 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_readlink(const char __user *path, char __user *buf, int bufsiz); asmlinkage long sys_creat(const char __user *pathname, int mode); @@ -437,25 +368,26 @@ asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times); asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes); -asmlinkage long sys_lseek(unsigned int fd, off_t offset, - unsigned int origin); +asmlinkage off_t 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 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 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_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); @@ -544,7 +476,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 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 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_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); @@ -598,6 +530,11 @@ 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, @@ -646,6 +583,13 @@ 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, @@ -677,15 +621,6 @@ 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[]); diff --git a/trunk/include/scsi/libiscsi_tcp.h b/trunk/include/scsi/libiscsi_tcp.h index 9e3182e659db..83e32f6d7859 100644 --- a/trunk/include/scsi/libiscsi_tcp.h +++ b/trunk/include/scsi/libiscsi_tcp.h @@ -39,7 +39,6 @@ struct iscsi_segment { unsigned int total_copied; struct hash_desc *hash; - unsigned char padbuf[ISCSI_PAD_LEN]; unsigned char recv_digest[ISCSI_DIGEST_SIZE]; unsigned char digest[ISCSI_DIGEST_SIZE]; unsigned int digest_len; diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig index 2af83825634e..a724a149bf3f 100644 --- a/trunk/init/Kconfig +++ b/trunk/init/Kconfig @@ -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/cgroups.txt for more - information on "cgroup" pseudo filesystem. + Refer to Documentation/cgroups.txt for more information + on "cgroup" pseudo filesystem. endchoice -menuconfig CGROUPS - boolean "Control Group support" +menu "Control Group support" +config CGROUPS + bool "Control Group support" help - This option adds support for grouping sets of processes together, for + This option add 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 - and resource control) + - Documentation/cgroups/ (features for grouping, isolation) + - Documentation/controllers/ (features for 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 "Freezer cgroup subsystem" - depends on CGROUPS - help - Provides a way to freeze and unfreeze all tasks in a + bool "control group freezer subsystem" + depends on CGROUPS + help + Provides a way to freeze and unfreeze all tasks in a cgroup. config CGROUP_DEVICE @@ -388,23 +388,18 @@ config CPUSETS Say N if unsure. -config PROC_PID_CPUSET - bool "Include legacy /proc//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 @@ -430,6 +425,9 @@ 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 @@ -446,10 +444,8 @@ 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 -config MM_OWNER - bool +endmenu config SYSFS_DEPRECATED bool @@ -487,6 +483,11 @@ 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//cpuset file" + depends on CPUSETS + default y + config RELAY bool "Kernel->user space relay support (formerly relayfs)" help diff --git a/trunk/ipc/mqueue.c b/trunk/ipc/mqueue.c index 54b4077fed79..23fdb8492b8e 100644 --- a/trunk/ipc/mqueue.c +++ b/trunk/ipc/mqueue.c @@ -650,8 +650,8 @@ static struct file *do_open(struct dentry *dentry, int oflag) return dentry_open(dentry, mqueue_mnt, oflag, cred); } -SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, - struct mq_attr __user *, u_attr) +asmlinkage long sys_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 @@ SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, return fd; } -SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name) +asmlinkage long sys_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; } -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) +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) { struct file *filp; struct inode *inode; @@ -907,9 +907,9 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, return ret; } -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) +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) { long timeout; ssize_t ret; @@ -997,8 +997,8 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, * and he isn't currently owner of notification, will be silently discarded. * It isn't explicitly defined in the POSIX. */ -SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, - const struct sigevent __user *, u_notification) +asmlinkage long sys_mq_notify(mqd_t mqdes, + const struct sigevent __user *u_notification) { int ret; struct file *filp; @@ -1123,9 +1123,9 @@ SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, return ret; } -SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, - const struct mq_attr __user *, u_mqstat, - struct mq_attr __user *, u_omqstat) +asmlinkage long sys_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; diff --git a/trunk/ipc/msg.c b/trunk/ipc/msg.c index 2ceab7f12fcb..b4eee1c6101d 100644 --- a/trunk/ipc/msg.c +++ b/trunk/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); } -SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg) +asmlinkage long sys_msgget(key_t key, int msgflg) { struct ipc_namespace *ns; struct ipc_ops msg_ops; @@ -466,7 +466,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, return err; } -SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) +asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) { struct msg_queue *msq; int err, version; @@ -723,8 +723,8 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext, return err; } -SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, - int, msgflg) +asmlinkage long +sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg) { long mtype; @@ -904,8 +904,8 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext, return msgsz; } -SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, - long, msgtyp, int, msgflg) +asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, + long msgtyp, int msgflg) { long err, mtype; diff --git a/trunk/ipc/sem.c b/trunk/ipc/sem.c index 16a2189e96f9..c68cd3f8f0c9 100644 --- a/trunk/ipc/sem.c +++ b/trunk/ipc/sem.c @@ -308,7 +308,7 @@ static inline int sem_more_checks(struct kern_ipc_perm *ipcp, return 0; } -SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg) +asmlinkage long sys_semget(key_t key, int nsems, int semflg) { struct ipc_namespace *ns; struct ipc_ops sem_ops; @@ -887,7 +887,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid, return err; } -SYSCALL_DEFINE(semctl)(int semid, int semnum, int cmd, union semun arg) +asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) { int err = -EINVAL; int version; @@ -923,13 +923,6 @@ SYSCALL_DEFINE(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, @@ -1055,8 +1048,8 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid) return un; } -SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, - unsigned, nsops, const struct timespec __user *, timeout) +asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, + unsigned nsops, const struct timespec __user *timeout) { int error = -EINVAL; struct sem_array *sma; @@ -1232,8 +1225,7 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, return error; } -SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops, - unsigned, nsops) +asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops) { return sys_semtimedop(semid, tsops, nsops, NULL); } diff --git a/trunk/ipc/shm.c b/trunk/ipc/shm.c index a9e09ad2263e..d0ab5527bf45 100644 --- a/trunk/ipc/shm.c +++ b/trunk/ipc/shm.c @@ -440,7 +440,7 @@ static inline int shm_more_checks(struct kern_ipc_perm *ipcp, return 0; } -SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg) +asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) { struct ipc_namespace *ns; struct ipc_ops shm_ops; @@ -621,7 +621,7 @@ static int shmctl_down(struct ipc_namespace *ns, int shmid, int cmd, return err; } -SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) +asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) { struct shmid_kernel *shp; int err, version; @@ -939,7 +939,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) goto out_nattch; } -SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) +asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) { unsigned long ret; long err; @@ -955,7 +955,7 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) * detach and kill segment if marked destroyed. * The work is done in shm_close. */ -SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) +asmlinkage long sys_shmdt(char __user *shmaddr) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma, *next; diff --git a/trunk/kernel/Makefile b/trunk/kernel/Makefile index 170a9213c1b6..2aebc4cd7878 100644 --- a/trunk/kernel/Makefile +++ b/trunk/kernel/Makefile @@ -40,8 +40,9 @@ 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 -obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o -ifneq ($(CONFIG_SMP),y) +ifeq ($(CONFIG_USE_GENERIC_SMP_HELPERS),y) +obj-y += smp.o +else obj-y += up.o endif obj-$(CONFIG_SMP) += spinlock.o diff --git a/trunk/kernel/acct.c b/trunk/kernel/acct.c index 7afa31564162..d57b7cbb98b6 100644 --- a/trunk/kernel/acct.c +++ b/trunk/kernel/acct.c @@ -277,7 +277,7 @@ static int acct_on(char *name) * should be written. If the filename is NULL, accounting will be * shutdown. */ -SYSCALL_DEFINE1(acct, const char __user *, name) +asmlinkage long sys_acct(const char __user *name) { int error; diff --git a/trunk/kernel/capability.c b/trunk/kernel/capability.c index 4e17041963f5..688926e496be 100644 --- a/trunk/kernel/capability.c +++ b/trunk/kernel/capability.c @@ -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. */ -SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) +asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) { int ret = 0; pid_t pid; @@ -235,7 +235,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) * * Returns 0 on success and < 0 on error. */ -SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data) +asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data) { struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; unsigned i, tocopy; diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index a85678865c5e..647c77a88fcb 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -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/cgroups/cpusets.txt + * See "What is sched_load_balance" in Documentation/cpusets.txt * for a background explanation of this. * * Does not return errors, on the theory that the callers of this diff --git a/trunk/kernel/exec_domain.c b/trunk/kernel/exec_domain.c index 667c841c2952..0511716e9424 100644 --- a/trunk/kernel/exec_domain.c +++ b/trunk/kernel/exec_domain.c @@ -209,7 +209,8 @@ static int __init proc_execdomains_init(void) module_init(proc_execdomains_init); #endif -SYSCALL_DEFINE1(personality, u_long, personality) +asmlinkage long +sys_personality(u_long personality) { u_long old = current->personality; diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index f80dec3f1875..c7740fa3252c 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -1141,7 +1141,7 @@ NORET_TYPE void complete_and_exit(struct completion *comp, long code) EXPORT_SYMBOL(complete_and_exit); -SYSCALL_DEFINE1(exit, int, error_code) +asmlinkage long sys_exit(int error_code) { do_exit((error_code&0xff)<<8); } @@ -1182,11 +1182,9 @@ 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. */ -SYSCALL_DEFINE1(exit_group, int, error_code) +asmlinkage void sys_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) @@ -1754,8 +1752,9 @@ static long do_wait(enum pid_type type, struct pid *pid, int options, return retval; } -SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, - infop, int, options, struct rusage __user *, ru) +asmlinkage long sys_waitid(int which, pid_t upid, + struct siginfo __user *infop, int options, + struct rusage __user *ru) { struct pid *pid = NULL; enum pid_type type; @@ -1794,8 +1793,8 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, return ret; } -SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, - int, options, struct rusage __user *, ru) +asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, + int options, struct rusage __user *ru) { struct pid *pid = NULL; enum pid_type type; @@ -1832,7 +1831,7 @@ SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, * sys_waitpid() remains for compatibility. waitpid() should be * implemented by calling sys_wait4() from libc.a. */ -SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options) +asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options) { return sys_wait4(pid, stat_addr, options, NULL); } diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index bf0cef8bbdf2..1d68f1255dd8 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -901,7 +901,7 @@ static void copy_flags(unsigned long clone_flags, struct task_struct *p) clear_freeze_flag(p); } -SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) +asmlinkage long sys_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. */ -SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) +asmlinkage long sys_unshare(unsigned long unshare_flags) { int err = 0; struct fs_struct *fs, *new_fs = NULL; diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index f89d373a9c6d..002aa189eb09 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -1733,8 +1733,9 @@ static int futex_unlock_pi(u32 __user *uaddr, int fshared) * @head: pointer to the list-head * @len: length of the list-head, as userspace expects */ -SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head, - size_t, len) +asmlinkage long +sys_set_robust_list(struct robust_list_head __user *head, + size_t len) { if (!futex_cmpxchg_enabled) return -ENOSYS; @@ -1755,9 +1756,9 @@ SYSCALL_DEFINE2(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 */ -SYSCALL_DEFINE3(get_robust_list, int, pid, - struct robust_list_head __user * __user *, head_ptr, - size_t __user *, len_ptr) +asmlinkage long +sys_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; @@ -1977,9 +1978,9 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, } -SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, - struct timespec __user *, utime, u32 __user *, uaddr2, - u32, val3) +asmlinkage long sys_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; diff --git a/trunk/kernel/hrtimer.c b/trunk/kernel/hrtimer.c index 2dc30c59c5fd..1455b7651b6b 100644 --- a/trunk/kernel/hrtimer.c +++ b/trunk/kernel/hrtimer.c @@ -1467,8 +1467,8 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp, return ret; } -SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, - struct timespec __user *, rmtp) +asmlinkage long +sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) { struct timespec tu; diff --git a/trunk/kernel/itimer.c b/trunk/kernel/itimer.c index 6a5fe93dd8bd..db7c358b9a02 100644 --- a/trunk/kernel/itimer.c +++ b/trunk/kernel/itimer.c @@ -100,7 +100,7 @@ int do_getitimer(int which, struct itimerval *value) return 0; } -SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value) +asmlinkage long sys_getitimer(int which, struct itimerval __user *value) { int error = -EFAULT; struct itimerval get_buffer; @@ -260,8 +260,9 @@ unsigned int alarm_setitimer(unsigned int seconds) return it_old.it_value.tv_sec; } -SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, - struct itimerval __user *, ovalue) +asmlinkage long sys_setitimer(int which, + struct itimerval __user *value, + struct itimerval __user *ovalue) { struct itimerval set_buffer, get_buffer; int error; diff --git a/trunk/kernel/kexec.c b/trunk/kernel/kexec.c index 8a6d7b08864e..3fb855ad6aa0 100644 --- a/trunk/kernel/kexec.c +++ b/trunk/kernel/kexec.c @@ -934,8 +934,9 @@ struct kimage *kexec_crash_image; static DEFINE_MUTEX(kexec_mutex); -SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, - struct kexec_segment __user *, segments, unsigned long, flags) +asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, + struct kexec_segment __user *segments, + unsigned long flags) { struct kimage **dest_image, *image; int result; diff --git a/trunk/kernel/kprobes.c b/trunk/kernel/kprobes.c index 7ba8cd9845cb..1b9cbdc0127a 100644 --- a/trunk/kernel/kprobes.c +++ b/trunk/kernel/kprobes.c @@ -123,7 +123,7 @@ static int collect_garbage_slots(void); static int __kprobes check_safety(void) { int ret = 0; -#if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER) +#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM) ret = freeze_processes(); if (ret == 0) { struct task_struct *p, *q; diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index e8b51d41dd72..c9332c90d5a0 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -743,8 +743,8 @@ static void wait_for_zero_refcount(struct module *mod) mutex_lock(&module_mutex); } -SYSCALL_DEFINE2(delete_module, const char __user *, name_user, - unsigned int, flags) +asmlinkage long +sys_delete_module(const char __user *name_user, unsigned int flags) { struct module *mod; char name[MODULE_NAME_LEN]; @@ -2296,8 +2296,10 @@ static noinline struct module *load_module(void __user *umod, } /* This is where the real work happens */ -SYSCALL_DEFINE3(init_module, void __user *, umod, - unsigned long, len, const char __user *, uargs) +asmlinkage long +sys_init_module(void __user *umod, + unsigned long len, + const char __user *uargs) { struct module *mod; int ret = 0; diff --git a/trunk/kernel/posix-timers.c b/trunk/kernel/posix-timers.c index 052ec4d195c7..887c63787de6 100644 --- a/trunk/kernel/posix-timers.c +++ b/trunk/kernel/posix-timers.c @@ -477,9 +477,10 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) /* Create a POSIX.1b interval timer. */ -SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock, - struct sigevent __user *, timer_event_spec, - timer_t __user *, created_timer_id) +asmlinkage long +sys_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; @@ -660,8 +661,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) } /* Get the time remaining on a POSIX.1b interval timer. */ -SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, - struct itimerspec __user *, setting) +asmlinkage long +sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) { struct k_itimer *timr; struct itimerspec cur_setting; @@ -690,7 +691,8 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, * the call back to do_schedule_next_timer(). So all we need to do is * to pick up the frozen overrun. */ -SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) +asmlinkage long +sys_timer_getoverrun(timer_t timer_id) { struct k_itimer *timr; int overrun; @@ -758,9 +760,10 @@ common_timer_set(struct k_itimer *timr, int flags, } /* Set a POSIX.1b interval timer */ -SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, - const struct itimerspec __user *, new_setting, - struct itimerspec __user *, old_setting) +asmlinkage long +sys_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; @@ -813,7 +816,8 @@ static inline int timer_delete_hook(struct k_itimer *timer) } /* Delete a POSIX.1b interval timer. */ -SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) +asmlinkage long +sys_timer_delete(timer_t timer_id) { struct k_itimer *timer; unsigned long flags; @@ -899,8 +903,8 @@ int do_posix_clock_nonanosleep(const clockid_t clock, int flags, } EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); -SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, - const struct timespec __user *, tp) +asmlinkage long sys_clock_settime(const clockid_t which_clock, + const struct timespec __user *tp) { struct timespec new_tp; @@ -912,8 +916,8 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); } -SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, - struct timespec __user *,tp) +asmlinkage long +sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) { struct timespec kernel_tp; int error; @@ -929,8 +933,8 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, } -SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, - struct timespec __user *, tp) +asmlinkage long +sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp) { struct timespec rtn_tp; int error; @@ -959,9 +963,10 @@ static int common_nsleep(const clockid_t which_clock, int flags, which_clock); } -SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, - const struct timespec __user *, rqtp, - struct timespec __user *, rmtp) +asmlinkage long +sys_clock_nanosleep(const clockid_t which_clock, int flags, + const struct timespec __user *rqtp, + struct timespec __user *rmtp) { struct timespec t; diff --git a/trunk/kernel/power/Makefile b/trunk/kernel/power/Makefile index d7a10167a25b..597823b5b700 100644 --- a/trunk/kernel/power/Makefile +++ b/trunk/kernel/power/Makefile @@ -4,8 +4,7 @@ EXTRA_CFLAGS += -DDEBUG endif obj-y := main.o -obj-$(CONFIG_PM_SLEEP) += console.o -obj-$(CONFIG_FREEZER) += process.o +obj-$(CONFIG_PM_SLEEP) += process.o console.o obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o diff --git a/trunk/kernel/printk.c b/trunk/kernel/printk.c index 69188f226a93..7015733793e8 100644 --- a/trunk/kernel/printk.c +++ b/trunk/kernel/printk.c @@ -382,7 +382,7 @@ int do_syslog(int type, char __user *buf, int len) return error; } -SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) +asmlinkage long sys_syslog(int type, char __user *buf, int len) { return do_syslog(type, buf, len); } @@ -742,6 +742,11 @@ 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) { } diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index c9cf48b21f05..29dc700e198c 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -574,7 +574,7 @@ struct task_struct *ptrace_get_task_struct(pid_t pid) #define arch_ptrace_attach(child) do { } while (0) #endif -SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) +asmlinkage long sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; long ret; diff --git a/trunk/kernel/resource.c b/trunk/kernel/resource.c index fd5d7d574bb9..ca6a1536b205 100644 --- a/trunk/kernel/resource.c +++ b/trunk/kernel/resource.c @@ -620,7 +620,6 @@ 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, diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 52bbf1c842a8..8be2c13b50d0 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -1323,8 +1323,8 @@ static inline void update_load_sub(struct load_weight *lw, unsigned long dec) * slice expiry etc. */ -#define WEIGHT_IDLEPRIO 3 -#define WMULT_IDLEPRIO 1431655765 +#define WEIGHT_IDLEPRIO 2 +#define WMULT_IDLEPRIO (1 << 31) /* * Nice levels are multiplicative, with a gentle 10% change for every @@ -4440,7 +4440,7 @@ void __kprobes sub_preempt_count(int val) /* * Underflow? */ - if (DEBUG_LOCKS_WARN_ON(val > preempt_count())) + if (DEBUG_LOCKS_WARN_ON(val > preempt_count() - (!!kernel_locked()))) return; /* * Is the spinlock portion underflowing? @@ -5126,7 +5126,7 @@ int can_nice(const struct task_struct *p, const int nice) * sys_setpriority is a more generic, but much slower function that * does similar things. */ -SYSCALL_DEFINE1(nice, int, increment) +asmlinkage long sys_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. */ -SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, - struct sched_param __user *, param) +asmlinkage long +sys_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 @@ SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, * @pid: the pid in question. * @param: structure containing the new RT priority. */ -SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) +asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) { return do_sched_setscheduler(pid, -1, param); } @@ -5457,7 +5457,7 @@ SYSCALL_DEFINE2(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. */ -SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) +asmlinkage long sys_sched_getscheduler(pid_t pid) { struct task_struct *p; int retval; @@ -5482,7 +5482,7 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) * @pid: the pid in question. * @param: structure containing the RT priority. */ -SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) +asmlinkage long sys_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 */ -SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, - unsigned long __user *, user_mask_ptr) +asmlinkage long sys_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 @@ long sched_getaffinity(pid_t pid, struct cpumask *mask) * @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 */ -SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, - unsigned long __user *, user_mask_ptr) +asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, + unsigned long __user *user_mask_ptr) { int ret; cpumask_var_t mask; @@ -5678,7 +5678,7 @@ SYSCALL_DEFINE3(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. */ -SYSCALL_DEFINE0(sched_yield) +asmlinkage long sys_sched_yield(void) { 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. */ -SYSCALL_DEFINE1(sched_get_priority_max, int, policy) +asmlinkage long sys_sched_get_priority_max(int policy) { int ret = -EINVAL; @@ -5844,7 +5844,7 @@ SYSCALL_DEFINE1(sched_get_priority_max, int, policy) * this syscall returns the minimum rt_priority that can be used * by a given scheduling class. */ -SYSCALL_DEFINE1(sched_get_priority_min, int, policy) +asmlinkage long sys_sched_get_priority_min(int policy) { int ret = -EINVAL; @@ -5869,8 +5869,8 @@ SYSCALL_DEFINE1(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. */ -SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, - struct timespec __user *, interval) +asmlinkage +long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval) { struct task_struct *p; unsigned int time_slice; @@ -9050,13 +9050,6 @@ static int tg_schedulable(struct task_group *tg, void *data) runtime = d->rt_runtime; } -#ifdef CONFIG_USER_SCHED - if (tg == &root_task_group) { - period = global_rt_period(); - runtime = global_rt_runtime(); - } -#endif - /* * Cannot have more runtime than the period. */ diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index 5cc1c162044f..8e1352c75557 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -283,7 +283,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq) struct sched_entity, run_node); - if (!cfs_rq->curr) + if (vruntime == cfs_rq->min_vruntime) vruntime = se->vruntime; else vruntime = min_vruntime(vruntime, se->vruntime); @@ -429,10 +429,7 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq); for_each_sched_entity(se) { - struct load_weight *load; - - cfs_rq = cfs_rq_of(se); - load = &cfs_rq->load; + struct load_weight *load = &cfs_rq->load; if (unlikely(!se->on_rq)) { struct load_weight lw = cfs_rq->load; @@ -680,13 +677,9 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) unsigned long thresh = sysctl_sched_latency; /* - * Convert the sleeper threshold into virtual time. - * SCHED_IDLE is a special sub-class. We care about - * fairness only relative to other SCHED_IDLE tasks, - * all of which have the same weight. + * convert the sleeper threshold into virtual time */ - if (sched_feat(NORMALIZED_SLEEPER) && - task_of(se)->policy != SCHED_IDLE) + if (sched_feat(NORMALIZED_SLEEPER)) thresh = calc_delta_fair(thresh, se); vruntime -= thresh; @@ -1347,18 +1340,14 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se) static void set_last_buddy(struct sched_entity *se) { - if (likely(task_of(se)->policy != SCHED_IDLE)) { - for_each_sched_entity(se) - cfs_rq_of(se)->last = se; - } + for_each_sched_entity(se) + cfs_rq_of(se)->last = se; } static void set_next_buddy(struct sched_entity *se) { - if (likely(task_of(se)->policy != SCHED_IDLE)) { - for_each_sched_entity(se) - cfs_rq_of(se)->next = se; - } + for_each_sched_entity(se) + cfs_rq_of(se)->next = se; } /* @@ -1404,18 +1393,12 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) return; /* - * Batch and idle tasks do not preempt (their preemption is driven by + * Batch tasks do not preempt (their preemption is driven by * the tick): */ - if (unlikely(p->policy != SCHED_NORMAL)) + if (unlikely(p->policy == SCHED_BATCH)) return; - /* Idle tasks are by definition preempted by everybody. */ - if (unlikely(curr->policy == SCHED_IDLE)) { - resched_task(curr); - return; - } - if (!sched_feat(WAKEUP_PREEMPT)) return; diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index e73759783dc8..3152ac3b62e2 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -1961,7 +1961,7 @@ EXPORT_SYMBOL(unblock_all_signals); * System call entry points. */ -SYSCALL_DEFINE0(restart_syscall) +asmlinkage long sys_restart_syscall(void) { struct restart_block *restart = ¤t_thread_info()->restart_block; return restart->fn(restart); @@ -2014,8 +2014,8 @@ int sigprocmask(int how, sigset_t *set, sigset_t *oldset) return error; } -SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, set, - sigset_t __user *, oset, size_t, sigsetsize) +asmlinkage long +sys_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,7 +2074,8 @@ long do_sigpending(void __user *set, unsigned long sigsetsize) return error; } -SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize) +asmlinkage long +sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize) { return do_sigpending(set, sigsetsize); } @@ -2145,9 +2146,11 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from) #endif -SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, - siginfo_t __user *, uinfo, const struct timespec __user *, uts, - size_t, sigsetsize) +asmlinkage long +sys_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; @@ -2220,7 +2223,8 @@ SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, return ret; } -SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) +asmlinkage long +sys_kill(pid_t pid, int sig) { struct siginfo info; @@ -2279,7 +2283,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. */ -SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig) +asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) { /* This is only valid for single tasks */ if (pid <= 0 || tgid <= 0) @@ -2291,7 +2295,8 @@ SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig) /* * Send a signal to only one task, even if it's a CLONE_THREAD task. */ -SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig) +asmlinkage long +sys_tkill(pid_t pid, int sig) { /* This is only valid for single tasks */ if (pid <= 0) @@ -2300,8 +2305,8 @@ SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig) return do_tkill(0, pid, sig); } -SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig, - siginfo_t __user *, uinfo) +asmlinkage long +sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo) { siginfo_t info; @@ -2429,7 +2434,8 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s #ifdef __ARCH_WANT_SYS_SIGPENDING -SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) +asmlinkage long +sys_sigpending(old_sigset_t __user *set) { return do_sigpending(set, sizeof(*set)); } @@ -2440,8 +2446,8 @@ SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) /* Some platforms have their own version with special arguments others support only sys_rt_sigprocmask. */ -SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, - old_sigset_t __user *, oset) +asmlinkage long +sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset) { int error; old_sigset_t old_set, new_set; @@ -2491,10 +2497,11 @@ SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ #ifdef __ARCH_WANT_SYS_RT_SIGACTION -SYSCALL_DEFINE4(rt_sigaction, int, sig, - const struct sigaction __user *, act, - struct sigaction __user *, oact, - size_t, sigsetsize) +asmlinkage long +sys_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; @@ -2524,13 +2531,15 @@ SYSCALL_DEFINE4(rt_sigaction, int, sig, /* * For backwards compatibility. Functionality superseded by sigprocmask. */ -SYSCALL_DEFINE0(sgetmask) +asmlinkage long +sys_sgetmask(void) { /* SMP safe */ return current->blocked.sig[0]; } -SYSCALL_DEFINE1(ssetmask, int, newmask) +asmlinkage long +sys_ssetmask(int newmask) { int old; @@ -2550,7 +2559,8 @@ SYSCALL_DEFINE1(ssetmask, int, newmask) /* * For backwards compatibility. Functionality superseded by sigaction. */ -SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) +asmlinkage unsigned long +sys_signal(int sig, __sighandler_t handler) { struct k_sigaction new_sa, old_sa; int ret; @@ -2567,7 +2577,8 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) #ifdef __ARCH_WANT_SYS_PAUSE -SYSCALL_DEFINE0(pause) +asmlinkage long +sys_pause(void) { current->state = TASK_INTERRUPTIBLE; schedule(); @@ -2577,7 +2588,7 @@ SYSCALL_DEFINE0(pause) #endif #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND -SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize) +asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) { sigset_t newset; diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index e7dc0e10a485..763c3c17ded3 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -143,7 +143,7 @@ static int set_one_prio(struct task_struct *p, int niceval, int error) return error; } -SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) +asmlinkage long sys_setpriority(int which, int who, int niceval) { struct task_struct *g, *p; struct user_struct *user; @@ -208,7 +208,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) * has been offset by 20 (ie it returns 40..1 instead of -20..19) * to stay compatible. */ -SYSCALL_DEFINE2(getpriority, int, which, int, who) +asmlinkage long sys_getpriority(int which, int who) { struct task_struct *g, *p; struct user_struct *user; @@ -355,8 +355,7 @@ EXPORT_SYMBOL_GPL(kernel_power_off); * * reboot doesn't sync: do that yourself before calling this. */ -SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, - void __user *, arg) +asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg) { char buffer[256]; @@ -479,7 +478,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). */ -SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) +asmlinkage long sys_setregid(gid_t rgid, gid_t egid) { const struct cred *old; struct cred *new; @@ -530,7 +529,7 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) * * SMP: Same implicit races as above. */ -SYSCALL_DEFINE1(setgid, gid_t, gid) +asmlinkage long sys_setgid(gid_t gid) { const struct cred *old; struct cred *new; @@ -598,7 +597,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. */ -SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) +asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) { const struct cred *old; struct cred *new; @@ -662,7 +661,7 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) * will allow a root program to temporarily drop privileges and be able to * regain them by swapping the real and effective uid. */ -SYSCALL_DEFINE1(setuid, uid_t, uid) +asmlinkage long sys_setuid(uid_t uid) { const struct cred *old; struct cred *new; @@ -706,7 +705,7 @@ SYSCALL_DEFINE1(setuid, uid_t, uid) * This function implements a generic ability to update ruid, euid, * and suid. This allows you to implement the 4.4 compatible seteuid(). */ -SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) +asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) { const struct cred *old; struct cred *new; @@ -757,7 +756,7 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) return retval; } -SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid) +asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid) { const struct cred *cred = current_cred(); int retval; @@ -772,7 +771,7 @@ SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __u /* * Same as above, but for rgid, egid, sgid. */ -SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) +asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) { const struct cred *old; struct cred *new; @@ -815,7 +814,7 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) return retval; } -SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid) +asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid) { const struct cred *cred = current_cred(); int retval; @@ -834,7 +833,7 @@ SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __u * whatever uid it wants to). It normally shadows "euid", except when * explicitly set by setfsuid() or for access.. */ -SYSCALL_DEFINE1(setfsuid, uid_t, uid) +asmlinkage long sys_setfsuid(uid_t uid) { const struct cred *old; struct cred *new; @@ -871,7 +870,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid) /* * Samma pÃ¥ svenska.. */ -SYSCALL_DEFINE1(setfsgid, gid_t, gid) +asmlinkage long sys_setfsgid(gid_t gid) { const struct cred *old; struct cred *new; @@ -920,7 +919,7 @@ void do_sys_times(struct tms *tms) tms->tms_cstime = cputime_to_clock_t(cstime); } -SYSCALL_DEFINE1(times, struct tms __user *, tbuf) +asmlinkage long sys_times(struct tms __user * tbuf) { if (tbuf) { struct tms tmp; @@ -945,7 +944,7 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf) * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. * LBT 04.03.94 */ -SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) +asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) { struct task_struct *p; struct task_struct *group_leader = current->group_leader; @@ -1016,7 +1015,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) return err; } -SYSCALL_DEFINE1(getpgid, pid_t, pid) +asmlinkage long sys_getpgid(pid_t pid) { struct task_struct *p; struct pid *grp; @@ -1046,14 +1045,14 @@ SYSCALL_DEFINE1(getpgid, pid_t, pid) #ifdef __ARCH_WANT_SYS_GETPGRP -SYSCALL_DEFINE0(getpgrp) +asmlinkage long sys_getpgrp(void) { return sys_getpgid(0); } #endif -SYSCALL_DEFINE1(getsid, pid_t, pid) +asmlinkage long sys_getsid(pid_t pid) { struct task_struct *p; struct pid *sid; @@ -1081,7 +1080,7 @@ SYSCALL_DEFINE1(getsid, pid_t, pid) return retval; } -SYSCALL_DEFINE0(setsid) +asmlinkage long sys_setsid(void) { struct task_struct *group_leader = current->group_leader; struct pid *sid = task_pid(group_leader); @@ -1312,7 +1311,7 @@ int set_current_groups(struct group_info *group_info) EXPORT_SYMBOL(set_current_groups); -SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist) +asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist) { const struct cred *cred = current_cred(); int i; @@ -1341,7 +1340,7 @@ SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist) * without another task interfering. */ -SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) +asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist) { struct group_info *group_info; int retval; @@ -1395,7 +1394,7 @@ EXPORT_SYMBOL(in_egroup_p); DECLARE_RWSEM(uts_sem); -SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) +asmlinkage long sys_newuname(struct new_utsname __user * name) { int errno = 0; @@ -1406,7 +1405,7 @@ SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) return errno; } -SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) +asmlinkage long sys_sethostname(char __user *name, int len) { int errno; char tmp[__NEW_UTS_LEN]; @@ -1430,7 +1429,7 @@ SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) #ifdef __ARCH_WANT_SYS_GETHOSTNAME -SYSCALL_DEFINE2(gethostname, char __user *, name, int, len) +asmlinkage long sys_gethostname(char __user *name, int len) { int i, errno; struct new_utsname *u; @@ -1455,7 +1454,7 @@ SYSCALL_DEFINE2(gethostname, char __user *, name, int, len) * Only setdomainname; getdomainname can be implemented by calling * uname() */ -SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) +asmlinkage long sys_setdomainname(char __user *name, int len) { int errno; char tmp[__NEW_UTS_LEN]; @@ -1478,7 +1477,7 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) return errno; } -SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) +asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) { if (resource >= RLIM_NLIMITS) return -EINVAL; @@ -1497,8 +1496,7 @@ SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) * Back compatibility for getrlimit. Needed for some apps. */ -SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource, - struct rlimit __user *, rlim) +asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim) { struct rlimit x; if (resource >= RLIM_NLIMITS) @@ -1516,7 +1514,7 @@ SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource, #endif -SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim) +asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim) { struct rlimit new_rlim, *old_rlim; int retval; @@ -1689,7 +1687,7 @@ int getrusage(struct task_struct *p, int who, struct rusage __user *ru) return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; } -SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) +asmlinkage long sys_getrusage(int who, struct rusage __user *ru) { if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && who != RUSAGE_THREAD) @@ -1697,14 +1695,14 @@ SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) return getrusage(current, who, ru); } -SYSCALL_DEFINE1(umask, int, mask) +asmlinkage long sys_umask(int mask) { mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); return mask; } -SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, - unsigned long, arg4, unsigned long, arg5) +asmlinkage long sys_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)]; @@ -1817,8 +1815,8 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, return error; } -SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep, - struct getcpu_cache __user *, unused) +asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep, + struct getcpu_cache __user *unused) { int err = 0; int cpu = raw_smp_processor_id(); diff --git a/trunk/kernel/sys_ni.c b/trunk/kernel/sys_ni.c index 27dad2967387..e14a23281707 100644 --- a/trunk/kernel/sys_ni.c +++ b/trunk/kernel/sys_ni.c @@ -131,7 +131,6 @@ 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); diff --git a/trunk/kernel/sysctl.c b/trunk/kernel/sysctl.c index 368d1638ee78..89d74436318c 100644 --- a/trunk/kernel/sysctl.c +++ b/trunk/kernel/sysctl.c @@ -144,7 +144,6 @@ extern int acct_parm[]; #ifdef CONFIG_IA64 extern int no_unaligned_warning; -extern int unaligned_dump_stack; #endif #ifdef CONFIG_RT_MUTEXES @@ -782,14 +781,6 @@ 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 { @@ -1697,7 +1688,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol return error; } -SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) +asmlinkage long sys_sysctl(struct __sysctl_args __user *args) { struct __sysctl_args tmp; int error; @@ -2998,7 +2989,7 @@ int sysctl_ms_jiffies(struct ctl_table *table, #else /* CONFIG_SYSCTL_SYSCALL */ -SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) +asmlinkage long sys_sysctl(struct __sysctl_args __user *args) { struct __sysctl_args tmp; int error; diff --git a/trunk/kernel/time.c b/trunk/kernel/time.c index 29511943871a..4886e3ce83a4 100644 --- a/trunk/kernel/time.c +++ b/trunk/kernel/time.c @@ -60,7 +60,7 @@ EXPORT_SYMBOL(sys_tz); * why not move it into the appropriate arch directory (for those * architectures that need it). */ -SYSCALL_DEFINE1(time, time_t __user *, tloc) +asmlinkage long sys_time(time_t __user * tloc) { time_t i = get_seconds(); @@ -79,7 +79,7 @@ SYSCALL_DEFINE1(time, time_t __user *, tloc) * architectures that need it). */ -SYSCALL_DEFINE1(stime, time_t __user *, tptr) +asmlinkage long sys_stime(time_t __user *tptr) { struct timespec tv; int err; @@ -99,8 +99,8 @@ SYSCALL_DEFINE1(stime, time_t __user *, tptr) #endif /* __ARCH_WANT_SYS_TIME */ -SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, - struct timezone __user *, tz) +asmlinkage long sys_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; } -SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv, - struct timezone __user *, tz) +asmlinkage long sys_settimeofday(struct timeval __user *tv, + struct timezone __user *tz) { struct timeval user_tv; struct timespec new_ts; @@ -205,7 +205,7 @@ SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv, return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); } -SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) +asmlinkage long sys_adjtimex(struct timex __user *txc_p) { struct timex txc; /* Local copy of parameter */ int ret; diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c index 13dd64fe143d..dee3f641a7a7 100644 --- a/trunk/kernel/timer.c +++ b/trunk/kernel/timer.c @@ -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. */ -SYSCALL_DEFINE1(alarm, unsigned int, seconds) +asmlinkage unsigned long sys_alarm(unsigned int seconds) { return alarm_setitimer(seconds); } @@ -1152,7 +1152,7 @@ SYSCALL_DEFINE1(alarm, unsigned int, seconds) * * This is SMP safe as current->tgid does not change. */ -SYSCALL_DEFINE0(getpid) +asmlinkage long sys_getpid(void) { return task_tgid_vnr(current); } @@ -1163,7 +1163,7 @@ SYSCALL_DEFINE0(getpid) * value of ->real_parent under rcu_read_lock(), see * release_task()->call_rcu(delayed_put_task_struct). */ -SYSCALL_DEFINE0(getppid) +asmlinkage long sys_getppid(void) { int pid; @@ -1174,25 +1174,25 @@ SYSCALL_DEFINE0(getppid) return pid; } -SYSCALL_DEFINE0(getuid) +asmlinkage long sys_getuid(void) { /* Only we change this so SMP safe */ return current_uid(); } -SYSCALL_DEFINE0(geteuid) +asmlinkage long sys_geteuid(void) { /* Only we change this so SMP safe */ return current_euid(); } -SYSCALL_DEFINE0(getgid) +asmlinkage long sys_getgid(void) { /* Only we change this so SMP safe */ return current_gid(); } -SYSCALL_DEFINE0(getegid) +asmlinkage long sys_getegid(void) { /* 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" */ -SYSCALL_DEFINE0(gettid) +asmlinkage long sys_gettid(void) { return task_pid_vnr(current); } @@ -1400,7 +1400,7 @@ int do_sysinfo(struct sysinfo *info) return 0; } -SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info) +asmlinkage long sys_sysinfo(struct sysinfo __user *info) { struct sysinfo val; diff --git a/trunk/kernel/uid16.c b/trunk/kernel/uid16.c index 0314501688b9..2460c3199b5a 100644 --- a/trunk/kernel/uid16.c +++ b/trunk/kernel/uid16.c @@ -17,7 +17,7 @@ #include -SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid return ret; } -SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gi return ret; } -SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) return ret; } -SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) +asmlinkage long sys_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 @@ SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) return ret; } -SYSCALL_DEFINE1(setgid16, old_gid_t, gid) +asmlinkage long sys_setgid16(old_gid_t gid) { long ret = sys_setgid(low2highgid(gid)); /* avoid REGPARM breakage on x86: */ @@ -57,7 +57,7 @@ SYSCALL_DEFINE1(setgid16, old_gid_t, gid) return ret; } -SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) +asmlinkage long sys_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 @@ SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) return ret; } -SYSCALL_DEFINE1(setuid16, old_uid_t, uid) +asmlinkage long sys_setuid16(old_uid_t uid) { long ret = sys_setuid(low2highuid(uid)); /* avoid REGPARM breakage on x86: */ @@ -73,7 +73,7 @@ SYSCALL_DEFINE1(setuid16, old_uid_t, uid) return ret; } -SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) return ret; } -SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, old_uid_t __user *, suid) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, return retval; } -SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) +asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) { long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), low2highgid(sgid)); @@ -103,8 +103,7 @@ SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) return ret; } - -SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid) +asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) { const struct cred *cred = current_cred(); int retval; @@ -116,7 +115,7 @@ SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, return retval; } -SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) +asmlinkage long sys_setfsuid16(old_uid_t uid) { long ret = sys_setfsuid(low2highuid(uid)); /* avoid REGPARM breakage on x86: */ @@ -124,7 +123,7 @@ SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) return ret; } -SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) +asmlinkage long sys_setfsgid16(old_gid_t gid) { long ret = sys_setfsgid(low2highgid(gid)); /* avoid REGPARM breakage on x86: */ @@ -162,7 +161,7 @@ static int groups16_from_user(struct group_info *group_info, return 0; } -SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist) +asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) { const struct cred *cred = current_cred(); int i; @@ -185,7 +184,7 @@ SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist) return i; } -SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist) +asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) { struct group_info *group_info; int retval; @@ -210,22 +209,22 @@ SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist) return retval; } -SYSCALL_DEFINE0(getuid16) +asmlinkage long sys_getuid16(void) { return high2lowuid(current_uid()); } -SYSCALL_DEFINE0(geteuid16) +asmlinkage long sys_geteuid16(void) { return high2lowuid(current_euid()); } -SYSCALL_DEFINE0(getgid16) +asmlinkage long sys_getgid16(void) { return high2lowgid(current_gid()); } -SYSCALL_DEFINE0(getegid16) +asmlinkage long sys_getegid16(void) { return high2lowgid(current_egid()); } diff --git a/trunk/kernel/up.c b/trunk/kernel/up.c index 1ff27a28bb7d..c04b9dcfcebe 100644 --- a/trunk/kernel/up.c +++ b/trunk/kernel/up.c @@ -2,7 +2,6 @@ * Uniprocessor-only support functions. The counterpart to kernel/smp.c */ -#include #include #include #include diff --git a/trunk/lib/idr.c b/trunk/lib/idr.c index c11c5765cdef..1c4f9281f412 100644 --- a/trunk/lib/idr.c +++ b/trunk/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_zalloc(idr_layer_cache, gfp_mask); + new = kmem_cache_alloc(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 @starting_id ... 0x7fffffff + * @id returns a value in the range 0 ... 0x7fffffff */ int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) { @@ -623,10 +623,16 @@ 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, NULL); + sizeof(struct idr_layer), 0, SLAB_PANIC, + idr_cache_ctor); } /** @@ -717,7 +723,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 @starting_id ... 0x7fffffff. + * @p_id returns a value in the range 0 ... 0x7fffffff. */ int ida_get_new_above(struct ida *ida, int starting_id, int *p_id) { diff --git a/trunk/mm/fadvise.c b/trunk/mm/fadvise.c index 54a0f8040afa..a1da969bd980 100644 --- a/trunk/mm/fadvise.c +++ b/trunk/mm/fadvise.c @@ -24,7 +24,7 @@ * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could * deactivate the pages and clear PG_Referenced. */ -SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) +asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) { struct file *file = fget(fd); struct address_space *mapping; @@ -126,26 +126,12 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) 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 -SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice) +asmlinkage long sys_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 diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index 23acefe51808..ceba0bd03662 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -1374,7 +1374,7 @@ do_readahead(struct address_space *mapping, struct file *filp, return 0; } -SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) +asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) { ssize_t ret; struct file *file; @@ -1393,13 +1393,6 @@ SYSCALL_DEFINE(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 /** diff --git a/trunk/mm/fremap.c b/trunk/mm/fremap.c index 736ba7f3306a..62d5bbda921a 100644 --- a/trunk/mm/fremap.c +++ b/trunk/mm/fremap.c @@ -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. */ -SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, - unsigned long, prot, unsigned long, pgoff, unsigned long, flags) +asmlinkage long sys_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; diff --git a/trunk/mm/madvise.c b/trunk/mm/madvise.c index b9ce574827c8..f9349c18a1b5 100644 --- a/trunk/mm/madvise.c +++ b/trunk/mm/madvise.c @@ -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. */ -SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) +asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior) { unsigned long end, tmp; struct vm_area_struct * vma, *prev; diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index 4d0ea3ceba6d..e2996b80601f 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -358,10 +358,6 @@ 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)) @@ -378,10 +374,7 @@ void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru) if (mem_cgroup_disabled()) 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. - */ + /* barrier to sync with "charge" */ smp_rmb(); if (!PageCgroupUsed(pc)) return; @@ -566,14 +559,6 @@ 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; @@ -633,7 +618,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; @@ -644,16 +629,19 @@ __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) { - /* caller handles NULL case */ - curr = NULL; + mem_cgroup_put(curr); + curr = root_mem; + mem_cgroup_get(curr); goto done; } @@ -661,9 +649,11 @@ __mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) * 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; } @@ -674,6 +664,7 @@ __mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) goto visit_parent; done: + root_mem->last_scanned_child = curr; return curr; } @@ -683,46 +674,40 @@ __mem_cgroup_get_next_node(struct mem_cgroup *curr, struct mem_cgroup *root_mem) * that to reclaim free pages from. */ static struct mem_cgroup * -mem_cgroup_get_next_node(struct mem_cgroup *root_mem) +mem_cgroup_get_first_node(struct mem_cgroup *root_mem) { struct cgroup *cgroup; - struct mem_cgroup *orig, *next; + struct mem_cgroup *ret; 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)) { - /* - * 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; + ret = root_mem; goto done; } - if (!orig || obsolete) { + if (!root_mem->last_scanned_child || obsolete) { + + if (obsolete && root_mem->last_scanned_child) + mem_cgroup_put(root_mem->last_scanned_child); + cgroup = list_first_entry(&root_mem->css.cgroup->children, struct cgroup, sibling); - next = mem_cgroup_from_cont(cgroup); + ret = mem_cgroup_from_cont(cgroup); + mem_cgroup_get(ret); } else - next = __mem_cgroup_get_next_node(orig, root_mem); + ret = mem_cgroup_get_next_node(root_mem->last_scanned_child, + root_mem); done: - if (next) - mem_cgroup_get(next); - root_mem->last_scanned_child = next; - if (orig) - mem_cgroup_put(orig); + root_mem->last_scanned_child = ret; mutex_unlock(&mem_cgroup_subsys.hierarchy_mutex); - return (next) ? next : root_mem; + return ret; } static bool mem_cgroup_check_under_limit(struct mem_cgroup *mem) @@ -773,25 +758,28 @@ 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 1; /* indicate reclaim has succeeded */ + return 0; if (!root_mem->use_hierarchy) return ret; - next_mem = mem_cgroup_get_next_node(root_mem); + next_mem = mem_cgroup_get_first_node(root_mem); while (next_mem != root_mem) { if (mem_cgroup_is_obsolete(next_mem)) { - next_mem = mem_cgroup_get_next_node(root_mem); + mem_cgroup_put(next_mem); + next_mem = mem_cgroup_get_first_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 1; /* indicate reclaim has succeeded */ - next_mem = mem_cgroup_get_next_node(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 ret; } @@ -875,8 +863,6 @@ 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 @@ -993,15 +979,14 @@ 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); @@ -1034,10 +1019,8 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc, if (ret || !parent) return ret; - if (!get_page_unless_zero(page)) { - ret = -EBUSY; - goto uncharge; - } + if (!get_page_unless_zero(page)) + return -EBUSY; ret = isolate_lru_page(page); @@ -1046,23 +1029,19 @@ 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; } - -cancel: - put_page(page); -uncharge: - /* drop extra refcnt by try_charge() */ - css_put(&parent->css); /* uncharge if move fails */ +cancel: res_counter_uncharge(&parent->res, PAGE_SIZE); if (do_swap_account) res_counter_uncharge(&parent->memsw, PAGE_SIZE); + put_page(page); return ret; } @@ -1992,7 +1971,6 @@ 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; @@ -2000,22 +1978,15 @@ 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))) { - cgroup_unlock(); + (memcg->use_hierarchy && !list_empty(&cgrp->children))) return -EINVAL; - } spin_lock(&memcg->reclaim_param_lock); memcg->swappiness = val; spin_unlock(&memcg->reclaim_param_lock); - cgroup_unlock(); - return 0; } @@ -2210,7 +2181,7 @@ static void __init enable_swap_cgroup(void) } #endif -static struct cgroup_subsys_state * __ref +static struct cgroup_subsys_state * mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) { struct mem_cgroup *mem, *parent; @@ -2261,14 +2232,7 @@ static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss, static void mem_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *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); + mem_cgroup_put(mem_cgroup_from_cont(cont)); } static int mem_cgroup_populate(struct cgroup_subsys *ss, diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 22bfa7a47a0b..e009ce870859 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -1511,7 +1511,6 @@ 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 @@ -1526,10 +1525,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, &pgprot, pfn, PAGE_SIZE)) + if (track_pfn_vma_new(vma, vma->vm_page_prot, pfn, PAGE_SIZE)) return -EINVAL; - ret = insert_pfn(vma, addr, pfn, pgprot); + ret = insert_pfn(vma, addr, pfn, vma->vm_page_prot); if (ret) untrack_pfn_vma(vma, pfn, PAGE_SIZE); @@ -1672,15 +1671,9 @@ 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) { - /* - * 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); + err = track_pfn_vma_new(vma, prot, pfn, PAGE_ALIGN(size)); + if (err) return -EINVAL; - } BUG_ON(addr >= end); pfn -= addr >> PAGE_SHIFT; @@ -3172,15 +3165,6 @@ 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 diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 3eb4a6fdc043..e412ffa8e52e 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -1068,9 +1068,10 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; } -SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len, - unsigned long, mode, unsigned long __user *, nmask, - unsigned long, maxnode, unsigned, flags) +asmlinkage long sys_mbind(unsigned long start, unsigned long len, + unsigned long mode, + unsigned long __user *nmask, unsigned long maxnode, + unsigned flags) { nodemask_t nodes; int err; @@ -1090,8 +1091,8 @@ SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len, } /* Set the process memory policy */ -SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask, - unsigned long, maxnode) +asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, + unsigned long maxnode) { int err; nodemask_t nodes; @@ -1109,9 +1110,9 @@ SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask, return do_set_mempolicy(mode, flags, &nodes); } -SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, - const unsigned long __user *, old_nodes, - const unsigned long __user *, new_nodes) +asmlinkage long sys_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; @@ -1184,9 +1185,10 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, /* Retrieve NUMA policy */ -SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, - unsigned long __user *, nmask, unsigned long, maxnode, - unsigned long, addr, unsigned long, flags) +asmlinkage long sys_get_mempolicy(int __user *policy, + unsigned long __user *nmask, + unsigned long maxnode, + unsigned long addr, unsigned long flags) { int err; int uninitialized_var(pval); diff --git a/trunk/mm/migrate.c b/trunk/mm/migrate.c index 2bb4e1d63520..a30ea5fcf9f1 100644 --- a/trunk/mm/migrate.c +++ b/trunk/mm/migrate.c @@ -1055,10 +1055,10 @@ static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages, * Move a list of pages in the address space of the currently executing * process. */ -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) +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) { const struct cred *cred = current_cred(), *tcred; struct task_struct *task; diff --git a/trunk/mm/mincore.c b/trunk/mm/mincore.c index 8cb508f84ea4..5178800bc129 100644 --- a/trunk/mm/mincore.c +++ b/trunk/mm/mincore.c @@ -177,8 +177,8 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag * mapped * -EAGAIN - A kernel resource was temporarily unavailable. */ -SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, - unsigned char __user *, vec) +asmlinkage long sys_mincore(unsigned long start, size_t len, + unsigned char __user * vec) { long retval; unsigned long pages; diff --git a/trunk/mm/mlock.c b/trunk/mm/mlock.c index 2904a347e476..e125156c664e 100644 --- a/trunk/mm/mlock.c +++ b/trunk/mm/mlock.c @@ -530,7 +530,7 @@ static int do_mlock(unsigned long start, size_t len, int on) return error; } -SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) +asmlinkage long sys_mlock(unsigned long start, size_t len) { unsigned long locked; unsigned long lock_limit; @@ -558,7 +558,7 @@ SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) return error; } -SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) +asmlinkage long sys_munlock(unsigned long start, size_t len) { int ret; @@ -595,7 +595,7 @@ static int do_mlockall(int flags) return 0; } -SYSCALL_DEFINE1(mlockall, int, flags) +asmlinkage long sys_mlockall(int flags) { unsigned long lock_limit; int ret = -EINVAL; @@ -623,7 +623,7 @@ SYSCALL_DEFINE1(mlockall, int, flags) return ret; } -SYSCALL_DEFINE0(munlockall) +asmlinkage long sys_munlockall(void) { int ret; diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index 8d95902e9a38..749623196cb9 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -245,7 +245,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) return next; } -SYSCALL_DEFINE1(brk, unsigned long, brk) +asmlinkage unsigned long sys_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); -SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) +asmlinkage long sys_munmap(unsigned long addr, size_t len) { int ret; struct mm_struct *mm = current->mm; diff --git a/trunk/mm/mprotect.c b/trunk/mm/mprotect.c index abe2694e13f4..d0f6e7ce09f1 100644 --- a/trunk/mm/mprotect.c +++ b/trunk/mm/mprotect.c @@ -217,8 +217,8 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev, return error; } -SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, - unsigned long, prot) +asmlinkage long +sys_mprotect(unsigned long start, size_t len, unsigned long prot) { unsigned long vm_flags, nstart, end, tmp, reqprot; struct vm_area_struct *vma, *prev; diff --git a/trunk/mm/mremap.c b/trunk/mm/mremap.c index a39b7b91be46..646de959aa58 100644 --- a/trunk/mm/mremap.c +++ b/trunk/mm/mremap.c @@ -420,9 +420,9 @@ unsigned long do_mremap(unsigned long addr, return ret; } -SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, - unsigned long, new_len, unsigned long, flags, - unsigned long, new_addr) +asmlinkage unsigned long sys_mremap(unsigned long addr, + unsigned long old_len, unsigned long new_len, + unsigned long flags, unsigned long new_addr) { unsigned long ret; diff --git a/trunk/mm/msync.c b/trunk/mm/msync.c index 4083209b7f02..07dae08cf31c 100644 --- a/trunk/mm/msync.c +++ b/trunk/mm/msync.c @@ -28,7 +28,7 @@ * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to * applications. */ -SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) +asmlinkage long sys_msync(unsigned long start, size_t len, int flags) { unsigned long end; struct mm_struct *mm = current->mm; diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index 8cee8c8ff0f2..60ed8375c986 100644 --- a/trunk/mm/nommu.c +++ b/trunk/mm/nommu.c @@ -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. */ -SYSCALL_DEFINE1(brk, unsigned long, brk) +asmlinkage unsigned long sys_brk(unsigned long brk) { struct mm_struct *mm = current->mm; @@ -1573,7 +1573,7 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) } EXPORT_SYMBOL(do_munmap); -SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) +asmlinkage long sys_munmap(unsigned long addr, size_t len) { int ret; struct mm_struct *mm = current->mm; @@ -1657,9 +1657,10 @@ unsigned long do_mremap(unsigned long addr, } EXPORT_SYMBOL(do_mremap); -SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, - unsigned long, new_len, unsigned long, flags, - unsigned long, new_addr) +asmlinkage +unsigned long sys_mremap(unsigned long addr, + unsigned long old_len, unsigned long new_len, + unsigned long flags, unsigned long new_addr) { unsigned long ret; diff --git a/trunk/mm/swapfile.c b/trunk/mm/swapfile.c index f48b831e5e5c..da422c47e2ee 100644 --- a/trunk/mm/swapfile.c +++ b/trunk/mm/swapfile.c @@ -1377,7 +1377,7 @@ static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span) return ret; } -SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) +asmlinkage long sys_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 */ -SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) +asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) { struct swap_info_struct * p; char *name = NULL; diff --git a/trunk/mm/vmalloc.c b/trunk/mm/vmalloc.c index 75f49d312e8c..c5db9a7264d9 100644 --- a/trunk/mm/vmalloc.c +++ b/trunk/mm/vmalloc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include @@ -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_SPINLOCK(purge_lock); + static DEFINE_MUTEX(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 (!spin_trylock(&purge_lock)) + if (!mutex_trylock(&purge_lock)) return; } else - spin_lock(&purge_lock); + mutex_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); } - spin_unlock(&purge_lock); + mutex_unlock(&purge_lock); } /* @@ -984,8 +984,6 @@ 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) { @@ -998,14 +996,6 @@ 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; } diff --git a/trunk/net/9p/Kconfig b/trunk/net/9p/Kconfig index 7ed75c7bd5d1..0663f99e977a 100644 --- a/trunk/net/9p/Kconfig +++ b/trunk/net/9p/Kconfig @@ -23,7 +23,7 @@ config NET_9P_VIRTIO guest partitions and a host partition. config NET_9P_RDMA - depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL + depends on INET && INFINIBAND && EXPERIMENTAL tristate "9P RDMA Transport (Experimental)" help This builds support for an RDMA transport. diff --git a/trunk/net/bridge/br_netfilter.c b/trunk/net/bridge/br_netfilter.c index cf754ace0b75..a65e43a17fbb 100644 --- a/trunk/net/bridge/br_netfilter.c +++ b/trunk/net/bridge/br_netfilter.c @@ -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 = 0; -static int brnf_filter_pppoe_tagged __read_mostly = 0; +static int brnf_filter_vlan_tagged __read_mostly = 1; +static int brnf_filter_pppoe_tagged __read_mostly = 1; #else -#define brnf_filter_vlan_tagged 0 -#define brnf_filter_pppoe_tagged 0 +#define brnf_filter_vlan_tagged 1 +#define brnf_filter_pppoe_tagged 1 #endif static inline __be16 vlan_proto(const struct sk_buff *skb) @@ -686,11 +686,8 @@ 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 if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || - IS_PPPOE_IPV6(skb)) - pf = PF_INET6; else - return NF_ACCEPT; + pf = PF_INET6; nf_bridge_pull_encap_header(skb); @@ -831,11 +828,8 @@ 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 if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) || - IS_PPPOE_IPV6(skb)) - pf = PF_INET6; else - return NF_ACCEPT; + pf = PF_INET6; #ifdef CONFIG_NETFILTER_DEBUG if (skb->dst == NULL) { diff --git a/trunk/net/bridge/netfilter/ebtables.c b/trunk/net/bridge/netfilter/ebtables.c index 820252aee81f..8a8743d7d6e7 100644 --- a/trunk/net/bridge/netfilter/ebtables.c +++ b/trunk/net/bridge/netfilter/ebtables.c @@ -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) ? EBT_MATCH : EBT_NOMATCH; + return m->u.match->match(skb, par); } static inline int ebt_dev_check(char *entry, const struct net_device *device) diff --git a/trunk/net/can/bcm.c b/trunk/net/can/bcm.c index b7c7d4651136..1649c8ab2c2f 100644 --- a/trunk/net/can/bcm.c +++ b/trunk/net/can/bcm.c @@ -347,54 +347,51 @@ 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)) { - - /* 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->count && (op->flags & TX_COUNTEVT)) + tasklet_schedule(&op->tsklet); } if (op->kt_ival1.tv64 && (op->count > 0)) { /* send (next) frame */ bcm_can_tx(op); - hrtimer_start(&op->timer, - ktime_add(ktime_get(), op->kt_ival1), - HRTIMER_MODE_ABS); + hrtimer_forward(hrtimer, ktime_get(), op->kt_ival1); + ret = HRTIMER_RESTART; } else { if (op->kt_ival2.tv64) { /* send (next) frame */ bcm_can_tx(op); - hrtimer_start(&op->timer, - ktime_add(ktime_get(), op->kt_ival2), - HRTIMER_MODE_ABS); + hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); + ret = HRTIMER_RESTART; } } -} -/* - * 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; + return ret; } /* diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 8d675975d85b..b715a55cccc4 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -2392,9 +2392,6 @@ 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; @@ -2491,6 +2488,12 @@ 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)); @@ -4430,45 +4433,6 @@ int register_netdevice(struct net_device *dev) 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 diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c index 65eac7739033..5110b359c758 100644 --- a/trunk/net/core/skbuff.c +++ b/trunk/net/core/skbuff.c @@ -2602,12 +2602,6 @@ 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; } diff --git a/trunk/net/ipv4/netfilter/iptable_filter.c b/trunk/net/ipv4/netfilter/iptable_filter.c index 52cb6939d093..c9224310ebae 100644 --- a/trunk/net/ipv4/netfilter/iptable_filter.c +++ b/trunk/net/ipv4/netfilter/iptable_filter.c @@ -93,8 +93,13 @@ 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)) + ip_hdrlen(skb) < sizeof(struct iphdr)) { + if (net_ratelimit()) + printk("iptable_filter: ignoring short SOCK_RAW " + "packet.\n"); return NF_ACCEPT; + } + return ipt_do_table(skb, hook, in, out, dev_net(out)->ipv4.iptable_filter); } diff --git a/trunk/net/ipv4/netfilter/iptable_mangle.c b/trunk/net/ipv4/netfilter/iptable_mangle.c index 3929d20b9e45..69f2c4287146 100644 --- a/trunk/net/ipv4/netfilter/iptable_mangle.c +++ b/trunk/net/ipv4/netfilter/iptable_mangle.c @@ -132,8 +132,12 @@ ipt_local_hook(unsigned int hook, /* root is playing with raw sockets. */ if (skb->len < sizeof(struct iphdr) - || ip_hdrlen(skb) < sizeof(struct iphdr)) + || ip_hdrlen(skb) < sizeof(struct iphdr)) { + if (net_ratelimit()) + printk("iptable_mangle: ignoring short SOCK_RAW " + "packet.\n"); return NF_ACCEPT; + } /* Save things which could affect route */ mark = skb->mark; diff --git a/trunk/net/ipv4/netfilter/iptable_raw.c b/trunk/net/ipv4/netfilter/iptable_raw.c index 7f65d18333e3..8faebfe638f1 100644 --- a/trunk/net/ipv4/netfilter/iptable_raw.c +++ b/trunk/net/ipv4/netfilter/iptable_raw.c @@ -65,8 +65,12 @@ ipt_local_hook(unsigned int hook, { /* root is playing with raw sockets. */ if (skb->len < sizeof(struct iphdr) || - ip_hdrlen(skb) < sizeof(struct iphdr)) + ip_hdrlen(skb) < sizeof(struct iphdr)) { + if (net_ratelimit()) + printk("iptable_raw: ignoring short SOCK_RAW " + "packet.\n"); return NF_ACCEPT; + } return ipt_do_table(skb, hook, in, out, dev_net(out)->ipv4.iptable_raw); } diff --git a/trunk/net/ipv4/netfilter/iptable_security.c b/trunk/net/ipv4/netfilter/iptable_security.c index a52a35f4a584..36f3be3cc428 100644 --- a/trunk/net/ipv4/netfilter/iptable_security.c +++ b/trunk/net/ipv4/netfilter/iptable_security.c @@ -96,8 +96,12 @@ 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)) + || ip_hdrlen(skb) < sizeof(struct iphdr)) { + if (net_ratelimit()) + printk(KERN_INFO "iptable_security: ignoring short " + "SOCK_RAW packet.\n"); return NF_ACCEPT; + } return ipt_do_table(skb, hook, in, out, dev_net(out)->ipv4.iptable_security); } diff --git a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index 4beb04fac588..b2141e11575e 100644 --- a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c @@ -145,8 +145,11 @@ 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)) + ip_hdrlen(skb) < sizeof(struct iphdr)) { + if (net_ratelimit()) + printk("ipt_hook: happy cracking.\n"); return NF_ACCEPT; + } return nf_conntrack_in(dev_net(out), PF_INET, hooknum, skb); } diff --git a/trunk/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/trunk/net/ipv4/netfilter/nf_conntrack_proto_icmp.c index 2a8bee26f43d..1fd3ef7718b6 100644 --- a/trunk/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +++ b/trunk/net/ipv4/netfilter/nf_conntrack_proto_icmp.c @@ -20,7 +20,7 @@ #include #include -static unsigned int nf_ct_icmp_timeout __read_mostly = 30*HZ; +static unsigned long 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) diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 0cd71b84e483..ce572f9dff02 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -522,12 +522,8 @@ 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; - ret = skb_splice_bits(skb, offset, tss->pipe, rd_desc->count, tss->flags); - if (ret > 0) - rd_desc->count -= ret; - return ret; + return skb_splice_bits(skb, offset, tss->pipe, tss->len, tss->flags); } static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss) @@ -535,7 +531,6 @@ 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); @@ -616,13 +611,11 @@ 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) || + (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo || signal_pending(current)) break; } @@ -2389,7 +2382,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) unsigned int seq; __be32 delta; unsigned int oldlen; - unsigned int mss; + unsigned int len; if (!pskb_may_pull(skb, sizeof(*th))) goto out; @@ -2405,13 +2398,10 @@ 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 | @@ -2422,6 +2412,7 @@ 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; @@ -2432,7 +2423,8 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) if (IS_ERR(segs)) goto out; - delta = htonl(oldlen + (thlen + mss)); + len = skb_shinfo(skb)->gso_size; + delta = htonl(oldlen + (thlen + len)); skb = segs; th = tcp_hdr(skb); @@ -2448,7 +2440,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 += mss; + seq += len; skb = skb->next; th = tcp_hdr(skb); diff --git a/trunk/net/ipv6/ip6_fib.c b/trunk/net/ipv6/ip6_fib.c index 52ee1dced2ff..29c7c99e69f7 100644 --- a/trunk/net/ipv6/ip6_fib.c +++ b/trunk/net/ipv6/ip6_fib.c @@ -298,10 +298,6 @@ 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); } @@ -334,12 +330,15 @@ 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) { - fib6_walker_unlink(w); - cb->args[4] = 0; + if (res != 0) { + if (res < 0) + fib6_walker_unlink(w); + goto end; } + fib6_walker_unlink(w); + cb->args[4] = 0; } - +end: return res; } diff --git a/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index c455cf4ee756..bd52151d31e9 100644 --- a/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/trunk/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c @@ -26,7 +26,7 @@ #include #include -static unsigned int nf_ct_icmpv6_timeout __read_mostly = 30*HZ; +static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ; static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, diff --git a/trunk/net/mac80211/ht.c b/trunk/net/mac80211/ht.c index c5c0c5271096..5f510a13b9f0 100644 --- a/trunk/net/mac80211/ht.c +++ b/trunk/net/mac80211/ht.c @@ -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 = 0; + int ret; if ((tid >= STA_TID_NUM) || !(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION)) return -EINVAL; diff --git a/trunk/net/mac80211/iface.c b/trunk/net/mac80211/iface.c index b9074824862a..5abbc3f07dd6 100644 --- a/trunk/net/mac80211/iface.c +++ b/trunk/net/mac80211/iface.c @@ -699,8 +699,7 @@ 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 && - type == NL80211_IFTYPE_ADHOC) + if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) return -EOPNOTSUPP; /* diff --git a/trunk/net/mac80211/mesh_plink.c b/trunk/net/mac80211/mesh_plink.c index 1159bdb4119c..929ba542fd72 100644 --- a/trunk/net/mac80211/mesh_plink.c +++ b/trunk/net/mac80211/mesh_plink.c @@ -107,7 +107,6 @@ 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; } diff --git a/trunk/net/mac80211/rc80211_minstrel.c b/trunk/net/mac80211/rc80211_minstrel.c index 3824990d340b..2b3b490a6073 100644 --- a/trunk/net/mac80211/rc80211_minstrel.c +++ b/trunk/net/mac80211/rc80211_minstrel.c @@ -395,15 +395,13 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, { struct minstrel_sta_info *mi = priv_sta; struct minstrel_priv *mp = priv; - struct ieee80211_local *local = hw_to_local(mp->hw); - struct ieee80211_rate *ctl_rate; + struct minstrel_rate *mr_ctl; unsigned int i, n = 0; unsigned int t_slot = 9; /* FIXME: get real slot time */ mi->lowest_rix = rate_lowest_index(sband, sta); - 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); + mr_ctl = &mi->r[rix_to_ndx(mi, mi->lowest_rix)]; + mi->sp_ack_dur = mr_ctl->ack_time; for (i = 0; i < sband->n_bitrates; i++) { struct minstrel_rate *mr = &mi->r[n]; @@ -418,7 +416,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, local, mr, + calc_rate_durations(mi, hw_to_local(mp->hw), mr, &sband->bitrates[i]); /* calculate maximum number of retransmissions before diff --git a/trunk/net/netfilter/nf_conntrack_core.c b/trunk/net/netfilter/nf_conntrack_core.c index 90ce9ddb9451..7e83f74cd5de 100644 --- a/trunk/net/netfilter/nf_conntrack_core.c +++ b/trunk/net/netfilter/nf_conntrack_core.c @@ -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; + struct nf_conn *ct = NULL; 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 (IS_ERR(ct)) { + if (ct == NULL || IS_ERR(ct)) { pr_debug("Can't allocate conntrack.\n"); return (struct nf_conntrack_tuple_hash *)ct; } diff --git a/trunk/net/netfilter/nf_conntrack_netlink.c b/trunk/net/netfilter/nf_conntrack_netlink.c index 3dddec6d2f7e..00e8c27130ff 100644 --- a/trunk/net/netfilter/nf_conntrack_netlink.c +++ b/trunk/net/netfilter/nf_conntrack_netlink.c @@ -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 (IS_ERR(ct)) + if (ct == NULL || IS_ERR(ct)) return -ENOMEM; if (!cda[CTA_TIMEOUT]) diff --git a/trunk/net/netfilter/x_tables.c b/trunk/net/netfilter/x_tables.c index bfbf521f6ea5..89837a4eef76 100644 --- a/trunk/net/netfilter/x_tables.c +++ b/trunk/net/netfilter/x_tables.c @@ -273,10 +273,6 @@ 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; } @@ -293,10 +289,6 @@ 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; } diff --git a/trunk/net/netfilter/xt_time.c b/trunk/net/netfilter/xt_time.c index 93acaa59d108..29375ba8db73 100644 --- a/trunk/net/netfilter/xt_time.c +++ b/trunk/net/netfilter/xt_time.c @@ -243,17 +243,6 @@ 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); } diff --git a/trunk/net/sched/sch_htb.c b/trunk/net/sched/sch_htb.c index 2f0f0b04d3fb..5070643ce534 100644 --- a/trunk/net/sched/sch_htb.c +++ b/trunk/net/sched/sch_htb.c @@ -661,13 +661,12 @@ 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, - unsigned long start) +static psched_time_t htb_do_events(struct htb_sched *q, int level) { /* 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 = start + 2; + unsigned long stop_at = jiffies + 2; while (time_before(jiffies, stop_at)) { struct htb_class *cl; long diff; @@ -686,8 +685,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 (including above) */ - return q->now + 2 * PSCHED_TICKS_PER_SEC / HZ; + /* too much load - let's continue on next jiffie */ + return q->now + PSCHED_TICKS_PER_SEC / HZ; } /* Returns class->node+prio from id-tree where classe's id is >= id. NULL @@ -846,7 +845,6 @@ 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); @@ -859,7 +857,6 @@ 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; @@ -869,14 +866,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, start_at); + event = htb_do_events(q, level); if (!event) event = q->now + PSCHED_TICKS_PER_SEC; q->near_ev_cache[level] = event; } else event = q->near_ev_cache[level]; - if (next_event > event) + if (event && next_event > event) next_event = event; m = ~q->row_mask[level]; diff --git a/trunk/net/socket.c b/trunk/net/socket.c index 35dd7371752a..06603d73c411 100644 --- a/trunk/net/socket.c +++ b/trunk/net/socket.c @@ -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); } -SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) +asmlinkage long sys_socket(int family, int type, int protocol) { int retval; struct socket *sock; @@ -1255,8 +1255,8 @@ SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) * Create a pair of connected sockets. */ -SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, - int __user *, usockvec) +asmlinkage long sys_socketpair(int family, int type, int protocol, + int __user *usockvec) { struct socket *sock1, *sock2; int fd1, fd2, err; @@ -1356,7 +1356,7 @@ SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, * the protocol layer (having also checked the address is ok). */ -SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) +asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) { struct socket *sock; struct sockaddr_storage address; @@ -1385,7 +1385,7 @@ SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) * ready for listening. */ -SYSCALL_DEFINE2(listen, int, fd, int, backlog) +asmlinkage long sys_listen(int fd, int backlog) { struct socket *sock; int err, fput_needed; @@ -1418,8 +1418,8 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog) * clean when we restucture accept also. */ -SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, - int __user *, upeer_addrlen, int, flags) +asmlinkage long sys_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 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, goto out_put; } -SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, - int __user *, upeer_addrlen) +asmlinkage long sys_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 @@ SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, * include the -EINPROGRESS status for such sockets. */ -SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, - int, addrlen) +asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr, + int addrlen) { struct socket *sock; struct sockaddr_storage address; @@ -1552,8 +1552,8 @@ SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, * name to user space. */ -SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, - int __user *, usockaddr_len) +asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr, + int __user *usockaddr_len) { struct socket *sock; struct sockaddr_storage address; @@ -1583,8 +1583,8 @@ SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, * name to user space. */ -SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, - int __user *, usockaddr_len) +asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, + int __user *usockaddr_len) { struct socket *sock; struct sockaddr_storage address; @@ -1615,9 +1615,9 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, * the protocol. */ -SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, - unsigned, flags, struct sockaddr __user *, addr, - int, addr_len) +asmlinkage long sys_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,8 +1660,7 @@ SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, * Send a datagram down a socket. */ -SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, - unsigned, flags) +asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) { return sys_sendto(fd, buff, len, flags, NULL, 0); } @@ -1672,9 +1671,9 @@ SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, * sender address from kernel to user space. */ -SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, - unsigned, flags, struct sockaddr __user *, addr, - int __user *, addr_len) +asmlinkage long sys_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; @@ -1726,8 +1725,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. */ -SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, - char __user *, optval, int, optlen) +asmlinkage long sys_setsockopt(int fd, int level, int optname, + char __user *optval, int optlen) { int err, fput_needed; struct socket *sock; @@ -1760,8 +1759,8 @@ SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, * to pass a user mode parameter for the protocols to sort out. */ -SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, - char __user *, optval, int __user *, optlen) +asmlinkage long sys_getsockopt(int fd, int level, int optname, + char __user *optval, int __user *optlen) { int err, fput_needed; struct socket *sock; @@ -1790,7 +1789,7 @@ SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, * Shutdown a socket. */ -SYSCALL_DEFINE2(shutdown, int, fd, int, how) +asmlinkage long sys_shutdown(int fd, int how) { int err, fput_needed; struct socket *sock; @@ -1816,7 +1815,7 @@ SYSCALL_DEFINE2(shutdown, int, fd, int, how) * BSD sendmsg interface */ -SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) +asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) { struct compat_msghdr __user *msg_compat = (struct compat_msghdr __user *)msg; @@ -1922,8 +1921,8 @@ SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) * BSD recvmsg interface */ -SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, - unsigned int, flags) +asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, + unsigned int flags) { struct compat_msghdr __user *msg_compat = (struct compat_msghdr __user *)msg; @@ -2046,7 +2045,7 @@ static const unsigned char nargs[19]={ * it is set by the callees. */ -SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) +asmlinkage long sys_socketcall(int call, unsigned long __user *args) { unsigned long a[6]; unsigned long a0, a1; diff --git a/trunk/net/xfrm/xfrm_user.c b/trunk/net/xfrm/xfrm_user.c index 7877e7975dae..b95a2d64eb59 100644 --- a/trunk/net/xfrm/xfrm_user.c +++ b/trunk/net/xfrm/xfrm_user.c @@ -1914,17 +1914,10 @@ 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] = 220, /* see above */ + [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), [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), @@ -1934,7 +1927,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] = 220, /* see above */ + [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info), [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, diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 45eb0ae98eba..7bed4ed2c519 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -10,7 +10,7 @@ my $P = $0; $P =~ s@.*/@@g; -my $V = '0.27'; +my $V = '0.26'; use Getopt::Long qw(:config no_auto_abbrev); @@ -411,15 +411,13 @@ sub ctx_statement_block { my $type = ''; my $level = 0; - my @stack = (); + my @stack = ([$type, $level]); 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. @@ -1665,7 +1663,7 @@ sub process { # Should not end with a space. $to =~ s/\s+$//; # '*'s should not have spaces between. - while ($to =~ s/\*\s+\*/\*\*/) { + while ($to =~ s/(.)\s\*/$1\*/) { } #print "from<$from> to<$to>\n"; @@ -1680,7 +1678,7 @@ sub process { # Should not end with a space. $to =~ s/\s+$//; # '*'s should not have spaces between. - while ($to =~ s/\*\s+\*/\*\*/) { + while ($to =~ s/(.)\s\*/$1\*/) { } # Modifiers should have spaces. $to =~ s/(\b$Modifier$)/$1 /; @@ -2016,11 +2014,7 @@ sub process { # Flatten any parentheses $value =~ s/\)\(/\) \(/g; - while ($value =~ s/\[[^\{\}]*\]/1/ || - $value !~ /(?:$Ident|-?$Constant)\s* - $Compare\s* - (?:$Ident|-?$Constant)/x && - $value =~ s/\([^\(\)]*\)/1/) { + while ($value !~ /(?:$Ident|-?$Constant)\s*$Compare\s*(?:$Ident|-?$Constant)/ && $value =~ s/\([^\(\)]*\)/1/) { } if ($value =~ /^(?:$Ident|-?$Constant)$/) { @@ -2108,11 +2102,6 @@ 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(?: @@ -2527,10 +2516,9 @@ sub process { WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); } # check for struct file_operations, ensure they are const. - if ($line !~ /\bconst\b/ && - $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) { - WARN("struct $1 should normally be const\n" . - $herecurr); + if ($line =~ /\bstruct\s+file_operations\b/ && + $line !~ /\bconst\b/) { + WARN("struct file_operations should normally be const\n" . $herecurr); } # use of NR_CPUS is usually wrong diff --git a/trunk/security/keys/keyctl.c b/trunk/security/keys/keyctl.c index e9335e1c6cf5..09796797d122 100644 --- a/trunk/security/keys/keyctl.c +++ b/trunk/security/keys/keyctl.c @@ -54,11 +54,11 @@ static int key_get_type_from_user(char *type, * - returns the new key's serial number * - implements add_key() */ -SYSCALL_DEFINE5(add_key, const char __user *, _type, - const char __user *, _description, - const void __user *, _payload, - size_t, plen, - key_serial_t, ringid) +asmlinkage long sys_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 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type, * - if the _callout_info string is empty, it will be rendered as "-" * - implements request_key() */ -SYSCALL_DEFINE4(request_key, const char __user *, _type, - const char __user *, _description, - const char __user *, _callout_info, - key_serial_t, destringid) +asmlinkage long sys_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 */ -SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, - unsigned long, arg4, unsigned long, arg5) +asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5) { switch (option) { case KEYCTL_GET_KEYRING_ID: diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index c39deebb588f..faef1ca86600 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -885,8 +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 }, + /* mute the master volume */ + { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE }, {} }; @@ -1138,6 +1138,8 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = { }; static struct snd_kcontrol_new stac925x_mixer[] = { + HDA_CODEC_VOLUME("Master Playback Volume", 0x0e, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Master Playback Switch", 0x0e, 0, HDA_OUTPUT), STAC_INPUT_SOURCE(1), HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT), @@ -3573,13 +3575,12 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out err = stac92xx_auto_fill_dac_nids(codec); if (err < 0) return err; + err = stac92xx_auto_create_multi_out_ctls(codec, + &spec->autocfg); + if (err < 0) + return err; } - err = stac92xx_auto_create_multi_out_ctls(codec, &spec->autocfg); - - if (err < 0) - return err; - /* setup analog beep controls */ if (spec->anabeep_nid > 0) { err = stac92xx_auto_create_beep_ctls(codec, diff --git a/trunk/sound/pci/oxygen/virtuoso.c b/trunk/sound/pci/oxygen/virtuoso.c index e9e829e83d7a..98c6a8c65d81 100644 --- a/trunk/sound/pci/oxygen/virtuoso.c +++ b/trunk/sound/pci/oxygen/virtuoso.c @@ -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) and EEPROM self-destruct (do not use!) + * SPI 4 -> 4th PCM1796 (back) * * GPIO 2 -> M0 of CS5381 * GPIO 3 -> M1 of CS5381 @@ -207,12 +207,6 @@ 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 @@ -223,7 +217,6 @@ 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, @@ -757,9 +750,6 @@ 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; @@ -850,8 +840,9 @@ 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, - .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S, + .function_flags = OXYGEN_FUNCTION_SPI | + OXYGEN_FUNCTION_ENABLE_SPI_4_5, + .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST, .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST, }; diff --git a/trunk/sound/ppc/snd_ps3.c b/trunk/sound/ppc/snd_ps3.c index ff321110ec02..8f9e3859c37c 100644 --- a/trunk/sound/ppc/snd_ps3.c +++ b/trunk/sound/ppc/snd_ps3.c @@ -477,7 +477,7 @@ static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream) card->dma_start_bus_addr[SND_PS3_CH_R] = runtime->dma_addr + (runtime->dma_bytes / 2); - pr_debug("%s: vaddr=%p bus=%#llx\n", __func__, + pr_debug("%s: vaddr=%p bus=%#lx\n", __func__, card->dma_start_vaddr[SND_PS3_CH_L], card->dma_start_bus_addr[SND_PS3_CH_L]); @@ -1030,7 +1030,7 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev) pr_info("%s: nullbuffer alloc failed\n", __func__); goto clean_preallocate; } - pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, + pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__, the_card.null_buffer_start_vaddr, the_card.null_buffer_start_dma_addr); /* set default sample rate/word width */ diff --git a/trunk/sound/soc/atmel/atmel-pcm.c b/trunk/sound/soc/atmel/atmel-pcm.c index 3dcdc4e3cfa0..1fac5efd285b 100644 --- a/trunk/sound/soc/atmel/atmel-pcm.c +++ b/trunk/sound/soc/atmel/atmel-pcm.c @@ -44,6 +44,8 @@ #include #include +#include + #include "atmel-pcm.h" diff --git a/trunk/sound/soc/soc-dapm.c b/trunk/sound/soc/soc-dapm.c index a2f1da8b4646..493a4e8aa273 100644 --- a/trunk/sound/soc/soc-dapm.c +++ b/trunk/sound/soc/soc-dapm.c @@ -720,8 +720,7 @@ 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 && - widget->id != snd_soc_dapm_value_mux) + if (widget->id != snd_soc_dapm_mux) return -ENODEV; if (!snd_soc_test_bits(widget->codec, e->reg, mask, val)) diff --git a/trunk/sound/usb/usbquirks.h b/trunk/sound/usb/usbquirks.h index 5d8ef09b9dcc..92115755d98e 100644 --- a/trunk/sound/usb/usbquirks.h +++ b/trunk/sound/usb/usbquirks.h @@ -128,14 +128,6 @@ .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