]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Pull c2 into release branch
authorLen Brown <len.brown@intel.com>
Tue, 20 Mar 2007 15:06:37 +0000 (11:06 -0400)
committerLen Brown <len.brown@intel.com>
Tue, 20 Mar 2007 15:06:37 +0000 (11:06 -0400)
213 files changed:
Documentation/gpio.txt
Documentation/kernel-parameters.txt
Documentation/sound/alsa/ALSA-Configuration.txt
MAINTAINERS
arch/arm/kernel/setup.c
arch/arm/mach-at91/gpio.c
arch/arm/mach-sa1100/generic.c
arch/avr32/mach-at32ap/pio.c
arch/i386/defconfig
arch/i386/kernel/apic.c
arch/i386/kernel/i386_ksyms.c
arch/i386/kernel/tsc.c
arch/i386/kernel/vmi.c
arch/ia64/Kconfig
arch/ia64/sn/kernel/io_init.c
arch/mips/Kconfig
arch/mips/ddb5xxx/ddb5477/irq.c
arch/mips/emma2rh/markeins/irq.c
arch/mips/gt64120/ev64120/irq.c
arch/mips/gt64120/wrppmc/irq.c
arch/mips/jazz/irq.c
arch/mips/kernel/genex.S
arch/mips/kernel/kspd.c
arch/mips/kernel/linux32.c
arch/mips/kernel/r2300_switch.S
arch/mips/kernel/r4k_fpu.S
arch/mips/kernel/r4k_switch.S
arch/mips/kernel/rtlx.c
arch/mips/kernel/signal-common.h
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c
arch/mips/kernel/signal_n32.c
arch/mips/kernel/traps.c
arch/mips/math-emu/kernel_linkage.c
arch/mips/mips-boards/generic/init.c
arch/mips/momentum/ocelot_c/irq.c
arch/mips/philips/pnx8550/common/int.c
arch/mips/qemu/q-smp.c
arch/mips/sgi-ip22/ip22-int.c
arch/mips/sgi-ip32/ip32-irq.c
arch/mips/sibyte/sb1250/irq.c
arch/mips/sni/pcimt.c
arch/mips/sni/pcit.c
arch/mips/tx4927/common/tx4927_irq.c
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/debug.c
arch/s390/kernel/early.c
arch/s390/kernel/ipl.c
arch/s390/kernel/syscalls.S
arch/sh/drivers/pci/pci-auto.c
arch/sh/kernel/cpu/init.c
arch/sh/kernel/cpu/sh2/entry.S
arch/sh/kernel/cpu/sh3/entry.S
arch/sh/kernel/cpu/sh4/probe.c
arch/sh/kernel/irq.c
arch/sparc64/Kconfig
arch/sparc64/defconfig
arch/sparc64/kernel/ktlb.S
arch/sparc64/kernel/tsb.S
arch/sparc64/lib/NGbzero.S
arch/sparc64/lib/NGmemcpy.S
arch/sparc64/lib/NGpage.S
arch/sparc64/mm/init.c
arch/x86_64/defconfig
arch/x86_64/ia32/ia32entry.S
arch/x86_64/kernel/cpufreq/Kconfig
arch/x86_64/kernel/e820.c
arch/x86_64/kernel/early-quirks.c
arch/x86_64/kernel/mpparse.c
arch/x86_64/kernel/pci-gart.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/x8664_ksyms.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evregion.c
drivers/acpi/events/evxface.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/ibm_acpi.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/tables.c
drivers/ata/Kconfig
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/sata_inic162x.c
drivers/ata/sata_sil24.c
drivers/char/lcd.c
drivers/char/tty_io.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/char/watchdog/machzwd.c
drivers/dma/dmaengine.c
drivers/hwmon/Kconfig
drivers/ide/Kconfig
drivers/ide/Makefile
drivers/ide/arm/icside.c
drivers/ide/ide-dma.c
drivers/ide/ide.c
drivers/ide/mips/au1xxx-ide.c
drivers/ide/pci/Makefile
drivers/ide/pci/cmd64x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/scc_pata.c [moved from drivers/ide/ppc/scc_pata.c with 100% similarity]
drivers/ide/setup-pci.c
drivers/kvm/kvm_main.c
drivers/kvm/mmu.c
drivers/kvm/vmx.c
drivers/md/linear.c
drivers/pnp/manager.c
drivers/s390/cio/qdio.c
drivers/s390/crypto/ap_bus.c
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/zcrypt_api.c
drivers/serial/sh-sci.c
drivers/spi/at25.c
drivers/spi/atmel_spi.c
drivers/spi/spi_bitbang.c
drivers/spi/spi_s3c24xx.c
drivers/usb/class/usblp.c
drivers/usb/misc/berry_charge.c
drivers/usb/net/dm9601.c
drivers/usb/serial/airprime.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/option.c
drivers/usb/serial/usb-serial.c
drivers/usb/storage/unusual_devs.h
drivers/video/Kconfig
drivers/video/savage/savagefb_driver.c
drivers/video/sstfb.c
fs/binfmt_elf.c
fs/ecryptfs/dentry.c
fs/nfs/inode.c
fs/nfs/super.c
fs/nfs/sysctl.c
fs/nfs/write.c
fs/partitions/Kconfig
fs/partitions/check.c
fs/smbfs/request.c
fs/ufs/balloc.c
fs/ufs/ialloc.c
fs/ufs/inode.c
fs/ufs/truncate.c
include/acpi/acinterp.h
include/acpi/actypes.h
include/asm-arm/arch-at91/gpio.h
include/asm-arm/arch-omap/gpio.h
include/asm-arm/arch-pxa/gpio.h
include/asm-arm/arch-s3c2410/gpio.h
include/asm-arm/arch-sa1100/gpio.h
include/asm-arm/atomic.h
include/asm-avr32/arch-at32ap/gpio.h
include/asm-i386/sync_bitops.h
include/asm-ia64/machvec.h
include/asm-mips/atomic.h
include/asm-mips/bitops.h
include/asm-mips/cpu-features.h
include/asm-mips/cpu-info.h
include/asm-mips/fpu.h
include/asm-mips/mach-au1x00/au1xxx_ide.h
include/asm-mips/mach-ip27/dma-coherence.h
include/asm-mips/mach-ip32/dma-coherence.h
include/asm-mips/rtlx.h
include/asm-mips/system.h
include/asm-mips/thread_info.h
include/asm-s390/ipl.h
include/asm-s390/unistd.h
include/asm-sh/ioctls.h
include/asm-sh/irq.h
include/asm-sh/unistd.h
include/asm-sparc64/tsb.h
include/asm-x86_64/proto.h
include/asm-x86_64/smp.h
include/linux/backing-dev.h
include/linux/kbd_kern.h
include/linux/ktime.h
include/linux/nfs_fs.h
include/linux/nfs_fs_sb.h
include/linux/spi/spi_bitbang.h
include/linux/sysfs.h
include/linux/ufs_fs.h
include/linux/vt_kern.h
include/sound/version.h
kernel/fork.c
kernel/futex.c
kernel/hrtimer.c
kernel/power/console.c
kernel/power/disk.c
kernel/power/user.c
kernel/time/tick-broadcast.c
kernel/time/tick-common.c
kernel/time/tick-internal.h
kernel/time/tick-oneshot.c
mm/backing-dev.c
mm/filemap.c
mm/madvise.c
mm/oom_kill.c
net/core/skbuff.c
net/ipv4/fib_trie.c
net/ipv4/tcp.c
net/ipv6/tcp_ipv6.c
sound/pci/ac97/ac97_patch.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/intel8x0.c
sound/soc/Kconfig
sound/soc/at91/Kconfig
sound/soc/pxa/Kconfig

index 576ce463cf442d7fb806fea31eb373c883647d86..989f1130f4f33e6960459b971b41862b10713a2d 100644 (file)
@@ -105,12 +105,15 @@ setting up a platform_device using the GPIO, is mark its direction:
 
        /* set as input or output, returning 0 or negative errno */
        int gpio_direction_input(unsigned gpio);
-       int gpio_direction_output(unsigned gpio);
+       int gpio_direction_output(unsigned gpio, int value);
 
 The return value is zero for success, else a negative errno.  It should
 be checked, since the get/set calls don't have error returns and since
 misconfiguration is possible.  (These calls could sleep.)
 
+For output GPIOs, the value provided becomes the initial output value.
+This helps avoid signal glitching during system startup.
+
 Setting the direction can fail if the GPIO number is invalid, or when
 that particular GPIO can't be used in that mode.  It's generally a bad
 idea to rely on boot firmware to have set the direction correctly, since
index 856c8b114e71698731c93503f19a32bd1b10c481..f0b7a5e5740ad1eaabe02a78cf4cc1de86d79f7e 100644 (file)
@@ -138,6 +138,12 @@ and is between 256 and 4096 characters. It is defined in the file
 
                        See also Documentation/pm.txt, pci=noacpi
 
+       acpi_apic_instance=     [ACPI, IOAPIC]
+                       Format: <int>
+                       2: use 2nd APIC table, if available
+                       1,0: use 1st APIC table
+                       default: 2
+
        acpi_sleep=     [HW,ACPI] Sleep options
                        Format: { s3_bios, s3_mode }
                        See Documentation/power/video.txt
index db398a6441c1b110c94b1f32b2038926b728e028..73e9a174b6427853b073bf4143e88e9f6e014a0f 100644 (file)
@@ -866,6 +866,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
          basic         3-jack (default)
          hp            HP nx6320
          thinkpad      Lenovo Thinkpad T60/X60/Z60
+         toshiba       Toshiba U205
 
        AD1986A
          6stack        6-jack, separate surrounds (default)
@@ -906,7 +907,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
          5stack        D945 5stack + SPDIF
          macmini       Intel Mac Mini
          macbook       Intel Mac Book
-         macbook-pro   Intel Mac Book Pro
+         macbook-pro-v1 Intel Mac Book Pro 1st generation
+         macbook-pro   Intel Mac Book Pro 2nd generation
 
        STAC9202/9250/9251
          ref           Reference board, base config
index 17555bba20af84bc071d7cd8d553d06b3598e4f3..dd6978b1e8fbcbde19e874828a16bdb3100e6f7a 100644 (file)
@@ -3066,11 +3066,10 @@ L:      netdev@vger.kernel.org
 S:     Maintained
 
 SONY VAIO CONTROL DEVICE DRIVER
-P:     Stelian Pop
-M:     stelian@popies.net
 P:     Mattia Dongili
 M:     malattia@linux.it
-W:     http://popies.net/sonypi/
+L:     linux-acpi@vger.kernel.org
+W:     http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
 S:     Maintained
 
 SOUND
@@ -3103,6 +3102,9 @@ TPM DEVICE DRIVER
 P:     Kylene Hall
 M:     kjhall@us.ibm.com
 W:     http://tpmdd.sourceforge.net
+P:     Marcel Selhorst
+M:     tpm@selhorst.net
+W:     http://www.prosec.rub.de/tpm/
 L:     tpmdd-devel@lists.sourceforge.net
 S:     Maintained
 
index 03e37af315d76cc702ca0af3b5bfae6da904147e..0453dcc757b40da1722d9d900e160d3f2751d86e 100644 (file)
@@ -839,8 +839,11 @@ static int __init topology_init(void)
 {
        int cpu;
 
-       for_each_possible_cpu(cpu)
-               register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu);
+       for_each_possible_cpu(cpu) {
+               struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu);
+               cpuinfo->cpu.hotpluggable = 1;
+               register_cpu(&cpuinfo->cpu, cpu);
+       }
 
        return 0;
 }
index 44211a0af19a805fd81a0d1a5783f07ed4db958f..ba4a1bb3ee4027c8dd51392abe670dd0e2ce3992 100644 (file)
@@ -215,13 +215,14 @@ int gpio_direction_input(unsigned pin)
 }
 EXPORT_SYMBOL(gpio_direction_input);
 
-int gpio_direction_output(unsigned pin)
+int gpio_direction_output(unsigned pin, int value)
 {
        void __iomem    *pio = pin_to_controller(pin);
        unsigned        mask = pin_to_mask(pin);
 
        if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
                return -EINVAL;
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
        __raw_writel(mask, pio + PIO_OER);
        return 0;
 }
index 192a5a26cf2b4c16ff5f9a5cd044c578468432dd..9e13c8358ea7c0cc4a111f2a86977f9dd19109ea 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 #include <asm/irq.h>
+#include <asm/gpio.h>
 
 #include "generic.h"
 
@@ -153,7 +154,7 @@ int gpio_direction_input(unsigned gpio)
 
 EXPORT_SYMBOL(gpio_direction_input);
 
-int gpio_direction_output(unsigned gpio)
+int gpio_direction_output(unsigned gpio, int value)
 {
        unsigned long flags;
 
@@ -161,6 +162,7 @@ int gpio_direction_output(unsigned gpio)
                return -EINVAL;
 
        local_irq_save(flags);
+       gpio_set_value(gpio, value);
        GPDR |= GPIO_GPIO(gpio);
        local_irq_restore(flags);
        return 0;
index 9ba5654cde110dda279fe83498ab5a1c25d33144..1eb99b814f5bcaf021f06ef46ea26c3cc96fa67f 100644 (file)
@@ -214,7 +214,7 @@ int gpio_direction_input(unsigned int gpio)
 }
 EXPORT_SYMBOL(gpio_direction_input);
 
-int gpio_direction_output(unsigned int gpio)
+int gpio_direction_output(unsigned int gpio, int value)
 {
        struct pio_device *pio;
        unsigned int pin;
@@ -223,6 +223,8 @@ int gpio_direction_output(unsigned int gpio)
        if (!pio)
                return -ENODEV;
 
+       gpio_set_value(gpio, value);
+
        pin = gpio & 0x1f;
        pio_writel(pio, OER, 1 << pin);
 
index 5ae1e0bc8fd7e6ecf6a73cb6b3fa002ebd6cdf45..f4efd66e1ee502a401c720085d8f81fcfe6c803e 100644 (file)
@@ -1,10 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-git8
-# Tue Feb 13 11:25:18 2007
+# Linux kernel version: 2.6.21-rc3
+# Wed Mar  7 15:29:47 2007
 #
 CONFIG_X86_32=y
 CONFIG_GENERIC_TIME=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_SEMAPHORE_SLEEPERS=y
@@ -34,6 +37,7 @@ CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
@@ -44,6 +48,7 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -103,6 +108,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 # Processor type and features
 #
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
 CONFIG_SMP=y
 # CONFIG_X86_PC is not set
 # CONFIG_X86_ELAN is not set
@@ -235,10 +243,8 @@ CONFIG_ACPI_PROCFS=y
 CONFIG_ACPI_AC=y
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
-# CONFIG_ACPI_HOTKEY is not set
 CONFIG_ACPI_FAN=y
 # CONFIG_ACPI_DOCK is not set
-# CONFIG_ACPI_BAY is not set
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_THERMAL=y
 # CONFIG_ACPI_ASUS is not set
@@ -289,6 +295,7 @@ CONFIG_X86_POWERNOW_K8_ACPI=y
 # CONFIG_X86_CPUFREQ_NFORCE2 is not set
 # CONFIG_X86_LONGRUN is not set
 # CONFIG_X86_LONGHAUL is not set
+# CONFIG_X86_E_POWERSAVER is not set
 
 #
 # shared options
@@ -368,7 +375,7 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
@@ -470,7 +477,13 @@ CONFIG_FW_LOADER=y
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
 
 #
 # Block devices
@@ -490,7 +503,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
@@ -500,6 +512,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_IBM_ASM is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_SONY_LAPTOP is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -526,6 +539,7 @@ CONFIG_BLK_DEV_IDEACPI=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -679,6 +693,7 @@ CONFIG_SATA_VIA=y
 # CONFIG_SATA_VITESSE is not set
 # CONFIG_SATA_INIC162X is not set
 CONFIG_SATA_INTEL_COMBINED=y
+CONFIG_SATA_ACPI=y
 # CONFIG_PATA_ALI is not set
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
@@ -786,6 +801,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
 
 #
 # ARCnet devices
@@ -979,6 +995,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -1064,6 +1081,11 @@ CONFIG_HANGCHECK_TIMER=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
 #
 # Multimedia devices
 #
@@ -1078,7 +1100,7 @@ CONFIG_HANGCHECK_TIMER=y
 #
 # Graphics support
 #
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 # CONFIG_FB is not set
 
 #
@@ -1089,7 +1111,6 @@ CONFIG_VGACON_SOFT_SCROLLBACK=y
 CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128
 CONFIG_VIDEO_SELECT=y
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -1238,6 +1259,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -1248,6 +1270,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1506,6 +1529,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
@@ -1525,6 +1549,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
 CONFIG_EARLY_PRINTK=y
 CONFIG_DEBUG_STACKOVERFLOW=y
 # CONFIG_DEBUG_STACK_USAGE is not set
index 2383bcf18c5d0c321712f854721441562d522025..5cff7970911e079d51923866746db4f3e9ad966c 100644 (file)
@@ -338,6 +338,7 @@ void __init setup_boot_APIC_clock(void)
        void (*real_handler)(struct clock_event_device *dev);
        unsigned long deltaj;
        long delta, deltapm;
+       int pm_referenced = 0;
 
        apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n"
                    "calibrating APIC timer ...\n");
@@ -357,7 +358,8 @@ void __init setup_boot_APIC_clock(void)
        /* Let the interrupts run */
        local_irq_enable();
 
-       while(lapic_cal_loops <= LAPIC_CAL_LOOPS);
+       while (lapic_cal_loops <= LAPIC_CAL_LOOPS)
+               cpu_relax();
 
        local_irq_disable();
 
@@ -394,6 +396,7 @@ void __init setup_boot_APIC_clock(void)
                               "%lu (%ld)\n", (unsigned long) res, delta);
                        delta = (long) res;
                }
+               pm_referenced = 1;
        }
 
        /* Calculate the scaled math multiplication factor */
@@ -423,68 +426,41 @@ void __init setup_boot_APIC_clock(void)
                    calibration_result / (1000000 / HZ),
                    calibration_result % (1000000 / HZ));
 
-
-       apic_printk(APIC_VERBOSE, "... verify APIC timer\n");
-
-       /*
-        * Setup the apic timer manually
-        */
        local_apic_timer_verify_ok = 1;
-       levt->event_handler = lapic_cal_handler;
-       lapic_timer_setup(CLOCK_EVT_MODE_PERIODIC, levt);
-       lapic_cal_loops = -1;
 
-       /* Let the interrupts run */
-       local_irq_enable();
+       /* We trust the pm timer based calibration */
+       if (!pm_referenced) {
+               apic_printk(APIC_VERBOSE, "... verify APIC timer\n");
 
-       while(lapic_cal_loops <= LAPIC_CAL_LOOPS);
+               /*
+                * Setup the apic timer manually
+                */
+               levt->event_handler = lapic_cal_handler;
+               lapic_timer_setup(CLOCK_EVT_MODE_PERIODIC, levt);
+               lapic_cal_loops = -1;
 
-       local_irq_disable();
+               /* Let the interrupts run */
+               local_irq_enable();
 
-       /* Stop the lapic timer */
-       lapic_timer_setup(CLOCK_EVT_MODE_SHUTDOWN, levt);
+               while(lapic_cal_loops <= LAPIC_CAL_LOOPS)
+                       cpu_relax();
 
-       local_irq_enable();
+               local_irq_disable();
 
-       /* Jiffies delta */
-       deltaj = lapic_cal_j2 - lapic_cal_j1;
-       apic_printk(APIC_VERBOSE, "... jiffies delta = %lu\n", deltaj);
+               /* Stop the lapic timer */
+               lapic_timer_setup(CLOCK_EVT_MODE_SHUTDOWN, levt);
 
-       /* Check, if the PM timer is available */
-       deltapm = lapic_cal_pm2 - lapic_cal_pm1;
-       apic_printk(APIC_VERBOSE, "... PM timer delta = %ld\n", deltapm);
+               local_irq_enable();
 
-       local_apic_timer_verify_ok = 0;
+               /* Jiffies delta */
+               deltaj = lapic_cal_j2 - lapic_cal_j1;
+               apic_printk(APIC_VERBOSE, "... jiffies delta = %lu\n", deltaj);
 
-       if (deltapm) {
-               if (deltapm > (pm_100ms - pm_thresh) &&
-                   deltapm < (pm_100ms + pm_thresh)) {
-                       apic_printk(APIC_VERBOSE, "... PM timer result ok\n");
-                       /* Check, if the jiffies result is consistent */
-                       if (deltaj < LAPIC_CAL_LOOPS-2 ||
-                           deltaj > LAPIC_CAL_LOOPS+2) {
-                               /*
-                                * Not sure, what we can do about this one.
-                                * When high resultion timers are active
-                                * and the lapic timer does not stop in C3
-                                * we are fine. Otherwise more trouble might
-                                * be waiting. -- tglx
-                                */
-                               printk(KERN_WARNING "Global event device %s "
-                                      "has wrong frequency "
-                                      "(%lu ticks instead of %d)\n",
-                                      global_clock_event->name, deltaj,
-                                      LAPIC_CAL_LOOPS);
-                       }
-                       local_apic_timer_verify_ok = 1;
-               }
-       } else {
                /* Check, if the jiffies result is consistent */
-               if (deltaj >= LAPIC_CAL_LOOPS-2 &&
-                   deltaj <= LAPIC_CAL_LOOPS+2) {
+               if (deltaj >= LAPIC_CAL_LOOPS-2 && deltaj <= LAPIC_CAL_LOOPS+2)
                        apic_printk(APIC_VERBOSE, "... jiffies result ok\n");
-                       local_apic_timer_verify_ok = 1;
-               }
+               else
+                       local_apic_timer_verify_ok = 0;
        }
 
        if (!local_apic_timer_verify_ok) {
index e3d4b73bfdb0334e6cfb0ccc54a7615acd337ace..4afe26e86260e2503a930915533506433cc2a26f 100644 (file)
@@ -28,3 +28,5 @@ EXPORT_SYMBOL(__read_lock_failed);
 #endif
 
 EXPORT_SYMBOL(csum_partial);
+
+EXPORT_SYMBOL(_proxy_pda);
index 602660df455c7676b2fd9400f628831b8b3d716c..0e65f7ab63a204081d908507eb35baddc157dde8 100644 (file)
@@ -105,7 +105,7 @@ unsigned long long sched_clock(void)
        /*
         * Fall back to jiffies if there's no TSC available:
         */
-       if (unlikely(tsc_disable))
+       if (tsc_unstable || unlikely(tsc_disable))
                /* No locking but a rare wrong value is not a big deal: */
                return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
 
index fbf45fa083207c7b70a1be6eed15bb27b4dcdb35..fb07a1aad2250459538f8e9a5319dbaf3f2cdaf2 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/license.h>
 #include <linux/cpu.h>
 #include <linux/bootmem.h>
 #include <linux/mm.h>
@@ -48,7 +47,6 @@ typedef u64 __attribute__((regparm(2))) (VROMLONGFUNC)(int);
    (((VROMLONGFUNC *)(rom->func)) (arg))
 
 static struct vrom_header *vmi_rom;
-static int license_gplok;
 static int disable_pge;
 static int disable_pse;
 static int disable_sep;
@@ -629,13 +627,14 @@ static inline int __init check_vmi_rom(struct vrom_header *rom)
                rom->api_version_maj, rom->api_version_min,
                pci->rom_version_maj, pci->rom_version_min);
 
-        license_gplok = license_is_gpl_compatible(license);
-        if (!license_gplok) {
-                printk(KERN_WARNING "VMI: ROM license '%s' taints kernel... "
-                      "inlining disabled\n",
-                       license);
-                add_taint(TAINT_PROPRIETARY_MODULE);
-        }
+       /* Don't allow BSD/MIT here for now because we don't want to end up
+          with any binary only shim layers */
+       if (strcmp(license, "GPL") && strcmp(license, "GPL v2")) {
+               printk(KERN_WARNING "VMI: Non GPL license `%s' found for ROM. Not used.\n",
+                       license);
+               return 0;
+       }
+
        return 1;
 }
 
index d51f0f11f7f95169f424cd99768928635be92dd3..e19185d2655484b1f4f8131025ba8ed497a99050 100644 (file)
@@ -13,6 +13,7 @@ config IA64
        bool
        select PCI if (!IA64_HP_SIM)
        select ACPI if (!IA64_HP_SIM)
+       select PM if (!IA64_HP_SIM)
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
index 600be3ebae05b660247050b2393057f22b49eda3..6b10e5d284883380a284a1d2616e1aa2ec834fd2 100644 (file)
@@ -247,10 +247,18 @@ sn_io_slot_fixup(struct pci_dev *dev)
                addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;
                dev->resource[idx].start = addr;
                dev->resource[idx].end = addr + size;
+
+               /*
+                * if it's already in the device structure, remove it before
+                * inserting
+                */
+               if (dev->resource[idx].parent && dev->resource[idx].parent->child)
+                       release_resource(&dev->resource[idx]);
+
                if (dev->resource[idx].flags & IORESOURCE_IO)
-                       dev->resource[idx].parent = &ioport_resource;
+                       insert_resource(&ioport_resource, &dev->resource[idx]);
                else
-                       dev->resource[idx].parent = &iomem_resource;
+                       insert_resource(&iomem_resource, &dev->resource[idx]);
                /* If ROM, mark as shadowed in PROM */
                if (idx == PCI_ROM_RESOURCE)
                        dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY;
index 2b9c65c3b5d1dfa319127d6c0127fdee23e15072..656f0ca52782def4e3cdc394de831f1835dcf30d 100644 (file)
@@ -250,7 +250,7 @@ config LASAT
        select R5000_CPU_SCACHE
        select SYS_HAS_CPU_R5000
        select SYS_SUPPORTS_32BIT_KERNEL
-       select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
+       select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select GENERIC_HARDIRQS_NO__DO_IRQ
 
@@ -542,6 +542,8 @@ config QEMU
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select ARCH_SPARSEMEM_ENABLE
        select GENERIC_HARDIRQS_NO__DO_IRQ
+       select NR_CPUS_DEFAULT_1
+       select SYS_SUPPORTS_SMP
        help
          Qemu is a software emulator which among other architectures also
          can simulate a MIPS32 4Kc system.  This patch adds support for the
@@ -1559,6 +1561,7 @@ config MIPS_MT_SMP
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_SRS
        select MIPS_MT
+       select NR_CPUS_DEFAULT_2
        select SMP
        select SYS_SUPPORTS_SMP
        help
@@ -1573,7 +1576,6 @@ config MIPS_MT_SMTC
        select CPU_MIPSR2_IRQ_VI
        select CPU_MIPSR2_SRS
        select MIPS_MT
-       select NR_CPUS_DEFAULT_2
        select NR_CPUS_DEFAULT_8
        select SMP
        select SYS_SUPPORTS_SMP
@@ -1805,6 +1807,9 @@ config SMP
 config SYS_SUPPORTS_SMP
        bool
 
+config NR_CPUS_DEFAULT_1
+       bool
+
 config NR_CPUS_DEFAULT_2
        bool
 
@@ -1825,8 +1830,9 @@ config NR_CPUS_DEFAULT_64
 
 config NR_CPUS
        int "Maximum number of CPUs (2-64)"
-       range 2 64
+       range 1 64 if NR_CPUS_DEFAULT_1
        depends on SMP
+       default "1" if NR_CPUS_DEFAULT_1
        default "2" if NR_CPUS_DEFAULT_2
        default "4" if NR_CPUS_DEFAULT_4
        default "8" if NR_CPUS_DEFAULT_8
@@ -1837,10 +1843,13 @@ config NR_CPUS
          This allows you to specify the maximum number of CPUs which this
          kernel will support.  The maximum supported value is 32 for 32-bit
          kernel and 64 for 64-bit kernels; the minimum value which makes
-         sense is 2.
+         sense is 1 for Qemu (useful only for kernel debugging purposes)
+         and 2 for all others.
 
          This is purely to save memory - each supported CPU adds
-         approximately eight kilobytes to the kernel image.
+         approximately eight kilobytes to the kernel image.  For best
+         performance should round up your number of processors to the next
+         power of two.
 
 #
 # Timer Interrupt Frequency Configuration
index 2b23234a5b95ec4a76db0f0b7a56ca804f265b5e..faa4a506bf82937582bd819a4c37eb8a82220137 100644 (file)
@@ -194,7 +194,7 @@ static void vrc5477_irq_dispatch(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_cause() & read_c0_status();
+       unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
 
        if (pending & STATUSF_IP7)
                do_IRQ(CPU_IRQ_BASE + 7);
index e266300263750d4e0277ba7fa467a37fce884464..6bcf6a06367a68784ef55dc325604a941abb90ae 100644 (file)
@@ -115,7 +115,7 @@ void __init arch_init_irq(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-        unsigned int pending = read_c0_status() & read_c0_cause();
+        unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
 
        if (pending & STATUSF_IP7)
                do_IRQ(CPU_IRQ_BASE + 7);
index 04572b9c964299a9a53c95b897031b0233de4bbd..64e4c80b6139a741cd9de4d727a8fd6075742315 100644 (file)
@@ -48,7 +48,7 @@
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_status() & read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
 
        if (pending & STATUSF_IP4)              /* int2 hardware line (timer) */
                do_IRQ(4);
index d3d96591780e65412f363a8efd3e70c23c4dcbc6..06177bf5b1d65e8f8fe6b96703361b8afe5d6d70 100644 (file)
@@ -32,7 +32,7 @@
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_status() & read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
 
        if (pending & STATUSF_IP7)
                do_IRQ(WRPPMC_MIPS_TIMER_IRQ);  /* CPU Compare/Count internal timer */
index 295892e4ce530a16c80109fd9e71325d4418fc4d..015cf4bb51ddb4ab3fd92928e460df07d9509aff 100644 (file)
@@ -122,7 +122,7 @@ static void ll_local_dev(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
+       unsigned int pending = read_c0_cause() & read_c0_status();
 
        if (pending & IE_IRQ5)
                write_c0_compare(0);
index aacd4a005c5febfcf761eabe3d1a1fb2e8ea8af1..83843a229be7f551f4e1e36cd6a043c610c1a833 100644 (file)
@@ -181,13 +181,13 @@ NESTED(except_vec_vi, 0, sp)
         * during service by SMTC kernel, we also want to
         * pass the IM value to be cleared.
         */
-EXPORT(except_vec_vi_mori)
+FEXPORT(except_vec_vi_mori)
        ori     a0, $0, 0
 #endif /* CONFIG_MIPS_MT_SMTC */
-EXPORT(except_vec_vi_lui)
+FEXPORT(except_vec_vi_lui)
        lui     v0, 0           /* Patched */
        j       except_vec_vi_handler
-EXPORT(except_vec_vi_ori)
+FEXPORT(except_vec_vi_ori)
         ori    v0, 0           /* Patched */
        .set    pop
        END(except_vec_vi)
@@ -220,7 +220,17 @@ NESTED(except_vec_vi_handler, 0, sp)
        _ehb
 #endif /* CONFIG_MIPS_MT_SMTC */
        CLI
+#ifdef CONFIG_TRACE_IRQFLAGS
+       move    s0, v0
+#ifdef CONFIG_MIPS_MT_SMTC
+       move    s1, a0
+#endif
        TRACE_IRQS_OFF
+#ifdef CONFIG_MIPS_MT_SMTC
+       move    a0, s1
+#endif
+       move    v0, s0
+#endif
 
        LONG_L  s0, TI_REGS($28)
        LONG_S  sp, TI_REGS($28)
index 241ee7a2906e413c6d367cf4e4d7356e68419106..29eadd404fa5fa5c9b1d787bac2335b62908b6a2 100644 (file)
@@ -191,6 +191,8 @@ void sp_work_handle_request(void)
        struct mtsp_syscall_generic generic;
        struct mtsp_syscall_ret ret;
        struct kspd_notifications *n;
+       unsigned long written;
+       mm_segment_t old_fs;
        struct timeval tv;
        struct timezone tz;
        int cmd;
@@ -201,7 +203,11 @@ void sp_work_handle_request(void)
 
        ret.retval = -1;
 
-       if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall), 0)) {
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+
+       if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) {
+               set_fs(old_fs);
                printk(KERN_ERR "Expected request but nothing to read\n");
                return;
        }
