Merge branches 'release', 'asus', 'bugzilla-8573', 'bugzilla-9995', 'bugzilla-10272...
authorLen Brown <len.brown@intel.com>
Tue, 18 Mar 2008 08:52:57 +0000 (04:52 -0400)
committerLen Brown <len.brown@intel.com>
Tue, 18 Mar 2008 08:52:57 +0000 (04:52 -0400)
57 files changed:
Documentation/acpi/dsdt-override.txt
Documentation/acpi/initramfs-add-dsdt.sh [deleted file]
Documentation/kernel-parameters.txt
MAINTAINERS
Makefile
arch/parisc/Makefile
arch/parisc/configs/default_defconfig [moved from arch/parisc/defconfig with 100% similarity]
arch/parisc/kernel/firmware.c
arch/parisc/kernel/hardware.c
arch/parisc/kernel/head.S
arch/parisc/kernel/pdc_cons.c
arch/parisc/kernel/syscall_table.S
arch/parisc/kernel/traps.c
drivers/acpi/Kconfig
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/osl.c
drivers/acpi/video.c
drivers/ata/Kconfig
drivers/ata/ahci.c
drivers/ata/libata-acpi.c
drivers/ata/pata_ali.c
drivers/block/virtio_blk.c
drivers/firewire/Kconfig
drivers/firewire/fw-ohci.c
drivers/firewire/fw-sbp2.c
drivers/firewire/fw-topology.c
drivers/firewire/fw-transaction.c
drivers/firewire/fw-transaction.h
drivers/ieee1394/sbp2.c
drivers/mmc/host/tifm_sd.c
drivers/net/virtio_net.c
drivers/parisc/pdc_stable.c
drivers/parisc/sba_iommu.c
drivers/thermal/Kconfig
drivers/thermal/thermal.c
drivers/virtio/virtio_balloon.c
drivers/virtio/virtio_pci.c
drivers/virtio/virtio_ring.c
fs/hfs/brec.c
fs/nfsd/nfsfh.c
include/asm-parisc/elf.h
include/asm-parisc/fixmap.h
include/asm-parisc/futex.h
include/asm-parisc/pdc.h
include/asm-parisc/pgalloc.h
include/asm-parisc/pgtable.h
include/asm-parisc/unistd.h
include/linux/exportfs.h
include/linux/pci.h
include/linux/virtio.h
include/net/dst.h
init/initramfs.c
init/main.c
kernel/sched.c
kernel/sched_fair.c
lib/devres.c

index 5008f256a2dbec6d642866262bb00ecb0eea65c1..febbb1ba4d2317b984e7217796ac39151f867531 100644 (file)
@@ -1,15 +1,7 @@
-Linux supports two methods of overriding the BIOS DSDT:
+Linux supports a method of overriding the BIOS DSDT:
 
 CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.
 
-CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd.
-
-When to use these methods is described in detail on the
+When to use this method is described in detail on the
 Linux/ACPI home page:
 http://www.lesswatts.org/projects/acpi/overridingDSDT.php
