Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/ralf/upstrea...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Apr 2008 18:31:31 +0000 (11:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Apr 2008 18:31:31 +0000 (11:31 -0700)
* 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/ralf/upstream-linus:
  [MIPS] XSS1500: Fix compilation
  [MIPS] Bigsur: make defconfig more useful.
  [MIPS] Alchemy: work around clock misdetection on early Au1000
  [MIPS] Add missing 4KEC TLB refill handler
  [MIPS] BCM1480: Fix PCI/HT IO access
  [MIPS] Fix the installation condition of MIPS clocksource
  [MIPS] Check for GCC r10k-cache-barrier support
  [MIPS] I8253: Export i2853_lock to modules.
  [MIPS] VPE loader: Check result of memory allocation.

15 files changed:
Documentation/kernel-parameters.txt
arch/arm/common/it8152.c
arch/arm/kernel/calls.S
arch/arm/kernel/sys_oabi-compat.c
drivers/acpi/sleep/main.c
drivers/hwmon/w83781d.c
drivers/input/apm-power.c
drivers/input/evdev.c
drivers/input/joydev.c
drivers/input/keyboard/pxa27x_keypad.c
drivers/input/mousedev.c
drivers/leds/leds-gpio.c
drivers/net/plip.c
drivers/watchdog/it8712f_wdt.c
include/linux/input.h

index 508e2a2c98644ad6c4ee70e59a33191af9af541e..4cd1a5da80a4d4f11a17214ed8c344ccf9bd06c4 100644 (file)
@@ -170,11 +170,6 @@ and is between 256 and 4096 characters. It is defined in the file
        acpi_irq_isa=   [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
                        Format: <irq>,<irq>...
 
-       acpi_new_pts_ordering [HW,ACPI]
-                       Enforce the ACPI 2.0 ordering of the _PTS control
-                       method wrt putting devices into low power states
-                       default: pre ACPI 2.0 ordering of _PTS
-
        acpi_no_auto_ssdt       [HW,ACPI] Disable automatic loading of SSDT
 
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
index 538262241483202545dad88ac247b427b9e6c3b6..5fe9588db077be52b1cebc1c11484e843e11a6d7 100644 (file)
@@ -120,6 +120,7 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
                          time, when they all three were 0. */
                       bits_pd = __raw_readl(IT8152_INTC_PDCNIRR);
                       bits_lp = __raw_readl(IT8152_INTC_LPCNIRR);
+                      bits_ld = __raw_readl(IT8152_INTC_LDCNIRR);
                       if (!(bits_ld | bits_lp | bits_pd))
                               return;
               }
@@ -133,14 +134,14 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
 
               bits_lp &= ((1 << IT8152_LP_IRQ_COUNT) - 1);
               while (bits_lp) {
-                      i = __ffs(bits_pd);
+                      i = __ffs(bits_lp);
                       it8152_irq(IT8152_LP_IRQ(i));
                       bits_lp &= ~(1 << i);
               }
 
               bits_ld &= ((1 << IT8152_LD_IRQ_COUNT) - 1);
               while (bits_ld) {
-                      i = __ffs(bits_pd);
+                      i = __ffs(bits_ld);
                       it8152_irq(IT8152_LD_IRQ(i));
                       bits_ld &= ~(1 << i);
               }
index 283e14fff993dde1881b005aa6dbb1598e359780..7e97b7376563d2b6afbce8803b2ab796d29e87d9 100644 (file)
                CALL(sys_mknodat)
 /* 325 */      CALL(sys_fchownat)
                CALL(sys_futimesat)
-               CALL(sys_fstatat64)
+               CALL(ABI(sys_fstatat64,  sys_oabi_fstatat64))
                CALL(sys_unlinkat)
                CALL(sys_renameat)
 /* 330 */      CALL(sys_linkat)
index e8b98046895b9b3907e9f02b2dc4d7393cdfc424..96ab5f52949c99d145aea4be30f077e5ea34ef9f 100644 (file)
@@ -25,6 +25,7 @@
  * sys_stat64:
  * sys_lstat64:
  * sys_fstat64:
+ * sys_fstatat64:
  *
  *   struct stat64 has different sizes and some members are shifted
  *   Compatibility wrappers are needed for them and provided below.
@@ -169,6 +170,29 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd,
        return error;
 }
 