@@ -209,7 +215,8 @@ void sp_work_handle_request(void)
        size = sc.size;
 
        if (size) {
-               if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size, 0)) {
+               if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) {
+                       set_fs(old_fs);
                        printk(KERN_ERR "Expected request but nothing to read\n");
                        return;
                }
@@ -282,8 +289,11 @@ void sp_work_handle_request(void)
        if (vpe_getuid(SP_VPE))
                sp_setfsuidgid( 0, 0);
 
-       if ((rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(struct mtsp_syscall_ret), 0))
-           < sizeof(struct mtsp_syscall_ret))
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret));
+       set_fs(old_fs);
+       if (written < sizeof(ret))
                printk("KSPD: sp_work_handle_request failed to send to SP\n");
 }
 
index 1df544c1f966e1e10b21664e95c9da7a40efe106..37849edd0645df1d611613a0838c351f3f98f552 100644 (file)
@@ -311,6 +311,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
        return ret;
 }
 
+#ifdef CONFIG_SYSVIPC
+
 asmlinkage long
 sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
 {
@@ -368,6 +370,16 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
        return err;
 }
 
+#else
+
+asmlinkage long
+sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
+{
+       return -ENOSYS;
+}
+
+#endif /* CONFIG_SYSVIPC */
+
 #ifdef CONFIG_MIPS32_N32
 asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
 {
index 656bde2e11b14d37186b5d3ec850b5397a78167d..28c2e2e6af73e7ff65df2c9d56ada233d601aca0 100644 (file)
@@ -49,8 +49,7 @@ LEAF(resume)
 #ifndef CONFIG_CPU_HAS_LLSC
        sw      zero, ll_bit
 #endif
-       mfc0    t1, CP0_STATUS
-       sw      t1, THREAD_STATUS(a0)
+       mfc0    t2, CP0_STATUS
        cpu_save_nonscratch a0
        sw      ra, THREAD_REG31(a0)
 
@@ -60,8 +59,8 @@ LEAF(resume)
        lw      t3, TASK_THREAD_INFO(a0)
        lw      t0, TI_FLAGS(t3)
        li      t1, _TIF_USEDFPU
-       and     t2, t0, t1
-       beqz    t2, 1f
+       and     t1, t0
+       beqz    t1, 1f
        nor     t1, zero, t1
 
        and     t0, t0, t1
@@ -74,10 +73,13 @@ LEAF(resume)
        li      t1, ~ST0_CU1
        and     t0, t0, t1
        sw      t0, ST_OFF(t3)
+       /* clear thread_struct CU1 bit */
+       and     t2, t1
 
        fpu_save_single a0, t0                  # clobbers t0
 
 1:
+       sw      t2, THREAD_STATUS(a0)
        /*
         * The order of restoring the registers takes care of the race
         * updating $28, $29 and kernelsp without disabling ints.
index 59c1577ecbb31e303dd8aa00d99d5dc3dfd4e13f..dbd42adc52ed96d4b4a2d6c0aff3e8e0f0e0f987 100644 (file)
@@ -114,14 +114,6 @@ LEAF(_save_fp_context32)
  */
 LEAF(_restore_fp_context)
        EX      lw t0, SC_FPC_CSR(a0)
-
-       /* Fail if the CSR has exceptions pending */
-       srl     t1, t0, 5
-       and     t1, t0
-       andi    t1, 0x1f << 7
-       bnez    t1, fault
-        nop
-
 #ifdef CONFIG_64BIT
        EX      ldc1 $f1, SC_FPREGS+8(a0)
        EX      ldc1 $f3, SC_FPREGS+24(a0)
@@ -165,14 +157,6 @@ LEAF(_restore_fp_context)
 LEAF(_restore_fp_context32)
        /* Restore an o32 sigcontext.  */
        EX      lw t0, SC32_FPC_CSR(a0)
-
-       /* Fail if the CSR has exceptions pending */
-       srl     t1, t0, 5
-       and     t1, t0
-       andi    t1, 0x1f << 7
-       bnez    t1, fault
-        nop
-
        EX      ldc1 $f0, SC32_FPREGS+0(a0)
        EX      ldc1 $f2, SC32_FPREGS+16(a0)
        EX      ldc1 $f4, SC32_FPREGS+32(a0)
index cc566cf122464f8672685766dd595bc8cc50cceb..c7698fd9955c14b121fed998398a4803970aed3c 100644 (file)
@@ -48,8 +48,7 @@
 #ifndef CONFIG_CPU_HAS_LLSC
        sw      zero, ll_bit
 #endif
-       mfc0    t1, CP0_STATUS
-       LONG_S  t1, THREAD_STATUS(a0)
+       mfc0    t2, CP0_STATUS
        cpu_save_nonscratch a0
        LONG_S  ra, THREAD_REG31(a0)
 
@@ -59,8 +58,8 @@
        PTR_L   t3, TASK_THREAD_INFO(a0)
        LONG_L  t0, TI_FLAGS(t3)
        li      t1, _TIF_USEDFPU
-       and     t2, t0, t1
-       beqz    t2, 1f
+       and     t1, t0
+       beqz    t1, 1f
        nor     t1, zero, t1
 
        and     t0, t0, t1
        li      t1, ~ST0_CU1
        and     t0, t0, t1
        LONG_S  t0, ST_OFF(t3)
+       /* clear thread_struct CU1 bit */
+       and     t2, t1
 
        fpu_save_double a0 t0 t1                # c0_status passed in t0
                                                # clobbers t1
 1:
+       LONG_S  t2, THREAD_STATUS(a0)
 
        /*
         * The order of restoring the registers takes care of the race
index e14ae09eda2b7a94dd4d264bd9d0b7c864380811..e6e3047151a6715d61fa1b1875d47b9d73fdb0b9 100644 (file)
@@ -54,6 +54,7 @@ static struct chan_waitqueues {
        wait_queue_head_t rt_queue;
        wait_queue_head_t lx_queue;
        atomic_t in_open;
+       struct mutex mutex;
 } channel_wqs[RTLX_CHANNELS];
 
 static struct irqaction irq;
@@ -146,7 +147,7 @@ static void stopping(int vpe)
 
 int rtlx_open(int index, int can_sleep)
 {
-       volatile struct rtlx_info **p;
+       struct rtlx_info **p;
        struct rtlx_channel *chan;
        enum rtlx_state state;
        int ret = 0;
@@ -179,13 +180,24 @@ int rtlx_open(int index, int can_sleep)
                        }
                }
 
+               smp_rmb();
                if (*p == NULL) {
                        if (can_sleep) {
-                               __wait_event_interruptible(channel_wqs[index].lx_queue,
-                                                          *p != NULL,
-                                                          ret);
-                               if (ret)
+                               DEFINE_WAIT(wait);
+
+                               for (;;) {
+                                       prepare_to_wait(&channel_wqs[index].lx_queue, &wait, TASK_INTERRUPTIBLE);
+                                       smp_rmb();
+                                       if (*p != NULL)
+                                               break;
+                                       if (!signal_pending(current)) {
+                                               schedule();
+                                               continue;
+                                       }
+                                       ret = -ERESTARTSYS;
                                        goto out_fail;
+                               }
+                               finish_wait(&channel_wqs[index].lx_queue, &wait);
                        } else {
                                printk(" *vpe_get_shared is NULL. "
                                       "Has an SP program been loaded?\n");
@@ -277,56 +289,52 @@ unsigned int rtlx_write_poll(int index)
        return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size);
 }
 
-static inline void copy_to(void *dst, void *src, size_t count, int user)
-{
-       if (user)
-               copy_to_user(dst, src, count);
-       else
-               memcpy(dst, src, count);
-}
-
-static inline void copy_from(void *dst, void *src, size_t count, int user)
+ssize_t rtlx_read(int index, void __user *buff, size_t count, int user)
 {
-       if (user)
-               copy_from_user(dst, src, count);
-       else
-               memcpy(dst, src, count);
-}
-
-ssize_t rtlx_read(int index, void *buff, size_t count, int user)
-{
-       size_t fl = 0L;
+       size_t lx_write, fl = 0L;
        struct rtlx_channel *lx;
+       unsigned long failed;
 
        if (rtlx == NULL)
                return -ENOSYS;
 
        lx = &rtlx->channel[index];
 
+       mutex_lock(&channel_wqs[index].mutex);
+       smp_rmb();
+       lx_write = lx->lx_write;
+
        /* find out how much in total */
        count = min(count,
-                    (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read)
+                    (size_t)(lx_write + lx->buffer_size - lx->lx_read)
                     % lx->buffer_size);
 
        /* then how much from the read pointer onwards */
-       fl = min( count, (size_t)lx->buffer_size - lx->lx_read);
+       fl = min(count, (size_t)lx->buffer_size - lx->lx_read);
 
-       copy_to(buff, &lx->lx_buffer[lx->lx_read], fl, user);
+       failed = copy_to_user(buff, lx->lx_buffer + lx->lx_read, fl);
+       if (failed)
+               goto out;
 
        /* and if there is anything left at the beginning of the buffer */
-       if ( count - fl )
-               copy_to (buff + fl, lx->lx_buffer, count - fl, user);
+       if (count - fl)
+               failed = copy_to_user(buff + fl, lx->lx_buffer, count - fl);
 
-       /* update the index */
-       lx->lx_read += count;
-       lx->lx_read %= lx->buffer_size;
+out:
+       count -= failed;
+
+       smp_wmb();
+       lx->lx_read = (lx->lx_read + count) % lx->buffer_size;
+       smp_wmb();
+       mutex_unlock(&channel_wqs[index].mutex);
 
        return count;
 }
 
-ssize_t rtlx_write(int index, void *buffer, size_t count, int user)
+ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int user)
 {
        struct rtlx_channel *rt;
+       size_t rt_read;
        size_t fl;
 
        if (rtlx == NULL)
@@ -334,24 +342,35 @@ ssize_t rtlx_write(int index, void *buffer, size_t count, int user)
 
        rt = &rtlx->channel[index];
 
+       mutex_lock(&channel_wqs[index].mutex);
+       smp_rmb();
+       rt_read = rt->rt_read;
+
        /* total number of bytes to copy */
        count = min(count,
-                   (size_t)write_spacefree(rt->rt_read, rt->rt_write,
-                                           rt->buffer_size));
+                   (size_t)write_spacefree(rt_read, rt->rt_write, rt->buffer_size));
 
        /* first bit from write pointer to the end of the buffer, or count */
        fl = min(count, (size_t) rt->buffer_size - rt->rt_write);
 
-       copy_from (&rt->rt_buffer[rt->rt_write], buffer, fl, user);
+       failed = copy_from_user(rt->rt_buffer + rt->rt_write, buffer, fl);
+       if (failed)
+               goto out;
 
        /* if there's any left copy to the beginning of the buffer */
-       if( count - fl )
-               copy_from (rt->rt_buffer, buffer + fl, count - fl, user);
+       if (count - fl) {
+               failed = copy_from_user(rt->rt_buffer, buffer + fl, count - fl);
+       }
+
+out:
+       count -= cailed;
 
-       rt->rt_write += count;
-       rt->rt_write %= rt->buffer_size;
+       smp_wmb();
+       rt->rt_write = (rt->rt_write + count) % rt->buffer_size;
+       smp_wmb();
+       mutex_unlock(&channel_wqs[index].mutex);
 
-       return(count);
+       return count;
 }
 
 
@@ -403,7 +422,7 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
                return 0;       // -EAGAIN makes cat whinge
        }
 
-       return rtlx_read(minor, buffer, count, 1);
+       return rtlx_read(minor, buffer, count);
 }
 
 static ssize_t file_write(struct file *file, const char __user * buffer,
@@ -429,7 +448,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer,
                        return ret;
        }
 
-       return rtlx_write(minor, (void *)buffer, count, 1);
+       return rtlx_write(minor, buffer, count);
 }
 
 static const struct file_operations rtlx_fops = {
@@ -468,6 +487,7 @@ static int rtlx_module_init(void)
                init_waitqueue_head(&channel_wqs[i].rt_queue);
                init_waitqueue_head(&channel_wqs[i].lx_queue);
                atomic_set(&channel_wqs[i].in_open, 0);
+               mutex_init(&channel_wqs[i].mutex);
 
                dev = device_create(mt_class, NULL, MKDEV(major, i),
                                    "%s%d", module_name, i);
index fdbdbdc65b543b6333610afcdf0f68d318b1151e..297dfcb97524fc65009d266c6fd53f52fc907658 100644 (file)
@@ -31,4 +31,7 @@ extern void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
  */
 extern int install_sigtramp(unsigned int __user *tramp, unsigned int syscall);
 
+/* Check and clear pending FPU exceptions in saved CSR */
+extern int fpcsr_pending(unsigned int __user *fpcsr);
+
 #endif /* __SIGNAL_COMMON_H */
index f091786187a69b8b7b41c596b0cbec573a8fe16a..8c3c5a5789b0935d9a99334e358663e0e91a69e7 100644 (file)
@@ -82,6 +82,7 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
 {
        int err = 0;
        int i;
+       unsigned int used_math;
 
        err |= __put_user(regs->cp0_epc, &sc->sc_pc);
 
@@ -104,26 +105,53 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
                err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
        }
 
-       err |= __put_user(!!used_math(), &sc->sc_used_math);
+       used_math = !!used_math();
+       err |= __put_user(used_math, &sc->sc_used_math);
 
-       if (used_math()) {
+       if (used_math) {
                /*
                 * Save FPU state to signal context. Signal handler
                 * will "inherit" current FPU state.
                 */
-               preempt_disable();
-
-               if (!is_fpu_owner()) {
-                       own_fpu();
-                       restore_fp(current);
-               }
+               own_fpu(1);
+               enable_fp_in_kernel();
                err |= save_fp_context(sc);
-
-               preempt_enable();
+               disable_fp_in_kernel();
        }
        return err;
 }
 
+int fpcsr_pending(unsigned int __user *fpcsr)
+{
+       int err, sig = 0;
+       unsigned int csr, enabled;
+
+       err = __get_user(csr, fpcsr);
+       enabled = FPU_CSR_UNI_X | ((csr & FPU_CSR_ALL_E) << 5);
+       /*
+        * If the signal handler set some FPU exceptions, clear it and
+        * send SIGFPE.
+        */
+       if (csr & enabled) {
+               csr &= ~enabled;
+               err |= __put_user(csr, fpcsr);
+               sig = SIGFPE;
+       }
+       return err ?: sig;
+}
+
+static int
+check_and_restore_fp_context(struct sigcontext __user *sc)
+{
+       int err, sig;
+
+       err = sig = fpcsr_pending(&sc->sc_fpc_csr);
+       if (err > 0)
+               err = 0;
+       err |= restore_fp_context(sc);
+       return err ?: sig;
+}
+
 int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
 {
        unsigned int used_math;
@@ -157,19 +185,18 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
        err |= __get_user(used_math, &sc->sc_used_math);
        conditional_used_math(used_math);
 
-       preempt_disable();
-
-       if (used_math()) {
+       if (used_math) {
                /* restore fpu context if we have used it before */
-               own_fpu();
-               err |= restore_fp_context(sc);
+               own_fpu(0);
+               enable_fp_in_kernel();
+               if (!err)
+                       err = check_and_restore_fp_context(sc);
+               disable_fp_in_kernel();
        } else {
                /* signal handler may have used FPU.  Give it up. */
-               lose_fpu();
+               lose_fpu(0);
        }
 
-       preempt_enable();
-
        return err;
 }
 
@@ -332,6 +359,7 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
 {
        struct sigframe __user *frame;
        sigset_t blocked;
+       int sig;
 
        frame = (struct sigframe __user *) regs.regs[29];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -345,8 +373,11 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
 
-       if (restore_sigcontext(&regs, &frame->sf_sc))
+       sig = restore_sigcontext(&regs, &frame->sf_sc);
+       if (sig < 0)
                goto badframe;
+       else if (sig)
+               force_sig(sig, current);
 
        /*
         * Don't let your children do this ...
@@ -368,6 +399,7 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        struct rt_sigframe __user *frame;
        sigset_t set;
        stack_t st;
+       int sig;
 
        frame = (struct rt_sigframe __user *) regs.regs[29];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -381,8 +413,11 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
 
-       if (restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext))
+       sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext);
+       if (sig < 0)
                goto badframe;
+       else if (sig)
+               force_sig(sig, current);
 
        if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st)))
                goto badframe;
index 19bbef001959ce9fe0305867f9af3379d4203604..151fd2f0893ab7e1c2e2f94f91964d74cdfb1ba7 100644 (file)
@@ -181,6 +181,7 @@ static int setup_sigcontext32(struct pt_regs *regs,
 {
        int err = 0;
        int i;
+       u32 used_math;
 
        err |= __put_user(regs->cp0_epc, &sc->sc_pc);
 
@@ -200,26 +201,34 @@ static int setup_sigcontext32(struct pt_regs *regs,
                err |= __put_user(mflo3(), &sc->sc_lo3);
        }
 
-       err |= __put_user(!!used_math(), &sc->sc_used_math);
+       used_math = !!used_math();
+       err |= __put_user(used_math, &sc->sc_used_math);
 
-       if (used_math()) {
+       if (used_math) {
                /*
                 * Save FPU state to signal context.  Signal handler
                 * will "inherit" current FPU state.
                 */
-               preempt_disable();
-
-               if (!is_fpu_owner()) {
-                       own_fpu();
-                       restore_fp(current);
-               }
+               own_fpu(1);
+               enable_fp_in_kernel();
                err |= save_fp_context32(sc);
-
-               preempt_enable();
+               disable_fp_in_kernel();
        }
        return err;
 }
 
+static int
+check_and_restore_fp_context32(struct sigcontext32 __user *sc)
+{
+       int err, sig;
+
+       err = sig = fpcsr_pending(&sc->sc_fpc_csr);
+       if (err > 0)
+               err = 0;
+       err |= restore_fp_context32(sc);
+       return err ?: sig;
+}
+
 static int restore_sigcontext32(struct pt_regs *regs,
                                struct sigcontext32 __user *sc)
 {
@@ -250,19 +259,18 @@ static int restore_sigcontext32(struct pt_regs *regs,
        err |= __get_user(used_math, &sc->sc_used_math);
        conditional_used_math(used_math);
 
-       preempt_disable();
-
-       if (used_math()) {
+       if (used_math) {
                /* restore fpu context if we have used it before */
-               own_fpu();
-               err |= restore_fp_context32(sc);
+               own_fpu(0);
+               enable_fp_in_kernel();
+               if (!err)
+                       err = check_and_restore_fp_context32(sc);
+               disable_fp_in_kernel();
        } else {
                /* signal handler may have used FPU.  Give it up. */
-               lose_fpu();
+               lose_fpu(0);
        }
 
-       preempt_enable();
-
        return err;
 }
 
@@ -508,6 +516,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
 {
        struct sigframe32 __user *frame;
        sigset_t blocked;
+       int sig;
 
        frame = (struct sigframe32 __user *) regs.regs[29];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -521,8 +530,11 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
 
-       if (restore_sigcontext32(&regs, &frame->sf_sc))
+       sig = restore_sigcontext32(&regs, &frame->sf_sc);
+       if (sig < 0)
                goto badframe;
+       else if (sig)
+               force_sig(sig, current);
 
        /*
         * Don't let your children do this ...
@@ -545,6 +557,7 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        sigset_t set;
        stack_t st;
        s32 sp;
+       int sig;
 
        frame = (struct rt_sigframe32 __user *) regs.regs[29];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -558,8 +571,11 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
 
-       if (restore_sigcontext32(&regs, &frame->rs_uc.uc_mcontext))
+       sig = restore_sigcontext32(&regs, &frame->rs_uc.uc_mcontext);
+       if (sig < 0)
                goto badframe;
+       else if (sig)
+               force_sig(sig, current);
 
        /* The ucontext contains a stack32_t, so we must convert!  */
        if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
index ecf1f7ecaad9e9173582a6bcf85805d16de6b8c9..a9202fa9598728d88852b0090d340e31fb8c284c 100644 (file)
@@ -127,6 +127,7 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        sigset_t set;
        stack_t st;
        s32 sp;
+       int sig;
 
        frame = (struct rt_sigframe_n32 __user *) regs.regs[29];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -140,8 +141,11 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
 
-       if (restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext))
+       sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext);
+       if (sig < 0)
                goto badframe;
+       else if (sig)
+               force_sig(sig, current);
 
        /* The ucontext contains a stack32_t, so we must convert!  */
        if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
index 18f56a9dbcfa487831e30d86dff1e4688d006634..7d76a85422b21ca5c250484fda8fc9125d734f5f 100644 (file)
@@ -610,16 +610,6 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
        if (fcr31 & FPU_CSR_UNI_X) {
                int sig;
 
-               preempt_disable();
-
-#ifdef CONFIG_PREEMPT
-               if (!is_fpu_owner()) {
-                       /* We might lose fpu before disabling preempt... */
-                       own_fpu();
-                       BUG_ON(!used_math());
-                       restore_fp(current);
-               }
-#endif
                /*
                 * Unimplemented operation exception.  If we've got the full
                 * software emulator on-board, let's use it...
@@ -630,18 +620,12 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
                 * register operands before invoking the emulator, which seems
                 * a bit extreme for what should be an infrequent event.
                 */
-               save_fp(current);
                /* Ensure 'resume' not overwrite saved fp context again. */
-               lose_fpu();
-
-               preempt_enable();
+               lose_fpu(1);
 
                /* Run the emulator */
                sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu, 1);
 
-               preempt_disable();
-
-               own_fpu();      /* Using the FPU again.  */
                /*
                 * We can't allow the emulated instruction to leave any of
                 * the cause bit set in $fcr31.
@@ -649,9 +633,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
                current->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X;
 
                /* Restore the hardware register state */
-               restore_fp(current);
-
-               preempt_enable();
+               own_fpu(1);     /* Using the FPU again.  */
 
                /* If something went wrong, signal */
                if (sig)
@@ -775,12 +757,11 @@ asmlinkage void do_cpu(struct pt_regs *regs)
 {
        unsigned int cpid;
 
-       die_if_kernel("do_cpu invoked from kernel context!", regs);
-
        cpid = (regs->cp0_cause >> CAUSEB_CE) & 3;
 
        switch (cpid) {
        case 0:
+               die_if_kernel("do_cpu invoked from kernel context!", regs);
                if (!cpu_has_llsc)
                        if (!simulate_llsc(regs))
                                return;
@@ -791,21 +772,30 @@ asmlinkage void do_cpu(struct pt_regs *regs)
                break;
 
        case 1:
-               preempt_disable();
-
-               own_fpu();
-               if (used_math()) {      /* Using the FPU again.  */
-                       restore_fp(current);
-               } else {                        /* First time FPU user.  */
+               if (!test_thread_flag(TIF_ALLOW_FP_IN_KERNEL))
+                       die_if_kernel("do_cpu invoked from kernel context!",
+                                     regs);
+               if (used_math())        /* Using the FPU again.  */
+                       own_fpu(1);
+               else {                  /* First time FPU user.  */
                        init_fpu();
                        set_used_math();
                }
 
-               if (cpu_has_fpu) {
-                       preempt_enable();
+               if (raw_cpu_has_fpu) {
+                       if (test_thread_flag(TIF_ALLOW_FP_IN_KERNEL)) {
+                               local_irq_disable();
+                               if (cpu_has_fpu)
+                                       regs->cp0_status |= ST0_CU1;
+                               /*
+                                * We must return without enabling
+                                * interrupts to ensure keep FPU
+                                * ownership until resume.
+                                */
+                               return;
+                       }
                } else {
                        int sig;
-                       preempt_enable();
                        sig = fpu_emulator_cop1Handler(regs,
                                                &current->thread.fpu, 0);
                        if (sig)
@@ -1259,26 +1249,26 @@ static inline void mips_srs_init(void)
 /*
  * This is used by native signal handling
  */
-asmlinkage int (*save_fp_context)(struct sigcontext *sc);
-asmlinkage int (*restore_fp_context)(struct sigcontext *sc);
+asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);
+asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);
 
-extern asmlinkage int _save_fp_context(struct sigcontext *sc);
-extern asmlinkage int _restore_fp_context(struct sigcontext *sc);
+extern asmlinkage int _save_fp_context(struct sigcontext __user *sc);
+extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc);
 
-extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc);
-extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc);
+extern asmlinkage int fpu_emulator_save_context(struct sigcontext __user *sc);
+extern asmlinkage int fpu_emulator_restore_context(struct sigcontext __user *sc);
 
 #ifdef CONFIG_SMP
-static int smp_save_fp_context(struct sigcontext *sc)
+static int smp_save_fp_context(struct sigcontext __user *sc)
 {
-       return cpu_has_fpu
+       return raw_cpu_has_fpu
               ? _save_fp_context(sc)
               : fpu_emulator_save_context(sc);
 }
 
-static int smp_restore_fp_context(struct sigcontext *sc)
+static int smp_restore_fp_context(struct sigcontext __user *sc)
 {
-       return cpu_has_fpu
+       return raw_cpu_has_fpu
               ? _restore_fp_context(sc)
               : fpu_emulator_restore_context(sc);
 }
@@ -1306,14 +1296,14 @@ static inline void signal_init(void)
 /*
  * This is used by 32-bit signal stuff on the 64-bit kernel
  */
-asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc);
-asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc);
+asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
+asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);
 
-extern asmlinkage int _save_fp_context32(struct sigcontext32 *sc);
-extern asmlinkage int _restore_fp_context32(struct sigcontext32 *sc);
+extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc);
+extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc);
 
-extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 *sc);
-extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 *sc);
+extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 __user *sc);
+extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user *sc);
 
 static inline void signal32_init(void)
 {
index 5b3390f64917fda0b53bc0d90be90c201048ae4a..ed49ef01ac533e1a7dbd31291208caab452a0648 100644 (file)
@@ -51,7 +51,7 @@ void fpu_emulator_init_fpu(void)
  * with appropriate macros from uaccess.h
  */
 
-int fpu_emulator_save_context(struct sigcontext *sc)
+int fpu_emulator_save_context(struct sigcontext __user *sc)
 {
        int i;
        int err = 0;
@@ -65,7 +65,7 @@ int fpu_emulator_save_context(struct sigcontext *sc)
        return err;
 }
 
-int fpu_emulator_restore_context(struct sigcontext *sc)
+int fpu_emulator_restore_context(struct sigcontext __user *sc)
 {
        int i;
        int err = 0;
@@ -84,7 +84,7 @@ int fpu_emulator_restore_context(struct sigcontext *sc)
  * This is the o32 version
  */
 
-int fpu_emulator_save_context32(struct sigcontext32 *sc)
+int fpu_emulator_save_context32(struct sigcontext32 __user *sc)
 {
        int i;
        int err = 0;
@@ -98,7 +98,7 @@ int fpu_emulator_save_context32(struct sigcontext32 *sc)
        return err;
 }
 
-int fpu_emulator_restore_context32(struct sigcontext32 *sc)
+int fpu_emulator_restore_context32(struct sigcontext32 __user *sc)
 {
        int i;
        int err = 0;
index 1acdf091c25877246fccae76d988ab6a3320de83..88e9c2a7a2f9a4b86b3eaa10c62db17c9471cb1d 100644 (file)
@@ -145,7 +145,7 @@ static void __init console_config(void)
        char parity = '\0', bits = '\0', flow = '\0';
        char *s;
 
-       if ((strstr(prom_getcmdline(), "console=ttyS")) == NULL) {
+       if ((strstr(prom_getcmdline(), "console=")) == NULL) {
                s = prom_getenv("modetty0");
                if (s) {
                        while (*s >= '0' && *s <= '9')
index 40472f7944d792cf3b69fbe72559db7cb5482108..844d566c9de3bdec72ee1763e2f260dbc1e32dc9 100644 (file)
@@ -64,7 +64,7 @@ extern void ll_cpci_irq(void);
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_cause() & read_c0_status();
+       unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
 
        if (pending & STATUSF_IP0)
                do_IRQ(0);
index b1c4805a0b92b97e82ee96a4790dc2299a337873..aad03429a5e3f65aab895ce7fd04473f94ebd3e0 100644 (file)
@@ -83,16 +83,15 @@ static void timer_irqdispatch(int irq)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_status() & read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
 
        if (pending & STATUSF_IP2)
                hw0_irqdispatch(2);
        else if (pending & STATUSF_IP7) {
                if (read_c0_config7() & 0x01c0)
                        timer_irqdispatch(7);
-       }
-
-       spurious_interrupt();
+       } else
+               spurious_interrupt();
 }
 
 static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask)
index 5a12354cd576f61e245f94b5c30914cb12d75163..786bbfa214d14620fd83b795f77c3ba2c13796d9 100644 (file)
@@ -46,3 +46,10 @@ void __init prom_prepare_cpus(unsigned int max_cpus)
 void prom_boot_secondary(int cpu, struct task_struct *idle)
 {
 }
+
+void __init plat_smp_setup(void)
+{
+}
+void __init plat_prepare_cpus(unsigned int max_cpus)
+{
+}
index b454924aeb56c2f897b96c2cacfeefc643b9fca9..18348321795ded539d4392674522122394b670a3 100644 (file)
@@ -237,7 +237,7 @@ extern void indy_8254timer_irq(void);
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause();
 
        /*
         * First we check for r4k counter/timer IRQ.
index 8c450d9e8696fbbc0e413384da6ebbd483a1f256..fb9da9acf53f491004e9cabe3ee4a6dba25c70b9 100644 (file)
@@ -454,7 +454,7 @@ static void ip32_irq5(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause();
 
        if (likely(pending & IE_IRQ0))
                ip32_irq0();
index 148239446e6e598c732111058847769b0388d5a4..0e6a13c0bd0e6cd294ac5a6a8cb54d9b965e792f 100644 (file)
@@ -421,7 +421,7 @@ asmlinkage void plat_irq_dispatch(void)
         * blasting the high 32 bits.
         */
 
-       pending = read_c0_cause() & read_c0_status();
+       pending = read_c0_cause() & read_c0_status() & ST0_IM;
 
 #ifdef CONFIG_SIBYTE_SB1250_PROF
        if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */
index 39e5b4abc5555f37666d73cb158907065b78c8dc..8e8593b64f6a3195bf0f887440e2504481565795 100644 (file)
@@ -333,7 +333,7 @@ static void pcimt_hwint3(void)
 
 static void sni_pcimt_hwint(void)
 {
-       u32 pending = (read_c0_cause() & read_c0_status());
+       u32 pending = read_c0_cause() & read_c0_status();
 
        if (pending & C_IRQ5)
                do_IRQ (MIPS_CPU_IRQ_BASE + 7);
index 8d6b3d5b13a1303bac8ffc41c050ab4cc87504eb..1dfc3f00bbd3879a3df6a12ac5a9e46e23e3ea4d 100644 (file)
@@ -271,7 +271,7 @@ static void pcit_hwint0(void)
 
 static void sni_pcit_hwint(void)
 {
-       u32 pending = (read_c0_cause() & read_c0_status());
+       u32 pending = read_c0_cause() & read_c0_status();
 
        if (pending & C_IRQ1)
                pcit_hwint1();
@@ -285,7 +285,7 @@ static void sni_pcit_hwint(void)
 
 static void sni_pcit_hwint_cplus(void)
 {
-       u32 pending = (read_c0_cause() & read_c0_status());
+       u32 pending = read_c0_cause() & read_c0_status();
 
        if (pending & C_IRQ0)
                pcit_hwint0();
index e7f3e5b84dcffaa51f300f9ca7af141b8bca9b5c..3d25d010f3d5bcaf1fc45272ba0256aad1363c1f 100644 (file)
@@ -416,7 +416,7 @@ static int tx4927_irq_nested(void)
 
 asmlinkage void plat_irq_dispatch(void)
 {
-       unsigned int pending = read_c0_status() & read_c0_cause();
+       unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
 
        if (pending & STATUSF_IP7)                      /* cpu timer */
                do_IRQ(TX4927_IRQ_CPU_TIMER);
index 97901296894eae6785bf74edfc6cceb2842f6656..32a69a18a796bc58c57e006d6de6de4a8529cacc 100644 (file)
@@ -1665,3 +1665,20 @@ sys_getcpu_wrapper:
        llgtr   %r3,%r3                 # unsigned *
        llgtr   %r4,%r4                 # struct getcpu_cache *
        jg      sys_getcpu
+
+       .globl  compat_sys_epoll_pwait_wrapper
+compat_sys_epoll_pwait_wrapper:
+       lgfr    %r2,%r2                 # int
+       llgtr   %r3,%r3                 # struct compat_epoll_event *
+       lgfr    %r4,%r4                 # int
+       lgfr    %r5,%r5                 # int
+       llgtr   %r6,%r6                 # compat_sigset_t *
+       llgf    %r0,164(%r15)           # compat_size_t
+       stg     %r0,160(%r15)
+       jg      compat_sys_epoll_pwait
+
+       .globl  compat_sys_utimes_wrapper
+compat_sys_utimes_wrapper:
+       llgtr   %r2,%r2                 # char *
+       llgtr   %r3,%r3                 # struct compat_timeval *
+       jg      compat_sys_utimes
index eca3fe595ff4a9b092b6ee8f89f69309731add77..dca6eaf82c80859a847802a1d6e975e8682a7691 100644 (file)
@@ -268,7 +268,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size,
        rc->level          = level;
        rc->buf_size       = buf_size;
        rc->entry_size     = sizeof(debug_entry_t) + buf_size;
-       strlcpy(rc->name, name, sizeof(rc->name)-1);
+       strlcpy(rc->name, name, sizeof(rc->name));
        memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));
        memset(rc->debugfs_entries, 0 ,DEBUG_MAX_VIEWS *
                sizeof(struct dentry*));
index afca1c6f4d219e911871eae85bb4412c831b9777..5e47936573f2397a724366331e65617d4b3a709b 100644 (file)
@@ -141,9 +141,9 @@ static noinline __init void detect_machine_type(void)
                machine_flags |= 4;
 }
 
+#ifdef CONFIG_64BIT
 static noinline __init int memory_fast_detect(void)
 {
-
        unsigned long val0 = 0;
        unsigned long val1 = 0xc;
        int ret = -ENOSYS;
@@ -161,9 +161,15 @@ static noinline __init int memory_fast_detect(void)
        if (ret || val0 != val1)
                return -ENOSYS;
 
-       memory_chunk[0].size = val0;
+       memory_chunk[0].size = val0 + 1;
        return 0;
 }
+#else
+static inline int memory_fast_detect(void)
+{
+       return -ENOSYS;
+}
+#endif
 
 #define ADDR2G (1UL << 31)
 
index d125a4ead08dbdb8778854b07565986f1ce3353a..f731185bf2bdb10ed7f4c954e8a833ad35e089e1 100644 (file)
@@ -839,7 +839,7 @@ static int __init reipl_ccw_init(void)
        }
        reipl_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN;
        reipl_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION;
-       reipl_block_ccw->hdr.blk0_len = sizeof(reipl_block_ccw->ipl_info.ccw);
+       reipl_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN;
        reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW;
        /* check if read scp info worked and set loadparm */
        if (SCCB_VALID)
@@ -880,8 +880,7 @@ static int __init reipl_fcp_init(void)
        } else {
                reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN;
                reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION;
-               reipl_block_fcp->hdr.blk0_len =
-                       sizeof(reipl_block_fcp->ipl_info.fcp);
+               reipl_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN;
                reipl_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP;
                reipl_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_IPL;
        }
@@ -930,7 +929,7 @@ static int __init dump_ccw_init(void)
        }
        dump_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN;
        dump_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION;
-       dump_block_ccw->hdr.blk0_len = sizeof(reipl_block_ccw->ipl_info.ccw);
+       dump_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN;
        dump_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW;
        dump_capabilities |= IPL_TYPE_CCW;
        return 0;
@@ -954,7 +953,7 @@ static int __init dump_fcp_init(void)
        }
        dump_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN;
        dump_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION;
-       dump_block_fcp->hdr.blk0_len = sizeof(dump_block_fcp->ipl_info.fcp);
+       dump_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN;
        dump_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP;
        dump_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_DUMP;
        dump_capabilities |= IPL_TYPE_FCP;
index a52c44455bf0bbb20db3e3f65e8d9edc0c9fc5a5..c774f1069e109bda9e0baa4dc9f561669d5afaa6 100644 (file)
@@ -320,4 +320,5 @@ SYSCALL(sys_tee,sys_tee,sys_tee_wrapper)
 SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper)
 NI_SYSCALL                                                     /* 310 sys_move_pages */
 SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper)
-SYSCALL(sys_epoll_pwait,sys_epoll_pwait,sys_ni_syscall)
+SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper)
+SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper)
index ecf16344f94a7347ea389e6dca256d6045787012..224e007736fb5bcf22cdae68a6ab174064dcb3a0 100644 (file)
@@ -214,6 +214,12 @@ retry:
                        continue;
                }
 
+               if (bar_value < *lower_limit || (bar_value + bar_size) >= *upper_limit) {
+                       DBG(" unavailable -- skipping, value %x size %x\n",
+                                       bar_value, bar_size);
+                       continue;
+               }
+
 #ifdef CONFIG_PCI_AUTO_UPDATE_RESOURCES
                /* Write it out and update our limit */
                early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
index 4b339a640b13c86dc02d9a6de09eab4f8c8ab9f0..726acfcb9b77bb8d94f879b6aeca4d309c9c1d82 100644 (file)
@@ -3,7 +3,7 @@
  *
  * CPU init code
  *
- * Copyright (C) 2002 - 2006  Paul Mundt
+ * Copyright (C) 2002 - 2007  Paul Mundt
  * Copyright (C) 2003  Richard Curnow
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -48,8 +48,19 @@ static void __init cache_init(void)
 {
        unsigned long ccr, flags;
 
-       if (current_cpu_data.type == CPU_SH_NONE)
-               panic("Unknown CPU");
+       /* First setup the rest of the I-cache info */
+       current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr -
+                                     current_cpu_data.icache.linesz;
+
+       current_cpu_data.icache.way_size = current_cpu_data.icache.sets *
+                                   current_cpu_data.icache.linesz;
+
+       /* And the D-cache too */
+       current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr -
+                                     current_cpu_data.dcache.linesz;
+
+       current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets *
+                                   current_cpu_data.dcache.linesz;
 
        jump_to_P2();
        ccr = ctrl_inl(CCR);
@@ -200,6 +211,9 @@ asmlinkage void __init sh_cpu_init(void)
        /* First, probe the CPU */
        detect_cpu_and_cache_system();
 
+       if (current_cpu_data.type == CPU_SH_NONE)
+               panic("Unknown CPU");
+
        /* Init the cache */
        cache_init();
 
index 7f7d292f36ec12d49aebaf956cbeafe4db2369bb..c16dc8fec489655ccf106612ab77a0adf6c3b7c0 100644 (file)
@@ -165,6 +165,7 @@ ENTRY(exception_handler)
 
 interrupt_entry:
        mov     r9,r4
+       mov     r15,r5
        mov.l   6f,r9
        mov.l   7f,r8
        jmp     @r8
index c19205b0f2c001d2ce1cd73c7dba7674890d102f..f3e827f29a46b298eb6a31561fe80dfe09340460 100644 (file)
@@ -514,13 +514,16 @@ skip_save:
 
 interrupt_exception:
        mov.l   1f, r9
+       mov.l   2f, r4
+       mov.l   @r4, r4
        jmp     @r9
-        nop
+        mov    r15, r5
        rts
         nop
 
        .align 2
 1:     .long   do_IRQ
+2:     .long   INTEVT
 
        .align  2
 ENTRY(exception_none)
index 9d28c88d2f9de65f829c8cf96208c5ac0705067d..58950de2696d1ab5285fa1024d19ebcfc8ee2ff3 100644 (file)
@@ -195,13 +195,6 @@ int __init detect_cpu_and_cache_system(void)
 
        }
 
-       /* Setup the rest of the I-cache info */
-       current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr -
-                                     current_cpu_data.icache.linesz;
-
-       current_cpu_data.icache.way_size = current_cpu_data.icache.sets *
-                                   current_cpu_data.icache.linesz;
-
        /* And the rest of the D-cache */
        if (current_cpu_data.dcache.ways > 1) {
                size = sizes[(cvr >> 16) & 0xf];
@@ -209,12 +202,6 @@ int __init detect_cpu_and_cache_system(void)
                current_cpu_data.dcache.sets            = (size >> 6);
        }
 
-       current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr -
-                                     current_cpu_data.dcache.linesz;
-
-       current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets *
-                                   current_cpu_data.dcache.linesz;
-
        /*
         * Setup the L2 cache desc
         *
index 67be2b6e8cd1657cdf657d50259806572c236580..9bdd8a00cd4a3a8b5dffb10a0911bdff37f13079 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/kernel_stat.h>
 #include <linux/seq_file.h>
-#include <linux/io.h>
 #include <linux/irq.h>
 #include <asm/processor.h>
 #include <asm/uaccess.h>
@@ -82,13 +81,9 @@ static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly;
 static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
 #endif
 
-asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
-                     unsigned long r6, unsigned long r7,
-                     struct pt_regs __regs)
+asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
-       struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
        struct pt_regs *old_regs = set_irq_regs(regs);
-       int irq;
 #ifdef CONFIG_4KSTACKS
        union irq_ctx *curctx, *irqctx;
 #endif
@@ -111,13 +106,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
        }
 #endif
 
-#ifdef CONFIG_CPU_HAS_INTEVT
-       irq = evt2irq(ctrl_inl(INTEVT));
-#else
-       irq = r4;
-#endif
-
-       irq = irq_demux(irq);
+       irq = irq_demux(evt2irq(irq));
 
 #ifdef CONFIG_4KSTACKS
        curctx = (union irq_ctx *)current_thread_info();
index f75a686ba6443d7ed3853c9afcdbbc6eeaaa83a8..1a6348b565fb4af6480e16afc988fe9c8cbef34c 100644 (file)
@@ -136,18 +136,6 @@ config SMP
 
          If you don't know what to do here, say N.
 
-config PREEMPT
-       bool "Preemptible Kernel"
-       help
-         This option reduces the latency of the kernel when reacting to
-         real-time or interactive events by allowing a low priority process to
-         be preempted even if it is in kernel mode executing a system call.
-         This allows applications to run more reliably even when the system is
-         under load.
-
-         Say Y here if you are building a kernel for a desktop, embedded
-         or real-time system.  Say N if you are unsure.
-
 config NR_CPUS
        int "Maximum number of CPUs (2-64)"
        range 2 64
@@ -399,6 +387,8 @@ config SCHED_SMT
          when dealing with UltraSPARC cpus at a cost of slightly increased
          overhead in some places. If unsure say N here.
 
+source "kernel/Kconfig.preempt"
+
 config CMDLINE_BOOL
        bool "Default bootloader kernel arguments"
 
index 860b8b60526c77bc4b722c6daf0a5a954e6d59f7..120c9c33b7a64d18769e0945e9fde6a55e03b199 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc2
-# Wed Feb 28 09:50:51 2007
+# Linux kernel version: 2.6.21-rc4
+# Sat Mar 17 14:18:44 2007
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -50,6 +50,7 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_IKCONFIG is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_RELAY=y
+# CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
@@ -108,7 +109,6 @@ CONFIG_GENERIC_HARDIRQS=y
 # General machine setup
 #
 # CONFIG_SMP is not set
-# CONFIG_PREEMPT is not set
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_TABLE=m
 # CONFIG_CPU_FREQ_DEBUG is not set
@@ -165,6 +165,9 @@ CONFIG_BINFMT_ELF32=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 CONFIG_SOLARIS_EMUL=y
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
 # CONFIG_CMDLINE_BOOL is not set
 
 #
@@ -340,7 +343,6 @@ CONFIG_BLK_DEV_NBD=m
 # CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_UB is not set
 # CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
 CONFIG_CDROM_PKTCDVD_WCACHE=y
index e492db845ea34c07ee49e1d4dea1011e5fd95886..d4024ac0d6195cbf5b0cee0f17b28537c130b1d0 100644 (file)
@@ -138,9 +138,15 @@ kvmap_dtlb_4v:
        brgez,pn        %g4, kvmap_dtlb_nonlinear
         nop
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       /* Index through the base page size TSB even for linear
+        * mappings when using page allocation debugging.
+        */
+       KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
+#else
        /* Correct TAG_TARGET is already in %g6, check 4mb TSB.  */
        KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
-
+#endif
        /* TSB entry address left in %g1, lookup linear PTE.
         * Must preserve %g1 and %g6 (TAG).
         */
index eedf94fa5664075b3443bf8b990094294de9bee8..10adb2fb8ffe1f80fd67fe6bc832bf93446bbfa5 100644 (file)
@@ -546,6 +546,7 @@ NGtsb_init:
        subcc           %o1, 0x100, %o1
        bne,pt          %xcc, 1b
         add            %o0, 0x100, %o0
+       membar          #Sync
        retl
         wr             %g2, 0x0, %asi
        .size           NGtsb_init, .-NGtsb_init
index e86baece5cc86ebd9f0b77dc3c9dd7165b9c981f..f10e4529ee3743b770730de61d03c02ad08aa961 100644 (file)
@@ -88,6 +88,7 @@ NGbzero_loop:
        bne,pt          %xcc, NGbzero_loop
         add            %o0, 64, %o0
 
+       membar          #Sync
        wr              %o4, 0x0, %asi
        brz,pn          %o1, NGbzero_done
 NGbzero_medium:
index 8e522b3dc095e2100760c87425488de66ecbfad7..66063a9a66b87146524809d2fcd932e7107bda08 100644 (file)
@@ -247,6 +247,8 @@ FUNC_NAME:  /* %o0=dst, %o1=src, %o2=len */
        /* fall through */
 
 60:    
+       membar          #Sync
+
        /* %o2 contains any final bytes still needed to be copied
         * over. If anything is left, we copy it one byte at a time.
         */
index 7d7c3bb8dcbfe0e2d87af5e815d3fcf7d9b184e4..8ce3a0c9c537ed4ac862afda0cca7f41ed4c0b98 100644 (file)
@@ -41,6 +41,7 @@ NGcopy_user_page:     /* %o0=dest, %o1=src, %o2=vaddr */
        subcc           %g7, 64, %g7
        bne,pt          %xcc, 1b
         add            %o0, 32, %o0
+       membar          #Sync
        retl
         nop
 
@@ -63,6 +64,7 @@ NGclear_user_page:    /* %o0=dest, %o1=vaddr */
        subcc           %g7, 64, %g7
        bne,pt          %xcc, 1b
         add            %o0, 32, %o0
+       membar          #Sync
        retl
         nop
 
index b1a1ee0cc6bd6b514e5d05b2b4d00d8e2de55e8b..f146071a4b2a383934f24c5a590c2433d0e3ab09 100644 (file)
@@ -59,8 +59,10 @@ unsigned long kern_linear_pte_xor[2] __read_mostly;
  */
 unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)];
 
+#ifndef CONFIG_DEBUG_PAGEALLOC
 /* A special kernel TSB for 4MB and 256MB linear mappings.  */
 struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES];
+#endif
 
 #define MAX_BANKS      32
 
@@ -1301,7 +1303,12 @@ static void __init tsb_phys_patch(void)
 }
 
 /* Don't mark as init, we give this to the Hypervisor.  */
-static struct hv_tsb_descr ktsb_descr[2];
+#ifndef CONFIG_DEBUG_PAGEALLOC
+#define NUM_KTSB_DESCR 2
+#else
+#define NUM_KTSB_DESCR 1
+#endif
+static struct hv_tsb_descr ktsb_descr[NUM_KTSB_DESCR];
 extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
 
 static void __init sun4v_ktsb_init(void)
@@ -1340,6 +1347,7 @@ static void __init sun4v_ktsb_init(void)
        ktsb_descr[0].tsb_base = ktsb_pa;
        ktsb_descr[0].resv = 0;
 
+#ifndef CONFIG_DEBUG_PAGEALLOC
        /* Second KTSB for 4MB/256MB mappings.  */
        ktsb_pa = (kern_base +
                   ((unsigned long)&swapper_4m_tsb[0] - KERNBASE));
@@ -1352,6 +1360,7 @@ static void __init sun4v_ktsb_init(void)
        ktsb_descr[1].ctx_idx = 0;
        ktsb_descr[1].tsb_base = ktsb_pa;
        ktsb_descr[1].resv = 0;
+#endif
 }
 
 void __cpuinit sun4v_ktsb_register(void)
@@ -1364,7 +1373,7 @@ void __cpuinit sun4v_ktsb_register(void)
        pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE);
 
        func = HV_FAST_MMU_TSB_CTX0;
-       arg0 = 2;
+       arg0 = NUM_KTSB_DESCR;
        arg1 = pa;
        __asm__ __volatile__("ta        %6"
                             : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
@@ -1393,7 +1402,9 @@ void __init paging_init(void)
 
        /* Invalidate both kernel TSBs.  */
        memset(swapper_tsb, 0x40, sizeof(swapper_tsb));
+#ifndef CONFIG_DEBUG_PAGEALLOC
        memset(swapper_4m_tsb, 0x40, sizeof(swapper_4m_tsb));
+#endif
 
        if (tlb_type == hypervisor)
                sun4v_pgprot_init();
@@ -1725,8 +1736,13 @@ static void __init sun4u_pgprot_init(void)
        pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4U | __DIRTY_BITS_4U |
                     __ACCESS_BITS_4U | _PAGE_E_4U);
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4U) ^
+               0xfffff80000000000;
+#else
        kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^
                0xfffff80000000000;
+#endif
        kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U |
                                   _PAGE_P_4U | _PAGE_W_4U);
 
@@ -1769,13 +1785,23 @@ static void __init sun4v_pgprot_init(void)
        _PAGE_E = _PAGE_E_4V;
        _PAGE_CACHE = _PAGE_CACHE_4V;
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^
+               0xfffff80000000000;
+#else
        kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^
                0xfffff80000000000;
+#endif
        kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V |
                                   _PAGE_P_4V | _PAGE_W_4V);
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^
+               0xfffff80000000000;
+#else
        kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^
                0xfffff80000000000;
+#endif
        kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V |
                                   _PAGE_P_4V | _PAGE_W_4V);
 
index 293a4a4c609e2c16649c685e6541d108be7fee31..7a1e251e333ddfc505dcc3e68cfa10acb19a46dd 100644 (file)
@@ -1,11 +1,13 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-git8
-# Tue Feb 13 11:25:16 2007
+# Linux kernel version: 2.6.21-rc3
+# Wed Mar  7 15:29:47 2007
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
 CONFIG_X86=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_ZONE_DMA32=y
 CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_STACKTRACE_SUPPORT=y
@@ -43,6 +45,7 @@ CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
@@ -53,6 +56,7 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -114,11 +118,11 @@ CONFIG_X86_PC=y
 # CONFIG_X86_VSMP is not set
 # CONFIG_MK8 is not set
 # CONFIG_MPSC is not set
-CONFIG_MCORE2=y
-# CONFIG_GENERIC_CPU is not set
-CONFIG_X86_L1_CACHE_BYTES=64
-CONFIG_X86_L1_CACHE_SHIFT=6
-CONFIG_X86_INTERNODE_CACHE_BYTES=64
+# CONFIG_MCORE2 is not set
+CONFIG_GENERIC_CPU=y
+CONFIG_X86_L1_CACHE_BYTES=128
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_X86_INTERNODE_CACHE_BYTES=128
 CONFIG_X86_TSC=y
 CONFIG_X86_GOOD_APIC=y
 # CONFIG_MICROCODE is not set
@@ -207,10 +211,8 @@ CONFIG_ACPI_PROCFS=y
 CONFIG_ACPI_AC=y
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
-# CONFIG_ACPI_HOTKEY is not set
 CONFIG_ACPI_FAN=y
 # CONFIG_ACPI_DOCK is not set
-# CONFIG_ACPI_BAY is not set
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_THERMAL=y
@@ -319,7 +321,7 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
@@ -421,7 +423,13 @@ CONFIG_FW_LOADER=y
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
 
 #
 # Block devices
@@ -441,7 +449,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
@@ -451,6 +458,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_IBM_ASM is not set
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_SONY_LAPTOP is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -477,6 +485,7 @@ CONFIG_BLK_DEV_IDEACPI=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -623,6 +632,7 @@ CONFIG_SATA_VIA=y
 # CONFIG_SATA_VITESSE is not set
 # CONFIG_SATA_INIC162X is not set
 CONFIG_SATA_INTEL_COMBINED=y
+CONFIG_SATA_ACPI=y
 # CONFIG_PATA_ALI is not set
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
@@ -726,6 +736,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=y
+# CONFIG_NET_SB1000 is not set
 
 #
 # ARCnet devices
@@ -920,6 +931,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -1001,6 +1013,7 @@ CONFIG_I2C_ISA=m
 # CONFIG_I2C_NFORCE2 is not set
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PASEMI is not set
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
 # CONFIG_I2C_SIS5595 is not set
@@ -1047,6 +1060,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADM1021 is not set
 # CONFIG_SENSORS_ADM1025 is not set
 # CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
 # CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ADM9240 is not set
 # CONFIG_SENSORS_K8TEMP is not set
@@ -1089,6 +1103,11 @@ CONFIG_SENSORS_SMSC47B397=m
 # CONFIG_SENSORS_HDAPS is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
 #
 # Multimedia devices
 #
@@ -1103,7 +1122,7 @@ CONFIG_SENSORS_SMSC47B397=m
 #
 # Graphics support
 #
-# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 # CONFIG_FB is not set
 
 #
@@ -1114,7 +1133,6 @@ CONFIG_VGACON_SOFT_SCROLLBACK=y
 CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256
 CONFIG_VIDEO_SELECT=y
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -1130,9 +1148,8 @@ CONFIG_SOUND=y
 # Open Sound System
 #
 CONFIG_SOUND_PRIME=y
-CONFIG_OBSOLETE_OSS=y
+# CONFIG_OBSOLETE_OSS is not set
 # CONFIG_SOUND_BT878 is not set
-# CONFIG_SOUND_ES1371 is not set
 CONFIG_SOUND_ICH=y
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
@@ -1263,6 +1280,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -1273,6 +1291,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1538,6 +1557,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
@@ -1556,6 +1576,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
 # CONFIG_DEBUG_RODATA is not set
 # CONFIG_IOMMU_DEBUG is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
index eda7a0d4dc15c8050c65bcb3b2c1d81369115435..796df6992f6217db4af2f98a2e0642b0cacd50cc 100644 (file)
@@ -560,7 +560,7 @@ ia32_sys_call_table:
        .quad sys_sched_yield
        .quad sys_sched_get_priority_max
        .quad sys_sched_get_priority_min  /* 160 */
-       .quad sys_sched_rr_get_interval
+       .quad sys32_sched_rr_get_interval
        .quad compat_sys_nanosleep
        .quad sys_mremap
        .quad sys_setresuid16
index ced15d06f0f3b9359d7e3d6edcdf175256d15266..40acb67fb882a4d3b6d4cdca9d4b22cc78ae4402 100644 (file)
@@ -75,6 +75,7 @@ config X86_ACPI_CPUFREQ_PROC_INTF
 config X86_P4_CLOCKMOD
        tristate "Intel Pentium 4 clock modulation"
        depends on EMBEDDED
+       select CPU_FREQ_TABLE
        help
          This adds the clock modulation driver for Intel Pentium 4 / XEON
          processors.  When enabled it will lower CPU temperature by skipping
index 4651fd22b213bf047e7e9ffd9bf904ddeb4d1cd4..a490fabfcf475f50135e35c346e922822c08b126 100644 (file)
@@ -662,7 +662,7 @@ static int __init parse_memmap_opt(char *p)
 }
 early_param("memmap", parse_memmap_opt);
 
-void finish_e820_parsing(void)
+void __init finish_e820_parsing(void)
 {
        if (userdef) {
                printk(KERN_INFO "user-defined physical RAM map:\n");
index dec587b293bfcf9ccfed71798279fdd8408c9a9f..148c6bcf5bb41c06ae2c4d1108429c88d33cbb56 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/proto.h>
 #include <asm/dma.h>
 
-static void via_bugs(void)
+static void __init via_bugs(void)
 {
 #ifdef CONFIG_IOMMU
        if ((end_pfn > MAX_DMA32_PFN ||  force_iommu) &&
@@ -36,7 +36,7 @@ static int __init nvidia_hpet_check(struct acpi_table_header *header)
 }
 #endif
 
-static void nvidia_bugs(void)
+static void __init nvidia_bugs(void)
 {
 #ifdef CONFIG_ACPI
        /*
@@ -62,7 +62,7 @@ static void nvidia_bugs(void)
 
 }
 
-static void ati_bugs(void)
+static void __init ati_bugs(void)
 {
        if (timer_over_8254 == 1) {
                timer_over_8254 = 0;
@@ -88,7 +88,7 @@ struct chipset {
        void (*f)(void);
 };
 
-static struct chipset early_qrk[] = {
+static struct __initdata chipset early_qrk[] = {
        { PCI_VENDOR_ID_NVIDIA, nvidia_bugs },
        { PCI_VENDOR_ID_VIA, via_bugs },
        { PCI_VENDOR_ID_ATI, ati_bugs },
index 50dd8bef850e92b1bc3451c17ab5ee17b1603760..455aa0b932f0fd05b5b98908daef2b8cca674d44 100644 (file)
@@ -60,9 +60,9 @@ unsigned long mp_lapic_addr = 0;
 /* Processor that is doing the boot up */
 unsigned int boot_cpu_id = -1U;
 /* Internal processor count */
-unsigned int num_processors __initdata = 0;
+unsigned int num_processors __cpuinitdata = 0;
 
-unsigned disabled_cpus __initdata;
+unsigned disabled_cpus __cpuinitdata;
 
 /* Bitmask of physically existing CPUs */
 physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
index 030eb3753358146c207f99864225cd88020137ba..2bac8c60ad61e1d5f60ea9b90183af3039a88b7f 100644 (file)
@@ -675,7 +675,7 @@ void __init gart_iommu_init(void)
        dma_ops = &gart_dma_ops;
 } 
 
-void gart_parse_options(char *p)
+void __init gart_parse_options(char *p)
 {
        int arg;
 
index cbbc6adc1a92004c902954f10777528f6b964178..d8d5ccc245c8977eaa1c616b9301df058661d386 100644 (file)
@@ -382,14 +382,17 @@ void exit_thread(void)
 void flush_thread(void)
 {
        struct task_struct *tsk = current;
-       struct thread_info *t = current_thread_info();
 
-       if (t->flags & _TIF_ABI_PENDING) {
-               t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
-               if (t->flags & _TIF_IA32)
+       if (test_tsk_thread_flag(tsk, TIF_ABI_PENDING)) {
+               clear_tsk_thread_flag(tsk, TIF_ABI_PENDING);
+               if (test_tsk_thread_flag(tsk, TIF_IA32)) {
+                       clear_tsk_thread_flag(tsk, TIF_IA32);
+               } else {
+                       set_tsk_thread_flag(tsk, TIF_IA32);
                        current_thread_info()->status |= TS_COMPAT;
+               }
        }
-       t->flags &= ~_TIF_DEBUG;
+       clear_tsk_thread_flag(tsk, TIF_DEBUG);
 
        tsk->thread.debugreg0 = 0;
        tsk->thread.debugreg1 = 0;
index 0dffae69f4ad89a52e0deb67688d1648f3f32c21..77c25b307635f6c521506b04f51d728ff7ac1b13 100644 (file)
@@ -59,3 +59,4 @@ EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(init_level4_pgt);
 EXPORT_SYMBOL(load_gs_index);
 
+EXPORT_SYMBOL(_proxy_pda);
index 3a799b9b5df572da85d5bba7573bd798f1b0a9d0..cae786ca8600edf12d26042b02c66a236a5a52ff 100644 (file)
@@ -196,11 +196,15 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                notify_info->notify.value = (u16) notify_value;
                notify_info->notify.handler_obj = handler_obj;
 
-               acpi_ex_relinquish_interpreter();
+               acpi_ex_exit_interpreter();
 
                acpi_ev_notify_dispatch(notify_info);
 
-               acpi_ex_reacquire_interpreter();
+               status = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status)) {
+                       return_ACPI_STATUS(status);
+               }
+
        }
 
        if (!handler_obj) {
index e99f0c435a4724006c9d204c69349733b91d763f..96b0e84317482ed67d8ecdd493d678986cf1d6c9 100644 (file)
@@ -291,6 +291,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                               u32 bit_width, acpi_integer * value)
 {
        acpi_status status;
+       acpi_status status2;
        acpi_adr_space_handler handler;
        acpi_adr_space_setup region_setup;
        union acpi_operand_object *handler_desc;
@@ -344,7 +345,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * setup will potentially execute control methods
                 * (e.g., _REG method for this region)
                 */
-               acpi_ex_relinquish_interpreter();
+               acpi_ex_exit_interpreter();
 
                status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
                                      handler_desc->address_space.context,
@@ -352,7 +353,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 
                /* Re-enter the interpreter */
 
-               acpi_ex_reacquire_interpreter();
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status2)) {
+                       return_ACPI_STATUS(status2);
+               }
 
                /* Check for failure of the Region Setup */
 
@@ -405,7 +409,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * exit the interpreter because the handler *might* block -- we don't
                 * know what it will do, so we can't hold the lock on the intepreter.
                 */
-               acpi_ex_relinquish_interpreter();
+               acpi_ex_exit_interpreter();
        }
 
        /* Call the handler */
@@ -426,7 +430,10 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * We just returned from a non-default handler, we must re-enter the
                 * interpreter
                 */
-               acpi_ex_reacquire_interpreter();
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status2)) {
+                       return_ACPI_STATUS(status2);
+               }
        }
 
        return_ACPI_STATUS(status);