-
-Note that if both options are used, the DSDT supplied
-by the INITRD method takes precedence.
-
-Documentation/initramfs-add-dsdt.sh is provided for convenience
-for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method.
diff --git a/Documentation/acpi/initramfs-add-dsdt.sh b/Documentation/acpi/initramfs-add-dsdt.sh
deleted file mode 100755 (executable)
index 17ef6e8..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Adds a DSDT file to the initrd (if it's an initramfs)
-# first argument is the name of archive
-# second argument is the name of the file to add
-# The file will be copied as /DSDT.aml
-
-# 20060126: fix "Premature end of file" with some old cpio (Roland Robic)
-# 20060205: this time it should really work
-
-# check the arguments
-if [ $# -ne 2 ]; then
-       program_name=$(basename $0)
-       echo "\
-$program_name: too few arguments
-Usage: $program_name initrd-name.img DSDT-to-add.aml
-Adds a DSDT file to an initrd (in initramfs format)
-
-  initrd-name.img: filename of the initrd in initramfs format
-  DSDT-to-add.aml: filename of the DSDT file to add
-  " 1>&2
-    exit 1
-fi
-
-# we should check it's an initramfs
-
-tempcpio=$(mktemp -d)
-# cleanup on exit, hangup, interrupt, quit, termination
-trap 'rm -rf $tempcpio' 0 1 2 3 15
-
-# extract the archive
-gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1
-
-# copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml"
-cp -f "$2" "$tempcpio"/DSDT.aml
-
-# add the file
-cd "$tempcpio"
-(echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1
-cd "$OLDPWD"
-
-# re-compress the archive
-gzip -c "$tempcpio"/initramfs.cpio > "$1"
-
index 49318b99e581406b7ec32793560c01546e69402d..622f7849edb968024f6879927aa7c6a2e008f695 100644 (file)
@@ -177,9 +177,6 @@ and is between 256 and 4096 characters. It is defined in the file
 
        acpi_no_auto_ssdt       [HW,ACPI] Disable automatic loading of SSDT
 
-       acpi_no_initrd_override [KNL,ACPI]
-                       Disable loading custom ACPI tables from the initramfs
-
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
                        Format: To spoof as Windows 98: ="Microsoft Windows"
 
index 0f95a4a787a68e3da0eeb79afa9c6ed7d7d63b9c..6d628fb6ee014a3e5491cc92b98cef54c3e67831 100644 (file)
@@ -266,6 +266,15 @@ L:      linux-acpi@vger.kernel.org
 W:      http://www.lesswatts.org/projects/acpi/
 S:      Maintained
 
+AD1889 ALSA SOUND DRIVER
+P:     Kyle McMartin
+M:     kyle@parisc-linux.org
+P:     Thibaut Varene
+M:     T-Bone@parisc-linux.org
+W:     http://wiki.parisc-linux.org/AD1889
+L:     linux-parisc@vger.kernel.org
+S:     Maintained
+
 ADM1025 HARDWARE MONITOR DRIVER
 P:     Jean Delvare
 M:     khali@linux-fr.org
index 0eb23e5bfc88cd30d6abec5c01d8f473a72a595a..7a4d34b91e032099d119adae92a0f347dc481901 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 25
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc6
 NAME = Funky Weasel is Jiggy wit it
 
 # *DOCUMENTATION*
index e574de4efb36c2e588ad93d8ab6c5637551bdff1..5ddad7bd60ac8740de6712aabd6c274fc1fb435d 100644 (file)
@@ -16,6 +16,9 @@
 # Modified for PA-RISC Linux by Paul Lahaie, Alex deVries, 
 # Mike Shaver, Helge Deller and Martin K. Petersen
 #
+
+KBUILD_DEFCONFIG := default_defconfig
+
 NM             = sh $(srctree)/arch/parisc/nm
 CHECKFLAGS     += -D__hppa__=1
 
index 4ab83d56974dcc88381ea4267c5ebb71fb69ddac..7177a6cd1b7f58b0fcc83f60ea5c11cf1bd96e1a 100644 (file)
@@ -1080,6 +1080,9 @@ void pdc_io_reset_devices(void)
        spin_unlock_irqrestore(&pdc_lock, flags);
 }
 
+/* locked by pdc_console_lock */
+static int __attribute__((aligned(8)))   iodc_retbuf[32];
+static char __attribute__((aligned(64))) iodc_dbuf[4096];
 
 /**
  * pdc_iodc_print - Console print using IODC.
@@ -1091,24 +1094,20 @@ void pdc_io_reset_devices(void)
  * Since the HP console requires CR+LF to perform a 'newline', we translate
  * "\n" to "\r\n".
  */
-int pdc_iodc_print(unsigned char *str, unsigned count)
+int pdc_iodc_print(const unsigned char *str, unsigned count)
 {
-       /* XXX Should we spinlock posx usage */
        static int posx;        /* for simple TAB-Simulation... */
-       int __attribute__((aligned(8)))   iodc_retbuf[32];
-       char __attribute__((aligned(64))) iodc_dbuf[4096];
        unsigned int i;
        unsigned long flags;
 
-       memset(iodc_dbuf, 0, 4096);
-       for (i = 0; i < count && i < 2048;) {
+       for (i = 0; i < count && i < 79;) {
                switch(str[i]) {
                case '\n':
                        iodc_dbuf[i+0] = '\r';
                        iodc_dbuf[i+1] = '\n';
                        i += 2;
                        posx = 0;
-                       break;
+                       goto print;
                case '\t':
                        while (posx & 7) {
                                iodc_dbuf[i] = ' ';
@@ -1124,6 +1123,16 @@ int pdc_iodc_print(unsigned char *str, unsigned count)
                }
        }
 
+       /* if we're at the end of line, and not already inserting a newline,
+        * insert one anyway. iodc console doesn't claim to support >79 char
+        * lines. don't account for this in the return value.
+        */
+       if (i == 79 && iodc_dbuf[i-1] != '\n') {
+               iodc_dbuf[i+0] = '\r';
+               iodc_dbuf[i+1] = '\n';
+       }
+
+print:
         spin_lock_irqsave(&pdc_lock, flags);
         real32_call(PAGE0->mem_cons.iodc_io,
                     (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
@@ -1142,11 +1151,9 @@ int pdc_iodc_print(unsigned char *str, unsigned count)
  */
 int pdc_iodc_getc(void)
 {
-       unsigned long flags;
-        static int __attribute__((aligned(8)))   iodc_retbuf[32];
-        static char __attribute__((aligned(64))) iodc_dbuf[4096];
        int ch;
        int status;
+       unsigned long flags;
 
        /* Bail if no console input device. */
        if (!PAGE0->mem_kbd.iodc_io)
index 84b9611a92285b8edcbab9fffc20fdbca6662d7c..f48a640b55fbe553fd191eace94be5a8d66aa0cf 100644 (file)
@@ -274,7 +274,18 @@ static struct hp_hardware hp_hardware_list[] __devinitdata = {
        {HPHW_NPROC,0x887,0x4,0x91,"Storm Peak Slow"},
        {HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"},
        {HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"},
-       {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak"},
+       {HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak Slow"},
+       {HPHW_NPROC,0x88C,0x4,0x91,"Orca Mako+"},
+       {HPHW_NPROC,0x88D,0x4,0x91,"Rainier/Medel Mako+ Slow"},
+       {HPHW_NPROC,0x88E,0x4,0x91,"Rainier/Medel Mako+ Fast"},
+       {HPHW_NPROC,0x894,0x4,0x91,"Mt. Hamilton Fast Mako+"},
+       {HPHW_NPROC,0x895,0x4,0x91,"Storm Peak Slow Mako+"},
+       {HPHW_NPROC,0x896,0x4,0x91,"Storm Peak Fast Mako+"},
+       {HPHW_NPROC,0x897,0x4,0x91,"Storm Peak DC- Slow Mako+"},
+       {HPHW_NPROC,0x898,0x4,0x91,"Storm Peak DC- Fast Mako+"},
+       {HPHW_NPROC,0x899,0x4,0x91,"Mt. Hamilton Slow Mako+"},
+       {HPHW_NPROC,0x89B,0x4,0x91,"Crestone Peak Mako+ Slow"},
+       {HPHW_NPROC,0x89C,0x4,0x91,"Crestone Peak Mako+ Fast"},
        {HPHW_A_DIRECT, 0x004, 0x0000D, 0x00, "Arrakis MUX"}, 
        {HPHW_A_DIRECT, 0x005, 0x0000D, 0x00, "Dyun Kiuh MUX"}, 
        {HPHW_A_DIRECT, 0x006, 0x0000D, 0x00, "Baat Kiuh AP/MUX (40299B)"}, 
index a7b8859488bb9ca7014746151a8d1f2a766a71be..ec2482dc1beb39f4a62a7e17c28b7238d8291709 100644 (file)
 #include <asm/pgtable.h>
 
 #include <linux/linkage.h>
+#include <linux/init.h>
 
        .level  LEVEL
 
-       .data
+       __INITDATA
 ENTRY(boot_args)
        .word 0 /* arg0 */
        .word 0 /* arg1 */
@@ -31,7 +32,7 @@ ENTRY(boot_args)
        .word 0 /* arg3 */
 END(boot_args)
 
-       .text
+       .section .text.head
        .align  4
        .import init_thread_union,data
        .import fault_vector_20,code    /* IVA parisc 2.0 32 bit */
@@ -343,7 +344,7 @@ smp_slave_stext:
 ENDPROC(stext)
 
 #ifndef CONFIG_64BIT
-       .data
+       .section .data.read_mostly
 
        .align  4
        .export $global$,data
index 33b1f84441b14e4076e077432c1212cd74b681a3..ccb68090781efdc24b553ce9e6162899ed349c03 100644 (file)
 #include <linux/tty.h>
 #include <asm/pdc.h>           /* for iodc_call() proto and friends */
 
+static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED;
 
 static void pdc_console_write(struct console *co, const char *s, unsigned count)
 {
-       pdc_iodc_print(s, count);
+       int i = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&pdc_console_lock, flags);
+       do {
+               i += pdc_iodc_print(s + i, count - i);
+       } while (i < count);
+       spin_unlock_irqrestore(&pdc_console_lock, flags);
 }
 
-void pdc_printf(const char *fmt, ...)
+int pdc_console_poll_key(struct console *co)
 {
-       va_list args;
-       char buf[1024];
-       int i, len;
-
-       va_start(args, fmt);
-       len = vscnprintf(buf, sizeof(buf), fmt, args);
-       va_end(args);
+       int c;
+       unsigned long flags;
 
-       pdc_iodc_print(buf, len);
-}
+       spin_lock_irqsave(&pdc_console_lock, flags);
+       c = pdc_iodc_getc();
+       spin_unlock_irqrestore(&pdc_console_lock, flags);
 
-int pdc_console_poll_key(struct console *co)
-{
-       return pdc_iodc_getc();
+       return c;
 }
 
 static int pdc_console_setup(struct console *co, char *options)
index 117438e9eb2a8329a932c17b5b184095982c39dc..6b5ac38f5a9916017473d3174bb6f3d047f72cb8 100644 (file)
        ENTRY_COMP(kexec_load)          /* 300 */
        ENTRY_COMP(utimensat)
        ENTRY_COMP(signalfd)
-       ENTRY_COMP(timerfd)
+       ENTRY_SAME(ni_syscall)          /* was timerfd */
        ENTRY_SAME(eventfd)
        ENTRY_COMP(fallocate)           /* 305 */
+       ENTRY_SAME(timerfd_create)
+       ENTRY_COMP(timerfd_settime)
+       ENTRY_COMP(timerfd_gettime)
 
        /* Nothing yet */
 
index 99fd56939afa73909f4aabbe9fe88a490afa3748..9dc6dc42f9cfb151e5d827338c9e27431e40c58d 100644 (file)
@@ -51,6 +51,9 @@
 DEFINE_SPINLOCK(pa_dbit_lock);
 #endif
 
+void parisc_show_stack(struct task_struct *t, unsigned long *sp,
+       struct pt_regs *regs);
+
 static int printbinary(char *buf, unsigned long x, int nbits)
 {
        unsigned long mask = 1UL << (nbits - 1);
@@ -148,6 +151,8 @@ void show_regs(struct pt_regs *regs)
        print_symbol(" IAOQ[1]: %s\n", regs->iaoq[1]);
        printk(level);
        print_symbol(" RP(r2): %s\n", regs->gr[2]);
+
+       parisc_show_stack(current, NULL, regs);
 }
 
 
@@ -181,11 +186,19 @@ static void do_show_stack(struct unwind_frame_info *info)
        printk("\n");
 }
 
-void show_stack(struct task_struct *task, unsigned long *s)
+void parisc_show_stack(struct task_struct *task, unsigned long *sp,
+       struct pt_regs *regs)
 {
        struct unwind_frame_info info;
+       struct task_struct *t;
+
+       t = task ? task : current;
+       if (regs) {
+               unwind_frame_init(&info, t, regs);
+               goto show_stack;
+       }
 
-       if (!task) {
+       if (t == current) {
                unsigned long sp;
 
 HERE:
@@ -201,12 +214,18 @@ HERE:
                        unwind_frame_init(&info, current, &r);
                }
        } else {
-               unwind_frame_init_from_blocked_task(&info, task);
+               unwind_frame_init_from_blocked_task(&info, t);
        }
 
+show_stack:
        do_show_stack(&info);
 }
 
+void show_stack(struct task_struct *t, unsigned long *sp)
+{
+       return parisc_show_stack(t, sp, NULL);
+}
+
 int is_valid_bugaddr(unsigned long iaoq)
 {
        return 1;
index fbcaa069be86678f0a3725f5250f5c662d5e989b..b4f5e85428294eed21bb8f342af5a7a7c3fac87b 100644 (file)
@@ -300,17 +300,6 @@ config ACPI_CUSTOM_DSDT
        bool
        default ACPI_CUSTOM_DSDT_FILE != ""
 
-config ACPI_CUSTOM_DSDT_INITRD
-       bool "Read Custom DSDT from initramfs"
-       depends on BLK_DEV_INITRD
-       default n
-       help
-         This option supports a custom DSDT by optionally loading it from initrd.
-         See Documentation/acpi/dsdt-override.txt
-
-         If you are not using this feature now, but may use it later,
-         it is safe to say Y here.
-
 config ACPI_BLACKLIST_YEAR
        int "Disable ACPI for systems before Jan 1st this year" if X86_32
        default 0
index d25ef961415cefdeebab67ac29f5a5f49d87ff18..44ad90c03c2ecaa615f9e6aa6f5366cc994e1399 100644 (file)
@@ -610,7 +610,7 @@ write_led(const char __user * buffer, unsigned long count,
            (led_out) ? (hotk->status | ledmask) : (hotk->status & ~ledmask);
 
        if (invert)             /* invert target value */
-               led_out = !led_out & 0x1;
+               led_out = !led_out;
 
        if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
                printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
index f6215e8098086887f11b414e180923479949c467..d5729d5dc1904564921cede6f7f80d72b987205c 100644 (file)
@@ -293,13 +293,12 @@ static int extract_package(struct acpi_battery *battery,
                                strncpy(ptr, (u8 *)&element->integer.value,
                                        sizeof(acpi_integer));
                                ptr[sizeof(acpi_integer)] = 0;
-                       } else return -EFAULT;
+                       } else
+                               *ptr = 0; /* don't have value */
                } else {
-                       if (element->type == ACPI_TYPE_INTEGER) {
-                               int *x = (int *)((u8 *)battery +
-                                               offsets[i].offset);
-                               *x = element->integer.value;
-                       } else return -EFAULT;
+                       int *x = (int *)((u8 *)battery + offsets[i].offset);
+                       *x = (element->type == ACPI_TYPE_INTEGER) ?
+                               element->integer.value : -1;
                }
        }
        return 0;
index 065819ba87c7ee5a6969674d3e654200b35f4da5..a697fb6cf050e8096d8be177f8303c5ed4290995 100644 (file)
@@ -91,10 +91,6 @@ static DEFINE_SPINLOCK(acpi_res_lock);
 #define        OSI_STRING_LENGTH_MAX 64        /* arbitrary */
 static char osi_additional_string[OSI_STRING_LENGTH_MAX];
 
-#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-static int acpi_no_initrd_override;
-#endif
-
 /*
  * "Ode to _OSI(Linux)"
  *
@@ -324,67 +320,6 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
        return AE_OK;
 }
 
-#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-static struct acpi_table_header *acpi_find_dsdt_initrd(void)
-{
-       struct file *firmware_file;
-       mm_segment_t oldfs;
-       unsigned long len, len2;
-       struct acpi_table_header *dsdt_buffer, *ret = NULL;
-       struct kstat stat;
-       char *ramfs_dsdt_name = "/DSDT.aml";
-
-       printk(KERN_INFO PREFIX "Checking initramfs for custom DSDT\n");
-
-       /*
-        * Never do this at home, only the user-space is allowed to open a file.
-        * The clean way would be to use the firmware loader.
-        * But this code must be run before there is any userspace available.
-        * A static/init firmware infrastructure doesn't exist yet...
-        */
-       if (vfs_stat(ramfs_dsdt_name, &stat) < 0)
-               return ret;
-
-       len = stat.size;
-       /* check especially against empty files */
-       if (len <= 4) {
-               printk(KERN_ERR PREFIX "Failed: DSDT only %lu bytes.\n", len);
-               return ret;
-       }
-
-       firmware_file = filp_open(ramfs_dsdt_name, O_RDONLY, 0);
-       if (IS_ERR(firmware_file)) {
-               printk(KERN_ERR PREFIX "Failed to open %s.\n", ramfs_dsdt_name);
-               return ret;
-       }
-
-       dsdt_buffer = kmalloc(len, GFP_ATOMIC);
-       if (!dsdt_buffer) {
-               printk(KERN_ERR PREFIX "Failed to allocate %lu bytes.\n", len);
-               goto err;
-       }
-
-       oldfs = get_fs();
-       set_fs(KERNEL_DS);
-       len2 = vfs_read(firmware_file, (char __user *)dsdt_buffer, len,
-               &firmware_file->f_pos);
-       set_fs(oldfs);
-       if (len2 < len) {
-               printk(KERN_ERR PREFIX "Failed to read %lu bytes from %s.\n",
-                       len, ramfs_dsdt_name);
-               ACPI_FREE(dsdt_buffer);
-               goto err;
-       }
-
-       printk(KERN_INFO PREFIX "Found %lu byte DSDT in %s.\n",
-                       len, ramfs_dsdt_name);
-       ret = dsdt_buffer;
-err:
-       filp_close(firmware_file, NULL);
-       return ret;
-}
-#endif
-
 acpi_status
 acpi_os_table_override(struct acpi_table_header * existing_table,
                       struct acpi_table_header ** new_table)
@@ -397,16 +332,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
 #ifdef CONFIG_ACPI_CUSTOM_DSDT
        if (strncmp(existing_table->signature, "DSDT", 4) == 0)
                *new_table = (struct acpi_table_header *)AmlCode;
-#endif
-#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-       if ((strncmp(existing_table->signature, "DSDT", 4) == 0) &&
-           !acpi_no_initrd_override) {
-               struct acpi_table_header *initrd_table;
-
-               initrd_table = acpi_find_dsdt_initrd();
-               if (initrd_table)
-                       *new_table = initrd_table;
-       }
 #endif
        if (*new_table != NULL) {
                printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], "
@@ -418,15 +343,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
        return AE_OK;
 }
 
-#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-static int __init acpi_no_initrd_override_setup(char *s)
-{
-       acpi_no_initrd_override = 1;
-       return 1;
-}
-__setup("acpi_no_initrd_override", acpi_no_initrd_override_setup);
-#endif
-
 static irqreturn_t acpi_irq(int irq, void *dev_id)
 {
        u32 handled;
index 1bc0c74f2755d1c3bbf8264c01a27dbd208ce227..12fb44f16766f5979be78b031cd16225161e23d3 100644 (file)
@@ -807,40 +807,11 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
 static int acpi_video_bus_check(struct acpi_video_bus *video)
 {
        acpi_status status = -ENOENT;
-       long device_id;
-       struct device *dev;
-       struct acpi_device *device;
+
 
        if (!video)
                return -EINVAL;
 
-       device = video->device;
-
-       status =
-           acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
-
-       if (!ACPI_SUCCESS(status))
-               return -ENODEV;
-
-       /* We need to attempt to determine whether the _ADR refers to a
-          PCI device or not. There's no terribly good way to do this,
-          so the best we can hope for is to assume that there'll never
-          be a video device in the host bridge */
-       if (device_id >= 0x10000) {
-               /* It looks like a PCI device. Does it exist? */
-               dev = acpi_get_physical_device(device->handle);
-       } else {
-               /* It doesn't look like a PCI device. Does its parent
-                  exist? */
-               acpi_handle phandle;
-               if (acpi_get_parent(device->handle, &phandle))
-                       return -ENODEV;
-               dev = acpi_get_physical_device(phandle);
-       }
-       if (!dev)
-               return -ENODEV;
-       put_device(dev);
-
        /* Since there is no HID, CID and so on for VGA driver, we have
         * to check well known required nodes.
         */
@@ -1366,37 +1337,8 @@ acpi_video_bus_write_DOS(struct file *file,
 
 static int acpi_video_bus_add_fs(struct acpi_device *device)
 {
-       long device_id;
-       int status;
        struct proc_dir_entry *entry = NULL;
        struct acpi_video_bus *video;
-       struct device *dev;
-
-       status =
-           acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
-
-       if (!ACPI_SUCCESS(status))
-               return -ENODEV;
-
-       /* We need to attempt to determine whether the _ADR refers to a
-          PCI device or not. There's no terribly good way to do this,
-          so the best we can hope for is to assume that there'll never
-          be a video device in the host bridge */
-       if (device_id >= 0x10000) {
-               /* It looks like a PCI device. Does it exist? */
-               dev = acpi_get_physical_device(device->handle);
-       } else {
-               /* It doesn't look like a PCI device. Does its parent
-                  exist? */
-               acpi_handle phandle;
-               if (acpi_get_parent(device->handle, &phandle))
-                       return -ENODEV;
-               dev = acpi_get_physical_device(phandle);
-       }
-       if (!dev)
-               return -ENODEV;
-       put_device(dev);
-
 
 
        video = acpi_driver_data(device);
index e469647330deb228b5c3ba24bca6fd35b9247a5c..25aba69b59b457146484f87832f4c60e64fc6612 100644 (file)
@@ -30,6 +30,7 @@ config ATA_NONSTANDARD
 config ATA_ACPI
        bool
        depends on ACPI && PCI
+       select ACPI_DOCK
        default y
        help
          This option adds support for ATA-related ACPI objects.
index 6978469eb16d87c9637c2969f6831a17c38cd267..17ee6ed985d9198ad356a9b68efebf406a4b11f6 100644 (file)
 #define DRV_NAME       "ahci"
 #define DRV_VERSION    "3.0"
 
+static int ahci_skip_host_reset;
+module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444);
+MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)");
+
 static int ahci_enable_alpm(struct ata_port *ap,
                enum link_pm policy);
 static void ahci_disable_alpm(struct ata_port *ap);
@@ -587,6 +591,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 
        /* Marvell */
        { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv },        /* 6145 */
+       { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv },        /* 6121 */
 
        /* Generic, PCI class code for AHCI */
        { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -661,6 +666,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
        void __iomem *mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
        u32 cap, port_map;
        int i;
+       int mv;
 
        /* make sure AHCI mode is enabled before accessing CAP */
        ahci_enable_ahci(mmio);
@@ -696,12 +702,16 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
         * presence register, as bit 4 (counting from 0)
         */
        if (hpriv->flags & AHCI_HFLAG_MV_PATA) {
+               if (pdev->device == 0x6121)
+                       mv = 0x3;
+               else
+                       mv = 0xf;
                dev_printk(KERN_ERR, &pdev->dev,
                           "MV_AHCI HACK: port_map %x -> %x\n",
-                          hpriv->port_map,
-                          hpriv->port_map & 0xf);
+                          port_map,
+                          port_map & mv);
 
-               port_map &= 0xf;
+               port_map &= mv;
        }
 
        /* cross check port_map and cap.n_ports */
@@ -1088,29 +1098,35 @@ static int ahci_reset_controller(struct ata_host *host)
        ahci_enable_ahci(mmio);
 
        /* global controller reset */
-       tmp = readl(mmio + HOST_CTL);
-       if ((tmp & HOST_RESET) == 0) {
-               writel(tmp | HOST_RESET, mmio + HOST_CTL);
-               readl(mmio + HOST_CTL); /* flush */
-       }
+       if (!ahci_skip_host_reset) {
+               tmp = readl(mmio + HOST_CTL);
+               if ((tmp & HOST_RESET) == 0) {
+                       writel(tmp | HOST_RESET, mmio + HOST_CTL);
+                       readl(mmio + HOST_CTL); /* flush */
+               }
 
-       /* reset must complete within 1 second, or
-        * the hardware should be considered fried.
-        */
-       ssleep(1);
+               /* reset must complete within 1 second, or
+                * the hardware should be considered fried.
+                */
+               ssleep(1);
 
-       tmp = readl(mmio + HOST_CTL);
-       if (tmp & HOST_RESET) {
-               dev_printk(KERN_ERR, host->dev,
-                          "controller reset failed (0x%x)\n", tmp);
-               return -EIO;
-       }
+               tmp = readl(mmio + HOST_CTL);
+               if (tmp & HOST_RESET) {
+                       dev_printk(KERN_ERR, host->dev,
+                                  "controller reset failed (0x%x)\n", tmp);
+                       return -EIO;
+               }
 
-       /* turn on AHCI mode */
-       ahci_enable_ahci(mmio);
+               /* turn on AHCI mode */
+               ahci_enable_ahci(mmio);
 
-       /* some registers might be cleared on reset.  restore initial values */
-       ahci_restore_initial_config(host);
+               /* Some registers might be cleared on reset.  Restore
+                * initial values.
+                */
+               ahci_restore_initial_config(host);
+       } else
+               dev_printk(KERN_INFO, host->dev,
+                          "skipping global host reset\n");
 
        if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
                u16 tmp16;
@@ -1162,9 +1178,14 @@ static void ahci_init_controller(struct ata_host *host)
        int i;
        void __iomem *port_mmio;
        u32 tmp;
+       int mv;
 
        if (hpriv->flags & AHCI_HFLAG_MV_PATA) {
-               port_mmio = __ahci_port_base(host, 4);
+               if (pdev->device == 0x6121)
+                       mv = 2;
+               else
+                       mv = 4;
+               port_mmio = __ahci_port_base(host, mv);
 
                writel(0, port_mmio + PORT_IRQ_MASK);
 
@@ -2241,7 +2262,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (rc)
                return rc;
 
-       rc = pcim_iomap_regions(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
+       /* AHCI controllers often implement SFF compatible interface.
+        * Grab all PCI BARs just in case.
+        */
+       rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
        if (rc == -EBUSY)
                pcim_pin_device(pdev);
        if (rc)
index 0770cb7391a42d5ef99f6d2cecd6937c8f98a240..bf98a566adac67c2ec49dc7fc4318fbf15cad68d 100644 (file)
@@ -118,45 +118,77 @@ static void ata_acpi_associate_ide_port(struct ata_port *ap)
                ap->pflags |= ATA_PFLAG_INIT_GTM_VALID;
 }
 
-static void ata_acpi_handle_hotplug(struct ata_port *ap, struct kobject *kobj,
+static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
                                    u32 event)
 {
        char event_string[12];
        char *envp[] = { event_string, NULL };
-       struct ata_eh_info *ehi = &ap->link.eh_info;
-
-       if (event == 0 || event == 1) {
-              unsigned long flags;
-              spin_lock_irqsave(ap->lock, flags);
-              ata_ehi_clear_desc(ehi);
-              ata_ehi_push_desc(ehi, "ACPI event");
-              ata_ehi_hotplugged(ehi);
-              ata_port_freeze(ap);
-              spin_unlock_irqrestore(ap->lock, flags);
+       struct ata_eh_info *ehi;
+       struct kobject *kobj = NULL;
+       int wait = 0;
+       unsigned long flags;
+
+       if (!ap)
+               ap = dev->link->ap;
+       ehi = &ap->link.eh_info;
+
+       spin_lock_irqsave(ap->lock, flags);
+
+       switch (event) {
+       case ACPI_NOTIFY_BUS_CHECK:
+       case ACPI_NOTIFY_DEVICE_CHECK:
+               ata_ehi_push_desc(ehi, "ACPI event");
+               ata_ehi_hotplugged(ehi);
+               ata_port_freeze(ap);
+               break;
+
+       case ACPI_NOTIFY_EJECT_REQUEST:
+               ata_ehi_push_desc(ehi, "ACPI event");
+               if (dev)
+                       dev->flags |= ATA_DFLAG_DETACH;
+               else {
+                       struct ata_link *tlink;
+                       struct ata_device *tdev;
+
+                       ata_port_for_each_link(tlink, ap)
+                               ata_link_for_each_dev(tdev, tlink)
+                                       tdev->flags |= ATA_DFLAG_DETACH;
+               }
+
+               ata_port_schedule_eh(ap);
+               wait = 1;
+               break;
        }
 
+       if (dev) {
+               if (dev->sdev)
+                       kobj = &dev->sdev->sdev_gendev.kobj;
+       } else
+               kobj = &ap->dev->kobj;
+
        if (kobj) {
                sprintf(event_string, "BAY_EVENT=%d", event);
                kobject_uevent_env(kobj, KOBJ_CHANGE, envp);
        }
+
+       spin_unlock_irqrestore(ap->lock, flags);
+
+       if (wait)
+               ata_port_wait_eh(ap);
 }
 
 static void ata_acpi_dev_notify(acpi_handle handle, u32 event, void *data)
 {
        struct ata_device *dev = data;
-       struct kobject *kobj = NULL;
 
-       if (dev->sdev)
-               kobj = &dev->sdev->sdev_gendev.kobj;
-
-       ata_acpi_handle_hotplug(dev->link->ap, kobj, event);
+       ata_acpi_handle_hotplug(NULL, dev, event);
 }
 
 static void ata_acpi_ap_notify(acpi_handle handle, u32 event, void *data)
 {
        struct ata_port *ap = data;
 
-       ata_acpi_handle_hotplug(ap, &ap->dev->kobj, event);
+       ata_acpi_handle_hotplug(ap, NULL, event);
 }
 
 /**
@@ -191,20 +223,30 @@ void ata_acpi_associate(struct ata_host *host)
                else
                        ata_acpi_associate_ide_port(ap);
 
-               if (ap->acpi_handle)
-                       acpi_install_notify_handler (ap->acpi_handle,
-                                                    ACPI_SYSTEM_NOTIFY,
-                                                    ata_acpi_ap_notify,
-                                                    ap);
+               if (ap->acpi_handle) {
+                       acpi_install_notify_handler(ap->acpi_handle,
+                                                   ACPI_SYSTEM_NOTIFY,
+                                                   ata_acpi_ap_notify, ap);
+#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
+                       /* we might be on a docking station */
+                       register_hotplug_dock_device(ap->acpi_handle,
+                                                    ata_acpi_ap_notify, ap);
+#endif
+               }
 
                for (j = 0; j < ata_link_max_devices(&ap->link); j++) {
                        struct ata_device *dev = &ap->link.device[j];
 
-                       if (dev->acpi_handle)
-                               acpi_install_notify_handler (dev->acpi_handle,
-                                                            ACPI_SYSTEM_NOTIFY,
-                                                            ata_acpi_dev_notify,
-                                                            dev);
+                       if (dev->acpi_handle) {
+                               acpi_install_notify_handler(dev->acpi_handle,
+                                               ACPI_SYSTEM_NOTIFY,
+                                               ata_acpi_dev_notify, dev);
+#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE)
+                               /* we might be on a docking station */
+                               register_hotplug_dock_device(dev->acpi_handle,
+                                               ata_acpi_dev_notify, dev);
+#endif
+                       }
                }
        }
 }
index 7e68edf3c0f3fe9c5133396c698c96159956d646..8786455c901d9b220d6f7f3cb0540900500e927a 100644 (file)
@@ -295,7 +295,7 @@ static void ali_lock_sectors(struct ata_device *adev)
 static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
 {
        /* If its not a media command, its not worth it */
-       if (qc->nbytes < 2048)
+       if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC)
                return -EOPNOTSUPP;
        return 0;
 }
index 3b1a68d6eddb3c0860794c778a643340b59ec920..0cfbe8c594a55c208a7727cc20a86db0e33ba704 100644 (file)
@@ -238,6 +238,7 @@ static int virtblk_probe(struct virtio_device *vdev)
        vblk->disk->first_minor = index_to_minor(index);
        vblk->disk->private_data = vblk;
        vblk->disk->fops = &virtblk_fops;
+       vblk->disk->driverfs_dev = &vdev->dev;
        index++;
 
        /* If barriers are supported, tell block layer that queue is ordered */
index fe9e768cfbc4d28aa462d73fb60d79b689d160e9..25bdc2dd9ce10cf5cb8bfe2fd19ac130c27cdb33 100644 (file)
@@ -1,5 +1,3 @@
-# -*- shell-script -*-
-
 comment "An alternative FireWire stack is available with EXPERIMENTAL=y"
        depends on EXPERIMENTAL=n
 
@@ -21,27 +19,7 @@ config FIREWIRE
           NOTE:
 
          You should only build ONE of the stacks, unless you REALLY know what
-         you are doing.  If you install both, you should configure them only as
-         modules rather than link them statically, and you should blacklist one
-         of the concurrent low-level drivers in /etc/modprobe.conf.  Add either
-
-             blacklist firewire-ohci
-         or
-             blacklist ohci1394
-
-         there depending on which driver you DON'T want to have auto-loaded.
-         You can optionally do the same with the other IEEE 1394/ FireWire
-         drivers.
-
-         If you have an old modprobe which doesn't implement the blacklist
-         directive, use either
-
-              install firewire-ohci /bin/true
-         or
-              install ohci1394 /bin/true
-
-         and so on, depending on which modules you DON't want to have
-         auto-loaded.
+         you are doing.
 
 config FIREWIRE_OHCI
        tristate "Support for OHCI FireWire host controllers"
@@ -57,8 +35,24 @@ config FIREWIRE_OHCI
 
           NOTE:
 
-         If you also build ohci1394 of the classic stack, blacklist either
-         ohci1394 or firewire-ohci to let hotplug load only the desired driver.
+         You should only build ohci1394 or firewire-ohci, but not both.
+         If you nevertheless want to install both, you should configure them
+         only as modules and blacklist the driver(s) which you don't want to
+         have auto-loaded.  Add either
+
+             blacklist firewire-ohci
+         or
+             blacklist ohci1394
+             blacklist video1394
+             blacklist dv1394
+
+         to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
+         depending on your distribution.  The latter two modules should be
+         blacklisted together with ohci1394 because they depend on ohci1394.
+
+         If you have an old modprobe which doesn't implement the blacklist
+         directive, use "install modulename /bin/true" for the modules to be
+         blacklisted.
 
 config FIREWIRE_SBP2
        tristate "Support for storage devices (SBP-2 protocol driver)"
@@ -75,9 +69,3 @@ config FIREWIRE_SBP2
 
          You should also enable support for disks, CD-ROMs, etc. in the SCSI
          configuration section.
-
-          NOTE:
-
-         If you also build sbp2 of the classic stack, blacklist either sbp2
-         or firewire-sbp2 to let hotplug load only the desired driver.
-
index 7ebad3c14cb80bbd62b930551494400c901f81f0..996d61f0d4602cf0cd942aea5daf54e08739c1cb 100644 (file)
 #include <asm/page.h>
 #include <asm/system.h>
 
+#ifdef CONFIG_PPC_PMAC
+#include <asm/pmac_feature.h>
+#endif
+
 #include "fw-ohci.h"
 #include "fw-transaction.h"
 
@@ -175,6 +179,7 @@ struct fw_ohci {
        int generation;
        int request_generation;
        u32 bus_seconds;
+       bool old_uninorth;
 
        /*
         * Spinlock for accessing fw_ohci data.  Never call out of
@@ -276,19 +281,13 @@ static int ar_context_add_page(struct ar_context *ctx)
 {
        struct device *dev = ctx->ohci->card.device;
        struct ar_buffer *ab;
-       dma_addr_t ab_bus;
+       dma_addr_t uninitialized_var(ab_bus);
        size_t offset;
 
-       ab = (struct ar_buffer *) __get_free_page(GFP_ATOMIC);
+       ab = dma_alloc_coherent(dev, PAGE_SIZE, &ab_bus, GFP_ATOMIC);
        if (ab == NULL)
                return -ENOMEM;
 
-       ab_bus = dma_map_single(dev, ab, PAGE_SIZE, DMA_BIDIRECTIONAL);
-       if (dma_mapping_error(ab_bus)) {
-               free_page((unsigned long) ab);
-               return -ENOMEM;
-       }
-
        memset(&ab->descriptor, 0, sizeof(ab->descriptor));
        ab->descriptor.control        = cpu_to_le16(DESCRIPTOR_INPUT_MORE |
                                                    DESCRIPTOR_STATUS |
@@ -299,8 +298,6 @@ static int ar_context_add_page(struct ar_context *ctx)
        ab->descriptor.res_count      = cpu_to_le16(PAGE_SIZE - offset);
        ab->descriptor.branch_address = 0;
 
-       dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
-
        ctx->last_buffer->descriptor.branch_address = cpu_to_le32(ab_bus | 1);
        ctx->last_buffer->next = ab;
        ctx->last_buffer = ab;
@@ -311,15 +308,22 @@ static int ar_context_add_page(struct ar_context *ctx)
        return 0;
 }
 
+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
+#define cond_le32_to_cpu(v) \
+       (ohci->old_uninorth ? (__force __u32)(v) : le32_to_cpu(v))
+#else
+#define cond_le32_to_cpu(v) le32_to_cpu(v)
+#endif
+
 static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
 {
        struct fw_ohci *ohci = ctx->ohci;
        struct fw_packet p;
        u32 status, length, tcode;
 
-       p.header[0] = le32_to_cpu(buffer[0]);
-       p.header[1] = le32_to_cpu(buffer[1]);
-       p.header[2] = le32_to_cpu(buffer[2]);
+       p.header[0] = cond_le32_to_cpu(buffer[0]);
+       p.header[1] = cond_le32_to_cpu(buffer[1]);
+       p.header[2] = cond_le32_to_cpu(buffer[2]);
 
        tcode = (p.header[0] >> 4) & 0x0f;
        switch (tcode) {
@@ -331,7 +335,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
                break;
 
        case TCODE_READ_BLOCK_REQUEST :
-               p.header[3] = le32_to_cpu(buffer[3]);
+               p.header[3] = cond_le32_to_cpu(buffer[3]);
                p.header_length = 16;
                p.payload_length = 0;
                break;
@@ -340,7 +344,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
        case TCODE_READ_BLOCK_RESPONSE:
        case TCODE_LOCK_REQUEST:
        case TCODE_LOCK_RESPONSE:
-               p.header[3] = le32_to_cpu(buffer[3]);
+               p.header[3] = cond_le32_to_cpu(buffer[3]);
                p.header_length = 16;
                p.payload_length = p.header[3] >> 16;
                break;
@@ -357,7 +361,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
 
        /* FIXME: What to do about evt_* errors? */
        length = (p.header_length + p.payload_length + 3) / 4;
-       status = le32_to_cpu(buffer[length]);
+       status = cond_le32_to_cpu(buffer[length]);
 
        p.ack        = ((status >> 16) & 0x1f) - 16;
        p.speed      = (status >> 21) & 0x7;
@@ -375,7 +379,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
         */
 
        if (p.ack + 16 == 0x09)
-               ohci->request_generation = (buffer[2] >> 16) & 0xff;
+               ohci->request_generation = (p.header[2] >> 16) & 0xff;
        else if (ctx == &ohci->ar_request_ctx)
                fw_core_handle_request(&ohci->card, &p);
        else
@@ -397,6 +401,7 @@ static void ar_context_tasklet(unsigned long data)
 
        if (d->res_count == 0) {
                size_t size, rest, offset;
+               dma_addr_t buffer_bus;
 
                /*
                 * This descriptor is finished and we may have a
@@ -405,9 +410,7 @@ static void ar_context_tasklet(unsigned long data)
                 */
 
                offset = offsetof(struct ar_buffer, data);
-               dma_unmap_single(ohci->card.device,
-                       le32_to_cpu(ab->descriptor.data_address) - offset,
-                       PAGE_SIZE, DMA_BIDIRECTIONAL);
+               buffer_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
 
                buffer = ab;
                ab = ab->next;
@@ -423,7 +426,8 @@ static void ar_context_tasklet(unsigned long data)
                while (buffer < end)
                        buffer = handle_ar_packet(ctx, buffer);
 
-               free_page((unsigned long)buffer);
+               dma_free_coherent(ohci->card.device, PAGE_SIZE,
+                                 buffer, buffer_bus);
                ar_context_add_page(ctx);
        } else {
                buffer = ctx->pointer;
@@ -532,7 +536,7 @@ static int
 context_add_buffer(struct context *ctx)
 {
        struct descriptor_buffer *desc;
-       dma_addr_t bus_addr;
+       dma_addr_t uninitialized_var(bus_addr);
        int offset;
 
        /*
@@ -1022,13 +1026,14 @@ static void bus_reset_tasklet(unsigned long data)
         */
 
        self_id_count = (reg_read(ohci, OHCI1394_SelfIDCount) >> 3) & 0x3ff;
-       generation = (le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
+       generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
        rmb();
 
        for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
                if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1])
                        fw_error("inconsistent self IDs\n");
-               ohci->self_id_buffer[j] = le32_to_cpu(ohci->self_id_cpu[i]);
+               ohci->self_id_buffer[j] =
+                               cond_le32_to_cpu(ohci->self_id_cpu[i]);
        }
        rmb();
 
@@ -1316,7 +1321,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
        unsigned long flags;
        int retval = -EBUSY;
        __be32 *next_config_rom;
-       dma_addr_t next_config_rom_bus;
+       dma_addr_t uninitialized_var(next_config_rom_bus);
 
        ohci = fw_ohci(card);
 
@@ -1487,7 +1492,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
        void *p, *end;
        int i;
 
-       if (db->first_res_count > 0 && db->second_res_count > 0) {
+       if (db->first_res_count != 0 && db->second_res_count != 0) {
                if (ctx->excess_bytes <= le16_to_cpu(db->second_req_count)) {
                        /* This descriptor isn't done yet, stop iteration. */
                        return 0;
@@ -1513,7 +1518,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
                memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
                i += ctx->base.header_size;
                ctx->excess_bytes +=
-                       (le32_to_cpu(*(u32 *)(p + 4)) >> 16) & 0xffff;
+                       (le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
                p += ctx->base.header_size + 4;
        }
        ctx->header_length = i;
@@ -2048,6 +2053,18 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
        int err;
        size_t size;
 
+#ifdef CONFIG_PPC_PMAC
+       /* Necessary on some machines if fw-ohci was loaded/ unloaded before */
+       if (machine_is(powermac)) {
+               struct device_node *ofn = pci_device_to_OF_node(dev);
+
+               if (ofn) {
+                       pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
+                       pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+               }
+       }
+#endif /* CONFIG_PPC_PMAC */
+
        ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
        if (ohci == NULL) {
                fw_error("Could not malloc fw_ohci data.\n");
@@ -2066,6 +2083,10 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
        pci_write_config_dword(dev, OHCI1394_PCI_HCI_Control, 0);
        pci_set_drvdata(dev, ohci);
 
+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
+       ohci->old_uninorth = dev->vendor == PCI_VENDOR_ID_APPLE &&
+                            dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW;
+#endif
        spin_lock_init(&ohci->lock);
 
        tasklet_init(&ohci->bus_reset_tasklet,
@@ -2182,6 +2203,19 @@ static void pci_remove(struct pci_dev *dev)
        pci_disable_device(dev);
        fw_card_put(&ohci->card);
 
+#ifdef CONFIG_PPC_PMAC
+       /* On UniNorth, power down the cable and turn off the chip clock
+        * to save power on laptops */
+       if (machine_is(powermac)) {
+               struct device_node *ofn = pci_device_to_OF_node(dev);
+
+               if (ofn) {
+                       pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+                       pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
+               }
+       }
+#endif /* CONFIG_PPC_PMAC */
+
        fw_notify("Removed fw-ohci device.\n");
 }
 
@@ -2202,6 +2236,16 @@ static int pci_suspend(struct pci_dev *pdev, pm_message_t state)
        if (err)
                fw_error("pci_set_power_state failed with %d\n", err);
 
+/* PowerMac suspend code comes last */
+#ifdef CONFIG_PPC_PMAC
+       if (machine_is(powermac)) {
+               struct device_node *ofn = pci_device_to_OF_node(pdev);
+
+               if (ofn)
+                       pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+       }
+#endif /* CONFIG_PPC_PMAC */
+
        return 0;
 }
 
@@ -2210,6 +2254,16 @@ static int pci_resume(struct pci_dev *pdev)
        struct fw_ohci *ohci = pci_get_drvdata(pdev);
        int err;
 
+/* PowerMac resume code comes first */
+#ifdef CONFIG_PPC_PMAC
+       if (machine_is(powermac)) {
+               struct device_node *ofn = pci_device_to_OF_node(pdev);
+
+               if (ofn)
+                       pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+       }
+#endif /* CONFIG_PPC_PMAC */
+
        pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
        err = pci_enable_device(pdev);
index 03069a454c07c57ec9eb53c177f586d0565981ac..62b4e47d0cc00bb19e58de01c3722c522bd2e55a 100644 (file)
@@ -173,6 +173,7 @@ struct sbp2_target {
 #define SBP2_ORB_TIMEOUT               2000U   /* Timeout in ms */
 #define SBP2_ORB_NULL                  0x80000000
 #define SBP2_MAX_SG_ELEMENT_LENGTH     0xf000
+#define SBP2_RETRY_LIMIT               0xf     /* 15 retries */
 
 #define SBP2_DIRECTION_TO_MEDIA                0x0
 #define SBP2_DIRECTION_FROM_MEDIA      0x1
@@ -330,6 +331,11 @@ static const struct {
                .model                  = ~0,
                .workarounds            = SBP2_WORKAROUND_128K_MAX_TRANS,
        },
+       /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
+               .firmware_revision      = 0x002600,
+               .model                  = ~0,
+               .workarounds            = SBP2_WORKAROUND_128K_MAX_TRANS,
+       },
 
        /*
         * There are iPods (2nd gen, 3rd gen) with model_id == 0, but
@@ -812,6 +818,30 @@ static void sbp2_target_put(struct sbp2_target *tgt)
        kref_put(&tgt->kref, sbp2_release_target);
 }
 
+static void
+complete_set_busy_timeout(struct fw_card *card, int rcode,
+                         void *payload, size_t length, void *done)
+{
+       complete(done);
+}
+
+static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+{
+       struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+       DECLARE_COMPLETION_ONSTACK(done);
+       struct fw_transaction t;
+       static __be32 busy_timeout;
+
+       /* FIXME: we should try to set dual-phase cycle_limit too */
+       busy_timeout = cpu_to_be32(SBP2_RETRY_LIMIT);
+
+       fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
+                       lu->tgt->node_id, lu->generation, device->max_speed,
+                       CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, &busy_timeout,
+                       sizeof(busy_timeout), complete_set_busy_timeout, &done);
+       wait_for_completion(&done);
+}
+
 static void sbp2_reconnect(struct work_struct *work);
 
 static void sbp2_login(struct work_struct *work)
@@ -864,10 +894,8 @@ static void sbp2_login(struct work_struct *work)
        fw_notify("%s: logged in to LUN %04x (%d retries)\n",
                  tgt->bus_id, lu->lun, lu->retries);
 
-#if 0
-       /* FIXME: The linux1394 sbp2 does this last step. */
-       sbp2_set_busy_timeout(scsi_id);
-#endif
+       /* set appropriate retry limit(s) in BUSY_TIMEOUT register */
+       sbp2_set_busy_timeout(lu);
 
        PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect);
        sbp2_agent_reset(lu);
index e47bb040197afb229f8c1078bca1741c18e6c7fc..d2c7a3d7e1cbb7711e8c76af6a76f448ea9d59f1 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/wait.h>
 #include <linux/errno.h>
+#include <asm/bug.h>
 #include <asm/system.h>
 #include "fw-transaction.h"
 #include "fw-topology.h"
@@ -424,8 +425,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
        node1 = fw_node(list1.next);
 
        while (&node0->link != &list0) {
+               WARN_ON(node0->port_count != node1->port_count);
 
-               /* assert(node0->port_count == node1->port_count); */
                if (node0->link_on && !node1->link_on)
                        event = FW_NODE_LINK_OFF;
                else if (!node0->link_on && node1->link_on)
index 7fcc59dedf08cfa038d652336d1f85383614ccd3..99529e59a0b13e4f5173205f5ab4d338ce6ebe3b 100644 (file)
@@ -751,7 +751,7 @@ handle_topology_map(struct fw_card *card, struct fw_request *request,
                    void *payload, size_t length, void *callback_data)
 {
        int i, start, end;
-       u32 *map;
+       __be32 *map;
 
        if (!TCODE_IS_READ_REQUEST(tcode)) {
                fw_send_response(card, request, RCODE_TYPE_ERROR);
index 09cb72870454ea72ceee81f5139c3460665d9ae8..a43bb22912f9da9488fd83a2060b80c78bdfe55b 100644 (file)
 static inline void
 fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
 {
-       u32 *dst = _dst;
-       u32 *src = _src;
+       u32    *dst = _dst;
+       __be32 *src = _src;
        int i;
 
        for (i = 0; i < size / 4; i++)
-               dst[i] = cpu_to_be32(src[i]);
+               dst[i] = be32_to_cpu(src[i]);
 }
 
 static inline void
index 9e2b1964d71add2103a735164cc7560de5ca3b38..f53f72daae34322390be1c8ca52849996e30c3e5 100644 (file)
@@ -376,6 +376,11 @@ static const struct {
                .model_id               = SBP2_ROM_VALUE_WILDCARD,
                .workarounds            = SBP2_WORKAROUND_128K_MAX_TRANS,
        },
+       /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
+               .firmware_revision      = 0x002600,
+               .model_id               = SBP2_ROM_VALUE_WILDCARD,
+               .workarounds            = SBP2_WORKAROUND_128K_MAX_TRANS,
+       },
        /* iPod 4th generation */ {
                .firmware_revision      = 0x0a2700,
                .model_id               = 0x000021,
index 20d5c7bd940a7c48eaa42b8af06484d918e6e6b8..1c14a186f000acc10b23b59b5bc554533bf6a4ec 100644 (file)
@@ -180,7 +180,7 @@ static void tifm_sd_transfer_data(struct tifm_sd *host)
                        host->sg_pos++;
                        if (host->sg_pos == host->sg_len) {
                                if ((r_data->flags & MMC_DATA_WRITE)
-                                   && DATA_CARRY)
+                                   && (host->cmd_flags & DATA_CARRY))
                                        writel(host->bounce_buf_data[0],
                                               host->dev->addr
                                               + SOCK_MMCSD_DATA);
index 19fd4cb0ddf8583cbd9235b6085a7ad1100dfa19..b58472cf76f862c16fa861b02bcb494008c00f90 100644 (file)
@@ -203,8 +203,11 @@ again:
        if (received < budget) {
                netif_rx_complete(vi->dev, napi);
                if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq))
-                   && netif_rx_reschedule(vi->dev, napi))
+                   && napi_schedule_prep(napi)) {
+                       vi->rvq->vq_ops->disable_cb(vi->rvq);
+                       __netif_rx_schedule(vi->dev, napi);
                        goto again;
+               }
        }
 
        return received;
@@ -278,10 +281,11 @@ again:
                pr_debug("%s: virtio not prepared to send\n", dev->name);
                netif_stop_queue(dev);
 
-               /* Activate callback for using skbs: if this fails it
+               /* Activate callback for using skbs: if this returns false it
                 * means some were used in the meantime. */
                if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
-                       printk("Unlikely: restart svq failed\n");
+                       printk("Unlikely: restart svq race\n");
+                       vi->svq->vq_ops->disable_cb(vi->svq);
                        netif_start_queue(dev);
                        goto again;
                }
@@ -294,6 +298,15 @@ again:
        return 0;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void virtnet_netpoll(struct net_device *dev)
+{
+       struct virtnet_info *vi = netdev_priv(dev);
+
+       napi_schedule(&vi->napi);
+}
+#endif
+
 static int virtnet_open(struct net_device *dev)
 {
        struct virtnet_info *vi = netdev_priv(dev);
@@ -336,6 +349,9 @@ static int virtnet_probe(struct virtio_device *vdev)
        dev->stop = virtnet_close;
        dev->hard_start_xmit = start_xmit;
        dev->features = NETIF_F_HIGHDMA;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller = virtnet_netpoll;
+#endif
        SET_NETDEV_DEV(dev, &vdev->dev);
 
        /* Do we support "hardware" checksums? */
index de34aa9d3136055566204767cd2f5b9cbb28bfb6..f9f9a5f1bbd0f9d74c5f505c4dea7f7a1ac6c129 100644 (file)
@@ -829,7 +829,7 @@ static ssize_t pdcs_autoboot_write(struct kobject *kobj,
                                   struct kobj_attribute *attr,
                                   const char *buf, size_t count)
 {
-       return pdcs_auto_write(kset, attr, buf, count, PF_AUTOBOOT);
+       return pdcs_auto_write(kobj, attr, buf, count, PF_AUTOBOOT);
 }
 
 /**
@@ -845,7 +845,7 @@ static ssize_t pdcs_autosearch_write(struct kobject *kobj,
                                     struct kobj_attribute *attr,
                                     const char *buf, size_t count)
 {
-       return pdcs_auto_write(kset, attr, buf, count, PF_AUTOSEARCH);
+       return pdcs_auto_write(kobj, attr, buf, count, PF_AUTOSEARCH);
 }
 
 /**
@@ -1066,7 +1066,7 @@ pdc_stable_init(void)
        }
 
        /* Don't forget the root entries */
-       error = sysfs_create_group(stable_kobj, pdcs_attr_group);
+       error = sysfs_create_group(stable_kobj, &pdcs_attr_group);
 
        /* register the paths kset as a child of the stable kset */
        paths_kset = kset_create_and_add("paths", NULL, stable_kobj);
index bdbe780e21c51e36de99d359c4304bfac2cc2054..8c4d2c13d5f246057a42d73ac518637973fca79e 100644 (file)
@@ -314,8 +314,8 @@ sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
 #define RESMAP_MASK(n)    (~0UL << (BITS_PER_LONG - (n)))
 #define RESMAP_IDX_MASK   (sizeof(unsigned long) - 1)
 
-unsigned long ptr_to_pide(struct ioc *ioc, unsigned long *res_ptr,
-                         unsigned int bitshiftcnt)
+static unsigned long ptr_to_pide(struct ioc *ioc, unsigned long *res_ptr,
+                                unsigned int bitshiftcnt)
 {
        return (((unsigned long)res_ptr - (unsigned long)ioc->res_map) << 3)
                + bitshiftcnt;
index 3ab313ed441cc07a4c9ef17ee62c3e325493a32c..17e71d56f31ef777af16d6745cfa5394c7c85df1 100644 (file)
@@ -4,8 +4,6 @@
 
 menuconfig THERMAL
        bool "Generic Thermal sysfs driver"
-       select HWMON
-       default y
        help
          Generic Thermal Sysfs driver offers a generic mechanism for
          thermal management. Usually it's made up of one or more thermal
index 41bd4c805ace249c6c43f44066df7c049d0cdac4..8b86e53ccf7a081586d32d09350dce072f2ef75e 100644 (file)
 #include <linux/idr.h>
 #include <linux/thermal.h>
 #include <linux/spinlock.h>
-#include <linux/hwmon.h>
-#include <linux/hwmon-sysfs.h>
 
-MODULE_AUTHOR("Zhang Rui");
+MODULE_AUTHOR("Zhang Rui")
 MODULE_DESCRIPTION("Generic thermal management sysfs support");
 MODULE_LICENSE("GPL");
 
@@ -58,9 +56,6 @@ static LIST_HEAD(thermal_tz_list);
 static LIST_HEAD(thermal_cdev_list);
 static DEFINE_MUTEX(thermal_list_lock);
 
-static struct device *thermal_hwmon;
-#define MAX_THERMAL_ZONES      10
-
 static int get_idr(struct idr *idr, struct mutex *lock, int *id)
 {
        int err;
@@ -92,67 +87,7 @@ static void release_idr(struct idr *idr, struct mutex *lock, int id)
                mutex_unlock(lock);
 }
 
-/* hwmon sys I/F*/
-static ssize_t
-name_show(struct device *dev, struct device_attribute *attr, char *buf)
-{
-       return sprintf(buf, "thermal_sys_class\n");
-}
-
-static ssize_t
-temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
-{
-       struct thermal_zone_device *tz;
-       struct sensor_device_attribute *sensor_attr
-                                               = to_sensor_dev_attr(attr);
-
-       list_for_each_entry(tz, &thermal_tz_list, node)
-               if (tz->id == sensor_attr->index)
-                       return tz->ops->get_temp(tz, buf);
-
-       return -ENODEV;
-}
-
-static ssize_t
-temp_crit_show(struct device *dev, struct device_attribute *attr,
-               char *buf)
-{
-       struct thermal_zone_device *tz;
-       struct sensor_device_attribute *sensor_attr
-                                               = to_sensor_dev_attr(attr);
-
-       list_for_each_entry(tz, &thermal_tz_list, node)
-               if (tz->id == sensor_attr->index)
-                       return tz->ops->get_trip_temp(tz, 0, buf);
-
-       return -ENODEV;
-}
-
-static DEVICE_ATTR(name, 0444, name_show, NULL);
-static struct sensor_device_attribute sensor_attrs[] = {
-       SENSOR_ATTR(temp1_input, 0444, temp_input_show, NULL, 0),
-       SENSOR_ATTR(temp1_crit, 0444, temp_crit_show, NULL, 0),
-       SENSOR_ATTR(temp2_input, 0444, temp_input_show, NULL, 1),
-       SENSOR_ATTR(temp2_crit, 0444, temp_crit_show, NULL, 1),
-       SENSOR_ATTR(temp3_input, 0444, temp_input_show, NULL, 2),
-       SENSOR_ATTR(temp3_crit, 0444, temp_crit_show, NULL, 2),
-       SENSOR_ATTR(temp4_input, 0444, temp_input_show, NULL, 3),
-       SENSOR_ATTR(temp4_crit, 0444, temp_crit_show, NULL, 3),
-       SENSOR_ATTR(temp5_input, 0444, temp_input_show, NULL, 4),
-       SENSOR_ATTR(temp5_crit, 0444, temp_crit_show, NULL, 4),
-       SENSOR_ATTR(temp6_input, 0444, temp_input_show, NULL, 5),
-       SENSOR_ATTR(temp6_crit, 0444, temp_crit_show, NULL, 5),
-       SENSOR_ATTR(temp7_input, 0444, temp_input_show, NULL, 6),
-       SENSOR_ATTR(temp7_crit, 0444, temp_crit_show, NULL, 6),
-       SENSOR_ATTR(temp8_input, 0444, temp_input_show, NULL, 7),
-       SENSOR_ATTR(temp8_crit, 0444, temp_crit_show, NULL, 7),
-       SENSOR_ATTR(temp9_input, 0444, temp_input_show, NULL, 8),
-       SENSOR_ATTR(temp9_crit, 0444, temp_crit_show, NULL, 8),
-       SENSOR_ATTR(temp10_input, 0444, temp_input_show, NULL, 9),
-       SENSOR_ATTR(temp10_crit, 0444, temp_crit_show, NULL, 9),
-};
-
-/* thermal zone sys I/F */
+/* sys I/F for thermal zone */
 
 #define to_thermal_zone(_dev) \
        container_of(_dev, struct thermal_zone_device, device)
@@ -279,7 +214,7 @@ do {        \
        device_remove_file(_dev, &trip_point_attrs[_index * 2 + 1]);    \
 } while (0)
 
-/* cooling device sys I/F */
+/* sys I/F for cooling device */
 #define to_cooling_device(_dev)        \
        container_of(_dev, struct thermal_cooling_device, device)
 
@@ -512,9 +447,6 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
        struct thermal_zone_device *pos;
        int result;
 
-       if (!type)
-               return ERR_PTR(-EINVAL);
-
        if (strlen(type) >= THERMAL_NAME_LENGTH)
                return ERR_PTR(-EINVAL);
 
@@ -545,9 +477,11 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
        }
 
        /* sys I/F */
-       result = device_create_file(&cdev->device, &dev_attr_cdev_type);
-       if (result)
-               goto unregister;
+       if (type) {
+               result = device_create_file(&cdev->device, &dev_attr_cdev_type);
+               if (result)
+                       goto unregister;
+       }
 
        result = device_create_file(&cdev->device, &dev_attr_max_state);
        if (result)
@@ -613,8 +547,8 @@ void thermal_cooling_device_unregister(struct
                tz->ops->unbind(tz, cdev);
        }
        mutex_unlock(&thermal_list_lock);
-
-       device_remove_file(&cdev->device, &dev_attr_cdev_type);
+       if (cdev->type[0])
+               device_remove_file(&cdev->device, &dev_attr_cdev_type);
        device_remove_file(&cdev->device, &dev_attr_max_state);
        device_remove_file(&cdev->device, &dev_attr_cur_state);
 
@@ -646,9 +580,6 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
        int result;
        int count;
 
-       if (!type)
-               return ERR_PTR(-EINVAL);
-
        if (strlen(type) >= THERMAL_NAME_LENGTH)
                return ERR_PTR(-EINVAL);
 
@@ -670,13 +601,6 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
                kfree(tz);
                return ERR_PTR(result);
        }
-       if (tz->id >= MAX_THERMAL_ZONES) {
-               printk(KERN_ERR PREFIX
-                       "Too many thermal zones\n");
-               release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id);
-               kfree(tz);
-               return ERR_PTR(-EINVAL);
-       }
 
        strcpy(tz->type, type);
        tz->ops = ops;
@@ -691,27 +615,12 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
                return ERR_PTR(result);
        }
 
-       /* hwmon sys I/F */
-       result = device_create_file(thermal_hwmon,
-                                       &sensor_attrs[tz->id * 2].dev_attr);
-       if (result)
-               goto unregister;
-
-       if (trips > 0) {
-               char buf[40];
-               result = tz->ops->get_trip_type(tz, 0, buf);
-               if (result > 0 && !strcmp(buf, "critical\n")) {
-                       result = device_create_file(thermal_hwmon,
-                                       &sensor_attrs[tz->id * 2 + 1].dev_attr);
-                       if (result)
-                               goto unregister;
-               }
-       }
-
        /* sys I/F */
-       result = device_create_file(&tz->device, &dev_attr_type);
-       if (result)
-               goto unregister;
+       if (type) {
+               result = device_create_file(&tz->device, &dev_attr_type);
+               if (result)
+                       goto unregister;
+       }
 
        result = device_create_file(&tz->device, &dev_attr_temp);
        if (result)
@@ -778,17 +687,8 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
                    tz->ops->unbind(tz, cdev);
        mutex_unlock(&thermal_list_lock);
 
-       device_remove_file(thermal_hwmon,
-                               &sensor_attrs[tz->id * 2].dev_attr);
-       if (tz->trips > 0) {
-               char buf[40];
-               if (tz->ops->get_trip_type(tz, 0, buf) > 0)
-                       if (!strcmp(buf, "critical\n"))
-                               device_remove_file(thermal_hwmon,
-                               &sensor_attrs[tz->id * 2 + 1].dev_attr);
-       }
-
-       device_remove_file(&tz->device, &dev_attr_type);
+       if (tz->type[0])
+               device_remove_file(&tz->device, &dev_attr_type);
        device_remove_file(&tz->device, &dev_attr_temp);
        if (tz->ops->get_mode)
                device_remove_file(&tz->device, &dev_attr_mode);
@@ -805,19 +705,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 
 EXPORT_SYMBOL(thermal_zone_device_unregister);
 
-static void thermal_exit(void)
-{
-       if (thermal_hwmon) {
-               device_remove_file(thermal_hwmon, &dev_attr_name);
-               hwmon_device_unregister(thermal_hwmon);
-       }
-       class_unregister(&thermal_class);
-       idr_destroy(&thermal_tz_idr);
-       idr_destroy(&thermal_cdev_idr);
-       mutex_destroy(&thermal_idr_lock);
-       mutex_destroy(&thermal_list_lock);
-}
-
 static int __init thermal_init(void)
 {
        int result = 0;
@@ -829,21 +716,17 @@ static int __init thermal_init(void)
                mutex_destroy(&thermal_idr_lock);
                mutex_destroy(&thermal_list_lock);
        }
-
-       thermal_hwmon = hwmon_device_register(NULL);
-       if (IS_ERR(thermal_hwmon)) {
-               result = PTR_ERR(thermal_hwmon);
-               thermal_hwmon = NULL;
-               printk(KERN_ERR PREFIX
-                       "unable to register hwmon device\n");
-               thermal_exit();
-               return result;
-       }
-
-       result = device_create_file(thermal_hwmon, &dev_attr_name);
-
        return result;
 }
 
+static void __exit thermal_exit(void)
+{
+       class_unregister(&thermal_class);
+       idr_destroy(&thermal_tz_idr);
+       idr_destroy(&thermal_cdev_idr);
+       mutex_destroy(&thermal_idr_lock);
+       mutex_destroy(&thermal_list_lock);
+}
+
 subsys_initcall(thermal_init);
 module_exit(thermal_exit);
index c8a4332d1132ef465c5aa0d522787cbd255ce293..0b3efc31ee6d38620f97855a8c2d4941eea5f5b9 100644 (file)
@@ -152,7 +152,7 @@ static void virtballoon_changed(struct virtio_device *vdev)
        wake_up(&vb->config_change);
 }
 
-static inline int towards_target(struct virtio_balloon *vb)
+static inline s64 towards_target(struct virtio_balloon *vb)
 {
        u32 v;
        __virtio_config_val(vb->vdev,
@@ -176,7 +176,7 @@ static int balloon(void *_vballoon)
 
        set_freezable();
        while (!kthread_should_stop()) {
-               int diff;
+               s64 diff;
 
                try_to_freeze();
                wait_event_interruptible(vb->config_change,
index 26f787ddd5ff58b81165d8d443bb3bda23db2586..59a8f73dec730421c3dcff6b52c0c9de59798b43 100644 (file)
@@ -177,6 +177,7 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
        struct virtio_pci_device *vp_dev = opaque;
        struct virtio_pci_vq_info *info;
        irqreturn_t ret = IRQ_NONE;
+       unsigned long flags;
        u8 isr;
 
        /* reading the ISR has the effect of also clearing it so it's very
@@ -197,12 +198,12 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
                        drv->config_changed(&vp_dev->vdev);
        }
 
-       spin_lock(&vp_dev->lock);
+       spin_lock_irqsave(&vp_dev->lock, flags);
        list_for_each_entry(info, &vp_dev->virtqueues, node) {
                if (vring_interrupt(irq, info->vq) == IRQ_HANDLED)
                        ret = IRQ_HANDLED;
        }
-       spin_unlock(&vp_dev->lock);
+       spin_unlock_irqrestore(&vp_dev->lock, flags);
 
        return ret;
 }
@@ -214,6 +215,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
        struct virtio_pci_device *vp_dev = to_vp_device(vdev);
        struct virtio_pci_vq_info *info;
        struct virtqueue *vq;
+       unsigned long flags;
        u16 num;
        int err;
 
@@ -255,9 +257,9 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
        vq->priv = info;
        info->vq = vq;
 
-       spin_lock(&vp_dev->lock);
+       spin_lock_irqsave(&vp_dev->lock, flags);
        list_add(&info->node, &vp_dev->virtqueues);
-       spin_unlock(&vp_dev->lock);
+       spin_unlock_irqrestore(&vp_dev->lock, flags);
 
        return vq;
 
@@ -274,10 +276,11 @@ static void vp_del_vq(struct virtqueue *vq)
 {
        struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
        struct virtio_pci_vq_info *info = vq->priv;
+       unsigned long flags;
 
-       spin_lock(&vp_dev->lock);
+       spin_lock_irqsave(&vp_dev->lock, flags);
        list_del(&info->node);
-       spin_unlock(&vp_dev->lock);
+       spin_unlock_irqrestore(&vp_dev->lock, flags);
 
        vring_del_virtqueue(vq);
 
index 3a28c1382131d04940035448d24aada5244e7589..aa714028641e630b068f683fc67e6707d6c6a853 100644 (file)
@@ -232,7 +232,6 @@ static bool vring_enable_cb(struct virtqueue *_vq)
        vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
        mb();
        if (unlikely(more_used(vq))) {
-               vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
                END_USE(vq);
                return false;
        }
index 878bf25dbc6a8c60d8ffc9736c0d6bf5c20ed699..92fb358ce824325e6b8275388b111e70728463dc 100644 (file)
@@ -229,7 +229,7 @@ skip:
 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
 {
        struct hfs_btree *tree;
-       struct hfs_bnode *node, *new_node;
+       struct hfs_bnode *node, *new_node, *next_node;
        struct hfs_bnode_desc node_desc;
        int num_recs, new_rec_off, new_off, old_rec_off;
        int data_start, data_end, size;
@@ -248,6 +248,17 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
        new_node->type = node->type;
        new_node->height = node->height;
 
+       if (node->next)
+               next_node = hfs_bnode_find(tree, node->next);
+       else
+               next_node = NULL;
+
+       if (IS_ERR(next_node)) {
+               hfs_bnode_put(node);
+               hfs_bnode_put(new_node);
+               return next_node;
+       }
+
        size = tree->node_size / 2 - node->num_recs * 2 - 14;
        old_rec_off = tree->node_size - 4;
        num_recs = 1;
@@ -261,6 +272,8 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
                /* panic? */
                hfs_bnode_put(node);
                hfs_bnode_put(new_node);
+               if (next_node)
+                       hfs_bnode_put(next_node);
                return ERR_PTR(-ENOSPC);
        }
 
@@ -315,8 +328,7 @@ static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd)
        hfs_bnode_write(node, &node_desc, 0, sizeof(node_desc));
 
        /* update next bnode header */
-       if (new_node->next) {
-               struct hfs_bnode *next_node = hfs_bnode_find(tree, new_node->next);
+       if (next_node) {
                next_node->prev = new_node->this;
                hfs_bnode_read(next_node, &node_desc, 0, sizeof(node_desc));
                node_desc.prev = cpu_to_be32(next_node->prev);
index 1eb771d79cca09a51326541dc76f3db3405f9245..3e6b3f41ee1f342918e6e3f57493f3c0ab21b033 100644 (file)
@@ -232,6 +232,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                fhp->fh_dentry = dentry;
                fhp->fh_export = exp;
                nfsd_nr_verified++;
+               cache_get(&exp->h);
        } else {
                /*
                 * just rechecking permissions
@@ -241,6 +242,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                dprintk("nfsd: fh_verify - just checking\n");
                dentry = fhp->fh_dentry;
                exp = fhp->fh_export;
+               cache_get(&exp->h);
                /*
                 * Set user creds for this exportpoint; necessary even
                 * in the "just checking" case because this may be a
@@ -252,8 +254,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
                if (error)
                        goto out;
        }
-       cache_get(&exp->h);
-
 
        error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
        if (error)
index ce0c0d844c7dfe40addc2488e94d2af5c7b2cb72..d0a4a82628181578a943ae082c60ae8b63959411 100644 (file)
@@ -204,7 +204,7 @@ typedef struct elf64_fdesc {
 /*
  * The following definitions are those for 32-bit ELF binaries on a 32-bit
  * kernel and for 64-bit binaries on a 64-bit kernel.  To run 32-bit binaries
- * on a 64-bit kernel, arch/parisc64/kernel/binfmt_elf32.c defines these
+ * on a 64-bit kernel, arch/parisc/kernel/binfmt_elf32.c defines these
  * macros appropriately and then #includes binfmt_elf.c, which then includes
  * this file.
  */
@@ -216,26 +216,25 @@ typedef struct elf64_fdesc {
  * Note that this header file is used by default in fs/binfmt_elf.c. So
  * the following macros are for the default case. However, for the 64
  * bit kernel we also support 32 bit parisc binaries. To do that
- * arch/parisc64/kernel/binfmt_elf32.c defines its own set of these
+ * arch/parisc/kernel/binfmt_elf32.c defines its own set of these
  * macros, and then it includes fs/binfmt_elf.c to provide an alternate
  * elf binary handler for 32 bit binaries (on the 64 bit kernel).
  */
 #ifdef CONFIG_64BIT
-#define ELF_CLASS       ELFCLASS64
+#define ELF_CLASS   ELFCLASS64
 #else
 #define ELF_CLASS      ELFCLASS32
 #endif
 
 typedef unsigned long elf_greg_t;
 
-/* This yields a string that ld.so will use to load implementation
-   specific libraries for optimization.  This is more specific in
-   intent than poking at uname or /proc/cpuinfo.
-
-   For the moment, we have only optimizations for the Intel generations,
-   but that could change... */
+/*
+ * This yields a string that ld.so will use to load implementation
+ * specific libraries for optimization.  This is more specific in
+ * intent than poking at uname or /proc/cpuinfo.
+ */
 
-#define ELF_PLATFORM  ("PARISC\0" /*+((boot_cpu_data.x86-3)*5) */)
+#define ELF_PLATFORM  ("PARISC\0")
 
 #define SET_PERSONALITY(ex, ibcs2) \
        current->personality = PER_LINUX; \
@@ -310,7 +309,7 @@ struct pt_regs;     /* forward declaration... */
 #define ELF_OSABI      ELFOSABI_LINUX
 
 /* %r23 is set by ld.so to a pointer to a function which might be 
-   registered using atexit.  This provides a mean for the dynamic
+   registered using atexit.  This provides a means for the dynamic
    linker to call DT_FINI functions for shared libraries that have
    been loaded before the code runs.
 
@@ -339,6 +338,5 @@ struct pt_regs;     /* forward declaration... */
    but it's not easy, and we've already done it here.  */
 
 #define ELF_HWCAP      0
-/* (boot_cpu_data.x86_capability) */
 
 #endif
index a5caf4b122b7c323b5abc9d233006d992214ceca..de3fe3a18229a23e99cea0ec2ec6a7cc7a9e6669 100644 (file)
 #define KERNEL_MAP_START       (GATEWAY_PAGE_SIZE)
 #define KERNEL_MAP_END         (TMPALIAS_MAP_START)
 
-#endif
+#ifndef __ASSEMBLY__
+extern void *vmalloc_start;
+#define PCXL_DMA_MAP_SIZE      (8*1024*1024)
+#define VMALLOC_START          ((unsigned long)vmalloc_start)
+#define VMALLOC_END            (KERNEL_MAP_END)
+#endif /*__ASSEMBLY__*/
+
+#endif /*_ASM_FIXMAP_H*/
index dbee6e60aa8139e66897ba65ba4ac9155bf00dab..fdc6d055ef7f2af68872f2f195d8b417ebb9558f 100644 (file)
@@ -56,6 +56,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
        int err = 0;
        int uval;
 
+       /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
+        * our gateway page, and causes no end of trouble...
+        */
+       if (segment_eq(KERNEL_DS, get_fs()) && !uaddr)
+               return -EFAULT;
+
        if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
                return -EFAULT;
 
@@ -67,5 +73,5 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
        return uval;
 }
 
-#endif
-#endif
+#endif /*__KERNEL__*/
+#endif /*_ASM_PARISC_FUTEX_H*/
index deda8c311373bb685771e38c44bc44668772d4d0..9eaa794c3e4a3f1de70716e450896e1cddf8d570 100644 (file)
@@ -645,8 +645,7 @@ int pdc_soft_power_button(int sw_control);
 void pdc_io_reset(void);
 void pdc_io_reset_devices(void);
 int pdc_iodc_getc(void);
-int pdc_iodc_print(unsigned char *str, unsigned count);
-void pdc_printf(const char *fmt, ...);
+int pdc_iodc_print(const unsigned char *str, unsigned count);
 
 void pdc_emergency_unlock(void);
 int pdc_sti_call(unsigned long func, unsigned long flags,
index 3996dfc30a3f3366aebd714d63b35fb8455fcbac..fc987a1c12a88828d66c9c322da3d0a514fd5143 100644 (file)
@@ -138,10 +138,10 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
        free_page((unsigned long)pte);
 }
 
-static inline void pte_free_kernel(struct mm_struct *mm, struct page *pte)
+static inline void pte_free(struct mm_struct *mm, struct page *pte)
 {
        pgtable_page_dtor(pte);
-       pte_free_kernel(page_address((pte));
+       pte_free_kernel(mm, page_address(pte));
 }
 
 #define check_pgt_cache()      do { } while (0)
index cd0fa4f73320fdbe72dd63b9a9aae1d425978d17..dc86adbec916da26e7825523324c39dc8a642fec 100644 (file)
 
 #define FIRST_USER_ADDRESS     0
 
-#ifndef __ASSEMBLY__
-extern  void *vmalloc_start;
-#define PCXL_DMA_MAP_SIZE   (8*1024*1024)
-#define VMALLOC_START   ((unsigned long)vmalloc_start)
-/* this is a fixmap remnant, see fixmap.h */
-#define VMALLOC_END    (KERNEL_MAP_END)
-#endif
-
 /* NB: The tlb miss handlers make certain assumptions about the order */
 /*     of the following bits, so be careful (One example, bits 25-31  */
 /*     are moved together in one instruction).                        */
index 081b4ae6186682aeaeffff35a677eab29b869f95..a7d857f0e4f404963c86f2baeb240f80d7a6f110 100644 (file)
 #define __NR_timerfd           (__NR_Linux + 303)
 #define __NR_eventfd           (__NR_Linux + 304)
 #define __NR_fallocate         (__NR_Linux + 305)
+#define __NR_timerfd_create    (__NR_Linux + 306)
+#define __NR_timerfd_settime   (__NR_Linux + 307)
+#define __NR_timerfd_gettime   (__NR_Linux + 308)
 
-#define __NR_Linux_syscalls    (__NR_fallocate + 1)
+#define __NR_Linux_syscalls    (__NR_timerfd_gettime + 1)
 
 
 #define __IGNORE_select                /* newselect */
index 51d214138814a509803e22db093c8a9f91108227..adcbb05b120b156758c4a8894990869ad473e103 100644 (file)
@@ -49,11 +49,11 @@ struct fid {
 
 /**
  * struct export_operations - for nfsd to communicate with file systems
- * @decode_fh:      decode a file handle fragment and return a &struct dentry
  * @encode_fh:      encode a file handle fragment from a dentry
+ * @fh_to_dentry:   find the implied object and get a dentry for it
+ * @fh_to_parent:   find the implied object's parent and get a dentry for it
  * @get_name:       find the name for a given inode in a given directory
  * @get_parent:     find the parent of a given directory
- * @get_dentry:     find a dentry for the inode given a file handle sub-fragment
  *
  * See Documentation/filesystems/Exporting for details on how to use
  * this interface correctly.
index 9010f545876723ad290c73b6f0a0a79d28c32376..b7e4b633c69b002d85bda6c7baa6da8341b48d35 100644 (file)
@@ -1045,6 +1045,8 @@ void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
 void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
 void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
 int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name);
+int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask,
+                                  const char *name);
 void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask);
 
 extern int pci_pci_problems;
index 260d1fcf29a4222c011ab39176b1e2e4d46a98a3..12c18ac1b973caf7fc33f44db0ee7fa759fc361f 100644 (file)
@@ -43,8 +43,9 @@ struct virtqueue
  *     vq: the struct virtqueue we're talking about.
  * @enable_cb: restart callbacks after disable_cb.
  *     vq: the struct virtqueue we're talking about.
- *     This returns "false" (and doesn't re-enable) if there are pending
- *     buffers in the queue, to avoid a race.
+ *     This re-enables callbacks; it returns "false" if there are pending
+ *     buffers in the queue, to detect a possible race between the driver
+ *     checking for more work, and enabling callbacks.
  *
  * Locking rules are straightforward: the driver is responsible for
  * locking.  No two operations may be invoked simultaneously.
index e3ac7d0fc4e1807e62d1246b74aefa5d9ae9f23a..ae13370e8484528a8501b0dbf4a8091ff5dd7e95 100644 (file)
@@ -52,15 +52,10 @@ struct dst_entry
        unsigned short          header_len;     /* more space at head required */
        unsigned short          trailer_len;    /* space to reserve at tail */
 
-       u32                     metrics[RTAX_MAX];
-       struct dst_entry        *path;
-
-       unsigned long           rate_last;      /* rate limiting for ICMP */
        unsigned int            rate_tokens;
+       unsigned long           rate_last;      /* rate limiting for ICMP */
 
-#ifdef CONFIG_NET_CLS_ROUTE
-       __u32                   tclassid;
-#endif
+       struct dst_entry        *path;
 
        struct neighbour        *neighbour;
        struct hh_cache         *hh;
@@ -70,10 +65,20 @@ struct dst_entry
        int                     (*output)(struct sk_buff*);
 
        struct  dst_ops         *ops;
-               
-       unsigned long           lastuse;
+
+       u32                     metrics[RTAX_MAX];
+
+#ifdef CONFIG_NET_CLS_ROUTE
+       __u32                   tclassid;
+#endif
+
+       /*
+        * __refcnt wants to be on a different cache line from
+        * input/output/ops or performance tanks badly
+        */
        atomic_t                __refcnt;       /* client references    */
        int                     __use;
+       unsigned long           lastuse;
        union {
                struct dst_entry *next;
                struct rtable    *rt_next;
index c0b1e0533d80d32080c8d44acf2ab9f9d90bcbb7..d53fee8d8604a5514889bfcd93acee4dd882fae0 100644 (file)
@@ -538,7 +538,7 @@ skip:
        initrd_end = 0;
 }
 
-int __init populate_rootfs(void)
+static int __init populate_rootfs(void)
 {
        char *err = unpack_to_rootfs(__initramfs_start,
                         __initramfs_end - __initramfs_start, 0);
@@ -577,10 +577,4 @@ int __init populate_rootfs(void)
        }
        return 0;
 }
-#ifndef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-/*
- * if this option is enabled, populate_rootfs() is called _earlier_ in the
- * boot sequence. This insures that the ACPI initialisation can find the file.
- */
 rootfs_initcall(populate_rootfs);
-#endif
index fbb0167c6b8a3532baad7bfeefa5194cc0bb6e40..99ce94930b09302f7af89f75c07d7daa6a7ef668 100644 (file)
@@ -102,12 +102,6 @@ static inline void mark_rodata_ro(void) { }
 extern void tc_init(void);
 #endif
 
-#ifdef CONFIG_ACPI_CUSTOM_DSDT_INITRD
-extern int populate_rootfs(void);
-#else
-static inline void populate_rootfs(void) {}
-#endif
-
 enum system_states system_state;
 EXPORT_SYMBOL(system_state);
 
@@ -650,7 +644,6 @@ asmlinkage void __init start_kernel(void)
 
        check_bugs();
 
-       populate_rootfs(); /* For DSDT override from initramfs */
        acpi_early_init(); /* before LAPIC and SMP init */
 
        /* Do the rest non-__init'ed, we're now alive */
index 1cb53fb1fe3ddcc102c9de1e44350e384fe66fff..d1ad69b270ca7abc418871ce3160cc4bfbc04135 100644 (file)
@@ -301,7 +301,7 @@ struct cfs_rq {
        /* 'curr' points to currently running entity on this cfs_rq.
         * It is set to NULL otherwise (i.e when none are currently running).
         */
-       struct sched_entity *curr;
+       struct sched_entity *curr, *next;
 
        unsigned long nr_spread_over;
 
@@ -1084,7 +1084,7 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight,
        u64 tmp;
 
        if (unlikely(!lw->inv_weight))
-               lw->inv_weight = (WMULT_CONST - lw->weight/2) / lw->weight + 1;
+               lw->inv_weight = (WMULT_CONST-lw->weight/2) / (lw->weight+1);
 
        tmp = (u64)delta_exec * weight;
        /*
@@ -1108,11 +1108,13 @@ calc_delta_fair(unsigned long delta_exec, struct load_weight *lw)
 static inline void update_load_add(struct load_weight *lw, unsigned long inc)
 {
        lw->weight += inc;
+       lw->inv_weight = 0;
 }
 
 static inline void update_load_sub(struct load_weight *lw, unsigned long dec)
 {
        lw->weight -= dec;
+       lw->inv_weight = 0;
 }
 
 /*
@@ -4268,11 +4270,10 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
        oldprio = p->prio;
        on_rq = p->se.on_rq;
        running = task_current(rq, p);
-       if (on_rq) {
+       if (on_rq)
                dequeue_task(rq, p, 0);
-               if (running)
-                       p->sched_class->put_prev_task(rq, p);
-       }
+       if (running)
+               p->sched_class->put_prev_task(rq, p);
 
        if (rt_prio(prio))
                p->sched_class = &rt_sched_class;
@@ -4281,10 +4282,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
 
        p->prio = prio;
 
+       if (running)
+               p->sched_class->set_curr_task(rq);
        if (on_rq) {
-               if (running)
-                       p->sched_class->set_curr_task(rq);
-
                enqueue_task(rq, p, 0);
 
                check_class_changed(rq, p, prev_class, oldprio, running);
@@ -4581,19 +4581,17 @@ recheck:
        update_rq_clock(rq);
        on_rq = p->se.on_rq;
        running = task_current(rq, p);
-       if (on_rq) {
+       if (on_rq)
                deactivate_task(rq, p, 0);
-               if (running)
-                       p->sched_class->put_prev_task(rq, p);
-       }
+       if (running)
+               p->sched_class->put_prev_task(rq, p);
 
        oldprio = p->prio;
        __setscheduler(rq, p, policy, param->sched_priority);
 
+       if (running)
+               p->sched_class->set_curr_task(rq);
        if (on_rq) {
-               if (running)
-                       p->sched_class->set_curr_task(rq);
-
                activate_task(rq, p, 0);
 
                check_class_changed(rq, p, prev_class, oldprio, running);
@@ -7618,11 +7616,10 @@ void sched_move_task(struct task_struct *tsk)
        running = task_current(rq, tsk);
        on_rq = tsk->se.on_rq;
 
-       if (on_rq) {
+       if (on_rq)
                dequeue_task(rq, tsk, 0);
-               if (unlikely(running))
-                       tsk->sched_class->put_prev_task(rq, tsk);
-       }
+       if (unlikely(running))
+               tsk->sched_class->put_prev_task(rq, tsk);
 
        set_task_rq(tsk, task_cpu(tsk));
 
@@ -7631,11 +7628,10 @@ void sched_move_task(struct task_struct *tsk)
                tsk->sched_class->moved_group(tsk);
 #endif
 
-       if (on_rq) {
-               if (unlikely(running))
-                       tsk->sched_class->set_curr_task(rq);
+       if (unlikely(running))
+               tsk->sched_class->set_curr_task(rq);
+       if (on_rq)
                enqueue_task(rq, tsk, 0);
-       }
 
        task_rq_unlock(rq, &flags);
 }
index e2a530515619ee8f3b42b1ca246cd18ae05f5544..f2cc59080efa4f9ae1e12aa30afe2e3fe08a86f9 100644 (file)
@@ -175,8 +175,15 @@ static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
         * Maintain a cache of leftmost tree entries (it is frequently
         * used):
         */
-       if (leftmost)
+       if (leftmost) {
                cfs_rq->rb_leftmost = &se->run_node;
+               /*
+                * maintain cfs_rq->min_vruntime to be a monotonic increasing
+                * value tracking the leftmost vruntime in the tree.
+                */
+               cfs_rq->min_vruntime =
+                       max_vruntime(cfs_rq->min_vruntime, se->vruntime);
+       }
 
        rb_link_node(&se->run_node, parent, link);
        rb_insert_color(&se->run_node, &cfs_rq->tasks_timeline);
@@ -184,8 +191,24 @@ static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 
 static void __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       if (cfs_rq->rb_leftmost == &se->run_node)
-               cfs_rq->rb_leftmost = rb_next(&se->run_node);
+       if (cfs_rq->rb_leftmost == &se->run_node) {
+               struct rb_node *next_node;
+               struct sched_entity *next;
+
+               next_node = rb_next(&se->run_node);
+               cfs_rq->rb_leftmost = next_node;
+
+               if (next_node) {
+                       next = rb_entry(next_node,
+                                       struct sched_entity, run_node);
+                       cfs_rq->min_vruntime =
+                               max_vruntime(cfs_rq->min_vruntime,
+                                            next->vruntime);
+               }
+       }
+
+       if (cfs_rq->next == se)
+               cfs_rq->next = NULL;
 
        rb_erase(&se->run_node, &cfs_rq->tasks_timeline);
 }
@@ -260,12 +283,8 @@ static u64 __sched_period(unsigned long nr_running)
  */
 static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       u64 slice = __sched_period(cfs_rq->nr_running);
-
-       slice *= se->load.weight;
-       do_div(slice, cfs_rq->load.weight);
-
-       return slice;
+       return calc_delta_mine(__sched_period(cfs_rq->nr_running),
+                              se->load.weight, &cfs_rq->load);
 }
 
 /*
@@ -303,7 +322,6 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
              unsigned long delta_exec)
 {
        unsigned long delta_exec_weighted;
-       u64 vruntime;
 
        schedstat_set(curr->exec_max, max((u64)delta_exec, curr->exec_max));
 
@@ -315,19 +333,6 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
                                                        &curr->load);
        }
        curr->vruntime += delta_exec_weighted;
-
-       /*
-        * maintain cfs_rq->min_vruntime to be a monotonic increasing
-        * value tracking the leftmost vruntime in the tree.
-        */
-       if (first_fair(cfs_rq)) {
-               vruntime = min_vruntime(curr->vruntime,
-                               __pick_next_entity(cfs_rq)->vruntime);
-       } else
-               vruntime = curr->vruntime;
-
-       cfs_rq->min_vruntime =
-               max_vruntime(cfs_rq->min_vruntime, vruntime);
 }
 
 static void update_curr(struct cfs_rq *cfs_rq)
@@ -493,7 +498,11 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
 {
        u64 vruntime;
 
-       vruntime = cfs_rq->min_vruntime;
+       if (first_fair(cfs_rq)) {
+               vruntime = min_vruntime(cfs_rq->min_vruntime,
+                               __pick_next_entity(cfs_rq)->vruntime);
+       } else
+               vruntime = cfs_rq->min_vruntime;
 
        if (sched_feat(TREE_AVG)) {
                struct sched_entity *last = __pick_last_entity(cfs_rq);
@@ -515,8 +524,10 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
 
        if (!initial) {
                /* sleeps upto a single latency don't count. */
-               if (sched_feat(NEW_FAIR_SLEEPERS))
-                       vruntime -= sysctl_sched_latency;
+               if (sched_feat(NEW_FAIR_SLEEPERS)) {
+                       vruntime -= calc_delta_fair(sysctl_sched_latency,
+                                                   &cfs_rq->load);
+               }
 
                /* ensure we never gain time by being placed backwards. */
                vruntime = max_vruntime(se->vruntime, vruntime);
@@ -616,12 +627,32 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
        se->prev_sum_exec_runtime = se->sum_exec_runtime;
 }
 
+static struct sched_entity *
+pick_next(struct cfs_rq *cfs_rq, struct sched_entity *se)
+{
+       s64 diff, gran;
+
+       if (!cfs_rq->next)
+               return se;
+
+       diff = cfs_rq->next->vruntime - se->vruntime;
+       if (diff < 0)
+               return se;
+
+       gran = calc_delta_fair(sysctl_sched_wakeup_granularity, &cfs_rq->load);
+       if (diff > gran)
+               return se;
+
+       return cfs_rq->next;
+}
+
 static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)
 {
        struct sched_entity *se = NULL;
 
        if (first_fair(cfs_rq)) {
                se = __pick_next_entity(cfs_rq);
+               se = pick_next(cfs_rq, se);
                set_next_entity(cfs_rq, se);
        }
 
@@ -1060,6 +1091,9 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
                resched_task(curr);
                return;
        }
+
+       cfs_rq_of(pse)->next = pse;
+
        /*
         * Batch tasks do not preempt (their preemption is driven by
         * the tick):
index b1d336ce7f3d0c34f694844c8bd7dfd0f1dc687d..edc27a5d1b735aba4855d33e9756ab375d9569ce 100644 (file)
@@ -297,6 +297,31 @@ int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name)
 }
 EXPORT_SYMBOL(pcim_iomap_regions);
 
+/**
+ * pcim_iomap_regions_request_all - Request all BARs and iomap specified ones
+ * @pdev: PCI device to map IO resources for
+ * @mask: Mask of BARs to iomap
+ * @name: Name used when requesting regions
+ *
+ * Request all PCI BARs and iomap regions specified by @mask.
+ */
+int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask,
+                                  const char *name)
+{
+       int request_mask = ((1 << 6) - 1) & ~mask;
+       int rc;
+
+       rc = pci_request_selected_regions(pdev, request_mask, name);
+       if (rc)
+               return rc;
+
+       rc = pcim_iomap_regions(pdev, mask, name);
+       if (rc)
+               pci_release_selected_regions(pdev, request_mask);
+       return rc;
+}
+EXPORT_SYMBOL(pcim_iomap_regions_request_all);
+
 /**
  * pcim_iounmap_regions - Unmap and release PCI BARs
  * @pdev: PCI device to map IO resources for