+asmlinkage long sys_oabi_fstatat64(int dfd,
+                                  char __user *filename,
+                                  struct oldabi_stat64  __user *statbuf,
+                                  int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+       error = cp_oldabi_stat64(&stat, statbuf);
+
+out:
+       return error;
+}
+
 struct oabi_flock64 {
        short   l_type;
        short   l_whence;
index d2f71a54726c5c988bdc680a892599966e0744df..71183eea7906fe05424a0500676d31107d119c4e 100644 (file)
@@ -26,21 +26,6 @@ u8 sleep_states[ACPI_S_STATE_COUNT];
 
 #ifdef CONFIG_PM_SLEEP
 static u32 acpi_target_sleep_state = ACPI_STATE_S0;
-static bool acpi_sleep_finish_wake_up;
-
-/*
- * ACPI 2.0 and later want us to execute _PTS after suspending devices, so we
- * allow the user to request that behavior by using the 'acpi_new_pts_ordering'
- * kernel command line option that causes the following variable to be set.
- */
-static bool new_pts_ordering;
-
-static int __init acpi_new_pts_ordering(char *str)
-{
-       new_pts_ordering = true;
-       return 1;
-}
-__setup("acpi_new_pts_ordering", acpi_new_pts_ordering);
 #endif
 
 static int acpi_sleep_prepare(u32 acpi_state)
@@ -91,14 +76,6 @@ static int acpi_pm_begin(suspend_state_t pm_state)
 
        if (sleep_states[acpi_state]) {
                acpi_target_sleep_state = acpi_state;
-               if (new_pts_ordering)
-                       return 0;
-
-               error = acpi_sleep_prepare(acpi_state);
-               if (error)
-                       acpi_target_sleep_state = ACPI_STATE_S0;
-               else
-                       acpi_sleep_finish_wake_up = true;
        } else {
                printk(KERN_ERR "ACPI does not support this state: %d\n",
                        pm_state);
@@ -116,14 +93,11 @@ static int acpi_pm_begin(suspend_state_t pm_state)
 
 static int acpi_pm_prepare(void)
 {
-       if (new_pts_ordering) {
-               int error = acpi_sleep_prepare(acpi_target_sleep_state);
+       int error = acpi_sleep_prepare(acpi_target_sleep_state);
 
-               if (error) {
-                       acpi_target_sleep_state = ACPI_STATE_S0;
-                       return error;
-               }
-               acpi_sleep_finish_wake_up = true;
+       if (error) {
+               acpi_target_sleep_state = ACPI_STATE_S0;
+               return error;
        }
 
        return ACPI_SUCCESS(acpi_hw_disable_all_gpes()) ? 0 : -EFAULT;
@@ -212,7 +186,6 @@ static void acpi_pm_finish(void)
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
 
        acpi_target_sleep_state = ACPI_STATE_S0;
-       acpi_sleep_finish_wake_up = false;
 
 #ifdef CONFIG_X86
        if (init_8259A_after_S1) {
@@ -229,11 +202,10 @@ static void acpi_pm_finish(void)
 static void acpi_pm_end(void)
 {
        /*
-        * This is necessary in case acpi_pm_finish() is not called directly
-        * during a failing transition to a sleep state.
+        * This is necessary in case acpi_pm_finish() is not called during a
+        * failing transition to a sleep state.
         */
-       if (acpi_sleep_finish_wake_up)
-               acpi_pm_finish();
+       acpi_target_sleep_state = ACPI_STATE_S0;
 }
 
 static int acpi_pm_state_valid(suspend_state_t pm_state)
@@ -285,31 +257,18 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
 #ifdef CONFIG_HIBERNATION
 static int acpi_hibernation_begin(void)
 {
-       int error;
-
        acpi_target_sleep_state = ACPI_STATE_S4;
-       if (new_pts_ordering)
-               return 0;
 
-       error = acpi_sleep_prepare(ACPI_STATE_S4);
-       if (error)
-               acpi_target_sleep_state = ACPI_STATE_S0;
-       else
-               acpi_sleep_finish_wake_up = true;
-
-       return error;
+       return 0;
 }
 
 static int acpi_hibernation_prepare(void)
 {
-       if (new_pts_ordering) {
-               int error = acpi_sleep_prepare(ACPI_STATE_S4);
+       int error = acpi_sleep_prepare(ACPI_STATE_S4);
 
-               if (error) {
-                       acpi_target_sleep_state = ACPI_STATE_S0;
-                       return error;
-               }
-               acpi_sleep_finish_wake_up = true;
+       if (error) {
+               acpi_target_sleep_state = ACPI_STATE_S0;
+               return error;
        }
 
        return ACPI_SUCCESS(acpi_hw_disable_all_gpes()) ? 0 : -EFAULT;
@@ -353,17 +312,15 @@ static void acpi_hibernation_finish(void)
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
 
        acpi_target_sleep_state = ACPI_STATE_S0;
-       acpi_sleep_finish_wake_up = false;
 }
 
 static void acpi_hibernation_end(void)
 {
        /*
         * This is necessary in case acpi_hibernation_finish() is not called
-        * directly during a failing transition to the sleep state.
+        * during a failing transition to the sleep state.
         */
-       if (acpi_sleep_finish_wake_up)
-               acpi_hibernation_finish();
+       acpi_target_sleep_state = ACPI_STATE_S0;
 }
 
 static int acpi_hibernation_pre_restore(void)
index 5c85670e2d1643cef897f1fc97c71fcf3380778c..f942ecdd47c873d68ad5cead56439ab8249d5a16 100644 (file)
@@ -1367,7 +1367,8 @@ w83781d_isa_probe(struct platform_device *pdev)
 
        /* Reserve the ISA region */
        res = platform_get_resource(pdev, IORESOURCE_IO, 0);
-       if (!request_region(res->start, W83781D_EXTENT, "w83781d")) {
+       if (!request_region(res->start + W83781D_ADDR_REG_OFFSET, 2,
+                           "w83781d")) {
                err = -EBUSY;
                goto exit;
        }
@@ -1415,7 +1416,7 @@ w83781d_isa_probe(struct platform_device *pdev)
        device_remove_file(&pdev->dev, &dev_attr_name);
        kfree(data);
  exit_release_region:
-       release_region(res->start, W83781D_EXTENT);
+       release_region(res->start + W83781D_ADDR_REG_OFFSET, 2);
  exit:
        return err;
 }
@@ -1429,7 +1430,7 @@ w83781d_isa_remove(struct platform_device *pdev)
        sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
        sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
        device_remove_file(&pdev->dev, &dev_attr_name);
-       release_region(data->client.addr, W83781D_EXTENT);
+       release_region(data->client.addr + W83781D_ADDR_REG_OFFSET, 2);
        kfree(data);
 
        return 0;
@@ -1797,8 +1798,17 @@ w83781d_isa_found(unsigned short address)
 {
        int val, save, found = 0;
 
-       if (!request_region(address, W83781D_EXTENT, "w83781d"))
+       /* We have to request the region in two parts because some
+          boards declare base+4 to base+7 as a PNP device */
+       if (!request_region(address, 4, "w83781d")) {
+               pr_debug("w83781d: Failed to request low part of region\n");
                return 0;
+       }
+       if (!request_region(address + 4, 4, "w83781d")) {
+               pr_debug("w83781d: Failed to request high part of region\n");
+               release_region(address, 4);
+               return 0;
+       }
 
 #define REALLY_SLOW_IO
        /* We need the timeouts for at least some W83781D-like
@@ -1871,7 +1881,8 @@ w83781d_isa_found(unsigned short address)
                        val == 0x30 ? "W83782D" : "W83781D", (int)address);
 
  release:
-       release_region(address, W83781D_EXTENT);
+       release_region(address + 4, 4);
+       release_region(address, 4);
        return found;
 }
 
index c36d110b349af2d1a5ee8f591c79ccfe7cfbba31..7d61a9660806c5a3d30e062ec04dc7344dedc6aa 100644 (file)
@@ -63,8 +63,6 @@ static int apmpower_connect(struct input_handler *handler,
        handle->handler = handler;
        handle->name = "apm-power";
 
-       handler->private = handle;
-
        error = input_register_handle(handle);
        if (error) {
                printk(KERN_ERR
@@ -87,11 +85,10 @@ static int apmpower_connect(struct input_handler *handler,
        return 0;
 }
 
-static void apmpower_disconnect(struct input_handle *handler)
+static void apmpower_disconnect(struct input_handle *handle)
 {
-       struct input_handle *handle = handler->private;
-
        input_close_device(handle);
+       input_unregister_handle(handle);
        kfree(handle);
 }
 
index 99562cee827e7c6af548ec2f889b3fc769dd9213..b32984bc516ff271cacbe72b56a60350bef63868 100644 (file)
@@ -124,6 +124,7 @@ static void evdev_free(struct device *dev)
 {
        struct evdev *evdev = container_of(dev, struct evdev, dev);
 
+       input_put_device(evdev->handle.dev);
        kfree(evdev);
 }
 
@@ -853,9 +854,6 @@ static void evdev_cleanup(struct evdev *evdev)
        evdev_hangup(evdev);
        evdev_remove_chrdev(evdev);
 
-       if (evdev->grab)
-               evdev_ungrab(evdev, evdev->grab);
-
        /* evdev is marked dead so no one else accesses evdev->open */
        if (evdev->open) {
                input_flush_device(handle, NULL);
@@ -896,7 +894,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
        evdev->exist = 1;
        evdev->minor = minor;
 
-       evdev->handle.dev = dev;
+       evdev->handle.dev = input_get_device(dev);
        evdev->handle.name = evdev->name;
        evdev->handle.handler = handler;
        evdev->handle.private = evdev;
index 22b2789ef58ad17e30299f5fcbc7f5587d11dba9..65d7077a75a19202288d4bc4484c19ca9b93c5c2 100644 (file)
@@ -171,6 +171,7 @@ static void joydev_free(struct device *dev)
 {
        struct joydev *joydev = container_of(dev, struct joydev, dev);
 
+       input_put_device(joydev->handle.dev);
        kfree(joydev);
 }
 
@@ -750,7 +751,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,
        joydev->minor = minor;
 
        joydev->exist = 1;
-       joydev->handle.dev = dev;
+       joydev->handle.dev = input_get_device(dev);
        joydev->handle.name = joydev->name;
        joydev->handle.handler = handler;
        joydev->handle.private = joydev;
index 6224c2fb3b65981aec7e6e8386b587d19ebfaf18..4e651c11c1dad71c64fe033381447cb31212f079 100644 (file)
@@ -50,9 +50,9 @@
 #define KPKDI           0x0048
 
 /* bit definitions */
-#define KPC_MKRN(n)    ((((n) & 0x7) - 1) << 26) /* matrix key row number */
-#define KPC_MKCN(n)    ((((n) & 0x7) - 1) << 23) /* matrix key column number */
-#define KPC_DKN(n)     ((((n) & 0x7) - 1) << 6)  /* direct key number */
+#define KPC_MKRN(n)    ((((n) - 1) & 0x7) << 26) /* matrix key row number */
+#define KPC_MKCN(n)    ((((n) - 1) & 0x7) << 23) /* matrix key column number */
+#define KPC_DKN(n)     ((((n) - 1) & 0x7) << 6)  /* direct key number */
 
 #define KPC_AS          (0x1 << 30)  /* Automatic Scan bit */
 #define KPC_ASACT       (0x1 << 29)  /* Automatic Scan on Activity */
index bbbe5e81adc1036d224925e4809ba05bd0fc22a5..b989748598ae2191cc58f806eb11a19290b847fe 100644 (file)
@@ -414,6 +414,7 @@ static void mousedev_free(struct device *dev)
 {
        struct mousedev *mousedev = container_of(dev, struct mousedev, dev);
 
+       input_put_device(mousedev->handle.dev);
        kfree(mousedev);
 }
 
@@ -865,7 +866,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev,
 
        mousedev->minor = minor;
        mousedev->exist = 1;
-       mousedev->handle.dev = dev;
+       mousedev->handle.dev = input_get_device(dev);
        mousedev->handle.name = mousedev->name;
        mousedev->handle.handler = handler;
        mousedev->handle.private = mousedev;
index 6c0a9c4761ee13ffd2333db779c7b8f42091ea21..4c0b05852cb6f2b7c85ab80013c06af0a73ecba0 100644 (file)
@@ -49,13 +49,13 @@ static void gpio_led_set(struct led_classdev *led_cdev,
        if (led_dat->active_low)
                level = !level;
 
-       /* setting GPIOs with I2C/etc requires a preemptible task context */
+       /* Setting GPIOs with I2C/etc requires a task context, and we don't
+        * seem to have a reliable way to know if we're already in one; so
+        * let's just assume the worst.
+        */
        if (led_dat->can_sleep) {
-               if (preempt_count()) {
-                       led_dat->new_level = level;
-                       schedule_work(&led_dat->work);
-               } else
-                       gpio_set_value_cansleep(led_dat->gpio, level);
+               led_dat->new_level = level;
+               schedule_work(&led_dat->work);
        } else
                gpio_set_value(led_dat->gpio, level);
 }
@@ -79,6 +79,10 @@ static int gpio_led_probe(struct platform_device *pdev)
                cur_led = &pdata->leds[i];
                led_dat = &leds_data[i];
 
+               ret = gpio_request(cur_led->gpio, cur_led->name);
+               if (ret < 0)
+                       goto err;
+
                led_dat->cdev.name = cur_led->name;
                led_dat->cdev.default_trigger = cur_led->default_trigger;
                led_dat->gpio = cur_led->gpio;
@@ -87,10 +91,6 @@ static int gpio_led_probe(struct platform_device *pdev)
                led_dat->cdev.brightness_set = gpio_led_set;
                led_dat->cdev.brightness = LED_OFF;
 
-               ret = gpio_request(led_dat->gpio, led_dat->cdev.name);
-               if (ret < 0)
-                       goto err;
-
                gpio_direction_output(led_dat->gpio, led_dat->active_low);
 
                INIT_WORK(&led_dat->work, gpio_led_work);
index fee3d7b1febaa715e6ba9ab09893a154f9426601..1e965427b0e987faae6ae26bfe3d07e1aad8bfa7 100644 (file)
@@ -903,17 +903,18 @@ plip_interrupt(void *dev_id)
        struct net_local *nl;
        struct plip_local *rcv;
        unsigned char c0;
+       unsigned long flags;
 
        nl = netdev_priv(dev);
        rcv = &nl->rcv_data;
 
-       spin_lock_irq (&nl->lock);
+       spin_lock_irqsave (&nl->lock, flags);
 
        c0 = read_status(dev);
        if ((c0 & 0xf8) != 0xc0) {
                if ((dev->irq != -1) && (net_debug > 1))
                        printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name);
-               spin_unlock_irq (&nl->lock);
+               spin_unlock_irqrestore (&nl->lock, flags);
                return;
        }
 
@@ -942,7 +943,7 @@ plip_interrupt(void *dev_id)
                break;
        }
 
-       spin_unlock_irq(&nl->lock);
+       spin_unlock_irqrestore(&nl->lock, flags);
 }
 
 static int
index 1efcad3b6fcaf91d3fc677d1641e885d7ecc0402..ca90c5192596f8c4f47628ced8d2aabdcdd82b37 100644 (file)
@@ -111,15 +111,6 @@ superio_inw(int reg)
        return val;
 }
 
-static void
-superio_outw(int val, int reg)
-{
-       outb(reg++, REG);
-       outb((val >> 8) & 0xff, VAL);
-       outb(reg, REG);
-       outb(val & 0xff, VAL);
-}
-
 static inline void
 superio_select(int ldn)
 {
@@ -170,9 +161,8 @@ it8712f_wdt_update_margin(void)
        superio_outb(config, WDT_CONFIG);
 
        if (revision >= 0x08)
-               superio_outw(units, WDT_TIMEOUT);
-       else
-               superio_outb(units, WDT_TIMEOUT);
+               superio_outb(units >> 8, WDT_TIMEOUT + 1);
+       superio_outb(units, WDT_TIMEOUT);
 }
 
 static int
index 1bdc39a8c76c6a0916af7b6698fdcd219a26c1fb..cae2c35d1206593bc6a3154e44ae47ef1db6fb75 100644 (file)
@@ -1227,12 +1227,13 @@ void input_free_device(struct input_dev *dev);
 
 static inline struct input_dev *input_get_device(struct input_dev *dev)
 {
-       return to_input_dev(get_device(&dev->dev));
+       return dev ? to_input_dev(get_device(&dev->dev)) : NULL;
 }
 
 static inline void input_put_device(struct input_dev *dev)
 {
-       put_device(&dev->dev);
+       if (dev)
+               put_device(&dev->dev);
 }
 
 static inline void *input_get_drvdata(struct input_dev *dev)