index 685a103a35873ee920e3d8e1c7783bed2b3ce1fd..a3379bafa676dc7da65fd71aeed1db5091ad7de7 100644 (file)
@@ -768,9 +768,11 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
                return (AE_BAD_PARAMETER);
        }
 
-       /* Must lock interpreter to prevent race conditions */
+       status = acpi_ex_enter_interpreter();
+       if (ACPI_FAILURE(status)) {
+               return (status);
+       }
 
-       acpi_ex_enter_interpreter();
        status = acpi_ev_acquire_global_lock(timeout);
        acpi_ex_exit_interpreter();
 
index 7c38528a7e8336ef1ec3c57b2bc5c7741438281f..ae97812681a3ee7fa9ce448aadc0baaea51f7b39 100644 (file)
@@ -583,7 +583,10 @@ acpi_ex_create_method(u8 * aml_start,
         * Get the sync_level. If method is serialized, a mutex will be
         * created for this method when it is parsed.
         */
-       if (method_flags & AML_METHOD_SERIALIZED) {
+       if (acpi_gbl_all_methods_serialized) {
+               obj_desc->method.sync_level = 0;
+               obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
+       } else if (method_flags & AML_METHOD_SERIALIZED) {
                /*
                 * ACPI 1.0: sync_level = 0
                 * ACPI 2.0: sync_level = sync_level in method declaration
index 9460baff30328f4c5565e2c5d671eabfdf4f634c..b2edf620ba8968d1086dfe1938be8727a8d1580e 100644 (file)
@@ -66,6 +66,7 @@ ACPI_MODULE_NAME("exsystem")
 acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 {
        acpi_status status;
+       acpi_status status2;
 
        ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
 
@@ -78,7 +79,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 
                /* We must wait, so unlock the interpreter */
 
-               acpi_ex_relinquish_interpreter();
+               acpi_ex_exit_interpreter();
 
                status = acpi_os_wait_semaphore(semaphore, 1, timeout);
 
@@ -88,7 +89,13 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 
                /* Reacquire the interpreter */
 
-               acpi_ex_reacquire_interpreter();
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status2)) {
+
+                       /* Report fatal error, could not acquire interpreter */
+
+                       return_ACPI_STATUS(status2);
+               }
        }
 
        return_ACPI_STATUS(status);
@@ -112,6 +119,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 {
        acpi_status status;
+       acpi_status status2;
 
        ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
 
@@ -124,7 +132,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 
                /* We must wait, so unlock the interpreter */
 
-               acpi_ex_relinquish_interpreter();
+               acpi_ex_exit_interpreter();
 
                status = acpi_os_acquire_mutex(mutex, timeout);
 
@@ -134,7 +142,13 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 
                /* Reacquire the interpreter */
 
-               acpi_ex_reacquire_interpreter();
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status2)) {
+
+                       /* Report fatal error, could not acquire interpreter */
+
+                       return_ACPI_STATUS(status2);
+               }
        }
 
        return_ACPI_STATUS(status);
@@ -195,18 +209,20 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
 
 acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
 {
+       acpi_status status;
+
        ACPI_FUNCTION_ENTRY();
 
        /* Since this thread will sleep, we must release the interpreter */
 
-       acpi_ex_relinquish_interpreter();
+       acpi_ex_exit_interpreter();
 
        acpi_os_sleep(how_long);
 
        /* And now we must get the interpreter again */
 
-       acpi_ex_reacquire_interpreter();
-       return (AE_OK);
+       status = acpi_ex_enter_interpreter();
+       return (status);
 }
 
 /*******************************************************************************
index 6b0aeccbb69b3f59738d5a9dd22fe875a1a2d018..aea461f3a48cc02ab7269c8e7e7e9807657edefc 100644 (file)
@@ -76,15 +76,14 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base);
  *
  * PARAMETERS:  None
  *
- * RETURN:      None
+ * RETURN:      Status
  *
- * DESCRIPTION: Enter the interpreter execution region. Failure to enter
- *              the interpreter region is a fatal system error. Used in
- *              conjunction with exit_interpreter.
+ * DESCRIPTION: Enter the interpreter execution region.  Failure to enter
+ *              the interpreter region is a fatal system error
  *
  ******************************************************************************/
 
-void acpi_ex_enter_interpreter(void)
+acpi_status acpi_ex_enter_interpreter(void)
 {
        acpi_status status;
 
@@ -92,42 +91,10 @@ void acpi_ex_enter_interpreter(void)
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO,
-                           "Could not acquire AML Interpreter mutex"));
+               ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
        }
 
-       return_VOID;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ex_reacquire_interpreter
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Reacquire the interpreter execution region from within the
- *              interpreter code. Failure to enter the interpreter region is a
- *              fatal system error. Used in  conjuction with
- *              relinquish_interpreter
- *
- ******************************************************************************/
-
-void acpi_ex_reacquire_interpreter(void)
-{
-       ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
-
-       /*
-        * If the global serialized flag is set, do not release the interpreter,
-        * since it was not actually released by acpi_ex_relinquish_interpreter.
-        * This forces the interpreter to be single threaded.
-        */
-       if (!acpi_gbl_all_methods_serialized) {
-               acpi_ex_enter_interpreter();
-       }
-
-       return_VOID;
+       return_ACPI_STATUS(status);
 }
 
 /*******************************************************************************
@@ -138,9 +105,17 @@ void acpi_ex_reacquire_interpreter(void)
  *
  * RETURN:      None
  *
- * DESCRIPTION: Exit the interpreter execution region. This is the top level
- *              routine used to exit the interpreter when all processing has
- *              been completed.
+ * DESCRIPTION: Exit the interpreter execution region
+ *
+ * Cases where the interpreter is unlocked:
+ *      1) Completion of the execution of a control method
+ *      2) Method blocked on a Sleep() AML opcode
+ *      3) Method blocked on an Acquire() AML opcode
+ *      4) Method blocked on a Wait() AML opcode
+ *      5) Method blocked to acquire the global lock
+ *      6) Method blocked to execute a serialized control method that is
+ *          already executing
+ *      7) About to invoke a user-installed opregion handler
  *
  ******************************************************************************/
 
@@ -152,46 +127,7 @@ void acpi_ex_exit_interpreter(void)
 
        status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO,
-                           "Could not release AML Interpreter mutex"));
-       }
-
-       return_VOID;
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ex_relinquish_interpreter
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Exit the interpreter execution region, from within the
- *              interpreter - before attempting an operation that will possibly
- *              block the running thread.
- *
- * Cases where the interpreter is unlocked internally
- *      1) Method to be blocked on a Sleep() AML opcode
- *      2) Method to be blocked on an Acquire() AML opcode
- *      3) Method to be blocked on a Wait() AML opcode
- *      4) Method to be blocked to acquire the global lock
- *      5) Method to be blocked waiting to execute a serialized control method
- *          that is currently executing
- *      6) About to invoke a user-installed opregion handler
- *
- ******************************************************************************/
-
-void acpi_ex_relinquish_interpreter(void)
-{
-       ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
-
-       /*
-        * If the global serialized flag is set, do not release the interpreter.
-        * This forces the interpreter to be single threaded.
-        */
-       if (!acpi_gbl_all_methods_serialized) {
-               acpi_ex_exit_interpreter();
+               ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
        }
 
        return_VOID;
@@ -205,8 +141,8 @@ void acpi_ex_relinquish_interpreter(void)
  *
  * RETURN:      none
  *
- * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
- *              32-bit, as determined by the revision of the DSDT.
+ * DESCRIPTION: Truncate a number to 32-bits if the currently executing method
+ *              belongs to a 32-bit ACPI table.
  *
  ******************************************************************************/
 
index 8fa93125fd4c94af822bf9b6dd1863511de16b7a..c84b1faba28cf3900001c78f2b0700975faf4d61 100644 (file)
@@ -300,6 +300,11 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
        /*
         * 2) Enable all wakeup GPEs
         */
+       status = acpi_hw_disable_all_gpes();
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
        acpi_gbl_system_awake_and_running = FALSE;
 
        status = acpi_hw_enable_all_wakeup_gpes();
index 36901362fd24418917ab0727f1450bd217d58967..dc1096608f4363bf0dd32312c55925b4fe168452 100644 (file)
@@ -2507,7 +2507,7 @@ static int __init setup_notify(struct ibm_struct *ibm)
        ret = acpi_bus_get_device(*ibm->handle, &ibm->device);
        if (ret < 0) {
                printk(IBM_ERR "%s device not present\n", ibm->name);
-               return 0;
+               return -ENODEV;
        }
 
        acpi_driver_data(ibm->device) = ibm;
@@ -2516,8 +2516,13 @@ static int __init setup_notify(struct ibm_struct *ibm)
        status = acpi_install_notify_handler(*ibm->handle, ibm->type,
                                             dispatch_notify, ibm);
        if (ACPI_FAILURE(status)) {
-               printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n",
-                      ibm->name, status);
+               if (status == AE_ALREADY_EXISTS) {
+                       printk(IBM_NOTICE "another device driver is already handling %s events\n",
+                               ibm->name);
+               } else {
+                       printk(IBM_ERR "acpi_install_notify_handler(%s) failed: %d\n",
+                               ibm->name, status);
+               }
                return -ENODEV;
        }
        ibm->notify_installed = 1;
@@ -2553,6 +2558,8 @@ static int __init register_driver(struct ibm_struct *ibm)
        return ret;
 }
 
+static void ibm_exit(struct ibm_struct *ibm);
+
 static int __init ibm_init(struct ibm_struct *ibm)
 {
        int ret;
@@ -2594,6 +2601,12 @@ static int __init ibm_init(struct ibm_struct *ibm)
 
        if (ibm->notify) {
                ret = setup_notify(ibm);
+               if (ret == -ENODEV) {
+                       printk(IBM_NOTICE "disabling subdriver %s\n",
+                               ibm->name);
+                       ibm_exit(ibm);
+                       return 0;
+               }
                if (ret < 0)
                        return ret;
        }
index aa6370c67ec1628fd055186a630779109741ad42..26fd0dd6953dc7be4792610f8e662276b46d6124 100644 (file)
@@ -154,7 +154,11 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
                 * Execute the method via the interpreter. The interpreter is locked
                 * here before calling into the AML parser
                 */
-               acpi_ex_enter_interpreter();
+               status = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status)) {
+                       return_ACPI_STATUS(status);
+               }
+
                status = acpi_ps_execute_method(info);
                acpi_ex_exit_interpreter();
        } else {
@@ -178,7 +182,10 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
                 * resolution, we must lock it because we could access an opregion.
                 * The opregion access code assumes that the interpreter is locked.
                 */
-               acpi_ex_enter_interpreter();
+               status = acpi_ex_enter_interpreter();
+               if (ACPI_FAILURE(status)) {
+                       return_ACPI_STATUS(status);
+               }
 
                /* Function has a strange interface */
 
index 33db2241044e5930430c5091f6580c9013721f15..c4ab615f77fea6a133f2f1cf9865217e9d02b0d5 100644 (file)
@@ -214,7 +214,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
                        u32 level, void *context, void **return_value)
 {
        acpi_object_type type;
-       acpi_status status = AE_OK;
+       acpi_status status;
        struct acpi_init_walk_info *info =
            (struct acpi_init_walk_info *)context;
        struct acpi_namespace_node *node =
@@ -268,7 +268,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
        /*
         * Must lock the interpreter before executing AML code
         */
-       acpi_ex_enter_interpreter();
+       status = acpi_ex_enter_interpreter();
+       if (ACPI_FAILURE(status)) {
+               return (status);
+       }
 
        /*
         * Each of these types can contain executable AML code within the
index 7ac6ace5005905f1fa191bbc13dd679311c9e6d4..8904d0fae6a2ff90794389456b6f62420c5410d3 100644 (file)
@@ -170,6 +170,7 @@ acpi_evaluate_object(acpi_handle handle,
                     struct acpi_buffer *return_buffer)
 {
        acpi_status status;
+       acpi_status status2;
        struct acpi_evaluate_info *info;
        acpi_size buffer_space_needed;
        u32 i;
@@ -328,12 +329,14 @@ acpi_evaluate_object(acpi_handle handle,
                 * Delete the internal return object. NOTE: Interpreter must be
                 * locked to avoid race condition.
                 */
-               acpi_ex_enter_interpreter();
+               status2 = acpi_ex_enter_interpreter();
+               if (ACPI_SUCCESS(status2)) {
 
-               /* Remove one reference on the return object (should delete it) */
+                       /* Remove one reference on the return object (should delete it) */
 
-               acpi_ut_remove_reference(info->return_object);
-               acpi_ex_exit_interpreter();
+                       acpi_ut_remove_reference(info->return_object);
+                       acpi_ex_exit_interpreter();
+               }
        }
 
       cleanup:
index 849e2c361804bd91fbba7279e149469e1848f56f..96792a6cc164188533d32d316c0282389688623b 100644 (file)
@@ -42,7 +42,9 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
 
 static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata;
 
-void acpi_table_print_madt_entry(struct acpi_subtable_header * header)
+static int acpi_apic_instance __initdata = 2;
+
+void acpi_table_print_madt_entry(struct acpi_subtable_header *header)
 {
        if (!header)
                return;
@@ -183,8 +185,10 @@ acpi_table_parse_entries(char *id,
        if (!handler)
                return -EINVAL;
 
-       /* Locate the table (if exists). There should only be one. */
-       acpi_get_table(id, 0, &table_header);
+       if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
+               acpi_get_table(id, acpi_apic_instance, &table_header);
+       else
+               acpi_get_table(id, 0, &table_header);
 
        if (!table_header) {
                printk(KERN_WARNING PREFIX "%4.4s not present\n", id);
@@ -237,10 +241,15 @@ acpi_table_parse_madt(enum acpi_madt_type id,
 int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
        struct acpi_table_header *table = NULL;
+
        if (!handler)
                return -EINVAL;
 
-       acpi_get_table(id, 0, &table);
+       if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
+               acpi_get_table(id, acpi_apic_instance, &table);
+       else
+               acpi_get_table(id, 0, &table);
+
        if (table) {
                handler(table);
                return 0;
@@ -248,6 +257,31 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
                return 1;
 }
 
+/* 
+ * The BIOS is supposed to supply a single APIC/MADT,
+ * but some report two.  Provide a knob to use either.
+ * (don't you wish instance 0 and 1 were not the same?)
+ */
+static void __init check_multiple_madt(void)
+{
+       struct acpi_table_header *table = NULL;
+
+       acpi_get_table(ACPI_SIG_MADT, 2, &table);
+       if (table) {
+               printk(KERN_WARNING PREFIX
+                      "BIOS bug: multiple APIC/MADT found,"
+                      " using %d\n", acpi_apic_instance);
+               printk(KERN_WARNING PREFIX
+                      "If \"acpi_apic_instance=%d\" works better, "
+                      "notify linux-acpi@vger.kernel.org\n",
+                      acpi_apic_instance ? 0 : 2);
+
+       } else
+               acpi_apic_instance = 0;
+
+       return;
+}
+
 /*
  * acpi_table_init()
  *
@@ -257,9 +291,22 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
  * result: sdt_entry[] is initialized
  */
 
-
 int __init acpi_table_init(void)
 {
        acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
+       check_multiple_madt();
+       return 0;
+}
+
+static int __init acpi_parse_apic_instance(char *str)
+{
+
+       acpi_apic_instance = simple_strtoul(str, NULL, 0);
+
+       printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n",
+              acpi_apic_instance);
+
        return 0;
 }
+
+early_param("acpi_apic_instance", acpi_parse_apic_instance);
index d16b5b0c8b76b5d0bcacb9fbf5348e33e94492b2..7bdbe5a914d0ce78f34d10325ce0e9eba31fb126 100644 (file)
@@ -564,7 +564,7 @@ config PATA_IXP4XX_CF
 
 config PATA_SCC
        tristate "Toshiba's Cell Reference Set IDE support"
-       depends on PCI && PPC_IBM_CELL_BLADE
+       depends on PCI && PPC_CELLEB
        help
          This option enables support for the built-in IDE controller on
          Toshiba Cell Reference Board.
index 3c1f8830ac8bf7dedef3d44b049beefcf695e811..bf327d473ce9053f81f7614a923b74611597735d 100644 (file)
@@ -826,7 +826,7 @@ static u64 ata_id_n_sectors(const u16 *id)
 /**
  *     ata_id_to_dma_mode      -       Identify DMA mode from id block
  *     @dev: device to identify
- *     @mode: mode to assume if we cannot tell
+ *     @unknown: mode to assume if we cannot tell
  *
  *     Set up the timing values for the device based upon the identify
  *     reported values for the DMA mode. This function is used by drivers
index 7349c3dbf774e672bfbcc8ce1ab5e8d6f2ac5ce0..361953a502035e4c846196f05ad3ad256ac6220b 100644 (file)
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
                rc = prereset(ap);
                if (rc) {
                        if (rc == -ENOENT) {
-                               ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n");
+                               ata_port_printk(ap, KERN_DEBUG,
+                                               "port disabled. ignoring.\n");
                                ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
+
+                               for (i = 0; i < ATA_MAX_DEVICES; i++)
+                                       classes[i] = ATA_DEV_NONE;
+
+                               rc = 0;
                        } else
                                ata_port_printk(ap, KERN_ERR,
                                        "prereset failed (errno=%d)\n", rc);
index 9a0523b5c947ce6c73c1b17d5c49ad51c91f2518..c6f0e192755156523ccb3cb93cf84e656c2833fe 100644 (file)
@@ -193,7 +193,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq)
-               set_irq_type(irq, IRQT_HIGH);
+               set_irq_type(irq, IRQT_RISING);
 
        /* Setup expansion bus chip selects */
        *data->cs0_cfg = data->cs0_bits;
@@ -232,7 +232,6 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev)
        struct ata_host *host = platform_get_drvdata(dev);
 
        ata_host_detach(host);
-       platform_set_drvdata(dev, NULL);
 
        return 0;
 }
index 3193a603d1a159cb99b59e9f7bb705f765d28bda..1e21688bfcf2f4992fd493de5299e5beb679b7c7 100644 (file)
@@ -672,10 +672,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (rc)
                return rc;
 
-       rc = pci_request_regions(pdev, DRV_NAME);
-       if (rc)
-               return rc;
-
        rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
        if (rc)
                return rc;
index 75d961599651b8198b9e4eb6b613cdf3d6cb00d4..5614df8c1ce2809bed166aa3b0f70d63e112819f 100644 (file)
@@ -346,6 +346,7 @@ static const struct pci_device_id sil24_pci_tbl[] = {
        { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 },
        { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 },
        { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 },
+       { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 },
        { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 },
        { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 },
 
index 5f4fdcf7c96e50124404e3e1fa16963bf9da9480..1f0962616ee509b2e53f996619191a933b3702dc 100644 (file)
@@ -11,9 +11,6 @@
  *       March 2001: Ported from 2.0.34  by Liam Davies
  *
  */
-
-#define RTC_IO_EXTENT  0x10    /*Only really two ports, but... */
-
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
@@ -32,8 +29,6 @@
 
 #include "lcd.h"
 
-static DEFINE_SPINLOCK(lcd_lock);
-
 static int lcd_ioctl(struct inode *inode, struct file *file,
                     unsigned int cmd, unsigned long arg);
 
index e453268566805238288ba64f96e1c5da0f8a1ba3..7a32df59490750775b6df3b718e0b33be2ee8514 100644 (file)
@@ -1376,6 +1376,8 @@ static void do_tty_hangup(struct work_struct *work)
        read_unlock(&tasklist_lock);
 
        tty->flags = 0;
+       put_pid(tty->session);
+       put_pid(tty->pgrp);
        tty->session = NULL;
        tty->pgrp = NULL;
        tty->ctrl_status = 0;
@@ -3841,6 +3843,9 @@ static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tt
 {
        struct pid *old_pgrp;
        if (tty) {
+               /* We should not have a session or pgrp to here but.... */
+               put_pid(tty->session);
+               put_pid(tty->pgrp);
                tty->session = get_pid(task_session(tsk));
                tty->pgrp = get_pid(task_pgrp(tsk));
        }
index c3f8e383933bbb957ffd2f50982558eb5cf08b81..1bbb45b937fd2abbfe028ab47807d49384ee0419 100644 (file)
@@ -724,6 +724,7 @@ int vc_allocate(unsigned int currcons)      /* return 0 on success */
                return -ENOMEM;
            memset(vc, 0, sizeof(*vc));
            vc_cons[currcons].d = vc;
+           INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
            visual_init(vc, currcons, 1);
            if (!*vc->vc_uni_pagedir_loc)
                con_set_default_unimap(vc);
@@ -2185,10 +2186,28 @@ static void console_callback(struct work_struct *ignored)
        release_console_sem();
 }
 
-void set_console(int nr)
+int set_console(int nr)
 {
+       struct vc_data *vc = vc_cons[fg_console].d;
+
+       if (!vc_cons_allocated(nr) || vt_dont_switch ||
+               (vc->vt_mode.mode == VT_AUTO && vc->vc_mode == KD_GRAPHICS)) {
+
+               /*
+                * Console switch will fail in console_callback() or
+                * change_console() so there is no point scheduling
+                * the callback
+                *
+                * Existing set_console() users don't check the return
+                * value so this shouldn't break anything
+                */
+               return -EINVAL;
+       }
+
        want_console = nr;
        schedule_console_callback();
+
+       return 0;
 }
 
 struct tty_driver *console_driver;
index 3a5d301e783b062617f3e7043b42670e33ca2be2..1fa2da8f4fbe02596ac3df45819b25fe4b62bc24 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/kbd_diacr.h>
 #include <linux/selection.h>
 
-static char vt_dont_switch;
+char vt_dont_switch;
 extern struct tty_driver *console_driver;
 
 #define VT_IS_IN_USE(i)        (console_driver->ttys[i] && console_driver->ttys[i]->count)
index 81fb3dec180f5be0b5076568b3c140caa6393d4f..76c7fa37fa6c8abdb515bc93beedabbc057687b8 100644 (file)
@@ -314,21 +314,21 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
-       switch(cmd){
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
-                               return -EFAULT;
-                       break;
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
+                       return -EFAULT;
+               break;
 
-               case WDIOC_GETSTATUS:
-                       return put_user(0, p);
+       case WDIOC_GETSTATUS:
+               return put_user(0, p);
 
-               case WDIOC_KEEPALIVE:
-                       zf_ping(NULL);
-                       break;
+       case WDIOC_KEEPALIVE:
+               zf_ping(0);
+               break;
 
-               default:
-                       return -ENOTTY;
+       default:
+               return -ENOTTY;
        }
 
        return 0;
index 15278044295cbf38559c7a5d0410f3aa1873b29e..322ee2984e3d0108302764832fabce469dfaeb4c 100644 (file)
@@ -176,6 +176,7 @@ void dma_chan_cleanup(struct kref *kref)
        chan->client = NULL;
        kref_put(&chan->device->refcount, dma_async_device_cleanup);
 }
+EXPORT_SYMBOL(dma_chan_cleanup);
 
 static void dma_chan_free_rcu(struct rcu_head *rcu)
 {
@@ -261,6 +262,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback)
 
        return client;
 }
+EXPORT_SYMBOL(dma_async_client_register);
 
 /**
  * dma_async_client_unregister - unregister a client and free the &dma_client
@@ -287,6 +289,7 @@ void dma_async_client_unregister(struct dma_client *client)
        kfree(client);
        dma_chans_rebalance();
 }
+EXPORT_SYMBOL(dma_async_client_unregister);
 
 /**
  * dma_async_client_chan_request - request DMA channels
@@ -304,6 +307,7 @@ void dma_async_client_chan_request(struct dma_client *client,
        client->chans_desired = number;
        dma_chans_rebalance();
 }
+EXPORT_SYMBOL(dma_async_client_chan_request);
 
 /**
  * dma_async_device_register - registers DMA devices found
@@ -346,6 +350,7 @@ int dma_async_device_register(struct dma_device *device)
 
        return 0;
 }
+EXPORT_SYMBOL(dma_async_device_register);
 
 /**
  * dma_async_device_cleanup - function called when all references are released
@@ -390,23 +395,12 @@ void dma_async_device_unregister(struct dma_device *device)
        kref_put(&device->refcount, dma_async_device_cleanup);
        wait_for_completion(&device->done);
 }
+EXPORT_SYMBOL(dma_async_device_unregister);
 
 static int __init dma_bus_init(void)
 {
        mutex_init(&dma_list_mutex);
        return class_register(&dma_devclass);
 }
-
 subsys_initcall(dma_bus_init);
 
-EXPORT_SYMBOL(dma_async_client_register);
-EXPORT_SYMBOL(dma_async_client_unregister);
-EXPORT_SYMBOL(dma_async_client_chan_request);
-EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf);
-EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg);
-EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg);
-EXPORT_SYMBOL(dma_async_memcpy_complete);
-EXPORT_SYMBOL(dma_async_memcpy_issue_pending);
-EXPORT_SYMBOL(dma_async_device_register);
-EXPORT_SYMBOL(dma_async_device_unregister);
-EXPORT_SYMBOL(dma_chan_cleanup);
index c3d4856fb61805cbd9217e3a0bd84ee7cc4ceb24..6d105a1d41b17976d92aead0e127698d548ec2aa 100644 (file)
@@ -527,6 +527,7 @@ config SENSORS_W83792D
 config SENSORS_W83793
        tristate "Winbond W83793"
        depends on HWMON && I2C && EXPERIMENTAL
+       select HWMON_VID
        help
          If you say yes here you get support for the Winbond W83793
          hardware monitoring chip.
index 3f76987d818af376d9912f0614b00d6e797c190a..8f1fd017679b4201daafd858d3708fc171097903 100644 (file)
@@ -434,24 +434,8 @@ config BLK_DEV_IDEDMA_FORCED
 
          Generally say N here.
 
-config IDEDMA_PCI_AUTO
-       bool "Use PCI DMA by default when available"
-       ---help---
-         Prior to kernel version 2.1.112, Linux used to automatically use
-         DMA for IDE drives and chipsets which support it. Due to concerns
-         about a couple of cases where buggy hardware may have caused damage,
-         the default is now to NOT use DMA automatically. To revert to the
-         previous behaviour, say Y to this question.
-
-         If you suspect your hardware is at all flakey, say N here.
-         Do NOT email the IDE kernel people regarding this issue!
-
-         It is normally safe to answer Y to this question unless your
-         motherboard uses a VIA VP2 chipset, in which case you should say N.
-
 config IDEDMA_ONLYDISK
        bool "Enable DMA only for disks "
-       depends on IDEDMA_PCI_AUTO
        help
          This is used if you know your ATAPI Devices are going to fail DMA
          Transfers.
@@ -769,6 +753,14 @@ config BLK_DEV_TC86C001
        help
        This driver adds support for Toshiba TC86C001 GOKU-S chip.
 
+config BLK_DEV_CELLEB
+       tristate "Toshiba's Cell Reference Set IDE support"
+       depends on PPC_CELLEB
+       help
+         This driver provides support for the built-in IDE controller on
+         Toshiba Cell Reference Board.
+         If unsure, say Y.
+
 endif
 
 config BLK_DEV_IDE_PMAC
@@ -800,14 +792,6 @@ config BLK_DEV_IDEDMA_PMAC
          to transfer data to and from memory.  Saying Y is safe and improves
          performance.
 
-config BLK_DEV_IDE_CELLEB
-       bool "Toshiba's Cell Reference Set IDE support"
-       depends on PPC_CELLEB && IDE=y
-       help
-         This driver provides support for the built-in IDE controller on
-         Toshiba Cell Reference Board.
-         If unsure, say Y.
-
 config BLK_DEV_IDE_SWARM
        tristate "IDE for Sibyte evaluation boards"
        depends on SIBYTE_SB1xxx_SOC
@@ -851,19 +835,6 @@ config BLK_DEV_IDEDMA_ICS
          Say Y here if you want to add DMA (Direct Memory Access) support to
          the ICS IDE driver.
 
-config IDEDMA_ICS_AUTO
-       bool "Use ICS DMA by default"
-       depends on BLK_DEV_IDEDMA_ICS
-       help
-         Prior to kernel version 2.1.112, Linux used to automatically use
-         DMA for IDE drives and chipsets which support it. Due to concerns
-         about a couple of cases where buggy hardware may have caused damage,
-         the default is now to NOT use DMA automatically. To revert to the
-         previous behaviour, say Y to this question.
-
-         If you suspect your hardware is at all flakey, say N here.
-         Do NOT email the IDE kernel people regarding this issue!
-
 config BLK_DEV_IDE_RAPIDE
        tristate "RapIDE interface support"
        depends on ARM && ARCH_ACORN
@@ -1086,9 +1057,6 @@ config IDEDMA_IVB
 
          It is normally safe to answer Y; however, the default is N.
 
-config IDEDMA_AUTO
-       def_bool IDEDMA_PCI_AUTO || IDEDMA_ICS_AUTO
-
 endif
 
 config BLK_DEV_HD_ONLY
index 28feedfbd21dda41123e8c6066bcdfa47e1b477f..d9f029e8ff7411cdb5827d5ed889bcbd5847402d 100644 (file)
@@ -37,7 +37,6 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE)     += legacy/q40ide.o
 # built-in only drivers from ppc/
 ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE)  += ppc/mpc8xx.o
 ide-core-$(CONFIG_BLK_DEV_IDE_PMAC)    += ppc/pmac.o
-ide-core-$(CONFIG_BLK_DEV_IDE_CELLEB)  += ppc/scc_pata.o
 
 # built-in only drivers from h8300/
 ide-core-$(CONFIG_H8300)               += h8300/ide-h8300.o
index 40e5c66b81ce58fea8c22c5d74b2d060cfc1c35c..e2953fc1fafbc175bb87bac04e9acf94a28944e2 100644 (file)
@@ -196,11 +196,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask)
 }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_ICS
-
-#ifndef CONFIG_IDEDMA_ICS_AUTO
-#warning CONFIG_IDEDMA_ICS_AUTO=n support is obsolete, and will be removed soon.
-#endif
-
 /*
  * SG-DMA support.
  *
@@ -474,12 +469,6 @@ static int icside_dma_lostirq(ide_drive_t *drive)
 
 static void icside_dma_init(ide_hwif_t *hwif)
 {
-       int autodma = 0;
-
-#ifdef CONFIG_IDEDMA_ICS_AUTO
-       autodma = 1;
-#endif
-
        printk("    %s: SG-DMA", hwif->name);
 
        hwif->atapi_dma         = 1;
@@ -489,7 +478,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
        hwif->dmatable_cpu      = NULL;
        hwif->dmatable_dma      = 0;
        hwif->speedproc         = icside_set_speed;
-       hwif->autodma           = autodma;
+       hwif->autodma           = 1;
 
        hwif->ide_dma_check     = icside_dma_check;
        hwif->dma_host_off      = icside_dma_host_off;
index 08e7cd043bccc9f9a7937276431f25130b3d7509..fd213088b06b4a467afc8222a87fd634f100cfe3 100644 (file)
@@ -767,7 +767,7 @@ int ide_set_dma(ide_drive_t *drive)
        switch(rc) {
        case -1: /* DMA needs to be disabled */
                hwif->dma_off_quietly(drive);
-               return 0;
+               return -1;
        case  0: /* DMA needs to be enabled */
                return hwif->ide_dma_on(drive);
        case  1: /* DMA setting cannot be changed */
index dfbd7445852234dff93f9e30534cac343afb72db..695610f0e3e4b4eaa49cfc024e6e07694fae15c5 100644 (file)
@@ -177,11 +177,7 @@ DECLARE_MUTEX(ide_cfg_sem);
 static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
 #endif
 
-#ifdef CONFIG_IDEDMA_AUTO
 int noautodma = 0;
-#else
-int noautodma = 1;
-#endif
 
 EXPORT_SYMBOL(noautodma);
 
index b2dc028dc8ca17d424cc5677e070cdcf374f9e87..d54d9fe92a7d548324b38809d360fe1c280722fa 100644 (file)
@@ -639,6 +639,7 @@ static int au_ide_probe(struct device *dev)
        _auide_hwif *ahwif = &auide_hwif;
        ide_hwif_t *hwif;
        struct resource *res;
+       hw_regs_t *hw;
        int ret = 0;
 
 #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
@@ -681,7 +682,7 @@ static int au_ide_probe(struct device *dev)
        /* FIXME:  This might possibly break PCMCIA IDE devices */
 
        hwif                            = &ide_hwifs[pdev->id];
-       hw_regs_t *hw                   = &hwif->hw;
+       hw                              = &hwif->hw;
        hwif->irq = hw->irq             = ahwif->irq;
        hwif->chipset                   = ide_au1xxx;
 
index 6591ff4753cb85a9363e0ad56be9cf04737269da..95d1ea8f1f1403d2efd0a14c8bc8569a6a5e51fa 100644 (file)
@@ -3,6 +3,7 @@ obj-$(CONFIG_BLK_DEV_AEC62XX)           += aec62xx.o
 obj-$(CONFIG_BLK_DEV_ALI15X3)          += alim15x3.o
 obj-$(CONFIG_BLK_DEV_AMD74XX)          += amd74xx.o
 obj-$(CONFIG_BLK_DEV_ATIIXP)           += atiixp.o
+obj-$(CONFIG_BLK_DEV_CELLEB)           += scc_pata.o
 obj-$(CONFIG_BLK_DEV_CMD64X)           += cmd64x.o
 obj-$(CONFIG_BLK_DEV_CS5520)           += cs5520.o
 obj-$(CONFIG_BLK_DEV_CS5530)           += cs5530.o
index b0d4825c56a9c45040dc062d05b185b2358869cd..561197f7b5bb92de6ae208d138cefaf6f9755082 100644 (file)
@@ -1,6 +1,6 @@
 /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
  *
- * linux/drivers/ide/pci/cmd64x.c              Version 1.41    Feb 3, 2007
+ * linux/drivers/ide/pci/cmd64x.c              Version 1.42    Feb 8, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *           Note, this driver is not used at all on other systems because
@@ -189,6 +189,11 @@ static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count)
 
 #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
 
+static u8 quantize_timing(int timing, int quant)
+{
+       return (timing + quant - 1) / quant;
+}
+
 /*
  * This routine writes the prepared setup/active/recovery counts
  * for a drive into the cmd646 chipset registers to active them.
@@ -268,47 +273,37 @@ static void program_drive_counts (ide_drive_t *drive, int setup_count, int activ
  */
 static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted)
 {
-       int setup_time, active_time, recovery_time;
-       int clock_time, pio_mode, cycle_time;
-       u8 recovery_count2, cycle_count;
-       int setup_count, active_count, recovery_count;
-       int bus_speed = system_bus_clock();
-       ide_pio_data_t  d;
+       int setup_time, active_time, cycle_time;
+       u8  cycle_count, setup_count, active_count, recovery_count;
+       u8  pio_mode;
+       int clock_time = 1000 / system_bus_clock();
+       ide_pio_data_t pio;
 
-       pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d);
-       cycle_time = d.cycle_time;
+       pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio);
+       cycle_time = pio.cycle_time;
 
-       /*
-        * I copied all this complicated stuff from cmd640.c and made a few
-        * minor changes.  For now I am just going to pray that it is correct.
-        */
        setup_time  = ide_pio_timings[pio_mode].setup_time;
        active_time = ide_pio_timings[pio_mode].active_time;
-       recovery_time = cycle_time - (setup_time + active_time);
-       clock_time = 1000 / bus_speed;
-       cycle_count = (cycle_time + clock_time - 1) / clock_time;
-
-       setup_count = (setup_time + clock_time - 1) / clock_time;
 
-       active_count = (active_time + clock_time - 1) / clock_time;
+       setup_count  = quantize_timing( setup_time, clock_time);
+       cycle_count  = quantize_timing( cycle_time, clock_time);
+       active_count = quantize_timing(active_time, clock_time);
 
-       recovery_count = (recovery_time + clock_time - 1) / clock_time;
-       recovery_count2 = cycle_count - (setup_count + active_count);
-       if (recovery_count2 > recovery_count)
-               recovery_count = recovery_count2;
+       recovery_count = cycle_count - active_count;
+       /* program_drive_counts() takes care of zero recovery cycles */
        if (recovery_count > 16) {
                active_count += recovery_count - 16;
                recovery_count = 16;
        }
        if (active_count > 16)
-               active_count = 16; /* maximum allowed by cmd646 */
+               active_count = 16; /* maximum allowed by cmd64x */
 
        program_drive_counts (drive, setup_count, active_count, recovery_count);
 
        cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, "
                "clocks=%d/%d/%d\n",
                drive->name, mode_wanted, pio_mode, cycle_time,
-               d.overridden ? " (overriding vendor mode)" : "",
+               pio.overridden ? " (overriding vendor mode)" : "",
                setup_count, active_count, recovery_count);
 
        return pio_mode;
index 53f25500c22b57afdb2cc54f1daa2cd510070000..be4fc96c29e0ded22f1629b9cfd046031e95e9d3 100644 (file)
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
        return 0;
 }
 
+/* If libata is configured, jmicron PCI quirk will configure it such
+ * that the SATA ports are in AHCI function while the PATA ports are
+ * in a separate IDE function.  In such cases, match device class and
+ * attach only to IDE.  If libata isn't configured, keep the old
+ * behavior for backward compatibility.
+ */
+#if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE)
+#define JMB_CLASS      PCI_CLASS_STORAGE_IDE << 8
+#define JMB_CLASS_MASK 0xffff00
+#else
+#define JMB_CLASS      0
+#define JMB_CLASS_MASK 0
+#endif
+
 static struct pci_device_id jmicron_pci_tbl[] = {
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
-       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,
+         PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,
+         PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,
+         PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,
+         PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,
+         PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4},
        { 0, },
 };
 
index a52c80fe7d3e5d6e05a3995d5dd75af9965e3fe7..118fb3205ca81cda6f4f260bedeea806883ffa4d 100644 (file)
@@ -505,11 +505,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
                }
        }
 }
-
-#ifndef CONFIG_IDEDMA_PCI_AUTO
-#warning CONFIG_IDEDMA_PCI_AUTO=n support is obsolete, and will be removed soon.
-#endif
-
 #endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/
 
 /**
index a163bca38973024bc8b0a4627c0dbb2c8a0c007a..dc7a8c78cbf9f31297e922d6b2c4a270ce75d21d 100644 (file)
@@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
 
        r = kvm_arch_ops->hardware_setup();
        if (r < 0)
-           return r;
+               goto out;
 
        on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1);
        r = register_cpu_notifier(&kvm_cpu_notifier);
@@ -2500,6 +2500,8 @@ out_free_2:
 out_free_1:
        on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
        kvm_arch_ops->hardware_unsetup();
+out:
+       kvm_arch_ops = NULL;
        return r;
 }
 
index a1a93368f314d4e89226c3ab1b78dd9934135d42..e85b4c7c36f7139bc20a7bcb3138ac4edb654acd 100644 (file)
@@ -131,7 +131,7 @@ static int dbg = 1;
        (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1))
 
 
-#define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & PAGE_MASK)
+#define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & ~(u64)(PAGE_SIZE-1))
 #define PT64_DIR_BASE_ADDR_MASK \
        (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1))
 
@@ -406,8 +406,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
                        spte = desc->shadow_ptes[0];
                }
                BUG_ON(!spte);
-               BUG_ON((*spte & PT64_BASE_ADDR_MASK) !=
-                      page_to_pfn(page) << PAGE_SHIFT);
+               BUG_ON((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT
+                      != page_to_pfn(page));
                BUG_ON(!(*spte & PT_PRESENT_MASK));
                BUG_ON(!(*spte & PT_WRITABLE_MASK));
                rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
@@ -1093,22 +1093,40 @@ out:
        return r;
 }
 
+static void mmu_pre_write_zap_pte(struct kvm_vcpu *vcpu,
+                                 struct kvm_mmu_page *page,
+                                 u64 *spte)
+{
+       u64 pte;
+       struct kvm_mmu_page *child;
+
+       pte = *spte;
+       if (is_present_pte(pte)) {
+               if (page->role.level == PT_PAGE_TABLE_LEVEL)
+                       rmap_remove(vcpu, spte);
+               else {
+                       child = page_header(pte & PT64_BASE_ADDR_MASK);
+                       mmu_page_remove_parent_pte(vcpu, child, spte);
+               }
+       }
+       *spte = 0;
+}
+
 void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
 {
        gfn_t gfn = gpa >> PAGE_SHIFT;
        struct kvm_mmu_page *page;
-       struct kvm_mmu_page *child;
        struct hlist_node *node, *n;
        struct hlist_head *bucket;
        unsigned index;
        u64 *spte;
-       u64 pte;
        unsigned offset = offset_in_page(gpa);
        unsigned pte_size;
        unsigned page_offset;
        unsigned misaligned;
        int level;
        int flooded = 0;
+       int npte;
 
        pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes);
        if (gfn == vcpu->last_pt_write_gfn) {
@@ -1144,22 +1162,26 @@ void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes)
                }
                page_offset = offset;
                level = page->role.level;
+               npte = 1;
                if (page->role.glevels == PT32_ROOT_LEVEL) {
-                       page_offset <<= 1;          /* 32->64 */
+                       page_offset <<= 1;      /* 32->64 */
+                       /*
+                        * A 32-bit pde maps 4MB while the shadow pdes map
+                        * only 2MB.  So we need to double the offset again
+                        * and zap two pdes instead of one.
+                        */
+                       if (level == PT32_ROOT_LEVEL) {
+                               page_offset <<= 1;
+                               npte = 2;
+                       }
                        page_offset &= ~PAGE_MASK;
                }
                spte = __va(page->page_hpa);
                spte += page_offset / sizeof(*spte);
-               pte = *spte;
-               if (is_present_pte(pte)) {
-                       if (level == PT_PAGE_TABLE_LEVEL)
-                               rmap_remove(vcpu, spte);
-                       else {
-                               child = page_header(pte & PT64_BASE_ADDR_MASK);
-                               mmu_page_remove_parent_pte(vcpu, child, spte);
-                       }
+               while (npte--) {
+                       mmu_pre_write_zap_pte(vcpu, page, spte);
+                       ++spte;
                }
-               *spte = 0;
        }
 }
 
index c07178e61122c7ed9534f598100ef61a7c3b8008..bfa0ce42ea92b35518345244b26604cc3855bd6d 100644 (file)
@@ -371,10 +371,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
                data = vmcs_read32(GUEST_SYSENTER_CS);
                break;
        case MSR_IA32_SYSENTER_EIP:
-               data = vmcs_read32(GUEST_SYSENTER_EIP);
+               data = vmcs_readl(GUEST_SYSENTER_EIP);
                break;
        case MSR_IA32_SYSENTER_ESP:
-               data = vmcs_read32(GUEST_SYSENTER_ESP);
+               data = vmcs_readl(GUEST_SYSENTER_ESP);
                break;
        default:
                msr = find_msr_entry(vcpu, msr_index);
@@ -412,10 +412,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
                vmcs_write32(GUEST_SYSENTER_CS, data);
                break;
        case MSR_IA32_SYSENTER_EIP:
-               vmcs_write32(GUEST_SYSENTER_EIP, data);
+               vmcs_writel(GUEST_SYSENTER_EIP, data);
                break;
        case MSR_IA32_SYSENTER_ESP:
-               vmcs_write32(GUEST_SYSENTER_ESP, data);
+               vmcs_writel(GUEST_SYSENTER_ESP, data);
                break;
        case MSR_IA32_TIME_STAMP_COUNTER:
                guest_write_tsc(data);
index c625ddb8833d8b2de3f3d937b899e67b42cb48ae..d5ecd2d53046ab5510b520df48813debdc45d3c8 100644 (file)
@@ -188,7 +188,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
        for (i=0; i < cnt-1 ; i++) {
                sector_t sz = 0;
                int j;
-               for (j=i; i<cnt-1 && sz < min_spacing ; j++)
+               for (j = i; j < cnt - 1 && sz < min_spacing; j++)
                        sz += conf->disks[j].size;
                if (sz >= min_spacing && sz < conf->hash_spacing)
                        conf->hash_spacing = sz;
index 5026b345cb30226c7ed3d13dc3cc664e41e75edd..57e6ab1004d0bd788f848440099ed35c0730ba4c 100644 (file)
@@ -451,7 +451,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
                return -EINVAL;
 
        if(!pnp_can_configure(dev)) {
-               pnp_info("Device %s does not support resource configuration.", dev->dev.bus_id);
+               pnp_dbg("Device %s does not support resource configuration.", dev->dev.bus_id);
                return -ENODEV;
        }
 
@@ -482,7 +482,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
 int pnp_start_dev(struct pnp_dev *dev)
 {
        if (!pnp_can_write(dev)) {
-               pnp_info("Device %s does not support activation.", dev->dev.bus_id);
+               pnp_dbg("Device %s does not support activation.", dev->dev.bus_id);
                return -EINVAL;
        }
 
@@ -506,7 +506,7 @@ int pnp_start_dev(struct pnp_dev *dev)
 int pnp_stop_dev(struct pnp_dev *dev)
 {
        if (!pnp_can_disable(dev)) {
-               pnp_info("Device %s does not support disabling.", dev->dev.bus_id);
+               pnp_dbg("Device %s does not support disabling.", dev->dev.bus_id);
                return -EINVAL;
        }
        if (dev->protocol->disable(dev)<0) {
index 5b1e3ff26c0ba24e990b983a2501ade1e3449c4c..05fac0733f3d508b74dd4bfb8c834ba0c0354cf4 100644 (file)
@@ -210,9 +210,11 @@ again:
                goto again;
        }
        if (rc < 0) {
-                QDIO_DBF_TEXT3(1,trace,"sqberr");
-                sprintf(dbf_text,"%2x,%2x,%d,%d",tmp_cnt,*cnt,ccq,q_no);
-                QDIO_DBF_TEXT3(1,trace,dbf_text);
+               QDIO_DBF_TEXT3(1,trace,"sqberr");
+               sprintf(dbf_text,"%2x,%2x",tmp_cnt,*cnt);
+               QDIO_DBF_TEXT3(1,trace,dbf_text);
+               sprintf(dbf_text,"%d,%d",ccq,q_no);
+               QDIO_DBF_TEXT3(1,trace,dbf_text);
                q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION|
                                QDIO_STATUS_LOOK_FOR_ERROR,
                                0, 0, 0, -1, -1, q->int_parm);
@@ -1250,7 +1252,6 @@ qdio_is_inbound_q_done(struct qdio_q *q)
        if (!no_used) {
                QDIO_DBF_TEXT4(0,trace,"inqisdnA");
                QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
-               QDIO_DBF_TEXT4(0,trace,dbf_text);
                return 1;
        }
        if (irq->is_qebsm) {
@@ -3371,10 +3372,15 @@ qdio_do_qdio_fill_input(struct qdio_q *q, unsigned int qidx,
                        unsigned int count, struct qdio_buffer *buffers)
 {
        struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
+       int tmp = 0;
+
        qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1);
        if (irq->is_qebsm) {
-               while (count)
-                       set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count);
+               while (count) {
+                       tmp = set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count);
+                       if (!tmp)
+                               return;
+               }
                return;
        }
        for (;;) {
@@ -3390,11 +3396,15 @@ qdio_do_qdio_fill_output(struct qdio_q *q, unsigned int qidx,
                         unsigned int count, struct qdio_buffer *buffers)
 {
        struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
+       int tmp = 0;
 
        qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1);
        if (irq->is_qebsm) {
-               while (count)
-                       set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count);
+               while (count) {
+                       tmp = set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count);
+                       if (!tmp)
+                               return;
+               }
                return;
        }
 
index c7d1355237b668d9342320366b544de205643187..181b51772b1b37e8a83cec5b1c0d2cc5a697e323 100644 (file)
@@ -65,6 +65,8 @@ module_param_named(poll_thread, ap_thread_flag, int, 0000);
 MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on).");
 
 static struct device *ap_root_device = NULL;
+static DEFINE_SPINLOCK(ap_device_lock);
+static LIST_HEAD(ap_device_list);
 
 /**
  * Workqueue & timer for bus rescan.
@@ -457,6 +459,9 @@ static int ap_device_probe(struct device *dev)
        int rc;
 
        ap_dev->drv = ap_drv;
+       spin_lock_bh(&ap_device_lock);
+       list_add(&ap_dev->list, &ap_device_list);
+       spin_unlock_bh(&ap_device_lock);
        rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
        return rc;
 }
@@ -497,6 +502,9 @@ static int ap_device_remove(struct device *dev)
        ap_flush_queue(ap_dev);
        if (ap_drv->remove)
                ap_drv->remove(ap_dev);
+       spin_lock_bh(&ap_device_lock);
+       list_del_init(&ap_dev->list);
+       spin_unlock_bh(&ap_device_lock);
        return 0;
 }
 
@@ -772,6 +780,7 @@ static void ap_scan_bus(struct work_struct *unused)
                spin_lock_init(&ap_dev->lock);
                INIT_LIST_HEAD(&ap_dev->pendingq);
                INIT_LIST_HEAD(&ap_dev->requestq);
+               INIT_LIST_HEAD(&ap_dev->list);
                if (device_type == 0)
                        ap_probe_device_type(ap_dev);
                else
@@ -1033,14 +1042,13 @@ static void ap_poll_timeout(unsigned long unused)
  * polling until bit 2^0 of the control flags is not set. If bit 2^1
  * of the control flags has been set arm the poll timer.
  */
-static int __ap_poll_all(struct device *dev, void *data)
+static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags)
 {
-       struct ap_device *ap_dev = to_ap_dev(dev);
        int rc;
 
        spin_lock(&ap_dev->lock);
        if (!ap_dev->unregistered) {
-               rc = ap_poll_queue(to_ap_dev(dev), (unsigned long *) data);
+               rc = ap_poll_queue(ap_dev, flags);
                if (rc)
                        ap_dev->unregistered = 1;
        } else
@@ -1054,10 +1062,15 @@ static int __ap_poll_all(struct device *dev, void *data)
 static void ap_poll_all(unsigned long dummy)
 {
        unsigned long flags;
+       struct ap_device *ap_dev;
 
        do {
                flags = 0;
-               bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all);
+               spin_lock(&ap_device_lock);
+               list_for_each_entry(ap_dev, &ap_device_list, list) {
+                       __ap_poll_all(ap_dev, &flags);
+               }
+               spin_unlock(&ap_device_lock);
        } while (flags & 1);
        if (flags & 2)
                ap_schedule_poll_timer();
@@ -1075,6 +1088,7 @@ static int ap_poll_thread(void *data)
        DECLARE_WAITQUEUE(wait, current);
        unsigned long flags;
        int requests;
+       struct ap_device *ap_dev;
 
        set_user_nice(current, 19);
        while (1) {
@@ -1092,10 +1106,12 @@ static int ap_poll_thread(void *data)
                set_current_state(TASK_RUNNING);
                remove_wait_queue(&ap_poll_wait, &wait);
 
-               local_bh_disable();
                flags = 0;
-               bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all);
-               local_bh_enable();
+               spin_lock_bh(&ap_device_lock);
+               list_for_each_entry(ap_dev, &ap_device_list, list) {
+                       __ap_poll_all(ap_dev, &flags);
+               }
+               spin_unlock_bh(&ap_device_lock);
        }
        set_current_state(TASK_RUNNING);
        remove_wait_queue(&ap_poll_wait, &wait);
index 83b69c01cd6e4b72bd61e9c6fecc94e91725d8c3..008559ea742b55537dc7c4c76ef6b2fc8c0bc50a 100644 (file)
@@ -106,6 +106,7 @@ struct ap_device {
        struct device device;
        struct ap_driver *drv;          /* Pointer to AP device driver. */
        spinlock_t lock;                /* Per device lock. */
+       struct list_head list;          /* private list of all AP devices. */
 
        ap_qid_t qid;                   /* AP queue id. */
        int queue_depth;                /* AP queue depth.*/
index 99761391f34090f89564d22dd2f8c94ad39bc99a..e3625a47a59638a168fdeaa72000a920adc8c1e6 100644 (file)
@@ -298,14 +298,14 @@ static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex)
                get_device(&zdev->ap_dev->device);
                zdev->request_count++;
                __zcrypt_decrease_preference(zdev);
-               spin_unlock_bh(&zcrypt_device_lock);
                if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
+                       spin_unlock_bh(&zcrypt_device_lock);
                        rc = zdev->ops->rsa_modexpo(zdev, mex);
+                       spin_lock_bh(&zcrypt_device_lock);
                        module_put(zdev->ap_dev->drv->driver.owner);
                }
                else
                        rc = -EAGAIN;
-               spin_lock_bh(&zcrypt_device_lock);
                zdev->request_count--;
                __zcrypt_increase_preference(zdev);
                put_device(&zdev->ap_dev->device);
@@ -373,14 +373,14 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt)
                get_device(&zdev->ap_dev->device);
                zdev->request_count++;
                __zcrypt_decrease_preference(zdev);
-               spin_unlock_bh(&zcrypt_device_lock);
                if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
+                       spin_unlock_bh(&zcrypt_device_lock);
                        rc = zdev->ops->rsa_modexpo_crt(zdev, crt);
+                       spin_lock_bh(&zcrypt_device_lock);
                        module_put(zdev->ap_dev->drv->driver.owner);
                }
                else
                        rc = -EAGAIN;
-               spin_lock_bh(&zcrypt_device_lock);
                zdev->request_count--;
                __zcrypt_increase_preference(zdev);
                put_device(&zdev->ap_dev->device);
@@ -408,14 +408,14 @@ static long zcrypt_send_cprb(struct ica_xcRB *xcRB)
                get_device(&zdev->ap_dev->device);
                zdev->request_count++;
                __zcrypt_decrease_preference(zdev);
-               spin_unlock_bh(&zcrypt_device_lock);
                if (try_module_get(zdev->ap_dev->drv->driver.owner)) {
+                       spin_unlock_bh(&zcrypt_device_lock);
                        rc = zdev->ops->send_cprb(zdev, xcRB);
+                       spin_lock_bh(&zcrypt_device_lock);
                        module_put(zdev->ap_dev->drv->driver.owner);
                }
                else
                        rc = -EAGAIN;
-               spin_lock_bh(&zcrypt_device_lock);
                zdev->request_count--;
                __zcrypt_increase_preference(zdev);
                put_device(&zdev->ap_dev->device);
index c53b69610a51005c0b845eb9a63c00e900a311e7..46c40bbc4bc6bc6c2972d30504d580fcca8bf8b2 100644 (file)
@@ -17,6 +17,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
 
 #undef DEBUG
 
 #endif
 
 #include <asm/sci.h>
-
-#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
-#define SUPPORT_SYSRQ
-#endif
-
 #include "sh-sci.h"
 
 struct sci_port {
@@ -645,6 +643,9 @@ static inline int sci_handle_breaks(struct uart_port *port)
        struct tty_struct *tty = port->info->tty;
        struct sci_port *s = &sci_ports[port->line];
 
+       if (uart_handle_break(port))
+               return 0;
+
        if (!s->break_flag && status & SCxSR_BRK(port)) {
 #if defined(CONFIG_CPU_SH3)
                /* Debounce break */
index 48e4f48e779f474d55e460dfd41fb1ec98b4bc6b..8efa07e8b8c2a7bef31ce118109b622e42de210d 100644 (file)
@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi)
         */
        sr = spi_w8r8(spi, AT25_RDSR);
        if (sr < 0 || sr & AT25_SR_nRDY) {
-               dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
+               dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
                err = -ENXIO;
                goto fail;
        }
index 6fa260d1a9be06607be15658bcbc3b7a452b18e8..66e7bc985797a0d8acce875c3281e744f7db9849 100644 (file)
@@ -425,7 +425,7 @@ static int atmel_spi_setup(struct spi_device *spi)
                if (ret)
                        return ret;
                spi->controller_state = (void *)npcs_pin;
-               gpio_direction_output(npcs_pin);
+               gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH));
        }
 
        dev_dbg(&spi->dev,
index 24a330d82395a6e260c9ae5bdc7bb6132bb7c477..88425e1af4d353fcc0ce14c0dd29c130c770f7f1 100644 (file)
@@ -302,10 +302,6 @@ static void bitbang_work(struct work_struct *work)
                setup_transfer = NULL;
 
                list_for_each_entry (t, &m->transfers, transfer_list) {
-                       if (bitbang->shutdown) {
-                               status = -ESHUTDOWN;
-                               break;
-                       }
 
                        /* override or restore speed and wordsize */
                        if (t->speed_hz || t->bits_per_word) {
@@ -410,8 +406,6 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m)
        m->status = -EINPROGRESS;
 
        bitbang = spi_master_get_devdata(spi->master);
-       if (bitbang->shutdown)
-               return -ESHUTDOWN;
 
        spin_lock_irqsave(&bitbang->lock, flags);
        if (!spi->max_speed_hz)
@@ -507,28 +501,12 @@ EXPORT_SYMBOL_GPL(spi_bitbang_start);
  */
 int spi_bitbang_stop(struct spi_bitbang *bitbang)
 {
-       unsigned        limit = 500;
-
-       spin_lock_irq(&bitbang->lock);
-       bitbang->shutdown = 0;
-       while (!list_empty(&bitbang->queue) && limit--) {
-               spin_unlock_irq(&bitbang->lock);
+       spi_unregister_master(bitbang->master);
 
-               dev_dbg(bitbang->master->cdev.dev, "wait for queue\n");
-               msleep(10);
-
-               spin_lock_irq(&bitbang->lock);
-       }
-       spin_unlock_irq(&bitbang->lock);
-       if (!list_empty(&bitbang->queue)) {
-               dev_err(bitbang->master->cdev.dev, "queue didn't empty\n");
-               return -EBUSY;
-       }
+       WARN_ON(!list_empty(&bitbang->queue));
 
        destroy_workqueue(bitbang->workqueue);
 
-       spi_unregister_master(bitbang->master);
-
        return 0;
 }
 EXPORT_SYMBOL_GPL(spi_bitbang_stop);
index 651379c51ae6b691bfd150d815ad5dbecbde77ba..220abce63e4abd12a0b9a3d620265d3caf698b0c 100644 (file)
@@ -41,7 +41,7 @@ struct s3c24xx_spi {
        int                      len;
        int                      count;
 
-       int                     (*set_cs)(struct s3c2410_spi_info *spi,
+       void                    (*set_cs)(struct s3c2410_spi_info *spi,
                                          int cs, int pol);
 
        /* data buffers */
index 63e50a1f139684e193893e24800b990b43c20fb5..6584cf00f7f31ba7b5bca03023753299ad5733f9 100644 (file)
@@ -202,6 +202,7 @@ struct quirk_printer_struct {
 
 #define USBLP_QUIRK_BIDIR      0x1     /* reports bidir but requires unidirectional mode (no INs/reads) */
 #define USBLP_QUIRK_USB_INIT   0x2     /* needs vendor USB init string */
+#define USBLP_QUIRK_BAD_CLASS  0x4     /* descriptor uses vendor-specific Class or SubClass */
 
 static const struct quirk_printer_struct quirk_printers[] = {
        { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
@@ -218,6 +219,7 @@ static const struct quirk_printer_struct quirk_printers[] = {
        { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
        { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
        { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */
+       { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */
        { 0, 0 }
 };
 
@@ -1048,7 +1050,8 @@ static int usblp_select_alts(struct usblp *usblp)
                ifd = &if_alt->altsetting[i];
 
                if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1)
-                       continue;
+                       if (!(usblp->quirks & USBLP_QUIRK_BAD_CLASS))
+                               continue;
 
                if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL ||
                    ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL)
@@ -1232,6 +1235,7 @@ static struct usb_device_id usblp_ids [] = {
        { USB_INTERFACE_INFO(7, 1, 1) },
        { USB_INTERFACE_INFO(7, 1, 2) },
        { USB_INTERFACE_INFO(7, 1, 3) },
+       { USB_DEVICE(0x04b8, 0x0202) }, /* Seiko Epson Receipt Printer M129C */
        { }                                             /* Terminating entry */
 };
 
index 60893c6c822113b8f298bae7bc101cef79e7aec5..b15f2fd8dab459b7ef4ea581f4192e7aae4c5c75 100644 (file)
@@ -69,7 +69,7 @@ static int magic_charge(struct usb_device *udev)
                return retval;
        }
 
-       dbg(&udev->dev, "Sending first magic command\n");
+       dbg(&udev->dev, "Sending second magic command\n");
        retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
                                 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100);
        if (retval != 0) {
index c0bc52be5e1094b634dee18ec05677b060c4746b..5130cc7eb314c189a26ef99ee9669c9730882459 100644 (file)
@@ -578,6 +578,14 @@ static const struct usb_device_id products[] = {
         USB_DEVICE(0x0a46, 0x9601),    /* Davicom USB-100 */
         .driver_info = (unsigned long)&dm9601_info,
         },
+       {
+        USB_DEVICE(0x0a46, 0x6688),    /* ZT6688 USB NIC */
+        .driver_info = (unsigned long)&dm9601_info,
+        },
+       {
+        USB_DEVICE(0x0a46, 0x0268),    /* ShanTou ST268 USB NIC */
+        .driver_info = (unsigned long)&dm9601_info,
+        },
        {},                     // END
 };
 
index 310a8b5f5906a6f54b226b5e2dddab2453d3f48f..7538c64a5097ea8be63fc0d7a5fdec1d912fb593 100644 (file)
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
-       { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
-       { USB_DEVICE(0x1410, 0x1130) }, /* Novatel Wireless S720 CDMA/EV-DO */
-       { USB_DEVICE(0x1410, 0x2110) }, /* Novatel Wireless U720 CDMA/EV-DO */
-       { USB_DEVICE(0x1410, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
        { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
        { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */
        { },
index 2d588fb82573f998aa6b899dae13a84fceff4e1b..19bf403f9db2026dc8e20d7faea0a4eeba9ee970 100644 (file)
@@ -1628,6 +1628,7 @@ static struct usb_serial_driver moschip7720_2port_driver = {
        .chars_in_buffer        = mos7720_chars_in_buffer,
        .break_ctl              = mos7720_break,
        .read_bulk_callback     = mos7720_bulk_in_callback,
+       .read_int_callback      = mos7720_interrupt_callback,
 };
 
 static int __init moschip7720_init(void)
index db92a7fb1f7cbbe9782aef280d46799c7e8d7490..e178e6f403196dce53190af4f2bc4fe35761e89e 100644 (file)
@@ -109,7 +109,6 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define HUAWEI_PRODUCT_E220                    0x1003
 
 #define NOVATELWIRELESS_VENDOR_ID              0x1410
-#define NOVATELWIRELESS_PRODUCT_U740           0x1400
 
 #define ANYDATA_VENDOR_ID                      0x16d5
 #define ANYDATA_PRODUCT_ID                     0x6501
@@ -152,7 +151,19 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
-       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */
+       { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
        { } /* Terminating entry */
 };
index 8511352251f33ea3f551438913b9a778bf0158db..7639022cdf84af83a74bcf5550abf5e642e527d6 100644 (file)
@@ -138,6 +138,11 @@ static void destroy_serial(struct kref *kref)
 
        dbg("%s - %s", __FUNCTION__, serial->type->description);
 
+       serial->type->shutdown(serial);
+
+       /* return the minor range that this device had */
+       return_serial(serial);
+
        for (i = 0; i < serial->num_ports; ++i)
                serial->port[i]->open_count = 0;
 
@@ -148,12 +153,6 @@ static void destroy_serial(struct kref *kref)
                        serial->port[i] = NULL;
                }
 
-       if (serial->type->shutdown)
-               serial->type->shutdown(serial);
-
-       /* return the minor range that this device had */
-       return_serial(serial);
-
        /* If this is a "fake" port, we have to clean it up here, as it will
         * not get cleaned up in port_release() as it was never registered with
         * the driver core */
index 2dd31e3f5107abaaa61cd8c1851f249a451bd02e..e13637dfb6422164abc4724b537dc2e3a808f41a 100644 (file)
@@ -1411,6 +1411,16 @@ UNUSUAL_DEV(  0x22b8, 0x3010, 0x0001, 0x0001,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
 
+/*
+ * Patch by Pete Zaitcev <zaitcev@redhat.com>
+ * Report by Mark Patton. Red Hat bz#208928.
+ */
+UNUSUAL_DEV(  0x22b8, 0x4810, 0x0001, 0x0001,
+               "Motorola",
+               "RAZR V3i",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY),
+
 /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */
 UNUSUAL_DEV(  0x2735, 0x100b, 0x0000, 0x9999,
                "MPIO",
index 7f5a59836818c6f1e227dfff3fff655b15f0d64d..e4f0dd00ae85a51098a02ef5e3acdba79c93f640 100644 (file)
@@ -1320,7 +1320,7 @@ config FB_AU1100
 
 config FB_AU1200
        bool "Au1200 LCD Driver"
-       depends on FB && MIPS && SOC_AU1200
+       depends on (FB = y) && MIPS && SOC_AU1200
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -1470,7 +1470,7 @@ config FB_G364
 
 config FB_68328
        bool "Motorola 68328 native frame buffer support"
-       depends on FB && (M68328 || M68EZ328 || M68VZ328)
+       depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328)
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
@@ -1616,7 +1616,7 @@ config FB_IBM_GXT4500
 
 config FB_PS3
        bool "PS3 GPU framebuffer driver"
-       depends on FB && PS3_PS3AV
+       depends on (FB = y) && PS3_PS3AV
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
index 4afa30522fdbb4c375b37057a77b3a04d1bf3097..0166ec2ccf32c1b59057cd61bf6d6f20a7997614 100644 (file)
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par  *par)
        BCI_SEND(0);
        BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
        BCI_SEND(GlobalBitmapDescriptor);
+
+       /*
+        * I don't know why, sending this twice fixes the intial black screen,
+        * prevents X from crashing at least in Toshiba laptops with SavageIX.
+        * --Tony
+        */
+       par->bci_ptr = 0;
+       par->SavageWaitFifo(par, 4);
+
+       BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1);
+       BCI_SEND(0);
+       BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
+       BCI_SEND(GlobalBitmapDescriptor);
 }
 
 static void savagefb_set_clip(struct fb_info *info)
@@ -496,7 +509,7 @@ static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1,
 #ifdef SAVAGEFB_DEBUG
 /* This function is used to debug, it prints out the contents of s3 regs */
 
-static void SavagePrintRegs(void)
+static void SavagePrintRegs(struct savagefb_par *par)
 {
        unsigned char i;
        int vgaCRIndex = 0x3d4;
@@ -1525,7 +1538,7 @@ static int savagefb_set_par(struct fb_info *info)
        savagefb_set_fix(info);
        savagefb_set_clip(info);
 
-       SavagePrintRegs();
+       SavagePrintRegs(par);
        return 0;
 }
 
@@ -2155,7 +2168,6 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
        int video_len;
 
        DBG("savagefb_probe");
-       SavagePrintRegs();
 
        info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev);
        if (!info)
index 59cd1e750f30dc595f96271277587ae151eab31c..62fa5500361d2a1b8a1ce7418c1b81f9d1044d1b 100644 (file)
@@ -257,6 +257,7 @@ static void __sst_dac_write(u8 __iomem *vbase, u8 reg, u8 val)
        r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val);
        reg &= 0x07;
        __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val);
+       __sst_wait_idle(vbase);
 }
 
 /* indexed access to ti/att dacs */
index 51db1182b27e4470edbc6945574aa1158a110bea..a2fceba7ef8ef7df17519c72e29124ad61ff6f6b 100644 (file)
@@ -507,7 +507,7 @@ out:
 #define INTERPRETER_ELF 2
 
 #ifndef STACK_RND_MASK
-#define STACK_RND_MASK 0x7ff           /* with 4K pages 8MB of VA */
+#define STACK_RND_MASK (0x7ff >> (PAGE_SHIFT - 12))    /* 8MB of VA */
 #endif
 
 static unsigned long randomize_stack_top(unsigned long stack_top)
index 329efcd3d8c9d672a66799390d5adeceb5150604..cb20b964419f8061bdf7391707a92ab0825c0716 100644 (file)
@@ -78,18 +78,13 @@ struct kmem_cache *ecryptfs_dentry_info_cache;
  */
 static void ecryptfs_d_release(struct dentry *dentry)
 {
-       struct dentry *lower_dentry;
-
-       lower_dentry = ecryptfs_dentry_to_lower(dentry);
-       if (ecryptfs_dentry_to_private(dentry))
+       if (ecryptfs_dentry_to_private(dentry)) {
+               if (ecryptfs_dentry_to_lower(dentry)) {
+                       mntput(ecryptfs_dentry_to_lower_mnt(dentry));
+                       dput(ecryptfs_dentry_to_lower(dentry));
+               }
                kmem_cache_free(ecryptfs_dentry_info_cache,
                                ecryptfs_dentry_to_private(dentry));
-       if (lower_dentry) {
-               struct vfsmount *lower_mnt =
-                       ecryptfs_dentry_to_lower_mnt(dentry);
-
-               mntput(lower_mnt);
-               dput(lower_dentry);
        }
        return;
 }
index af53c02f473bd5825ccd1abac7d6a748239eef48..93d046c85f5245c9be6a335f4cbc3f2721c8f4c9 100644 (file)
@@ -429,7 +429,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
        int err;
 
        /* Flush out writes to the server in order to update c/mtime */
-       nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT);
+       if (S_ISREG(inode->i_mode))
+               nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT);
 
        /*
         * We may force a getattr if the user cares about atime.
index bb516a2cfbafa4f50446b4ca5e99e1d8c6303831..f1eae44b9a1aec5167dfefb934437ccaedba2576 100644 (file)
@@ -151,10 +151,10 @@ int __init register_nfs_fs(void)
        if (ret < 0)
                goto error_0;
 
-#ifdef CONFIG_NFS_V4
        ret = nfs_register_sysctl();
        if (ret < 0)
                goto error_1;
+#ifdef CONFIG_NFS_V4
        ret = register_filesystem(&nfs4_fs_type);
        if (ret < 0)
                goto error_2;
@@ -165,9 +165,9 @@ int __init register_nfs_fs(void)
 #ifdef CONFIG_NFS_V4
 error_2:
        nfs_unregister_sysctl();
+#endif
 error_1:
        unregister_filesystem(&nfs_fs_type);
-#endif
 error_0:
        return ret;
 }
index fcdcafbb32939931c111d3fe75458d71f6f676ff..b62481dabae907a7f11e56c39f2179b4cc389819 100644 (file)
@@ -50,6 +50,14 @@ static ctl_table nfs_cb_sysctls[] = {
                .proc_handler   = &proc_dointvec_jiffies,
                .strategy       = &sysctl_jiffies,
        },
+       {
+               .ctl_name       = CTL_UNNUMBERED,
+               .procname       = "nfs_congestion_kb",
+               .data           = &nfs_congestion_kb,
+               .maxlen         = sizeof(nfs_congestion_kb),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
        { .ctl_name = 0 }
 };
 
index febdade91670562b003a43fd3e0ee8ad900445eb..2867e6b7096f006c174ca58a087c584f3cc561b2 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/pagemap.h>
 #include <linux/file.h>
 #include <linux/writeback.h>
+#include <linux/swap.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/nfs_fs.h>
@@ -38,7 +39,6 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*,
                                            struct page *,
                                            unsigned int, unsigned int);
 static void nfs_mark_request_dirty(struct nfs_page *req);
-static int nfs_wait_on_write_congestion(struct address_space *, int);
 static long nfs_flush_mapping(struct address_space *mapping, struct writeback_control *wbc, int how);
 static const struct rpc_call_ops nfs_write_partial_ops;
 static const struct rpc_call_ops nfs_write_full_ops;
@@ -48,8 +48,6 @@ static struct kmem_cache *nfs_wdata_cachep;
 static mempool_t *nfs_wdata_mempool;
 static mempool_t *nfs_commit_mempool;
 
-static DECLARE_WAIT_QUEUE_HEAD(nfs_write_congestion);
-
 struct nfs_write_data *nfs_commit_alloc(void)
 {
        struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, GFP_NOFS);
@@ -210,6 +208,40 @@ static int wb_priority(struct writeback_control *wbc)
        return 0;
 }
 
+/*
+ * NFS congestion control
+ */
+
+int nfs_congestion_kb;
+
+#define NFS_CONGESTION_ON_THRESH       (nfs_congestion_kb >> (PAGE_SHIFT-10))
+#define NFS_CONGESTION_OFF_THRESH      \
+       (NFS_CONGESTION_ON_THRESH - (NFS_CONGESTION_ON_THRESH >> 2))
+
+static void nfs_set_page_writeback(struct page *page)
+{
+       if (!test_set_page_writeback(page)) {
+               struct inode *inode = page->mapping->host;
+               struct nfs_server *nfss = NFS_SERVER(inode);
+
+               if (atomic_inc_return(&nfss->writeback) >
+                               NFS_CONGESTION_ON_THRESH)
+                       set_bdi_congested(&nfss->backing_dev_info, WRITE);
+       }
+}
+
+static void nfs_end_page_writeback(struct page *page)
+{
+       struct inode *inode = page->mapping->host;
+       struct nfs_server *nfss = NFS_SERVER(inode);
+
+       end_page_writeback(page);
+       if (atomic_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) {
+               clear_bdi_congested(&nfss->backing_dev_info, WRITE);
+               congestion_end(WRITE);
+       }
+}
+
 /*
  * Find an associated nfs write request, and prepare to flush it out
  * Returns 1 if there was no write request, or if the request was
@@ -247,7 +279,7 @@ static int nfs_page_mark_flush(struct page *page)
        spin_unlock(req_lock);
        if (test_and_set_bit(PG_FLUSHING, &req->wb_flags) == 0) {
                nfs_mark_request_dirty(req);
-               set_page_writeback(page);
+               nfs_set_page_writeback(page);
        }
        ret = test_bit(PG_NEED_FLUSH, &req->wb_flags);
        nfs_unlock_request(req);
@@ -302,13 +334,8 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
        return err; 
 }
 
-/*
- * Note: causes nfs_update_request() to block on the assumption
- *      that the writeback is generated due to memory pressure.
- */
 int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
 {
-       struct backing_dev_info *bdi = mapping->backing_dev_info;
        struct inode *inode = mapping->host;
        int err;
 
@@ -317,20 +344,12 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc)
        err = generic_writepages(mapping, wbc);
        if (err)
                return err;
-       while (test_and_set_bit(BDI_write_congested, &bdi->state) != 0) {
-               if (wbc->nonblocking)
-                       return 0;
-               nfs_wait_on_write_congestion(mapping, 0);
-       }
        err = nfs_flush_mapping(mapping, wbc, wb_priority(wbc));
        if (err < 0)
                goto out;
        nfs_add_stats(inode, NFSIOS_WRITEPAGES, err);
        err = 0;
 out:
-       clear_bit(BDI_write_congested, &bdi->state);
-       wake_up_all(&nfs_write_congestion);
-       congestion_end(WRITE);
        return err;
 }
 
@@ -360,7 +379,7 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
 }
 
 /*
- * Insert a write request into an inode
+ * Remove a write request from an inode
  */
 static void nfs_inode_remove_request(struct nfs_page *req)
 {
@@ -531,10 +550,10 @@ static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst, un
 }
 #endif
 
-static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr)
+static int nfs_wait_on_write_congestion(struct address_space *mapping)
 {
+       struct inode *inode = mapping->host;
        struct backing_dev_info *bdi = mapping->backing_dev_info;
-       DEFINE_WAIT(wait);
        int ret = 0;
 
        might_sleep();
@@ -542,31 +561,23 @@ static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr)
        if (!bdi_write_congested(bdi))
                return 0;
 
-       nfs_inc_stats(mapping->host, NFSIOS_CONGESTIONWAIT);
+       nfs_inc_stats(inode, NFSIOS_CONGESTIONWAIT);
 
-       if (intr) {
-               struct rpc_clnt *clnt = NFS_CLIENT(mapping->host);
+       do {
+               struct rpc_clnt *clnt = NFS_CLIENT(inode);
                sigset_t oldset;
 
                rpc_clnt_sigmask(clnt, &oldset);
-               prepare_to_wait(&nfs_write_congestion, &wait, TASK_INTERRUPTIBLE);
-               if (bdi_write_congested(bdi)) {
-                       if (signalled())
-                               ret = -ERESTARTSYS;
-                       else
-                               schedule();
-               }
+               ret = congestion_wait_interruptible(WRITE, HZ/10);
                rpc_clnt_sigunmask(clnt, &oldset);
-       } else {
-               prepare_to_wait(&nfs_write_congestion, &wait, TASK_UNINTERRUPTIBLE);
-               if (bdi_write_congested(bdi))
-                       schedule();
-       }
-       finish_wait(&nfs_write_congestion, &wait);
+               if (ret == -ERESTARTSYS)
+                       break;
+               ret = 0;
+       } while (bdi_write_congested(bdi));
+
        return ret;
 }
 
-
 /*
  * Try to update any existing write request, or create one if there is none.
  * In order to match, the request's credentials must match those of
@@ -577,14 +588,15 @@ static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr)
 static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
                struct page *page, unsigned int offset, unsigned int bytes)
 {
-       struct inode *inode = page->mapping->host;
+       struct address_space *mapping = page->mapping;
+       struct inode *inode = mapping->host;
        struct nfs_inode *nfsi = NFS_I(inode);
        struct nfs_page         *req, *new = NULL;
        unsigned long           rqend, end;
 
        end = offset + bytes;
 
-       if (nfs_wait_on_write_congestion(page->mapping, NFS_SERVER(inode)->flags & NFS_MOUNT_INTR))
+       if (nfs_wait_on_write_congestion(mapping))
                return ERR_PTR(-ERESTARTSYS);
        for (;;) {
                /* Loop over all inode entries and see if we find
@@ -727,7 +739,7 @@ int nfs_updatepage(struct file *file, struct page *page,
 
 static void nfs_writepage_release(struct nfs_page *req)
 {
-       end_page_writeback(req->wb_page);
+       nfs_end_page_writeback(req->wb_page);
 
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
        if (!PageError(req->wb_page)) {
@@ -1042,12 +1054,12 @@ static void nfs_writeback_done_full(struct rpc_task *task, void *calldata)
                if (task->tk_status < 0) {
                        nfs_set_pageerror(page);
                        req->wb_context->error = task->tk_status;
-                       end_page_writeback(page);
+                       nfs_end_page_writeback(page);
                        nfs_inode_remove_request(req);
                        dprintk(", error = %d\n", task->tk_status);
                        goto next;
                }
-               end_page_writeback(page);
+               nfs_end_page_writeback(page);
 
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
                if (data->args.stable != NFS_UNSTABLE || data->verf.committed == NFS_FILE_SYNC) {
@@ -1514,6 +1526,26 @@ int __init nfs_init_writepagecache(void)
        if (nfs_commit_mempool == NULL)
                return -ENOMEM;
 
+       /*
+        * NFS congestion size, scale with available memory.
+        *
+        *  64MB:    8192k
+        * 128MB:   11585k
+        * 256MB:   16384k
+        * 512MB:   23170k
+        *   1GB:   32768k
+        *   2GB:   46340k
+        *   4GB:   65536k
+        *   8GB:   92681k
+        *  16GB:  131072k
+        *
+        * This allows larger machines to have larger/more transfers.
+        * Limit the default to 256M
+        */
+       nfs_congestion_kb = (16*int_sqrt(totalram_pages)) << (PAGE_SHIFT-10);
+       if (nfs_congestion_kb > 256*1024)
+               nfs_congestion_kb = 256*1024;
+
        return 0;
 }
 
index 74552c60b671fa1f7b0525723d1d5ddae77a0f29..6e8bb66fe61957afe51b4e7eb00004ba20b0ba96 100644 (file)
@@ -235,5 +235,4 @@ config EFI_PARTITION
        select CRC32
        help
          Say Y here if you would like to use hard disks under Linux which
-         were partitioned using EFI GPT.  Presently only useful on the
-         IA-64 platform.
+         were partitioned using EFI GPT.
index e46d237b10f90c1d7f643244a7ffd1e44b40bbfe..8a7d0035ad7a3d9c5cc856b0f9f264baf584b1ca 100644 (file)
@@ -541,7 +541,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
        if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
                return 0;
        if (IS_ERR(state))      /* I/O error reading the partition table */
-               return PTR_ERR(state);
+               return -EIO;
        for (p = 1; p < state->limit; p++) {
                sector_t size = state->parts[p].size;
                sector_t from = state->parts[p].from;
index 42261dbdf60f172270dff8c70c1942c50a2ce0b3..723f7c6676614f6343ad6d3df7ca850c434eb282 100644 (file)
@@ -181,6 +181,7 @@ static int smb_setup_request(struct smb_request *req)
        req->rq_errno = 0;
        req->rq_fragment = 0;
        kfree(req->rq_trans2buffer);
+       req->rq_trans2buffer = NULL;
 
        return 0;
 }
index bcc44084e0049fca554e28d87a02c12ec2ab8bc0..841ac25fd95042f86d134330a13dafd8521521dd 100644 (file)
@@ -244,62 +244,87 @@ failed:
  * We can come here from ufs_writepage or ufs_prepare_write,
  * locked_page is argument of these functions, so we already lock it.
  */
-static void ufs_change_blocknr(struct inode *inode, unsigned int beg,
-                              unsigned int count, unsigned int oldb,
-                              unsigned int newb, struct page *locked_page)
+static void ufs_change_blocknr(struct inode *inode, sector_t beg,
+                              unsigned int count, sector_t oldb,
+                              sector_t newb, struct page *locked_page)
 {
-       const unsigned mask = (1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)) - 1;
+       const unsigned blks_per_page =
+               1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
+       const unsigned mask = blks_per_page - 1;
        struct address_space * const mapping = inode->i_mapping;
-       pgoff_t index, cur_index;
-       unsigned end, pos, j;
+       pgoff_t index, cur_index, last_index;
+       unsigned pos, j, lblock;
+       sector_t end, i;
        struct page *page;
        struct buffer_head *head, *bh;
 
-       UFSD("ENTER, ino %lu, count %u, oldb %u, newb %u\n",
-             inode->i_ino, count, oldb, newb);
+       UFSD("ENTER, ino %lu, count %u, oldb %llu, newb %llu\n",
+             inode->i_ino, count,
+            (unsigned long long)oldb, (unsigned long long)newb);
 
        BUG_ON(!locked_page);
        BUG_ON(!PageLocked(locked_page));
 
        cur_index = locked_page->index;
-
-       for (end = count + beg; beg < end; beg = (beg | mask) + 1) {
-               index = beg >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
+       end = count + beg;
+       last_index = end >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
+       for (i = beg; i < end; i = (i | mask) + 1) {
+               index = i >> (PAGE_CACHE_SHIFT - inode->i_blkbits);
 
                if (likely(cur_index != index)) {
                        page = ufs_get_locked_page(mapping, index);
-                       if (!page || IS_ERR(page)) /* it was truncated or EIO */
+                       if (!page)/* it was truncated */
+                               continue;
+                       if (IS_ERR(page)) {/* or EIO */
+                               ufs_error(inode->i_sb, __FUNCTION__,
+                                         "read of page %llu failed\n",
+                                         (unsigned long long)index);
                                continue;
+                       }
                } else
                        page = locked_page;
 
                head = page_buffers(page);
                bh = head;
-               pos = beg & mask;
+               pos = i & mask;
                for (j = 0; j < pos; ++j)
                        bh = bh->b_this_page;
-               j = 0;
+
+
+               if (unlikely(index == last_index))
+                       lblock = end & mask;
+               else
+                       lblock = blks_per_page;
+
                do {
-                       if (buffer_mapped(bh)) {
-                               pos = bh->b_blocknr - oldb;
-                               if (pos < count) {
-                                       UFSD(" change from %llu to %llu\n",
-                                            (unsigned long long)pos + oldb,
-                                            (unsigned long long)pos + newb);
-                                       bh->b_blocknr = newb + pos;
-                                       unmap_underlying_metadata(bh->b_bdev,
-                                                                 bh->b_blocknr);
-                                       mark_buffer_dirty(bh);
-                                       ++j;
+                       if (j >= lblock)
+                               break;
+                       pos = (i - beg) + j;
+
+                       if (!buffer_mapped(bh))
+                                       map_bh(bh, inode->i_sb, oldb + pos);
+                       if (!buffer_uptodate(bh)) {
+                               ll_rw_block(READ, 1, &bh);
+                               wait_on_buffer(bh);
+                               if (!buffer_uptodate(bh)) {
+                                       ufs_error(inode->i_sb, __FUNCTION__,
+                                                 "read of block failed\n");
+                                       break;
                                }
                        }
 
+                       UFSD(" change from %llu to %llu, pos %u\n",
+                            (unsigned long long)pos + oldb,
+                            (unsigned long long)pos + newb, pos);
+
+                       bh->b_blocknr = newb + pos;
+                       unmap_underlying_metadata(bh->b_bdev,
+                                                 bh->b_blocknr);
+                       mark_buffer_dirty(bh);
+                       ++j;
                        bh = bh->b_this_page;
                } while (bh != head);
 
-               if (j)
-                       set_page_dirty(page);
-
                if (likely(cur_index != index))
                        ufs_put_locked_page(page);
        }
@@ -457,8 +482,9 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
        if (result) {
                ufs_clear_frags(inode, result + oldcount, newcount - oldcount,
                                locked_page != NULL);
-               ufs_change_blocknr(inode, fragment - oldcount, oldcount, tmp,
-                                  result, locked_page);
+               ufs_change_blocknr(inode, fragment - oldcount, oldcount,
+                                  uspi->s_sbbase + tmp,
+                                  uspi->s_sbbase + result, locked_page);
                ufs_cpu_to_data_ptr(sb, p, result);
                *err = 0;
                UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count);
index b868878009b68515730a8c43b9690b001d59fbfa..c28a8b6f2feb65695dca3be4cd7d954871425d8f 100644 (file)
@@ -343,9 +343,8 @@ cg_found:
                lock_buffer(bh);
                ufs2_inode = (struct ufs2_inode *)bh->b_data;
                ufs2_inode += ufs_inotofsbo(inode->i_ino);
-               ufs2_inode->ui_birthtime.tv_sec =
-                       cpu_to_fs32(sb, CURRENT_TIME_SEC.tv_sec);
-               ufs2_inode->ui_birthtime.tv_usec = 0;
+               ufs2_inode->ui_birthtime = cpu_to_fs64(sb, CURRENT_TIME.tv_sec);
+               ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, CURRENT_TIME.tv_nsec);
                mark_buffer_dirty(bh);
                unlock_buffer(bh);
                if (sb->s_flags & MS_SYNCHRONOUS)
index fb34ad03e22404af08871ea66267c7df1542e636..013d7afe7cde796a02c2c70b9b9872ba064e06bb 100644 (file)
@@ -212,7 +212,7 @@ repeat:
                        brelse (result);
                        goto repeat;
                } else {
-                       *phys = tmp + blockoff;
+                       *phys = uspi->s_sbbase + tmp + blockoff;
                        return NULL;
                }
        }
@@ -282,9 +282,9 @@ repeat:
        }
 
        if (!phys) {
-               result = sb_getblk(sb, tmp + blockoff);
+               result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff);
        } else {
-               *phys = tmp + blockoff;
+               *phys = uspi->s_sbbase + tmp + blockoff;
                result = NULL;
                *err = 0;
                *new = 1;
@@ -368,7 +368,7 @@ repeat:
                        brelse (result);
                        goto repeat;
                } else {
-                       *phys = tmp + blockoff;
+                       *phys = uspi->s_sbbase + tmp + blockoff;
                        goto out;
                }
        }
@@ -389,9 +389,9 @@ repeat:
 
 
        if (!phys) {
-               result = sb_getblk(sb, tmp + blockoff);
+               result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff);
        } else {
-               *phys = tmp + blockoff;
+               *phys = uspi->s_sbbase + tmp + blockoff;
                *new = 1;
        }
 
@@ -668,12 +668,12 @@ static void ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
        inode->i_gid = fs32_to_cpu(sb, ufs2_inode->ui_gid);
 
        inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size);
-       inode->i_atime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_atime.tv_sec);
-       inode->i_ctime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_ctime.tv_sec);
-       inode->i_mtime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_mtime.tv_sec);
-       inode->i_mtime.tv_nsec = 0;
-       inode->i_atime.tv_nsec = 0;
-       inode->i_ctime.tv_nsec = 0;
+       inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime);
+       inode->i_ctime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_ctime);
+       inode->i_mtime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_mtime);
+       inode->i_atime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_atimensec);
+       inode->i_ctime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_ctimensec);
+       inode->i_mtime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_mtimensec);
        inode->i_blocks = fs64_to_cpu(sb, ufs2_inode->ui_blocks);
        inode->i_generation = fs32_to_cpu(sb, ufs2_inode->ui_gen);
        ufsi->i_flags = fs32_to_cpu(sb, ufs2_inode->ui_flags);
@@ -803,12 +803,12 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode)
        ufs_inode->ui_gid = cpu_to_fs32(sb, inode->i_gid);
 
        ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size);
-       ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec);
-       ufs_inode->ui_atime.tv_usec = 0;
-       ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, inode->i_ctime.tv_sec);
-       ufs_inode->ui_ctime.tv_usec = 0;
-       ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, inode->i_mtime.tv_sec);
-       ufs_inode->ui_mtime.tv_usec = 0;
+       ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec);
+       ufs_inode->ui_atimensec = cpu_to_fs32(sb, inode->i_atime.tv_nsec);
+       ufs_inode->ui_ctime = cpu_to_fs64(sb, inode->i_ctime.tv_sec);
+       ufs_inode->ui_ctimensec = cpu_to_fs32(sb, inode->i_ctime.tv_nsec);
+       ufs_inode->ui_mtime = cpu_to_fs64(sb, inode->i_mtime.tv_sec);
+       ufs_inode->ui_mtimensec = cpu_to_fs32(sb, inode->i_mtime.tv_nsec);
 
        ufs_inode->ui_blocks = cpu_to_fs64(sb, inode->i_blocks);
        ufs_inode->ui_flags = cpu_to_fs32(sb, ufsi->i_flags);
index 749581fa7729fe2e20add00e0ae587bc33267edb..79c54c85fb58e8cd937da6fa1e8b46505e26908b 100644 (file)
@@ -74,7 +74,7 @@ static int ufs_trunc_direct(struct inode *inode)
        unsigned i, tmp;
        int retry;
        
-       UFSD("ENTER\n");
+       UFSD("ENTER: ino %lu\n", inode->i_ino);
 
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
@@ -96,8 +96,8 @@ static int ufs_trunc_direct(struct inode *inode)
                block2 = ufs_fragstoblks (frag3);
        }
 
-       UFSD("frag1 %llu, frag2 %llu, block1 %llu, block2 %llu, frag3 %llu,"
-            " frag4 %llu\n",
+       UFSD("ino %lu, frag1 %llu, frag2 %llu, block1 %llu, block2 %llu,"
+            " frag3 %llu, frag4 %llu\n", inode->i_ino,
             (unsigned long long)frag1, (unsigned long long)frag2,
             (unsigned long long)block1, (unsigned long long)block2,
             (unsigned long long)frag3, (unsigned long long)frag4);
@@ -163,7 +163,7 @@ next1:
        mark_inode_dirty(inode);
  next3:
 
-       UFSD("EXIT\n");
+       UFSD("EXIT: ino %lu\n", inode->i_ino);
        return retry;
 }
 
@@ -248,7 +248,7 @@ static int ufs_trunc_indirect(struct inode *inode, u64 offset, void *p)
        }
        ubh_brelse (ind_ubh);
        
-       UFSD("EXIT\n");
+       UFSD("EXIT: ino %lu\n", inode->i_ino);
        
        return retry;
 }
@@ -262,7 +262,7 @@ static int ufs_trunc_dindirect(struct inode *inode, u64 offset, void *p)
        void *dind;
        int retry = 0;
        
-       UFSD("ENTER\n");
+       UFSD("ENTER: ino %lu\n", inode->i_ino);
        
        sb = inode->i_sb;
        uspi = UFS_SB(sb)->s_uspi;
@@ -312,7 +312,7 @@ static int ufs_trunc_dindirect(struct inode *inode, u64 offset, void *p)
        }
        ubh_brelse (dind_bh);
        
-       UFSD("EXIT\n");
+       UFSD("EXIT: ino %lu\n", inode->i_ino);
        
        return retry;
 }
@@ -327,7 +327,7 @@ static int ufs_trunc_tindirect(struct inode *inode)
        void *tind, *p;
        int retry;
        
-       UFSD("ENTER\n");
+       UFSD("ENTER: ino %lu\n", inode->i_ino);
 
        retry = 0;
        
@@ -348,7 +348,7 @@ static int ufs_trunc_tindirect(struct inode *inode)
        }
 
        for (i = tindirect_block ; i < uspi->s_apb ; i++) {
-               tind = ubh_get_addr32 (tind_bh, i);
+               tind = ubh_get_data_ptr(uspi, tind_bh, i);
                retry |= ufs_trunc_dindirect(inode, UFS_NDADDR + 
                        uspi->s_apb + ((i + 1) << uspi->s_2apbshift), tind);
                ubh_mark_buffer_dirty(tind_bh);
@@ -372,19 +372,21 @@ static int ufs_trunc_tindirect(struct inode *inode)
        }
        ubh_brelse (tind_bh);
        
-       UFSD("EXIT\n");
+       UFSD("EXIT: ino %lu\n", inode->i_ino);
        return retry;
 }
 
 static int ufs_alloc_lastblock(struct inode *inode)
 {
        int err = 0;
+       struct super_block *sb = inode->i_sb;
        struct address_space *mapping = inode->i_mapping;
-       struct ufs_sb_private_info *uspi = UFS_SB(inode->i_sb)->s_uspi;
+       struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
        unsigned i, end;
        sector_t lastfrag;
        struct page *lastpage;
        struct buffer_head *bh;
+       u64 phys64;
 
        lastfrag = (i_size_read(inode) + uspi->s_fsize - 1) >> uspi->s_fshift;
 
@@ -424,6 +426,20 @@ static int ufs_alloc_lastblock(struct inode *inode)
               set_page_dirty(lastpage);
        }
 
+       if (lastfrag >= UFS_IND_FRAGMENT) {
+              end = uspi->s_fpb - ufs_fragnum(lastfrag) - 1;
+              phys64 = bh->b_blocknr + 1;
+              for (i = 0; i < end; ++i) {
+                      bh = sb_getblk(sb, i + phys64);
+                      lock_buffer(bh);
+                      memset(bh->b_data, 0, sb->s_blocksize);
+                      set_buffer_uptodate(bh);
+                      mark_buffer_dirty(bh);
+                      unlock_buffer(bh);
+                      sync_dirty_buffer(bh);
+                      brelse(bh);
+              }
+       }
 out_unlock:
        ufs_put_locked_page(lastpage);
 out:
index 73967c8152d325012db1f690f9cd6744caec2f76..440983019993def8c5e3352b091892be11c6d288 100644 (file)
@@ -446,14 +446,10 @@ acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
 /*
  * exutils - interpreter/scanner utilities
  */
-void acpi_ex_enter_interpreter(void);
+acpi_status acpi_ex_enter_interpreter(void);
 
 void acpi_ex_exit_interpreter(void);
 
-void acpi_ex_reacquire_interpreter(void);
-
-void acpi_ex_relinquish_interpreter(void);
-
 void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
 
 u8 acpi_ex_acquire_global_lock(u32 rule);
index 72a6e2c3a5361fa3a1b5b5e0ef2548ec97569863..56bf492e7acc819e7718e6cc13dd85b3b206560a 100644 (file)
@@ -344,7 +344,7 @@ typedef u32 acpi_integer;
 
 /* 64-bit integers */
 
-typedef u64 acpi_integer;
+typedef unsigned long long              acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
 #define ACPI_INTEGER_BIT_SIZE           64
 #define ACPI_MAX_DECIMAL_DIGITS         20     /* 2^64 = 18,446,744,073,709,551,616 */
index 98ad2114f43a2bbae4c68c19225dd25270d7a533..0a241e2fb672212b52293872dcb445e53c081be3 100644 (file)
@@ -223,7 +223,7 @@ static inline void gpio_free(unsigned gpio)
 }
 
 extern int gpio_direction_input(unsigned gpio);
-extern int gpio_direction_output(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio, int value);
 
 static inline int gpio_get_value(unsigned gpio)
 {
index 3762a6ae6a7f345d1343d1defa43737546b9e445..590917efc94acdecca3be6fad273f31b24a9ef41 100644 (file)
@@ -113,8 +113,9 @@ static inline int gpio_direction_input(unsigned gpio)
        return __gpio_set_direction(gpio, 1);
 }
 
-static inline int gpio_direction_output(unsigned gpio)
+static inline int gpio_direction_output(unsigned gpio, int value)
 {
+       omap_set_gpio_dataout(gpio, value);
        return __gpio_set_direction(gpio, 0);
 }
 
index 3d348a3511575fb4083359a944740fe12746098c..aeba24347f8e43355619711b3a4f10e4ec0a8c4d 100644 (file)
@@ -43,9 +43,9 @@ static inline int gpio_direction_input(unsigned gpio)
        return pxa_gpio_mode(gpio | GPIO_IN);
 }
 
-static inline int gpio_direction_output(unsigned gpio)
+static inline int gpio_direction_output(unsigned gpio, int value)
 {
-       return pxa_gpio_mode(gpio | GPIO_OUT);
+       return pxa_gpio_mode(gpio | GPIO_OUT | (value ? 0 : GPIO_DFLT_LOW));
 }
 
 static inline int __gpio_get_value(unsigned gpio)
index d47ae453f8cae3eb4728964bc5c08d4546e0687e..7583895fd336fa7e8aabff426645e71824e3c273 100644 (file)
@@ -44,9 +44,11 @@ static inline int gpio_direction_input(unsigned gpio)
        return 0;
 }
 
-static inline int gpio_direction_output(unsigned gpio)
+static inline int gpio_direction_output(unsigned gpio, int value)
 {
        s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
+       /* REVISIT can we write the value first, to avoid glitching? */
+       s3c2410_gpio_setpin(gpio, value);
        return 0;
 }
 
index da7575b0e5d0f2f00ca58b09cc4aeaa22635f93a..e7a9d26e22a8b0a4baa1d0de08b65d672e418a79 100644 (file)
@@ -38,7 +38,7 @@ static inline void gpio_free(unsigned gpio)
 }
 
 extern int gpio_direction_input(unsigned gpio);
-extern int gpio_direction_output(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio, int value);
 
 
 static inline int gpio_get_value(unsigned gpio)
index ea88aa6bfc78e91c9d0442ab2b504e3ddabe1c56..f266c2795124901fc05b6ba3cff0bb607e393655 100644 (file)
@@ -103,9 +103,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
        unsigned long tmp, tmp2;
 
        __asm__ __volatile__("@ atomic_clear_mask\n"
-"1:    ldrex   %0, %2\n"
+"1:    ldrex   %0, [%2]\n"
 "      bic     %0, %0, %3\n"
-"      strex   %1, %0, %2\n"
+"      strex   %1, %0, [%2]\n"
 "      teq     %1, #0\n"
 "      bne     1b"
        : "=&r" (tmp), "=&r" (tmp2)
index fcb756bdaa8e01922901c374f17a3a744ba3204f..80a21aa9ae77016158e12bad83064ca4a9d2a39f 100644 (file)
@@ -10,7 +10,7 @@ int __must_check gpio_request(unsigned int gpio, const char *label);
 void gpio_free(unsigned int gpio);
 
 int gpio_direction_input(unsigned int gpio);
-int gpio_direction_output(unsigned int gpio);
+int gpio_direction_output(unsigned int gpio, int value);
 int gpio_get_value(unsigned int gpio);
 void gpio_set_value(unsigned int gpio, int value);
 
index c94d51c993ee15f6009415c921082e544762d32a..7d72351bea753f54d79d26e32aa460f2dd01ea06 100644 (file)
@@ -130,7 +130,7 @@ static inline int sync_test_and_change_bit(int nr, volatile unsigned long* addr)
        return oldbit;
 }
 
-static __always_inline int sync_const_test_bit(int nr, const volatile unsigned long *addr)
+static __always_inline int sync_constant_test_bit(int nr, const volatile unsigned long *addr)
 {
        return ((1UL << (nr & 31)) &
                (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
index 3c96ac19154eaf4113028d5690521fb075adc78b..ca33eb181ff26949eabc5758b7203b47aa11a154 100644 (file)
@@ -168,6 +168,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
 #  define platform_setup_msi_irq       ia64_mv.setup_msi_irq
 #  define platform_teardown_msi_irq    ia64_mv.teardown_msi_irq
 #  define platform_pci_fixup_bus       ia64_mv.pci_fixup_bus
+#  define platform_kernel_launch_event ia64_mv.kernel_launch_event
 # endif
 
 /* __attribute__((__aligned__(16))) is required to make size of the
@@ -269,6 +270,7 @@ struct ia64_machine_vector {
        platform_setup_msi_irq,                 \
        platform_teardown_msi_irq,              \
        platform_pci_fixup_bus,                 \
+       platform_kernel_launch_event            \
 }
 
 extern struct ia64_machine_vector ia64_mv;
index 8578869a8bcfb4556d3e50a62312b0c5abc3f8ee..1ac50b6c47adfc634ad55a3b023dc1d63fce7d3e 100644 (file)
@@ -79,9 +79,9 @@ static __inline__ void atomic_add(int i, atomic_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                v->counter += i;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -124,9 +124,9 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                v->counter -= i;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -173,11 +173,11 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result += i;
                v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
@@ -225,11 +225,11 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result -= i;
                v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
@@ -293,12 +293,12 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result -= i;
                if (result >= 0)
                        v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
@@ -454,9 +454,9 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                v->counter += i;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -499,9 +499,9 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                v->counter -= i;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -548,11 +548,11 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result += i;
                v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
@@ -600,11 +600,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result -= i;
                v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
@@ -668,12 +668,12 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                result = v->counter;
                result -= i;
                if (result >= 0)
                        v->counter = result;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 
        smp_mb();
index 8959da245cfbb751d77b2186870a98ca1816301a..d995413e11fd87af0844e82b6d10c90e3324b60b 100644 (file)
@@ -100,9 +100,9 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                *a |= mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -165,9 +165,9 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                *a &= ~mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -220,9 +220,9 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                *a ^= mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
        }
 }
 
@@ -287,10 +287,10 @@ static inline int test_and_set_bit(unsigned long nr,
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = (mask & *a) != 0;
                *a |= mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
 
                return retval;
        }
@@ -381,10 +381,10 @@ static inline int test_and_clear_bit(unsigned long nr,
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = (mask & *a) != 0;
                *a &= ~mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
 
                return retval;
        }
@@ -452,10 +452,10 @@ static inline int test_and_change_bit(unsigned long nr,
 
                a += nr >> SZLONG_LOG;
                mask = 1UL << bit;
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = (mask & *a) != 0;
                *a ^= mask;
-               local_irq_restore(flags);
+               raw_local_irq_restore(flags);
 
                return retval;
        }
index eadca266f159bcaae8d1fd5644e4bc191e026b40..5e4bed123b487640f13541f3153e5d1e43960ab1 100644 (file)
@@ -40,6 +40,9 @@
 #endif
 #ifndef cpu_has_fpu
 #define cpu_has_fpu            (current_cpu_data.options & MIPS_CPU_FPU)
+#define raw_cpu_has_fpu                (raw_current_cpu_data.options & MIPS_CPU_FPU)
+#else
+#define raw_cpu_has_fpu                cpu_has_fpu
 #endif
 #ifndef cpu_has_32fpr
 #define cpu_has_32fpr          (cpu_data[0].options & MIPS_CPU_32FPR)
index 610d0cdeaa9e164ecdc372f3199d9793429be0c9..22fe8453fcc764427dc1f7f5807d7ee30e817f28 100644 (file)
@@ -87,6 +87,7 @@ struct cpuinfo_mips {
 
 extern struct cpuinfo_mips cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
+#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
 
 extern void cpu_probe(void);
 extern void cpu_report(void);
index efef843b93f0c1694a2084f1a502523a5ac69318..4e12d1f9534f9d99d43123c0cb517887946b5443 100644 (file)
 struct sigcontext;
 struct sigcontext32;
 
-extern asmlinkage int (*save_fp_context)(struct sigcontext *sc);
-extern asmlinkage int (*restore_fp_context)(struct sigcontext *sc);
+extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);
+extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);
 
-extern asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc);
-extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc);
+extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
+extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);
 
 extern void fpu_emulator_init_fpu(void);
 extern void _init_fpu(void);
@@ -68,6 +68,8 @@ do {                                                                  \
        /* We don't care about the c0 hazard here  */                   \
 } while (0)
 
+#define __fpu_enabled()        (read_c0_status() & ST0_CU1)
+
 #define enable_fpu()                                                   \
 do {                                                                   \
        if (cpu_has_fpu)                                                \
@@ -93,31 +95,47 @@ static inline int is_fpu_owner(void)
        return cpu_has_fpu && __is_fpu_owner();
 }
 
-static inline void own_fpu(void)
+static inline void __own_fpu(void)
 {
-       if (cpu_has_fpu) {
-               __enable_fpu();
-               KSTK_STATUS(current) |= ST0_CU1;
-               set_thread_flag(TIF_USEDFPU);
+       __enable_fpu();
+       KSTK_STATUS(current) |= ST0_CU1;
+       set_thread_flag(TIF_USEDFPU);
+}
+
+static inline void own_fpu(int restore)
+{
+       preempt_disable();
+       if (cpu_has_fpu && !__is_fpu_owner()) {
+               __own_fpu();
+               if (restore)
+                       _restore_fp(current);
        }
+       preempt_enable();
 }
 
-static inline void lose_fpu(void)
+static inline void lose_fpu(int save)
 {
-       if (cpu_has_fpu) {
+       preempt_disable();
+       if (is_fpu_owner()) {
+               if (save)
+                       _save_fp(current);
                KSTK_STATUS(current) &= ~ST0_CU1;
                clear_thread_flag(TIF_USEDFPU);
                __disable_fpu();
        }
+       preempt_enable();
 }
 
 static inline void init_fpu(void)
 {
+       preempt_disable();
        if (cpu_has_fpu) {
+               __own_fpu();
                _init_fpu();
        } else {
                fpu_emulator_init_fpu();
        }
+       preempt_enable();
 }
 
 static inline void save_fp(struct task_struct *tsk)
@@ -144,4 +162,18 @@ static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
        return tsk->thread.fpu.fpr;
 }
 
+static inline void enable_fp_in_kernel(void)
+{
+       set_thread_flag(TIF_ALLOW_FP_IN_KERNEL);
+       /* make sure CU1 and FPU ownership are consistent */
+       if (!__is_fpu_owner() && __fpu_enabled())
+               __disable_fpu();
+}
+
+static inline void disable_fp_in_kernel(void)
+{
+       BUG_ON(!__is_fpu_owner() && __fpu_enabled());
+       clear_thread_flag(TIF_ALLOW_FP_IN_KERNEL);
+}
+
 #endif /* _ASM_FPU_H */
index e9fa252f8a3f0deeb8e018b0e7c7cecb455cdb18..8fcae21adbd5a0af54f89f6b0e7e7e8fa1cdeb60 100644 (file)
@@ -141,40 +141,6 @@ static int auide_ddma_init( _auide_hwif *auide );
 static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif);
 int __init auide_probe(void);
 
-#ifdef CONFIG_PM
-        int au1200ide_pm_callback( au1xxx_power_dev_t *dev,
-                                   au1xxx_request_t request, void *data);
-        static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_access( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev );
-#endif
-
-
-/*
- * Multi-Word DMA + DbDMA functions
- */
-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-        static int auide_build_sglist(ide_drive_t *drive,  struct request *rq);
-        static int auide_build_dmatable(ide_drive_t *drive);
-        static int auide_dma_end(ide_drive_t *drive);
-        ide_startstop_t auide_dma_intr (ide_drive_t *drive);
-        static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command);
-        static int auide_dma_setup(ide_drive_t *drive);
-        static int auide_dma_check(ide_drive_t *drive);
-        static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);
-        static int auide_dma_host_on(ide_drive_t *drive);
-        static int auide_dma_lostirq(ide_drive_t *drive);
-        static int auide_dma_on(ide_drive_t *drive);
-        static void auide_ddma_tx_callback(int irq, void *param);
-        static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
-#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
-
 /*******************************************************************************
 * PIO Mode timing calculation :                                                *
 *                                                                              *
index 659816e200d4b1bedc724919479d38b4b0fc3f0b..3fdbbf68e9522a91897f655d79cdf6ad44df26c6 100644 (file)
@@ -18,7 +18,8 @@
 
 struct device;
 
-static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size)
+static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
+       size_t size)
 {
        dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr));
 
@@ -37,7 +38,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return dma_addr & (0xffUL << 56);
 }
 
-static void plat_unmap_dma_mem(dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
 {
 }
 
index 950be17bbb86ef38a89a9ccea7e2c5e3fe6be13e..c3f9a6a20eb0110c351e6a6e89934da8ac5cbb4b 100644 (file)
@@ -26,7 +26,8 @@ struct device;
 
 #define RAM_OFFSET_MASK 0x3fffffffUL
 
-static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size)
+static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
+       size_t size)
 {
        dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK;
 
@@ -59,7 +60,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return addr;
 }
 
-static void plat_unmap_dma_mem(dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(dma_addr_t dma_addr)
 {
 }
 
index 59162f74a7982b98801fe903aceafe0fe08354a5..65778c890a62ef4ed3b06a673d7ce552ca616e2a 100644 (file)
@@ -23,8 +23,8 @@
 
 extern int rtlx_open(int index, int can_sleep);
 extern int rtlx_release(int index);
-extern ssize_t rtlx_read(int index, void *buff, size_t count, int user);
-extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user);
+extern ssize_t rtlx_read(int index, void __user *buff, size_t count);
+extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count);
 extern unsigned int rtlx_read_poll(int index, int can_sleep);
 extern unsigned int rtlx_write_poll(int index);
 
index 597a3743f6a1896aedf1369afabeb11ebe632c6d..290887077e4497cda1812a13da6b24d5fd07d243 100644 (file)
@@ -121,10 +121,10 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = *m;
                *m = val;
-               local_irq_restore(flags);       /* implies memory barrier  */
+               raw_local_irq_restore(flags);   /* implies memory barrier  */
        }
 
        smp_mb();
@@ -169,10 +169,10 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = *m;
                *m = val;
-               local_irq_restore(flags);       /* implies memory barrier  */
+               raw_local_irq_restore(flags);   /* implies memory barrier  */
        }
 
        smp_mb();
@@ -250,11 +250,11 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = *m;
                if (retval == old)
                        *m = new;
-               local_irq_restore(flags);       /* implies memory barrier  */
+               raw_local_irq_restore(flags);   /* implies memory barrier  */
        }
 
        smp_mb();
@@ -304,11 +304,11 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
        } else {
                unsigned long flags;
 
-               local_irq_save(flags);
+               raw_local_irq_save(flags);
                retval = *m;
                if (retval == old)
                        *m = new;
-               local_irq_restore(flags);       /* implies memory barrier  */
+               raw_local_irq_restore(flags);   /* implies memory barrier  */
        }
 
        smp_mb();
index fbcda82044738b34674f8630aab3905dc2a7bf44..6cf05f4a4e7e6add8341c8eaaab3a9e36238170d 100644 (file)
@@ -119,6 +119,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #define TIF_POLLING_NRFLAG     17      /* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_MEMDIE             18
 #define TIF_FREEZE             19
+#define TIF_ALLOW_FP_IN_KERNEL 20
 #define TIF_SYSCALL_TRACE      31      /* syscall trace active */
 
 #define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
index 660f78271a93e3c9d91585bff8c186365a2a1239..0eb64083480a82146ce755206a0e09dff3aabea8 100644 (file)
 #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \
                              sizeof(struct ipl_block_fcp))
 
+#define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8)
+
 #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \
                              sizeof(struct ipl_block_ccw))
 
+#define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8)
+
 #define IPL_MAX_SUPPORTED_VERSION (0)
 
 #define IPL_PARMBLOCK_START    ((struct ipl_parameter_block *) \
@@ -58,6 +62,7 @@ struct ipl_block_ccw {
        u8  vm_flags;
        u8  reserved3[3];
        u32 vm_parm_len;
+       u8  reserved4[80];
 } __attribute__((packed));
 
 struct ipl_parameter_block {
index fb6fef97d739c55e5ff32bf1eca477c4697a35e8..5c6f00d62df8b3582c5975a0623f920571ce45aa 100644 (file)
 /* Number 310 is reserved for new sys_move_pages */
 #define __NR_getcpu            311
 #define __NR_epoll_pwait       312
+#define __NR_utimes            313
 
-#define NR_syscalls 313
+#define NR_syscalls 314
 
 /* 
  * There are some system calls that are not present on 64 bit, some
index 9d84a2d445a269eee10367b265b942ec7c268b11..35805df010a0fbf266a5c968fccf41f52dba944a 100644 (file)
 #define TCSETSW                0x5403
 #define TCSETSF                0x5404
 
-#define TCGETA         _IOR('t', 23, struct termio)
-#define TCSETA         _IOW('t', 24, struct termio)
-#define TCSETAW                _IOW('t', 25, struct termio)
-#define TCSETAF                _IOW('t', 28, struct termio)
+#define TCGETA         0x80127417      /* _IOR('t', 23, struct termio) */
+#define TCSETA         0x40127418      /* _IOW('t', 24, struct termio) */
+#define TCSETAW                0x40127419      /* _IOW('t', 25, struct termio) */
+#define TCSETAF                0x4012741C      /* _IOW('t', 28, struct termio) */
 
 #define TCSBRK         _IO('t', 29)
 #define TCXONC         _IO('t', 30)
 #define TCFLSH         _IO('t', 31)
 
-#define TIOCSWINSZ     _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ     _IOR('t', 104, struct winsize)
+#define TIOCSWINSZ     0x40087467      /* _IOW('t', 103, struct winsize) */
+#define TIOCGWINSZ     0x80087468      /* _IOR('t', 104, struct winsize) */
 #define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
 #define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
 #define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
@@ -59,8 +59,8 @@
 #define TIOCSSOFTCAR   _IOW('T', 26, unsigned int) /* 0x541A */
 #define TIOCLINUX      _IOW('T', 28, char) /* 0x541C */
 #define TIOCCONS       _IO('T', 29) /* 0x541D */
-#define TIOCGSERIAL    _IOR('T', 30, struct serial_struct) /* 0x541E */
-#define TIOCSSERIAL    _IOW('T', 31, struct serial_struct) /* 0x541F */
+#define TIOCGSERIAL    0x803C541E      /* _IOR('T', 30, struct serial_struct) 0x541E */
+#define TIOCSSERIAL    0x403C541F      /* _IOW('T', 31, struct serial_struct) 0x541F */
 #define TIOCPKT                _IOW('T', 32, int) /* 0x5420 */
 # define TIOCPKT_DATA           0
 # define TIOCPKT_FLUSHREAD      1
 #define TIOCSERSWILD   _IOW('T', 85,  int) /* 0x5455 */
 #define TIOCGLCKTRMIOS 0x5456
 #define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT _IOR('T', 88, struct async_struct) /* 0x5458 */ /* For debugging only */
+#define TIOCSERGSTRUCT 0x80d85458      /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */
 #define TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
   /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
 # define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* 0x545A */ /* Get multiport config  */
-#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */
+#define TIOCSERGETMULTI 0x80A8545A     /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */
+#define TIOCSERSETMULTI 0x40A8545B     /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */
 
 #define TIOCMIWAIT     _IO('T', 92) /* 0x545C */       /* wait for a change on serial input line(s) */
 #define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
index 8ccf7ae593efaf871b0d8e7ec04e2625ae91eb72..afe188f0ad5f444ee60e7356ec650de87f6216fd 100644 (file)
 /*
  * Convert back and forth between INTEVT and IRQ values.
  */
+#ifdef CONFIG_CPU_HAS_INTEVT
 #define evt2irq(evt)           (((evt) >> 5) - 16)
 #define irq2evt(irq)           (((irq) + 16) << 5)
+#else
+#define evt2irq(evt)           (evt)
+#define irq2evt(irq)           (irq)
+#endif
 
 /*
  * Simple Mask Register Support
index 17f527bfd455ec72fa369e056f32652138e9a1fb..49be50a36b77dc3dc02dad61892100051f030377 100644 (file)
 #define __NR_fcntl64           221
 /* 223 is unused */
 #define __NR_gettid            224
+#define __NR_readahead         225
 #define __NR_setxattr          226
 #define __NR_lsetxattr         227
 #define __NR_fsetxattr         228
index e82612cd9f33635f7d198838c44f88f213e0cd2d..ab55ffcb7bf4963cb07f61a730f6b89390e43771 100644 (file)
@@ -264,6 +264,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
        be,a,pt         %xcc, OK_LABEL; \
         mov            REG4, REG1;
 
+#ifndef CONFIG_DEBUG_PAGEALLOC
        /* This version uses a trick, the TAG is already (VADDR >> 22) so
         * we can make use of that for the index computation.
         */
@@ -277,5 +278,6 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
        cmp             REG3, TAG; \
        be,a,pt         %xcc, OK_LABEL; \
         mov            REG4, REG1;
+#endif
 
 #endif /* !(_SPARC64_TSB_H) */
index f54f3abf93ce5a575d0d2b7dc5d4f26776335c71..b6e65a699f2af833bf9c01b0d5671321ff216925 100644 (file)
@@ -99,7 +99,7 @@ extern int force_iommu, no_iommu;
 extern int iommu_detected;
 #ifdef CONFIG_IOMMU
 extern void gart_iommu_init(void);
-extern void gart_parse_options(char *);
+extern void __init gart_parse_options(char *);
 extern void iommu_hole_init(void);
 extern int fallback_aper_order;
 extern int fallback_aper_force;
index e17b9ec42e98d105d61d373ce47a828f8e6eaabc..de592a408c0781cae04fbd9ddf2d63a02d897810 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/bitops.h>
+#include <linux/init.h>
 extern int disable_apic;
 
 #include <asm/fixmap.h>
@@ -68,7 +69,7 @@ extern int __cpu_disable(void);
 extern void __cpu_die(unsigned int cpu);
 extern void prefill_possible_map(void);
 extern unsigned num_processors;
-extern unsigned disabled_cpus;
+extern unsigned __cpuinitdata disabled_cpus;
 
 #define NO_PROC_ID             0xFF            /* No processor magic marker */
 
index 7011d6255593dda940f859ab02e89e505d1a57ae..f2542c24b328b291c23b3cbee3a12a9f1ae45e86 100644 (file)
@@ -93,6 +93,7 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
 void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
 void set_bdi_congested(struct backing_dev_info *bdi, int rw);
 long congestion_wait(int rw, long timeout);
+long congestion_wait_interruptible(int rw, long timeout);
 void congestion_end(int rw);
 
 #define bdi_cap_writeback_dirty(bdi) \
index 06c58c423fe17668987839f71695c8bf64983a49..506ad20c18f8736b355530cc01fa91ca149fe322 100644 (file)
@@ -75,7 +75,7 @@ extern int do_poke_blanked_console;
 
 extern void (*kbd_ledfunc)(unsigned int led);
 
-extern void set_console(int nr);
+extern int set_console(int nr);
 extern void schedule_console_callback(void);
 
 static inline void set_leds(void)
index c68c7ac6b2323601321f80910f8b2e7a19e03709..248305bb9a181681e837667a9fa0f005330a3fa0 100644 (file)
@@ -57,7 +57,11 @@ typedef union {
 } ktime_t;
 
 #define KTIME_MAX                      ((s64)~((u64)1 << 63))
-#define KTIME_SEC_MAX                  (KTIME_MAX / NSEC_PER_SEC)
+#if (BITS_PER_LONG == 64)
+# define KTIME_SEC_MAX                 (KTIME_MAX / NSEC_PER_SEC)
+#else
+# define KTIME_SEC_MAX                 LONG_MAX
+#endif
 
 /*
  * ktime_t definitions when using the 64-bit scalar representation:
index 47aaa2c66738c5d574b96d9048964e7822227a00..e9ae0c6e2c62048a9410df000cac3b8350e70c69 100644 (file)
@@ -415,6 +415,7 @@ extern void nfs_complete_unlink(struct dentry *);
 /*
  * linux/fs/nfs/write.c
  */
+extern int  nfs_congestion_kb;
 extern int  nfs_writepage(struct page *page, struct writeback_control *wbc);
 extern int  nfs_writepages(struct address_space *, struct writeback_control *);
 extern int  nfs_flush_incompatible(struct file *file, struct page *page);
index 95796e6924f1d10be492771595275b7c169dde3a..c95d5e642548428cbdbff5ad0f6462f6ee75f4d8 100644 (file)
@@ -82,6 +82,7 @@ struct nfs_server {
        struct rpc_clnt *       client_acl;     /* ACL RPC client handle */
        struct nfs_iostats *    io_stats;       /* I/O statistics */
        struct backing_dev_info backing_dev_info;
+       atomic_t                writeback;      /* number of writeback pages */
        int                     flags;          /* various flags */
        unsigned int            caps;           /* server capabilities */
        unsigned int            rsize;          /* read size */
index 2e8c048b9b80f9bf539c96a7dcf12a5d86bad27f..9dbca629dcfbfb2f401965e9a4ff87ddda38ce2c 100644 (file)
@@ -25,7 +25,6 @@ struct spi_bitbang {
        spinlock_t              lock;
        struct list_head        queue;
        u8                      busy;
-       u8                      shutdown;
        u8                      use_dma;
 
        struct spi_master       *master;
index 0544edda716888ee3ee26823be8cd82ac497c606..fea9a6b3fb7b54be1a26f4e430dc62a7dbcfff1b 100644 (file)
@@ -11,6 +11,7 @@
 #define _SYSFS_H_
 
 #include <linux/compiler.h>
+#include <linux/errno.h>
 #include <linux/list.h>
 #include <asm/atomic.h>
 
index dc2e9fe694183722ed3dbc29c59cefd8aef2cefb..daeba22b765695d9daffdce3b9249ac6e36a2179 100644 (file)
@@ -649,10 +649,10 @@ struct ufs2_inode {
        __fs32     ui_blksize;     /*  12: Inode blocksize. */
        __fs64     ui_size;        /*  16: File byte count. */
        __fs64     ui_blocks;      /*  24: Bytes actually held. */
-       struct ufs_timeval   ui_atime;       /*  32: Last access time. */
-       struct ufs_timeval   ui_mtime;       /*  40: Last modified time. */
-       struct ufs_timeval   ui_ctime;       /*  48: Last inode change time. */
-       struct ufs_timeval   ui_birthtime;   /*  56: Inode creation time. */
+       __fs64   ui_atime;       /*  32: Last access time. */
+       __fs64   ui_mtime;       /*  40: Last modified time. */
+       __fs64   ui_ctime;       /*  48: Last inode change time. */
+       __fs64   ui_birthtime;   /*  56: Inode creation time. */
        __fs32     ui_mtimensec;   /*  64: Last modified time. */
        __fs32     ui_atimensec;   /*  68: Last access time. */
        __fs32     ui_ctimensec;   /*  72: Last inode change time. */
index 37a1a41f5b65cbd06a0e71ccb17c3304160a9594..e0db669998f3e98ff72dbc02ca230aad82c8a75c 100644 (file)
@@ -83,6 +83,7 @@ void reset_vc(struct vc_data *vc);
 #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
 extern char con_buf[CON_BUF_SIZE];
 extern struct semaphore con_buf_sem;
+extern char vt_dont_switch;
 
 struct vt_spawn_console {
        spinlock_t lock;
index 5f7275000102f47ede042bc0b2a0c660ef4ddaf8..42a18cc95f38cdec90b4c94880ed2a058677fa4b 100644 (file)
@@ -1,3 +1,3 @@
 /* include/version.h.  Generated by alsa/ksync script.  */
 #define CONFIG_SND_VERSION "1.0.14rc3"
-#define CONFIG_SND_DATE " (Tue Mar 06 13:10:00 2007 UTC)"
+#define CONFIG_SND_DATE " (Wed Mar 14 07:25:50 2007 UTC)"
index d154cc786489f3928bbaefe5d31e8da4f78b2481..6af959c034d892a360f4196ed3b981a51890f92a 100644 (file)
@@ -933,8 +933,8 @@ asmlinkage long sys_set_tid_address(int __user *tidptr)
 
 static inline void rt_mutex_init_task(struct task_struct *p)
 {
-#ifdef CONFIG_RT_MUTEXES
        spin_lock_init(&p->pi_lock);
+#ifdef CONFIG_RT_MUTEXES
        plist_head_init(&p->pi_waiters, &p->pi_lock);
        p->pi_blocked_on = NULL;
 #endif
index e749e7df14b1a598c201f61b4d9b5bf8fb7c3d97..5a270b5e3f95de173e44194cd7e5b3d511ec6ff8 100644 (file)
@@ -565,6 +565,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
        if (!pi_state)
                return -EINVAL;
 
+       spin_lock(&pi_state->pi_mutex.wait_lock);
        new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
 
        /*
@@ -604,6 +605,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
        pi_state->owner = new_owner;
        spin_unlock_irq(&new_owner->pi_lock);
 
+       spin_unlock(&pi_state->pi_mutex.wait_lock);
        rt_mutex_unlock(&pi_state->pi_mutex);
 
        return 0;
index ec4cb9f3e3b70c39044cf2ed41b6d7d3785f8d37..6a7938a0d513c2695563a2801eaf6941d1b65128 100644 (file)
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);
 static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
 {
        ktime_t xtim, tomono;
-       struct timespec xts;
+       struct timespec xts, tom;
        unsigned long seq;
 
        do {
@@ -145,10 +145,11 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
 #else
                xts = xtime;
 #endif
+               tom = wall_to_monotonic;
        } while (read_seqretry(&xtime_lock, seq));
 
        xtim = timespec_to_ktime(xts);
-       tomono = timespec_to_ktime(wall_to_monotonic);
+       tomono = timespec_to_ktime(tom);
        base->clock_base[CLOCK_REALTIME].softirq_time = xtim;
        base->clock_base[CLOCK_MONOTONIC].softirq_time =
                ktime_add(xtim, tomono);
@@ -644,6 +645,12 @@ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
                orun++;
        }
        timer->expires = ktime_add(timer->expires, interval);
+       /*
+        * Make sure, that the result did not wrap with a very large
+        * interval.
+        */
+       if (timer->expires.tv64 < 0)
+               timer->expires = ktime_set(KTIME_SEC_MAX, 0);
 
        return orun;
 }
index 623786d4415950b08c8fb6f3461bfb8c86c152b2..89bcf4973ee51cb8cc8028c6a3cf6a2272367b0a 100644 (file)
@@ -27,7 +27,15 @@ int pm_prepare_console(void)
                return 1;
        }
 
-       set_console(SUSPEND_CONSOLE);
+       if (set_console(SUSPEND_CONSOLE)) {
+               /*
+                * We're unable to switch to the SUSPEND_CONSOLE.
+                * Let the calling function know so it can decide
+                * what to do.
+                */
+               release_console_sem();
+               return 1;
+       }
        release_console_sem();
 
        if (vt_waitactive(SUSPEND_CONSOLE)) {
index 406b20adb27ad820a455b93a836ab636cbf65436..873cdf8ea5a419ff5003da0754891bf3382387c7 100644 (file)
@@ -58,6 +58,7 @@ static inline int platform_prepare(void)
 
 static void power_down(suspend_disk_method_t mode)
 {
+       disable_nonboot_cpus();
        switch(mode) {
        case PM_DISK_PLATFORM:
                if (pm_ops && pm_ops->enter) {
@@ -251,6 +252,7 @@ static int software_resume(void)
        error = swsusp_read();
        if (error) {
                swsusp_free();
+               platform_finish();
                goto Thaw;
        }
 
index dd09efe7df54352fac2a621c3cef33286dd4d63a..d6a8dcc26ae552d94f38d456b38a5ce1821e4071 100644 (file)
@@ -398,9 +398,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
 
                case PMOPS_ENTER:
                        if (data->platform_suspend) {
+                               disable_nonboot_cpus();
                                kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
                                error = pm_ops->enter(PM_SUSPEND_DISK);
-                               error = 0;
+                               enable_nonboot_cpus();
                        }
                        break;
 
index 5567745470f7121a284401beec86c1868ed026ae..eadfce2fff74c89f30849f1af213cde5a88dee14 100644 (file)
@@ -307,12 +307,19 @@ int tick_resume_broadcast(void)
        spin_lock_irqsave(&tick_broadcast_lock, flags);
 
        bc = tick_broadcast_device.evtdev;
-       if (bc) {
-               if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC &&
-                   !cpus_empty(tick_broadcast_mask))
-                       tick_broadcast_start_periodic(bc);
 
-               broadcast = cpu_isset(smp_processor_id(), tick_broadcast_mask);
+       if (bc) {
+               switch (tick_broadcast_device.mode) {
+               case TICKDEV_MODE_PERIODIC:
+                       if(!cpus_empty(tick_broadcast_mask))
+                               tick_broadcast_start_periodic(bc);
+                       broadcast = cpu_isset(smp_processor_id(),
+                                             tick_broadcast_mask);
+                       break;
+               case TICKDEV_MODE_ONESHOT:
+                       broadcast = tick_resume_broadcast_oneshot(bc);
+                       break;
+               }
        }
        spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 
@@ -347,6 +354,16 @@ static int tick_broadcast_set_event(ktime_t expires, int force)
        }
 }
 
+int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
+{
+       clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
+
+       if(!cpus_empty(tick_broadcast_oneshot_mask))
+               tick_broadcast_set_event(ktime_get(), 1);
+
+       return cpu_isset(smp_processor_id(), tick_broadcast_oneshot_mask);
+}
+
 /*
  * Reprogram the broadcast device:
  *
index 43ba1bdec14cac3f6b4aa2aff26f4b268572915a..bfda3f7f0716a9ad4915dd2191390f8bbf59ddd8 100644 (file)
@@ -298,18 +298,17 @@ static void tick_shutdown(unsigned int *cpup)
        spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
-static void tick_suspend_periodic(void)
+static void tick_suspend(void)
 {
        struct tick_device *td = &__get_cpu_var(tick_cpu_device);
        unsigned long flags;
 
        spin_lock_irqsave(&tick_device_lock, flags);
-       if (td->mode == TICKDEV_MODE_PERIODIC)
-               clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
+       clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
        spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
-static void tick_resume_periodic(void)
+static void tick_resume(void)
 {
        struct tick_device *td = &__get_cpu_var(tick_cpu_device);
        unsigned long flags;
@@ -317,6 +316,8 @@ static void tick_resume_periodic(void)
        spin_lock_irqsave(&tick_device_lock, flags);
        if (td->mode == TICKDEV_MODE_PERIODIC)
                tick_setup_periodic(td->evtdev, 0);
+       else
+               tick_resume_oneshot();
        spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
@@ -348,13 +349,13 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason,
                break;
 
        case CLOCK_EVT_NOTIFY_SUSPEND:
-               tick_suspend_periodic();
+               tick_suspend();
                tick_suspend_broadcast();
                break;
 
        case CLOCK_EVT_NOTIFY_RESUME:
                if (!tick_resume_broadcast())
-                       tick_resume_periodic();
+                       tick_resume();
                break;
 
        default:
index 75890efd24ff315245562b8ca0c9aef796bc6628..c9d203bde5182a116260819b440768d69b31da2e 100644 (file)
@@ -19,12 +19,13 @@ extern void tick_setup_oneshot(struct clock_event_device *newdev,
 extern int tick_program_event(ktime_t expires, int force);
 extern void tick_oneshot_notify(void);
 extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *));
-
+extern void tick_resume_oneshot(void);
 # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
 extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
 extern void tick_broadcast_oneshot_control(unsigned long reason);
 extern void tick_broadcast_switch_to_oneshot(void);
 extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup);
+extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
 # else /* BROADCAST */
 static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 {
@@ -43,6 +44,10 @@ void tick_setup_oneshot(struct clock_event_device *newdev,
 {
        BUG();
 }
+static inline void tick_resume_oneshot(void)
+{
+       BUG();
+}
 static inline int tick_program_event(ktime_t expires, int force)
 {
        return 0;
@@ -54,6 +59,10 @@ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
 }
 static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
 static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
+static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
+{
+       return 0;
+}
 #endif /* !TICK_ONESHOT */
 
 /*
index 2e8b7ff863cc3396387e0e6b790074d5b53ad381..f6997ab0c3c9c1101c9df8c9bd433e4126cc4a40 100644 (file)
@@ -40,6 +40,18 @@ int tick_program_event(ktime_t expires, int force)
        }
 }
 
+/**
+ * tick_resume_onshot - resume oneshot mode
+ */
+void tick_resume_oneshot(void)
+{
+       struct tick_device *td = &__get_cpu_var(tick_cpu_device);
+       struct clock_event_device *dev = td->evtdev;
+
+       clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
+       tick_program_event(ktime_get(), 1);
+}
+
 /**
  * tick_setup_oneshot - setup the event device for oneshot mode (hres or nohz)
  */
index f50a2811f9dc86b876d24e75333558583c075f1d..e5de3781d3feed5b6f156b064b4af8bb79871fed 100644 (file)
@@ -55,6 +55,22 @@ long congestion_wait(int rw, long timeout)
 }
 EXPORT_SYMBOL(congestion_wait);
 
+long congestion_wait_interruptible(int rw, long timeout)
+{
+       long ret;
+       DEFINE_WAIT(wait);
+       wait_queue_head_t *wqh = &congestion_wqh[rw];
+
+       prepare_to_wait(wqh, &wait, TASK_INTERRUPTIBLE);
+       if (signal_pending(current))
+               ret = -ERESTARTSYS;
+       else
+               ret = io_schedule_timeout(timeout);
+       finish_wait(wqh, &wait);
+       return ret;
+}
+EXPORT_SYMBOL(congestion_wait_interruptible);
+
 /**
  * congestion_end - wake up sleepers on a congested backing_dev_info
  * @rw: READ or WRITE
index d1060b8d3cd65ba696afce181c09fd1c2585f196..5dfc093ceb3d680322158f508bed3b0b47a8fbb7 100644 (file)
@@ -2379,7 +2379,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
        struct file *file = iocb->ki_filp;
        struct address_space *mapping = file->f_mapping;
        ssize_t retval;
-       size_t write_len = 0;
+       size_t write_len;
+       pgoff_t end = 0; /* silence gcc */
 
        /*
         * If it's a write, unmap all mmappings of the file up-front.  This
@@ -2388,23 +2389,46 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
         */
        if (rw == WRITE) {
                write_len = iov_length(iov, nr_segs);
+               end = (offset + write_len - 1) >> PAGE_CACHE_SHIFT;
                if (mapping_mapped(mapping))
                        unmap_mapping_range(mapping, offset, write_len, 0);
        }
 
        retval = filemap_write_and_wait(mapping);
-       if (retval == 0) {
-               retval = mapping->a_ops->direct_IO(rw, iocb, iov,
-                                               offset, nr_segs);
-               if (rw == WRITE && mapping->nrpages) {
-                       pgoff_t end = (offset + write_len - 1)
-                                               >> PAGE_CACHE_SHIFT;
-                       int err = invalidate_inode_pages2_range(mapping,
+       if (retval)
+               goto out;
+
+       /*
+        * After a write we want buffered reads to be sure to go to disk to get
+        * the new data.  We invalidate clean cached page from the region we're
+        * about to write.  We do this *before* the write so that we can return
+        * -EIO without clobbering -EIOCBQUEUED from ->direct_IO().
+        */
+       if (rw == WRITE && mapping->nrpages) {
+               retval = invalidate_inode_pages2_range(mapping,
                                        offset >> PAGE_CACHE_SHIFT, end);
-                       if (err)
-                               retval = err;
-               }
+               if (retval)
+                       goto out;
        }
+
+       retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
+       if (retval)
+               goto out;
+
+       /*
+        * Finally, try again to invalidate clean pages which might have been
+        * faulted in by get_user_pages() if the source of the write was an
+        * mmap()ed region of the file we're writing.  That's a pretty crazy
+        * thing to do, so we don't support it 100%.  If this invalidation
+        * fails and we have -EIOCBQUEUED we ignore the failure.
+        */
+       if (rw == WRITE && mapping->nrpages) {
+               int err = invalidate_inode_pages2_range(mapping,
+                                             offset >> PAGE_CACHE_SHIFT, end);
+               if (err && retval >= 0)
+                       retval = err;
+       }
+out:
        return retval;
 }
 
index 4e196155a0c3635801bd0f8dcff0b18ce1bbcf37..77916e9fc52bc466abb08d55457b8c79b0e05854 100644 (file)
@@ -155,11 +155,14 @@ static long madvise_dontneed(struct vm_area_struct * vma,
  * Other filesystems return -ENOSYS.
  */
 static long madvise_remove(struct vm_area_struct *vma,
+                               struct vm_area_struct **prev,
                                unsigned long start, unsigned long end)
 {
        struct address_space *mapping;
         loff_t offset, endoff;
 
+       *prev = vma;
+
        if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB))
                return -EINVAL;
 
@@ -199,7 +202,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
                error = madvise_behavior(vma, prev, start, end, behavior);
                break;
        case MADV_REMOVE:
-               error = madvise_remove(vma, start, end);
+               error = madvise_remove(vma, prev, start, end);
                break;
 
        case MADV_WILLNEED:
index b278b8d60eee4ac13bba50222c478901cff39a60..2f3916986abf7054bc00e4c2fc8ed2ed688d199b 100644 (file)
@@ -320,7 +320,7 @@ static int oom_kill_task(struct task_struct *p)
         * Don't kill the process if any threads are set to OOM_DISABLE
         */
        do_each_thread(g, q) {
-               if (q->mm == mm && p->oomkilladj == OOM_DISABLE)
+               if (q->mm == mm && q->oomkilladj == OOM_DISABLE)
                        return 1;
        } while_each_thread(g, q);
 
index 820761f9eeef92df8929a1517e04e81779148d2c..702fa8f0874780b04ef4e2110c84f5e92985b9d5 100644 (file)
@@ -463,6 +463,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
        memcpy(n->cb, skb->cb, sizeof(skb->cb));
        C(len);
        C(data_len);
+       C(mac_len);
        C(csum);
        C(local_df);
        n->cloned = 1;
index 72b3036bbc09299ada84b297f4ef50b4de453dcb..ada9b3db507d08b938ba8b9697dc35882a3f76fa 100644 (file)
@@ -1527,7 +1527,6 @@ static int trie_leaf_remove(struct trie *t, t_key key)
        t->revision++;
        t->size--;
 
-       preempt_disable();
        tp = NODE_PARENT(n);
        tnode_free((struct tnode *) n);
 
@@ -1537,7 +1536,6 @@ static int trie_leaf_remove(struct trie *t, t_key key)
                rcu_assign_pointer(t->trie, trie_rebalance(t, tp));
        } else
                rcu_assign_pointer(t->trie, NULL);
-       preempt_enable();
 
        return 1;
 }
index 74c4d103ebc2f74e919983c53605941356ab21d3..3834b10b51152aa24d3b69e08392d23274bca5f8 100644 (file)
@@ -2458,11 +2458,18 @@ void __init tcp_init(void)
                sysctl_max_syn_backlog = 128;
        }
 
-       /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */
-       sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order;
-       sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3;
+       /* Set the pressure threshold to be a fraction of global memory that
+        * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
+        * memory, with a floor of 128 pages.
+        */
+       limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
+       limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+       limit = max(limit, 128UL);
+       sysctl_tcp_mem[0] = limit / 4 * 3;
+       sysctl_tcp_mem[1] = limit;
        sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2;
 
+       /* Set per-socket limits to no more than 1/128 the pressure threshold */
        limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
        max_share = min(4UL*1024*1024, limit);
 
index f57a9baa6b272417af7c1f705b44ae605891f70a..92f99927d12d668a41b804dda43c20b17ec82b6a 100644 (file)
@@ -1453,6 +1453,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
           First: no IPv4 options.
         */
        newinet->opt = NULL;
+       newnp->ipv6_fl_list = NULL;
 
        /* Clone RX bits */
        newnp->rxopt.all = np->rxopt.all;
index 37fabf75daa7291d148d30d141562ddcf0d9f69a..b188a4df58cbd5cc5ea7209cf8d1ed99c1cb139c 100644 (file)
@@ -1962,9 +1962,11 @@ static int snd_ac97_ad1888_downmix_put(struct snd_kcontrol *kcontrol, struct snd
 static void ad1888_update_jacks(struct snd_ac97 *ac97)
 {
        unsigned short val = 0;
-       if (! is_shared_linein(ac97))
+       /* clear LODIS if shared jack is to be used for Surround out */
+       if (is_shared_linein(ac97))
                val |= (1 << 12);
-       if (! is_shared_micin(ac97))
+       /* clear CLDIS if shared jack is to be used for C/LFE out */
+       if (is_shared_micin(ac97))
                val |= (1 << 11);
        /* shared Line-In */
        snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val);
@@ -2136,8 +2138,9 @@ static const struct snd_kcontrol_new snd_ac97_ad1985_controls[] = {
 static void ad1985_update_jacks(struct snd_ac97 *ac97)
 {
        ad1888_update_jacks(ac97);
+       /* clear OMS if shared jack is to be used for C/LFE out */
        snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9,
-                            is_shared_micin(ac97) ? 0 : 1 << 9);
+                            is_shared_micin(ac97) ? 1 << 9 : 0);
 }
 
 static int patch_ad1985_specific(struct snd_ac97 *ac97)
@@ -2418,9 +2421,9 @@ static void ad1986_update_jacks(struct snd_ac97 *ac97)
        unsigned short ser_val;
 
        /* disable SURROUND and CENTER/LFE if not surround mode */
-       if (! is_surround_on(ac97))
+       if (!is_surround_on(ac97))
                misc_val |= AC97_AD1986_SODIS;
-       if (! is_clfe_on(ac97))
+       if (!is_clfe_on(ac97))
                misc_val |= AC97_AD1986_CLDIS;
 
        /* select line input (default=LINE_IN, SURROUND or MIC_1/2) */
index b9a8e238b0a882bdc58071f43652294f939b73e8..1672cace1ae7d55592a1088a97511efe9761d4c0 100644 (file)
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 
 /* STATESTS int mask: SD2,SD1,SD0 */
 #define STATESTS_INT_MASK      0x07
-#define AZX_MAX_CODECS         3
 
 /* SD_CTL bits */
 #define SD_CTL_STREAM_RESET    0x01    /* stream reset bit */
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
  * Codec initialization
  */
 
+static unsigned int azx_max_codecs[] __devinitdata = {
+       [AZX_DRIVER_ICH] = 3,
+       [AZX_DRIVER_ATI] = 4,
+       [AZX_DRIVER_ATIHDMI] = 4,
+       [AZX_DRIVER_VIA] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_SIS] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_ULI] = 3,           /* FIXME: correct? */
+       [AZX_DRIVER_NVIDIA] = 3,        /* FIXME: correct? */
+};
+
 static int __devinit azx_codec_create(struct azx *chip, const char *model)
 {
        struct hda_bus_template bus_temp;
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
                return err;
 
        codecs = 0;
-       for (c = 0; c < AZX_MAX_CODECS; c++) {
+       for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) {
                if ((chip->codec_mask & (1 << c)) & probe_mask) {
                        err = snd_hda_codec_new(chip->bus, c, NULL);
                        if (err < 0)
@@ -1078,6 +1087,10 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
        runtime->hw.rates = hinfo->rates;
        snd_pcm_limit_hw_rates(runtime);
        snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
+       snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+                                  128);
+       snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+                                  128);
        if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) {
                azx_release_device(azx_dev);
                mutex_unlock(&chip->open_mutex);
index 00ace59b05c982f9867fa40886604f1c5f44192b..f94f1f22889ee07ca48f7cc0557c9245e5dd860c 100644 (file)
@@ -833,12 +833,14 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK),
        SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
        SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
+       SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
        SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
        SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD),
        SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
        SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
        SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
        SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
+       SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP),
        SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK),
        SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD),
        SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP),
@@ -1205,7 +1207,7 @@ static struct hda_verb ad1981_init_verbs[] = {
 /*
  * Patch for HP nx6320
  *
- * nx6320 uses EAPD in the reserve way - EAPD-on means the internal
+ * nx6320 uses EAPD in the reverse way - EAPD-on means the internal
  * speaker output enabled _and_ mute-LED off.
  */
 
@@ -1373,6 +1375,21 @@ static int ad1981_hp_init(struct hda_codec *codec)
        return 0;
 }
 
+/* configuration for Toshiba Laptops */
+static struct hda_verb ad1981_toshiba_init_verbs[] = {
+       {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */
+       /* pin sensing on HP and Mic jacks */
+       {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT},
+       {0x08, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_MIC_EVENT},
+       {}
+};
+
+static struct snd_kcontrol_new ad1981_toshiba_mixers[] = {
+       HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT),
+       { }
+};
+
 /* configuration for Lenovo Thinkpad T60 */
 static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
        HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
@@ -1418,6 +1435,7 @@ enum {
        AD1981_BASIC,
        AD1981_HP,
        AD1981_THINKPAD,
+       AD1981_TOSHIBA,
        AD1981_MODELS
 };
 
@@ -1425,6 +1443,7 @@ static const char *ad1981_models[AD1981_MODELS] = {
        [AD1981_HP]             = "hp",
        [AD1981_THINKPAD]       = "thinkpad",
        [AD1981_BASIC]          = "basic",
+       [AD1981_TOSHIBA]        = "toshiba"
 };
 
 static struct snd_pci_quirk ad1981_cfg_tbl[] = {
@@ -1435,6 +1454,7 @@ static struct snd_pci_quirk ad1981_cfg_tbl[] = {
        /* Lenovo Thinkpad T60/X60/Z6xx */
        SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD),
        SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD),
+       SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba U205", AD1981_TOSHIBA),
        {}
 };
 
@@ -1485,8 +1505,17 @@ static int patch_ad1981(struct hda_codec *codec)
                spec->mixers[0] = ad1981_thinkpad_mixers;
                spec->input_mux = &ad1981_thinkpad_capture_source;
                break;
+       case AD1981_TOSHIBA:
+               spec->mixers[0] = ad1981_hp_mixers;
+               spec->mixers[1] = ad1981_toshiba_mixers;
+               spec->num_init_verbs = 2;
+               spec->init_verbs[1] = ad1981_toshiba_init_verbs;
+               spec->multiout.dig_out_nid = 0;
+               spec->input_mux = &ad1981_hp_capture_source;
+               codec->patch_ops.init = ad1981_hp_init;
+               codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
+               break;
        }
-
        return 0;
 }
 
@@ -2607,6 +2636,12 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = {
        [AD1988_AUTO]           = "auto",
 };
 
+static struct snd_pci_quirk ad1988_cfg_tbl[] = {
+       SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
+       SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
+       {}
+};
+
 static int patch_ad1988(struct hda_codec *codec)
 {
        struct ad198x_spec *spec;
@@ -2623,7 +2658,7 @@ static int patch_ad1988(struct hda_codec *codec)
                snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
 
        board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST,
-                                                 ad1988_models, NULL);
+                                                 ad1988_models, ad1988_cfg_tbl);
        if (board_config < 0) {
                printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n");
                board_config = AD1988_AUTO;
index 84d005ef30eed3a044c7041881cf056384553e51..fba3cb11bc2a46da818a6662f9be630c38e8167b 100644 (file)
@@ -4186,6 +4186,8 @@ static const char *alc260_models[ALC260_MODEL_LAST] = {
 static struct snd_pci_quirk alc260_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
        SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
+       SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
+       SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013),
        SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
        SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP),
        SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013),
index 4c7b03996be99b773f5ff84ca9c9ae2b1a3bbf8c..c94291bc53677c36c62c0109bd0537cee79b40cb 100644 (file)
@@ -60,7 +60,8 @@ enum {
        STAC_D945GTP5,
        STAC_MACMINI,
        STAC_MACBOOK,
-       STAC_MACBOOK_PRO,
+       STAC_MACBOOK_PRO_V1,
+       STAC_MACBOOK_PRO_V2,
        STAC_922X_MODELS
 };
 
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = {
        0x400000fc, 0x400000fb,
 };
 
-static unsigned int macbook_pro_pin_configs[10] = {
+static unsigned int macbook_pro_v1_pin_configs[10] = {
+       0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010,
+       0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e,
+       0x02a19320, 0x400000fb
+};
+
+static unsigned int macbook_pro_v2_pin_configs[10] = {
        0x0221401f, 0x90a70120, 0x01813024, 0x01014010,
        0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e,
        0x400000fc, 0x400000fb,
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
        [STAC_D945GTP5] = d945gtp5_pin_configs,
        [STAC_MACMINI] = d945gtp5_pin_configs,
        [STAC_MACBOOK] = macbook_pin_configs,
-       [STAC_MACBOOK_PRO] = macbook_pro_pin_configs,
+       [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs,
+       [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs,
 };
 
 static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
        [STAC_D945GTP3] = "3stack",
        [STAC_MACMINI]  = "macmini",
        [STAC_MACBOOK]  = "macbook",
-       [STAC_MACBOOK_PRO]      = "macbook-pro",
+       [STAC_MACBOOK_PRO_V1]   = "macbook-pro-v1",
+       [STAC_MACBOOK_PRO_V2]   = "macbook-pro",
 };
 
 static struct snd_pci_quirk stac922x_cfg_tbl[] = {
@@ -1600,6 +1609,11 @@ static int stac92xx_init(struct hda_codec *codec)
                for (i = 0; i < cfg->hp_outs; i++)
                        enable_pin_detect(codec, cfg->hp_pins[i],
                                          STAC_HP_EVENT);
+               /* force to enable the first line-out; the others are set up
+                * in unsol_event
+                */
+               stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
+                                        AC_PINCTL_OUT_EN);
                stac92xx_auto_init_hp_out(codec);
                /* fake event to set up pins */
                codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
@@ -1889,9 +1903,13 @@ static int patch_stac922x(struct hda_codec *codec)
                /* Intel Macs have all same PCI SSID, so we need to check
                 * codec SSID to distinguish the exact models
                 */
+               printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id);
                switch (codec->subsystem_id) {
-               case 0x106b1e00:
-                       spec->board_config = STAC_MACBOOK_PRO;
+               case 0x106b0200: /* MacBook Pro first generation */
+                       spec->board_config = STAC_MACBOOK_PRO_V1;
+                       break;
+               case 0x106b1e00: /* MacBook Pro second generation */
+                       spec->board_config = STAC_MACBOOK_PRO_V2;
                        break;
                }
        }
index a289abfc7172f5daeab4a255463570cb06ff7805..7cf2dcb9d8d4b99010204bf643f89952b9ec6dd7 100644 (file)
@@ -725,10 +725,11 @@ static void fill_nocache(void *buf, int size, int nocache)
 static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev)
 {
        unsigned long port = ichdev->reg_offset;
+       unsigned long flags;
        int status, civ, i, step;
        int ack = 0;
 
-       spin_lock(&chip->reg_lock);
+       spin_lock_irqsave(&chip->reg_lock, flags);
        status = igetbyte(chip, port + ichdev->roff_sr);
        civ = igetbyte(chip, port + ICH_REG_OFF_CIV);
        if (!(status & ICH_BCIS)) {
@@ -768,7 +769,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
                        ack = 1;
                }
        }
-       spin_unlock(&chip->reg_lock);
+       spin_unlock_irqrestore(&chip->reg_lock, flags);
        if (ack && ichdev->substream) {
                snd_pcm_period_elapsed(ichdev->substream);
        }
@@ -2470,7 +2471,10 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state)
        }
        pci_disable_device(pci);
        pci_save_state(pci);
-       pci_set_power_state(pci, pci_choose_state(pci, state));
+       /* The call below may disable built-in speaker on some laptops
+        * after S2RAM.  So, don't touch it.
+        */
+       /* pci_set_power_state(pci, pci_choose_state(pci, state)); */
        return 0;
 }
 
index ec821a57f8432c9742c285fb54d549b09f4f5df1..dccaa4be679edb2321b832ecf6645d7c4aa2503f 100644 (file)
@@ -10,6 +10,8 @@ config SND_SOC_AC97_BUS
 
 config SND_SOC
        tristate "SoC audio support"
+       depends on SND
+       select SND_PCM
        ---help---
 
          If you want SoC support, you should say Y here and also to the
index 5bcf08b728b0eed71e17335cc2d6e91fa46b3446..a5b2558916c1124eb0d9a3c2017f32920873d24a 100644 (file)
@@ -2,8 +2,7 @@ menu "SoC Audio for the Atmel AT91"
 
 config SND_AT91_SOC
        tristate "SoC Audio for the Atmel AT91 System-on-Chip"
-       depends on ARCH_AT91 && SND
-       select SND_PCM
+       depends on ARCH_AT91 && SND_SOC
        help
          Say Y or M if you want to add support for codecs attached to
          the AT91 SSC interface. You will also need
index 579e1c8d2b28946f6341fb9bf9a9e64f28a11c99..b9ab3b8e1d3ecdff0aec3ec1823e1c6f3f5e19dd 100644 (file)
@@ -2,8 +2,7 @@ menu "SoC Audio for the Intel PXA2xx"
 
 config SND_PXA2XX_SOC
        tristate "SoC Audio for the Intel PXA2xx chip"
-       depends on ARCH_PXA && SND
-       select SND_PCM
+       depends on ARCH_PXA && SND_SOC
        help
          Say Y or M if you want to add support for codecs attached to
          the PXA2xx AC97, I2S or SSP interface. You will also need