]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'bugzilla-16422' into release
authorLen Brown <len.brown@intel.com>
Sun, 15 Aug 2010 03:57:32 +0000 (23:57 -0400)
committerLen Brown <len.brown@intel.com>
Sun, 15 Aug 2010 03:57:32 +0000 (23:57 -0400)
177 files changed:
Documentation/acpi/method-customizing.txt
Documentation/credentials.txt
MAINTAINERS
Makefile
arch/arm/boot/compressed/Makefile
arch/arm/common/sa1111.c
arch/arm/include/asm/io.h
arch/arm/lib/csumpartialcopyuser.S
arch/arm/mach-clps711x/include/mach/debug-macro.S
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-footbridge/common.c
arch/arm/mach-h720x/include/mach/debug-macro.S
arch/arm/mach-kirkwood/tsx1x-common.c
arch/arm/mach-kirkwood/tsx1x-common.h
arch/arm/mach-ns9xxx/include/mach/debug-macro.S
arch/arm/mach-ns9xxx/include/mach/uncompress.h
arch/arm/mach-pxa/colibri-pxa300.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/cpufreq-pxa2xx.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-realview/core.c
arch/arm/mach-shark/include/mach/debug-macro.S
arch/arm/mach-ux500/include/mach/uncompress.h
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-w90x900/cpu.c
arch/arm/mm/cache-l2x0.c
arch/arm/mm/highmem.c
arch/arm/plat-spear/include/plat/debug-macro.S
arch/avr32/include/asm/ioctls.h
arch/avr32/mach-at32ap/include/mach/board.h
arch/mips/alchemy/common/platform.c
arch/mips/alchemy/mtx-1/board_setup.c
arch/mips/bcm63xx/dev-enet.c
arch/mips/include/asm/atomic.h
arch/mips/include/asm/unistd.h
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/vdso.c
arch/mips/mti-malta/malta-pci.c
arch/mips/nxp/pnx8550/common/pci.c
arch/mips/nxp/pnx8550/common/setup.c
arch/mips/pci/ops-pmcmsp.c
arch/mips/pci/pci-yosemite.c
arch/mips/powertv/asic/asic_devices.c
arch/powerpc/kernel/perf_event_fsl_emb.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S
arch/s390/kernel/time.c
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/mcheck/mce-apei.c
arch/x86/kernel/hpet.c
arch/x86/kernel/i8259.c
arch/x86/kernel/kgdb.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c
drivers/acpi/Makefile
drivers/acpi/acpica/acglobal.h
drivers/acpi/apei/Kconfig
drivers/acpi/apei/Makefile
drivers/acpi/apei/apei-base.c
drivers/acpi/apei/erst-dbg.c [new file with mode: 0644]
drivers/acpi/apei/ghes.c
drivers/acpi/apei/hest.c
drivers/acpi/bus.c
drivers/acpi/debug.c
drivers/acpi/debugfs.c [new file with mode: 0644]
drivers/acpi/internal.h
drivers/acpi/sleep.c
drivers/acpi/sleep.h
drivers/acpi/wakeup.c
drivers/char/agp/intel-gtt.c
drivers/char/tpm/tpm_tis.c
drivers/cpufreq/cpufreq.c
drivers/edac/i7core_edac.c
drivers/edac/mpc85xx_edac.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/radeon/radeon_pm.c
drivers/mmc/host/mmci.c
drivers/net/bnx2x.h
drivers/net/bnx2x_main.c
drivers/net/bonding/bond_alb.c
drivers/net/declance.c
drivers/net/igb/igb_main.c
drivers/net/ixgbe/ixgbe_main.c
drivers/net/macvlan.c
drivers/net/macvtap.c
drivers/net/s2io.h
drivers/net/tun.c
drivers/net/wimax/i2400m/i2400m-usb.h
drivers/net/wimax/i2400m/usb.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/pcmcia/pxa2xx_base.c
drivers/power/ds2782_battery.c
drivers/regulator/ab3100.c
drivers/regulator/tps6507x-regulator.c
drivers/regulator/wm8350-regulator.c
drivers/rtc/rtc-rx8581.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_qdio.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ipr.c
drivers/scsi/ipr.h
drivers/serial/atmel_serial.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/gadget/s3c2410_udc.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/misc/sisusbvga/sisusb.c
drivers/usb/musb/tusb6010.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio_ids.h
drivers/usb/serial/option.c
drivers/usb/serial/qcserial.c
drivers/usb/serial/sierra.c
drivers/usb/storage/transport.c
drivers/video/au1100fb.c
drivers/video/cyber2000fb.c
drivers/video/gbefb.c
drivers/video/pmag-ba-fb.c
drivers/video/pmagb-b-fb.c
fs/9p/vfs_dir.c
fs/ceph/Kconfig
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mon_client.c
fs/ceph/osd_client.c
fs/ceph/osdmap.c
fs/cifs/dns_resolve.c
fs/cifs/dns_resolve.h
fs/ecryptfs/messaging.c
fs/gfs2/dir.c
fs/nfs/file.c
fs/nfs/nfsroot.c
fs/nfs/write.c
fs/proc/array.c
fs/sysfs/symlink.c
include/acpi/acpixf.h
include/linux/cper.h
include/linux/cred.h
include/linux/if_macvlan.h
include/linux/nfs_fs.h
include/linux/regulator/tps6507x.h [new file with mode: 0644]
include/linux/sched.h
include/net/tc_act/tc_mirred.h
kernel/cred.c
kernel/module.c
mm/memory.c
net/core/dev.c
net/core/skbuff.c
net/ipv6/addrconf.c
net/mac80211/cfg.c
net/sched/act_mirred.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_nvhdmi.c
sound/pci/hda/patch_realtek.c
sound/soc/au1x/psc-i2s.c

index e628cd23ca8093315b6d3e31ccd4d0e3204df17d..3e1d25aee3fb2037b34af127214a1652691fa2f2 100644 (file)
@@ -19,6 +19,8 @@ Note: Only ACPI METHOD can be overridden, any other object types like
       "Device", "OperationRegion", are not recognized.
 Note: The same ACPI control method can be overridden for many times,
       and it's always the latest one that used by Linux/kernel.
+Note: To get the ACPI debug object output (Store (AAAA, Debug)),
+      please run "echo 1 > /sys/module/acpi/parameters/aml_debug_output".
 
 1. override an existing method
    a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT,
index a2db352870036ba062aa177ce450d0d491f7d8c8..995baf379c076770962a84268fde19b527caa0be 100644 (file)
@@ -417,6 +417,9 @@ reference on them using:
 This does all the RCU magic inside of it.  The caller must call put_cred() on
 the credentials so obtained when they're finished with.
 
+ [*] Note: The result of __task_cred() should not be passed directly to
+     get_cred() as this may race with commit_cred().
+
 There are a couple of convenience functions to access bits of another task's
 credentials, hiding the RCU magic from the caller:
 
index db3d0f5061f9c42e301e420878b0dc5cbe31e6e1..02f75fccac20915ae4c7aad6b333ed0061f90e44 100644 (file)
@@ -6243,6 +6243,8 @@ F:        drivers/mmc/host/wbsd.*
 
 WATCHDOG DEVICE DRIVERS
 M:     Wim Van Sebroeck <wim@iguana.be>
+L:     linux-watchdog@vger.kernel.org
+W:     http://www.linux-watchdog.org/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
 S:     Maintained
 F:     Documentation/watchdog/
index 886bf04931d4aea56c26761b26898a8f393fb9ce..141da26fda4b87870ba19237f61ced915d0cebcb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 35
-EXTRAVERSION = -rc6
+EXTRAVERSION =
 NAME = Sheep on Meth
 
 # *DOCUMENTATION*
index 53faa9063a035be790c3aef7c5f32c4f48eb8025..864a002137fed0bbc42efe7b4f2dc787a06ba48a 100644 (file)
@@ -71,6 +71,9 @@ targets       := vmlinux vmlinux.lds \
                 piggy.$(suffix_y) piggy.$(suffix_y).o \
                 font.o font.c head.o misc.o $(OBJS)
 
+# Make sure files are removed during clean
+extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
+
 ifeq ($(CONFIG_FUNCTION_TRACER),y)
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
index 6f80665f477e70b0acad4d6ead228295446863c3..9eaf65f43642e6886b3ab4bae43e7821aad285b6 100644 (file)
@@ -1028,13 +1028,12 @@ static int sa1111_remove(struct platform_device *pdev)
        struct sa1111 *sachip = platform_get_drvdata(pdev);
 
        if (sachip) {
-               __sa1111_remove(sachip);
-               platform_set_drvdata(pdev, NULL);
-
 #ifdef CONFIG_PM
                kfree(sachip->saved_state);
                sachip->saved_state = NULL;
 #endif
+               __sa1111_remove(sachip);
+               platform_set_drvdata(pdev, NULL);
        }
 
        return 0;
index c980156f32638f8f031b93e730d0c2e8396aec40..1261b1f928d95a9ac1cf374148208415c4dc248d 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 #include <asm/memory.h>
+#include <asm/system.h>
 
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
@@ -179,25 +180,38 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
  * IO port primitives for more information.
  */
 #ifdef __mem_pci
-#define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
-#define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \
+#define readb_relaxed(c) ({ u8  __v = __raw_readb(__mem_pci(c)); __v; })
+#define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \
                                        __raw_readw(__mem_pci(c))); __v; })
-#define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \
+#define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \
                                        __raw_readl(__mem_pci(c))); __v; })
-#define readb_relaxed(addr) readb(addr)
-#define readw_relaxed(addr) readw(addr)
-#define readl_relaxed(addr) readl(addr)
+
+#define writeb_relaxed(v,c)    ((void)__raw_writeb(v,__mem_pci(c)))
+#define writew_relaxed(v,c)    ((void)__raw_writew((__force u16) \
+                                       cpu_to_le16(v),__mem_pci(c)))
+#define writel_relaxed(v,c)    ((void)__raw_writel((__force u32) \
+                                       cpu_to_le32(v),__mem_pci(c)))
+
+#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
+#define __iormb()              rmb()
+#define __iowmb()              wmb()
+#else
+#define __iormb()              do { } while (0)
+#define __iowmb()              do { } while (0)
+#endif
+
+#define readb(c)               ({ u8  __v = readb_relaxed(c); __iormb(); __v; })
+#define readw(c)               ({ u16 __v = readw_relaxed(c); __iormb(); __v; })
+#define readl(c)               ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
+
+#define writeb(v,c)            ({ __iowmb(); writeb_relaxed(v,c); })
+#define writew(v,c)            ({ __iowmb(); writew_relaxed(v,c); })
+#define writel(v,c)            ({ __iowmb(); writel_relaxed(v,c); })
 
 #define readsb(p,d,l)          __raw_readsb(__mem_pci(p),d,l)
 #define readsw(p,d,l)          __raw_readsw(__mem_pci(p),d,l)
 #define readsl(p,d,l)          __raw_readsl(__mem_pci(p),d,l)
 
-#define writeb(v,c)            __raw_writeb(v,__mem_pci(c))
-#define writew(v,c)            __raw_writew((__force __u16) \
-                                       cpu_to_le16(v),__mem_pci(c))
-#define writel(v,c)            __raw_writel((__force __u32) \
-                                       cpu_to_le32(v),__mem_pci(c))
-
 #define writesb(p,d,l)         __raw_writesb(__mem_pci(p),d,l)
 #define writesw(p,d,l)         __raw_writesw(__mem_pci(p),d,l)
 #define writesl(p,d,l)         __raw_writesl(__mem_pci(p),d,l)
@@ -244,13 +258,13 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
  * io{read,write}{8,16,32} macros
  */
 #ifndef ioread8
-#define ioread8(p)     ({ unsigned int __v = __raw_readb(p); __v; })
-#define ioread16(p)    ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; })
-#define ioread32(p)    ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; })
+#define ioread8(p)     ({ unsigned int __v = __raw_readb(p); __iormb(); __v; })
+#define ioread16(p)    ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; })
+#define ioread32(p)    ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; })
 
-#define iowrite8(v,p)  __raw_writeb(v, p)
-#define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p)
-#define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p)
+#define iowrite8(v,p)  ({ __iowmb(); (void)__raw_writeb(v, p); })
+#define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); })
+#define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); })
 
 #define ioread8_rep(p,d,c)     __raw_readsb(p,d,c)
 #define ioread16_rep(p,d,c)    __raw_readsw(p,d,c)
index 59ff6fdc1e634835575846693fb0828a05c66a55..7d08b43d2c0e496fc704378301b82d3b34d93f3a 100644 (file)
@@ -71,7 +71,7 @@
                .pushsection .fixup,"ax"
                .align  4
 9001:          mov     r4, #-EFAULT
-               ldr     r5, [fp, #4]            @ *err_ptr
+               ldr     r5, [sp, #8*4]          @ *err_ptr
                str     r4, [r5]
                ldmia   sp, {r1, r2}            @ retrieve dst, len
                add     r2, r2, r1
index fedd8076a689a3555a986b5e96bc9348cf4ae77f..072cc6b61ba30b7b6e363040b40d409e8a43e38f 100644 (file)
@@ -11,6 +11,7 @@
  *
 */
 
+#include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
 
                .macro  addruart, rx, tmp
index 2ec3095ffb7b564e61a54bcc4e366f32b87e671c..b280efb1fa120806b1cfe85bdea1f90d1bc0caaf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/mfd/tps6507x.h>
 #include <linux/input/tps6507x-ts.h>
 
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
        },
 };
 
+/* We take advantage of the fact that both defdcdc{2,3} are tied high */
+static struct tps6507x_reg_platform_data tps6507x_platform_data = {
+       .defdcdc_default = true,
+};
+
 struct regulator_init_data tps65070_regulator_data[] = {
        /* dcdc1 */
        {
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
                .consumer_supplies = tps65070_dcdc2_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* dcdc3 */
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
                .consumer_supplies = tps65070_dcdc3_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* ldo1 */
index e3bc3f6f6b105d42c8d4f73d33b4d5f92fc15a81..88b3dd89be89a20b65761de100c7799798ccb1df 100644 (file)
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt);
 
 unsigned long __pfn_to_bus(unsigned long pfn)
 {
-       return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET));
+       return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET);
 }
 EXPORT_SYMBOL(__pfn_to_bus);
 
index a9ee8f0d48b7f6792ea5004844649c3acb3a5bd0..27cafd12f033cbba19bd507e5a90ac198c1db8e1 100644 (file)
  *
 */
 
-               .equ    io_virt, IO_BASE
-               .equ    io_phys, IO_START
+#include <mach/hardware.h>
+
+               .equ    io_virt, IO_VIRT
+               .equ    io_phys, IO_PHYS
 
                .macro  addruart, rx, tmp
                mrc     p15, 0, \rx, c1, c0
index 7221c20b2afa241b5854c90b90f24352b73572c8..f781164e623fc89e7a4362b3d039f9e58688fd0d 100644 (file)
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
        },
 };
 
-void qnap_tsx1x_register_flash(void)
+void __init qnap_tsx1x_register_flash(void)
 {
        spi_register_board_info(qnap_tsx1x_spi_slave_info,
                                ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
index 9a592962a6ea0df6f7546d847a50b150d45243c1..7fa037361b55a5e23738f9a37c8637f64d91b56e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
 #define __ARCH_KIRKWOOD_TSX1X_COMMON_H
 
-extern void qnap_tsx1x_register_flash(void);
+extern void __init qnap_tsx1x_register_flash(void);
 extern void qnap_tsx1x_power_off(void);
 
 #endif
index 0859336a8e6d1be71a8090c1e8ef53b1640c87bc..5c934bdb71583e037c59fdadc3490e43838ff425 100644 (file)
@@ -8,6 +8,7 @@
  * the Free Software Foundation.
  */
 #include <mach/hardware.h>
+#include <asm/memory.h>
 
 #include <mach/regs-board-a9m9750dev.h>
 
index 1b12d324b087d1528c87d828bebec3308be1dbaa..770a68c46e8114f4a7360b559e0ddecd15cfdc57 100644 (file)
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base)
        /* nothing */
 }
 
+static int timeout;
+
 static void putc_ns9360(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (__raw_readl(base + 8) & (1 << 3)) {
                        __raw_writeb(c, base + 16);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 }
 
 static void putc_a9m9750dev(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (__raw_readb(base + 5) & (1 << 5)) {
                        __raw_writeb(c, base);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 
 }
 
 static void putc_ns921x(char c, void __iomem *base)
 {
-       static int t = 0x10000;
        do {
-               if (t)
-                       --t;
+               if (timeout)
+                       --timeout;
 
                if (!(__raw_readl(base) & (1 << 11))) {
                        __raw_writeb(c, base + 0x0028);
-                       t = 0x10000;
+                       timeout = 0x10000;
                        break;
                }
-       } while (t);
+       } while (timeout);
 }
 
 #define MSCS __REG(0xA0900184)
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base)
 
 static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
 {
+       timeout = 0x10000;
        if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
                /* ns9360 or ns9750 */
                if (NS9360_UART_ENABLED(NS9360_UARTA)) {
index 45c23fd6df31e9696d2b0c42be0752cba1683217..40b6ac2de876cf8dcc4c0328b72b086e15253eb8 100644 (file)
@@ -26,6 +26,7 @@
 #include <mach/colibri.h>
 #include <mach/ohci.h>
 #include <mach/pxafb.h>
+#include <mach/audio.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void)
 static inline void colibri_pxa300_init_lcd(void) {}
 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
 
-#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE)
+#if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE)
 static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = {
        GPIO24_AC97_SYSCLK,
        GPIO23_AC97_nACRESET,
index 3d1dcb9ac08f497fc63e333ee6d20438f20d0d28..51ffa6afb67530e5cde74659319584ac52646593 100644 (file)
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = {
 static struct pxamci_platform_data corgi_mci_platform_data = {
        .detect_delay_ms        = 250,
        .ocr_mask               = MMC_VDD_32_33|MMC_VDD_33_34,
-       .gpio_card_detect       = -1,
+       .gpio_card_detect       = CORGI_GPIO_nSD_DETECT,
        .gpio_card_ro           = CORGI_GPIO_nSD_WP,
        .gpio_power             = CORGI_GPIO_SD_PWR,
 };
index 9e4d9816726ad5d75c0657f9a32d0b36c0ec3aa7..268a9bc6be8a22a4ca0ac4fed742d035753581a3 100644 (file)
@@ -256,13 +256,9 @@ static void init_sdram_rows(void)
 
 static u32 mdrefr_dri(unsigned int freq)
 {
-       u32 dri = 0;
+       u32 interval = freq * SDRAM_TREF / sdram_rows;
 
-       if (cpu_is_pxa25x())
-               dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
-       if (cpu_is_pxa27x())
-               dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
-       return dri;
+       return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
 }
 
 /* find a valid frequency point */
index 0af36177ff085c92f34cd729bd5775f25d948a2f..c059dac02b61412b64b22f869d2e8913404236ed 100644 (file)
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void)
 EXPORT_SYMBOL(pxa27x_clear_otgph);
 
 static unsigned long ac97_reset_config[] = {
-       GPIO95_AC97_nRESET,
-       GPIO95_GPIO,
-       GPIO113_AC97_nRESET,
        GPIO113_GPIO,
+       GPIO113_AC97_nRESET,
+       GPIO95_GPIO,
+       GPIO95_AC97_nRESET,
 };
 
 void pxa27x_assert_ac97reset(int reset_gpio, int on)
index 595be19f8ad5027e29daed72bbe0fb2c5d2d1a04..02e9fdeb8faf26891bdf43cb5846ae717fb720ea 100644 (file)
@@ -237,7 +237,7 @@ static unsigned int realview_mmc_status(struct device *dev)
        else
                mask = 2;
 
-       return !(readl(REALVIEW_SYSMCI) & mask);
+       return readl(REALVIEW_SYSMCI) & mask;
 }
 
 struct mmci_platform_data realview_mmc0_plat_data = {
index 50f071c5bf4d603656a01a9c8c2865bf07ee2eb9..5ea24d4d1ba6e176985b16076b48412952de9aec 100644 (file)
@@ -20,6 +20,9 @@
                strb    \rd, [\rx]
                .endm
 
+               .macro waituart,rd,rx
+               .endm
+
                .macro  busyuart,rd,rx
                mov     \rd, #0
 1001:          add     \rd, \rd, #1
index 8552eb188b50274c7ed4b18ccf48e743192652de..0271ca0a83df86c4fb43eb37b3c93754414d706d 100644 (file)
 static void putc(const char c)
 {
        /* Do nothing if the UART is not enabled. */
-       if (!(readb(U8500_UART_CR) & 0x1))
+       if (!(__raw_readb(U8500_UART_CR) & 0x1))
                return;
 
        if (c == '\n')
                putc('\r');
 
-       while (readb(U8500_UART_FR) & (1 << 5))
+       while (__raw_readb(U8500_UART_FR) & (1 << 5))
                barrier();
-       writeb(c, U8500_UART_DR);
+       __raw_writeb(c, U8500_UART_DR);
 }
 
 static void flush(void)
 {
-       if (!(readb(U8500_UART_CR) & 0x1))
+       if (!(__raw_readb(U8500_UART_CR) & 0x1))
                return;
-       while (readb(U8500_UART_FR) & (1 << 3))
+       while (__raw_readb(U8500_UART_FR) & (1 << 3))
                barrier();
 }
 
index d250711b8c7a4e3c17ee2ddcc53ad5b2e24ee420..c84239761cb4a2881d226f6f82b3acb694d30dae 100644 (file)
@@ -241,7 +241,7 @@ static struct platform_device v2m_flash_device = {
 
 static unsigned int v2m_mmci_status(struct device *dev)
 {
-       return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0));
+       return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0);
 }
 
 static struct mmci_platform_data v2m_mmci_data = {
index 642207e18198db20777ef475a27ada0bd2ae0c3d..83c56324a472f16a5f155df056b4cc29ba9e562d 100644 (file)
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = {
        DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
        DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
        DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
-       DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL),
+       DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL),
        DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
        DEF_CLKLOOK(&clk_ext, NULL, "ext"),
        DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
index df4955885b21d412ede58df0a8c26a4fcb8ca0fb..9982eb385c0f9844d70f53d45c7377fcf5fa2887 100644 (file)
@@ -32,14 +32,14 @@ static uint32_t l2x0_way_mask;      /* Bitmask of active ways */
 static inline void cache_wait(void __iomem *reg, unsigned long mask)
 {
        /* wait for the operation to complete */
-       while (readl(reg) & mask)
+       while (readl_relaxed(reg) & mask)
                ;
 }
 
 static inline void cache_sync(void)
 {
        void __iomem *base = l2x0_base;
-       writel(0, base + L2X0_CACHE_SYNC);
+       writel_relaxed(0, base + L2X0_CACHE_SYNC);
        cache_wait(base + L2X0_CACHE_SYNC, 1);
 }
 
@@ -47,14 +47,14 @@ static inline void l2x0_clean_line(unsigned long addr)
 {
        void __iomem *base = l2x0_base;
        cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
-       writel(addr, base + L2X0_CLEAN_LINE_PA);
+       writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA);
 }
 
 static inline void l2x0_inv_line(unsigned long addr)
 {
        void __iomem *base = l2x0_base;
        cache_wait(base + L2X0_INV_LINE_PA, 1);
-       writel(addr, base + L2X0_INV_LINE_PA);
+       writel_relaxed(addr, base + L2X0_INV_LINE_PA);
 }
 
 #ifdef CONFIG_PL310_ERRATA_588369
@@ -75,9 +75,9 @@ static inline void l2x0_flush_line(unsigned long addr)
 
        /* Clean by PA followed by Invalidate by PA */
        cache_wait(base + L2X0_CLEAN_LINE_PA, 1);
-       writel(addr, base + L2X0_CLEAN_LINE_PA);
+       writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA);
        cache_wait(base + L2X0_INV_LINE_PA, 1);
-       writel(addr, base + L2X0_INV_LINE_PA);
+       writel_relaxed(addr, base + L2X0_INV_LINE_PA);
 }
 #else
 
@@ -90,7 +90,7 @@ static inline void l2x0_flush_line(unsigned long addr)
 {
        void __iomem *base = l2x0_base;
        cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1);
-       writel(addr, base + L2X0_CLEAN_INV_LINE_PA);
+       writel_relaxed(addr, base + L2X0_CLEAN_INV_LINE_PA);
 }
 #endif
 
@@ -109,7 +109,7 @@ static inline void l2x0_inv_all(void)
 
        /* invalidate all ways */
        spin_lock_irqsave(&l2x0_lock, flags);
-       writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);
+       writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);
        cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);
        cache_sync();
        spin_unlock_irqrestore(&l2x0_lock, flags);
@@ -215,8 +215,8 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 
        l2x0_base = base;
 
-       cache_id = readl(l2x0_base + L2X0_CACHE_ID);
-       aux = readl(l2x0_base + L2X0_AUX_CTRL);
+       cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID);
+       aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
 
        aux &= aux_mask;
        aux |= aux_val;
@@ -248,15 +248,15 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
         * If you are booting from non-secure mode
         * accessing the below registers will fault.
         */
-       if (!(readl(l2x0_base + L2X0_CTRL) & 1)) {
+       if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) {
 
                /* l2x0 controller is disabled */
-               writel(aux, l2x0_base + L2X0_AUX_CTRL);
+               writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL);
 
                l2x0_inv_all();
 
                /* enable L2X0 */
-               writel(1, l2x0_base + L2X0_CTRL);
+               writel_relaxed(1, l2x0_base + L2X0_CTRL);
        }
 
        outer_cache.inv_range = l2x0_inv_range;
index 086816b205b8cf25c9d178c9d56c44a654e2ff9f..6ab244062b4ab2f720e84d870011faac64878c81 100644 (file)
@@ -163,19 +163,22 @@ static DEFINE_PER_CPU(int, kmap_high_l1_vipt_depth);
 
 void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte)
 {
-       unsigned int idx, cpu = smp_processor_id();
-       int *depth = &per_cpu(kmap_high_l1_vipt_depth, cpu);
+       unsigned int idx, cpu;
+       int *depth;
        unsigned long vaddr, flags;
        pte_t pte, *ptep;
 
+       if (!in_interrupt())
+               preempt_disable();
+
+       cpu = smp_processor_id();
+       depth = &per_cpu(kmap_high_l1_vipt_depth, cpu);
+
        idx = KM_L1_CACHE + KM_TYPE_NR * cpu;
        vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
        ptep = TOP_PTE(vaddr);
        pte = mk_pte(page, kmap_prot);
 
-       if (!in_interrupt())
-               preempt_disable();
-
        raw_local_irq_save(flags);
        (*depth)++;
        if (pte_val(*ptep) == pte_val(pte)) {
index 1670734b7e5159d34ada41710c0dc5381fcc4c3a..37fa593884ee64d345add30e2ca9738e238e3511 100644 (file)
@@ -17,8 +17,8 @@
                .macro  addruart, rx
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                                 @ MMU enabled?
-               moveq   \rx, =SPEAR_DBG_UART_BASE               @ Physical base
-               movne   \rx, =VA_SPEAR_DBG_UART_BASE            @ Virtual base
+               moveq   \rx, #SPEAR_DBG_UART_BASE               @ Physical base
+               movne   \rx, #VA_SPEAR_DBG_UART_BASE            @ Virtual base
                .endm
 
                .macro  senduart, rd, rx
index 0cf2c0a4502bd55769edf2166899a2c47d833f8a..e6ac0b6610763e6a51c30d64c607691c4fe869fe 100644 (file)
@@ -54,6 +54,9 @@
 #define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
 #define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
 
+#define TIOCGRS485      0x542E
+#define TIOCSRS485      0x542F
+
 #define FIONCLEX       0x5450
 #define FIOCLEX                0x5451
 #define FIOASYNC       0x5452
index c7f25bb1d068e0de55c8d2eeeb9ea817d5232328..61740201b3115eb7988ff3eca6728195f5d90d8b 100644 (file)
@@ -5,6 +5,7 @@
 #define __ASM_ARCH_BOARD_H
 
 #include <linux/types.h>
+#include <linux/serial.h>
 
 #define GPIO_PIN_NONE  (-1)
 
@@ -35,6 +36,7 @@ struct atmel_uart_data {
        short           use_dma_tx;     /* use transmit DMA? */
        short           use_dma_rx;     /* use receive DMA? */
        void __iomem    *regs;          /* virtual base address, if any */
+       struct serial_rs485     rs485;          /* rs485 settings */
 };
 void at32_map_usart(unsigned int hw_id, unsigned int line, int flags);
 struct platform_device *at32_add_device_usart(unsigned int id);
index 2580e77624d2072b4637b28eb32f5deb5053c1c0..f9e5622ebc95b8e37a42ac96d3556176c44b11c9 100644 (file)
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = {
 static int __init au1xxx_platform_init(void)
 {
        unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
-       int i;
+       int err, i;
 
        /* Fill up uartclk. */
        for (i = 0; au1x00_uart_data[i].flags; i++)
                au1x00_uart_data[i].uartclk = uartclk;
 
+       err = platform_add_devices(au1xxx_platform_devices,
+                                  ARRAY_SIZE(au1xxx_platform_devices));
 #ifndef CONFIG_SOC_AU1100
        /* Register second MAC if enabled in pinfunc */
-       if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
+       if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2))
                platform_device_register(&au1xxx_eth1_device);
 #endif
 
-       return platform_add_devices(au1xxx_platform_devices,
-                                   ARRAY_SIZE(au1xxx_platform_devices));
+       return err;
 }
 
 arch_initcall(au1xxx_platform_init);
index a9f0336e1f1fd626cca60c57748c1430be64c8f4..52d883d37dd7e4b69a82ab89e724c7b0c2cca7d4 100644 (file)
@@ -67,8 +67,6 @@ static void mtx1_power_off(void)
 
 void __init board_setup(void)
 {
-       alchemy_gpio2_enable();
-
 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
        /* Enable USB power switch */
        alchemy_gpio_direction_output(204, 0);
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
 
        if (assert && devsel != 0)
                /* Suppress signal to Cardbus */
-               gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
+               alchemy_gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
        else
-               gpio_set_value(1, 1);   /* set EXT_IO3 ON */
+               alchemy_gpio_set_value(1, 1);   /* set EXT_IO3 ON */
 
-       au_sync_udelay(1);
+       udelay(1);
        return 1;
 }
 
index 9f544badd0b4d5dddc25701a690bb63b797cf8f8..39c23366c5c7ea4bcbe6c272fe0279aca4d82aba 100644 (file)
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit,
        if (unit > 1)
                return -ENODEV;
 
+       if (unit == 1 && BCMCPU_IS_6338())
+               return -ENODEV;
+
        if (!shared_device_registered) {
                shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
                shared_res[0].end = shared_res[0].start;
index 59dc0c7ef7334b2e28e4b508e03f84e8f2ea2aca..c63c56bfd18461b558e0cba7380d6297fc47115e 100644 (file)
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_add          \n"
-               "       addu    %0, %2                                  \n"
+               "       daddu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_add          \n"
-               "       addu    %0, %2                                  \n"
+               "       daddu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqz    %0, 2f                                  \n"
                "       .subsection 2                                   \n"
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_sub          \n"
-               "       subu    %0, %2                                  \n"
+               "       dsubu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqzl   %0, 1b                                  \n"
                "       .set    mips0                                   \n"
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %0, %1          # atomic64_sub          \n"
-               "       subu    %0, %2                                  \n"
+               "       dsubu   %0, %2                                  \n"
                "       scd     %0, %1                                  \n"
                "       beqz    %0, 2f                                  \n"
                "       .subsection 2                                   \n"
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_add_return   \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqzl   %0, 1b                                  \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
                : "=&r" (result), "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter)
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_add_return   \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqz    %0, 2f                                  \n"
-               "       addu    %0, %1, %3                              \n"
+               "       daddu   %0, %1, %3                              \n"
                "       .subsection 2                                   \n"
                "2:     b       1b                                      \n"
                "       .previous                                       \n"
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_sub_return   \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqzl   %0, 1b                                  \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       .set    mips0                                   \n"
                : "=&r" (result), "=&r" (temp), "=m" (v->counter)
                : "Ir" (i), "m" (v->counter)
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
                __asm__ __volatile__(
                "       .set    mips3                                   \n"
                "1:     lld     %1, %2          # atomic64_sub_return   \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       scd     %0, %2                                  \n"
                "       beqz    %0, 2f                                  \n"
-               "       subu    %0, %1, %3                              \n"
+               "       dsubu   %0, %1, %3                              \n"
                "       .subsection 2                                   \n"
                "2:     b       1b                                      \n"
                "       .previous                                       \n"
index 1b5a6648eb86dda1598877acf8fd4a9ac9b301c1..baa318a59c97f8c2791842df809c1218796c7492 100644 (file)
 #define __NR_perf_event_open           (__NR_Linux + 296)
 #define __NR_accept4                   (__NR_Linux + 297)
 #define __NR_recvmmsg                  (__NR_Linux + 298)
+#define __NR_getdents64                        (__NR_Linux + 299)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            298
+#define __NR_Linux_syscalls            299
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                298
+#define __NR_N32_Linux_syscalls                299
 
 #ifdef __KERNEL__
 
index a5297e2a353aede2279664446611de8100bf1f98..a4faceea9d885043a0628afcf649d6b957c9b7a3 100644 (file)
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table)
        PTR     sys_perf_event_open
        PTR     sys_accept4
        PTR     compat_sys_recvmmsg
+       PTR     sys_getdents
        .size   sysn32_call_table,.-sysn32_call_table
index b773c1112b140f0f976139a3f57a9e69b2ee4bde..e5cdfd603f8fb6dabbdf22051b043604c8ad6496 100644 (file)
@@ -61,11 +61,9 @@ static int __init init_vdso(void)
 
        vunmap(vdso);
 
-       pr_notice("init_vdso successfull\n");
-
        return 0;
 }
-device_initcall(init_vdso);
+subsys_initcall(init_vdso);
 
 static unsigned long vdso_addr(unsigned long start)
 {
index 2fbfa1a8c3a9a96a4a2bc159a9eb8c986bc4297e..bf80921f2f56c0b145e698fa2c673ff49c7c0636 100644 (file)
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void)
        iomem_resource.end &= 0xfffffffffULL;                   /* 64 GB */
        ioport_resource.end = controller->io_resource->end;
 
+       controller->io_map_base = mips_io_port_base;
+
        register_pci_controller(controller);
 }
 
index eee4f3dfc410e248d5caf1e625b14dcbbb273ff3..98e86ddb86ccd6e07766d53a04998d7f3a413cc4 100644 (file)
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops;
 
 static struct pci_controller pnx8550_controller = {
        .pci_ops        = &pnx8550_pci_ops,
+       .io_map_base    = PNX8550_PORT_BASE,
        .io_resource    = &pci_io_resource,
        .mem_resource   = &pci_mem_resource,
 };
index 2aed50fef10ff8b800a58c8cdc0551d654b8fbf8..64246c9c875c51d09e5c3861ca0e6f1096d50ac5 100644 (file)
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void)
        PNX8550_GLB2_ENAB_INTA_O = 0;
 
        /* IO/MEM resources. */
-       set_io_port_base(KSEG1);
+       set_io_port_base(PNX8550_PORT_BASE);
        ioport_resource.start = 0;
        ioport_resource.end = ~0;
        iomem_resource.start = 0;
index 04b31478a6d7d6631ad3faa684be6f41e66e2a09..b7c03d80c88c80e1a54af4254d42522b95e9f76a 100644 (file)
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = {
        .pci_ops        = &msp_pci_ops,
        .mem_resource   = &pci_mem_resource,
        .mem_offset     = 0,
+       .io_map_base    = MSP_PCI_IOSPACE_BASE,
        .io_resource    = &pci_io_resource,
        .io_offset      = 0
 };
index 0357946f30e6ec5d2719446eaf68a9b86e980b98..cf5e1a25cb7d7fb942c3d0ebe53e9b3c6e5e14c1 100644 (file)
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void)
                panic(ioremap_failed);
 
        set_io_port_base(io_v_base);
+       py_controller.io_map_base = io_v_base;
        TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);
 
        ioport_resource.end = TITAN_IO_SIZE - 1;
index 8ee77887306a24986a54b27af1b3dc009011273a..9ec523e4dd060afb93ebd5fea93c07450daf933f 100644 (file)
@@ -472,6 +472,9 @@ void __init configure_platform(void)
                 * it*/
                platform_features = FFS_CAPABLE | DISPLAY_CAPABLE;
 
+               /* Cronus and Cronus Lite have the same register map */
+               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
+
                /* ASIC version will determine if this is a real CronusLite or
                 * Castrati(Cronus) */
                chipversion  = asic_read(chipver3) << 24;
@@ -484,8 +487,6 @@ void __init configure_platform(void)
                else
                        asic = ASIC_CRONUSLITE;
 
-               /* Cronus and Cronus Lite have the same register map */
-               set_register_map(CRONUS_IO_BASE, &cronus_register_map);
                gp_resources = non_dvr_cronuslite_resources;
                pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, "
                        "chipversion=0x%08X\n",
index 369872f6cf78aa139564275b714af2f6901af85a..babcceecd2eab6335217d2434c6e91e5c7fe5884 100644 (file)
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
         * Finally record data if requested.
         */
        if (record) {
-               struct perf_sample_data data = {
-                       .period = event->hw.last_period,
-               };
+               struct perf_sample_data data;
+
+               perf_sample_data_init(&data, 0);
 
                if (perf_event_overflow(event, nmi, &data, regs)) {
                        /*
index d5e3e60074472f8824f599d503c40744ad622ab0..bea9ee37ac9d2fc78cb9c5c7da4454bf529cb955 100644 (file)
@@ -535,8 +535,16 @@ pgm_no_vtime2:
        l       %r3,__LC_PGM_ILC        # load program interruption code
        la      %r8,0x7f
        nr      %r8,%r3                 # clear per-event-bit and ilc
-       be      BASED(pgm_exit)         # only per or per+check ?
-       b       BASED(pgm_do_call)
+       be      BASED(pgm_exit2)        # only per or per+check ?
+       l       %r7,BASED(.Ljump_table)
+       sll     %r8,2
+       l       %r7,0(%r8,%r7)          # load address of handler routine
+       la      %r2,SP_PTREGS(%r15)     # address of register-save area
+       basr    %r14,%r7                # branch to interrupt-handler
+pgm_exit2:
+       TRACE_IRQS_ON
+       stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
+       b       BASED(sysc_return)
 
 #
 # it was a single stepped SVC that is causing all the trouble
index e7192e1cb6785b24db347b2bbe2c22a469bdeb7d..8bccec15ea90086a557de590f90977d1e018cb4f 100644 (file)
@@ -544,8 +544,16 @@ pgm_no_vtime2:
        lgf     %r3,__LC_PGM_ILC        # load program interruption code
        lghi    %r8,0x7f
        ngr     %r8,%r3                 # clear per-event-bit and ilc
-       je      pgm_exit
-       j       pgm_do_call
+       je      pgm_exit2
+       sll     %r8,3
+       larl    %r1,pgm_check_table
+       lg      %r1,0(%r8,%r1)          # load address of handler routine
+       la      %r2,SP_PTREGS(%r15)     # address of register-save area
+       basr    %r14,%r1                # branch to interrupt-handler
+pgm_exit2:
+       TRACE_IRQS_ON
+       stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
+       j       sysc_return
 
 #
 # it was a single stepped SVC that is causing all the trouble
index a2163c95eb9845ffac908bf09b7af1bb5084cf3c..15a7536452d508b7998d37d9b679f4545d670dc1 100644 (file)
@@ -524,8 +524,11 @@ void etr_switch_to_local(void)
        if (!etr_eacr.sl)
                return;
        disable_sync_clock(NULL);
-       set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events);
-       queue_work(time_sync_wq, &etr_work);
+       if (!test_and_set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events)) {
+               etr_eacr.es = etr_eacr.sl = 0;
+               etr_setr(&etr_eacr);
+               queue_work(time_sync_wq, &etr_work);
+       }
 }
 
 /*
@@ -539,8 +542,11 @@ void etr_sync_check(void)
        if (!etr_eacr.es)
                return;
        disable_sync_clock(NULL);
-       set_bit(ETR_EVENT_SYNC_CHECK, &etr_events);
-       queue_work(time_sync_wq, &etr_work);
+       if (!test_and_set_bit(ETR_EVENT_SYNC_CHECK, &etr_events)) {
+               etr_eacr.es = 0;
+               etr_setr(&etr_eacr);
+               queue_work(time_sync_wq, &etr_work);
+       }
 }
 
 /*
@@ -902,7 +908,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib *aib,
         * Do not try to get the alternate port aib if the clock
         * is not in sync yet.
         */
-       if (!check_sync_clock())
+       if (!eacr.es || !check_sync_clock())
                return eacr;
 
        /*
@@ -1064,7 +1070,7 @@ static void etr_work_fn(struct work_struct *work)
         * If the clock is in sync just update the eacr and return.
         * If there is no valid sync port wait for a port update.
         */
-       if (check_sync_clock() || sync_port < 0) {
+       if ((eacr.es && check_sync_clock()) || sync_port < 0) {
                etr_update_eacr(eacr);
                etr_set_tolec_timeout(now);
                goto out_unlock;
index ce7cde713e7174e8293b552b332f968946a46904..a36de5bbb6222e953986ee4f4b34fe4caee1388d 100644 (file)
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
                return -ENODEV;
 
        out_obj = output.pointer;
-       if (out_obj->type != ACPI_TYPE_BUFFER) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (out_obj->type != ACPI_TYPE_BUFFER)
+               return -ENODEV;
 
        errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
-       if (errors) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (errors)
+               return -ENODEV;
 
        supported = *((u32 *)(out_obj->buffer.pointer + 4));
-       if (!(supported & 0x1)) {
-               ret = -ENODEV;
-               goto out_free;
-       }
+       if (!(supported & 0x1))
+               return -ENODEV;
 
 out_free:
        kfree(output.pointer);
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void)
        struct pcc_memory_resource *mem_resource;
        struct pcc_register_resource *reg_resource;
        union acpi_object *out_obj, *member;
-       acpi_handle handle, osc_handle;
+       acpi_handle handle, osc_handle, pcch_handle;
        int ret = 0;
 
        status = acpi_get_handle(NULL, "\\_SB", &handle);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
+       status = acpi_get_handle(handle, "PCCH", &pcch_handle);
+       if (ACPI_FAILURE(status))
+               return -ENODEV;
+
        status = acpi_get_handle(handle, "_OSC", &osc_handle);
        if (ACPI_SUCCESS(status)) {
                ret = pcc_cpufreq_do_osc(&osc_handle);
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
        if (!pcch_virt_addr) {
                result = -1;
-               goto pcch_null;
+               goto out;
        }
 
        result = pcc_get_offset(cpu);
        if (result) {
                dprintk("init: PCCP evaluation failed\n");
-               goto free;
+               goto out;
        }
 
        policy->max = policy->cpuinfo.max_freq =
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
                ioread32(&pcch_hdr->minimum_frequency) * 1000;
        policy->cur = pcc_get_freq(cpu);
 
+       if (!policy->cur) {
+               dprintk("init: Unable to get current CPU frequency\n");
+               result = -EINVAL;
+               goto out;
+       }
+
        dprintk("init: policy->max is %d, policy->min is %d\n",
                policy->max, policy->min);
-
-       return 0;
-free:
-       pcc_clear_mapping();
-       free_percpu(pcc_cpu_info);
-pcch_null:
+out:
        return result;
 }
 
index 7ec2123838e6f70f5af02e6e5804143bcc29090c..3e90cce3dc8bfe50fa245e8febe2aaf2625df25e 100644 (file)
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data)
        }
        if (max_latency == 0) {
                /*
-                * Fam 11h always returns 0 as transition latency.
-                * This is intended and means "very fast". While cpufreq core
-                * and governors currently can handle that gracefully, better
-                * set it to 1 to avoid problems in the future.
-                * For all others it's a BIOS bug.
+                * Fam 11h and later may return 0 as transition latency. This
+                * is intended and means "very fast". While cpufreq core and
+                * governors currently can handle that gracefully, better set it
+                * to 1 to avoid problems in the future.
                 */
-               if (boot_cpu_data.x86 != 0x11)
+               if (boot_cpu_data.x86 < 0x11)
                        printk(KERN_ERR FW_WARN PFX "Invalid zero transition "
                                "latency\n");
                max_latency = 1;
index 745b54f9be89fe02d3043bdb24032016deb2d7db..8209472b27a5ef2e91b88c02841ee702a5a906ee 100644 (file)
@@ -80,7 +80,7 @@ int apei_write_mce(struct mce *m)
        rcd.hdr.revision = CPER_RECORD_REV;
        rcd.hdr.signature_end = CPER_SIG_END;
        rcd.hdr.section_count = 1;
-       rcd.hdr.error_severity = CPER_SER_FATAL;
+       rcd.hdr.error_severity = CPER_SEV_FATAL;
        /* timestamp, platform_id, partition_id are all invalid */
        rcd.hdr.validation_bits = 0;
        rcd.hdr.record_length = sizeof(rcd);
@@ -96,7 +96,7 @@ int apei_write_mce(struct mce *m)
        rcd.sec_hdr.validation_bits = 0;
        rcd.sec_hdr.flags = CPER_SEC_PRIMARY;
        rcd.sec_hdr.section_type = CPER_SECTION_TYPE_MCE;
-       rcd.sec_hdr.section_severity = CPER_SER_FATAL;
+       rcd.sec_hdr.section_severity = CPER_SEV_FATAL;
 
        memcpy(&rcd.mce, m, sizeof(*m));
 
index a198b7c87a123d2f80c6313261e9b80e8346cad1..ba390d731175a492686643dd873786eafda9521b 100644 (file)
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init);
 
 void hpet_disable(void)
 {
-       if (is_hpet_capable()) {
+       if (is_hpet_capable() && hpet_virt_address) {
                unsigned int cfg = hpet_readl(HPET_CFG);
 
                if (hpet_legacy_int_enabled) {
index 7c9f02c130f3ca9167e81205f39c968174a8e9ef..cafa7c80ac95714e7097ba06ff195cd6f285417f 100644 (file)
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = {
        .cls    = &i8259_sysdev_class,
 };
 
-static int __init i8259A_init_sysfs(void)
-{
-       int error = sysdev_class_register(&i8259_sysdev_class);
-       if (!error)
-               error = sysdev_register(&device_i8259A);
-       return error;
-}
-
-device_initcall(i8259A_init_sysfs);
-
 static void mask_8259A(void)
 {
        unsigned long flags;
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = {
 };
 
 struct legacy_pic *legacy_pic = &default_legacy_pic;
+
+static int __init i8259A_init_sysfs(void)
+{
+       int error;
+
+       if (legacy_pic != &default_legacy_pic)
+               return 0;
+
+       error = sysdev_class_register(&i8259_sysdev_class);
+       if (!error)
+               error = sysdev_register(&device_i8259A);
+       return error;
+}
+
+device_initcall(i8259A_init_sysfs);
index 4f4af75b94828af47b811b6b5c6a45e7c4ae650e..01ab17ae2ae72c7bdf2d2c4de2a51f19f59755bf 100644 (file)
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
        return NOTIFY_STOP;
 }
 
-#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
 int kgdb_ll_trap(int cmd, const char *str,
                 struct pt_regs *regs, long err, int trap, int sig)
 {
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str,
 
        return __kgdb_notify(&args, cmd);
 }
-#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
 
 static int
 kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
@@ -625,6 +623,12 @@ int kgdb_arch_init(void)
        return register_die_notifier(&kgdb_notifier);
 }
 
+static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi,
+               struct perf_sample_data *data, struct pt_regs *regs)
+{
+       kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP);
+}
+
 void kgdb_arch_late(void)
 {
        int i, cpu;
@@ -655,6 +659,7 @@ void kgdb_arch_late(void)
                for_each_online_cpu(cpu) {
                        pevent = per_cpu_ptr(breakinfo[i].pev, cpu);
                        pevent[0]->hw.sample_period = 1;
+                       pevent[0]->overflow_handler = kgdb_hw_overflow_handler;
                        if (pevent[0]->destroy != NULL) {
                                pevent[0]->destroy = NULL;
                                release_bp_slot(*pevent);
index 89d66ca4d87cb2982ae48c5877580e733ab0cce8..2331bdc2b549569e56f7dcec275c72bf06275928 100644 (file)
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
                        /* advance table_gfn when emulating 1gb pages with 4k */
                        if (delta == 0)
                                table_gfn += PT_INDEX(addr, level);
+                       access &= gw->pte_access;
                } else {
                        direct = 0;
                        table_gfn = gw->table_gfn[level - 2];
index 05d571f6f19615cab8a90dec413e0a39537e914a..7fa89c39c64f67df0a62804cfa242ae6a2d6f638 100644 (file)
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
 
        r = -ENOMEM;
        size = sizeof(struct kvm_msr_entry) * msrs.nmsrs;
-       entries = vmalloc(size);
+       entries = kmalloc(size, GFP_KERNEL);
        if (!entries)
                goto out;
 
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs,
        r = n;
 
 out_free:
-       vfree(entries);
+       kfree(entries);
 out:
        return r;
 }
index 6ee33169e1dc59e2f48efeab0a3094a788f19e4c..7891904419fcba7541a2d18e38db67f8a9d55c35 100644 (file)
@@ -39,6 +39,7 @@ acpi-y                                += pci_root.o pci_link.o pci_irq.o pci_bind.o
 acpi-y                         += power.o
 acpi-y                         += system.o event.o
 acpi-$(CONFIG_ACPI_DEBUG)      += debug.o
+acpi-$(CONFIG_DEBUG_FS)                += debugfs.o
 acpi-$(CONFIG_ACPI_NUMA)       += numa.o
 acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
 ifdef CONFIG_ACPI_VIDEO
index 899d68afc3c5e0bde9be08338ec14399e52c7d32..92122292ef1f60eddc5d70f3814137681ff58153 100644 (file)
@@ -115,7 +115,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);
 /*
  * Optionally enable output from the AML Debug Object.
  */
-u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
+u32 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
 
 /*
  * Optionally copy the entire DSDT to local memory (instead of simply
index f8c668f27b5a29eda7fbcc93357fbe5f1724fd1f..907e350f1c7df58370cb0e68a399b91d903ec466 100644 (file)
@@ -28,3 +28,12 @@ config ACPI_APEI_EINJ
          EINJ provides a hardware error injection mechanism, it is
          mainly used for debugging and testing the other parts of
          APEI and some other RAS features.
+
+config ACPI_APEI_ERST_DEBUG
+       tristate "APEI Error Record Serialization Table (ERST) Debug Support"
+       depends on ACPI_APEI
+       help
+         ERST is a way provided by APEI to save and retrieve hardware
+         error infomation to and from a persistent store. Enable this
+         if you want to debugging and testing the ERST kernel support
+         and firmware implementation.
index b13b03a177896263fc5e9fb1ebbd6e88653beaba..d1d1bc0a4ee1623006f5eaa787595e4b1562b607 100644 (file)
@@ -1,5 +1,6 @@
 obj-$(CONFIG_ACPI_APEI)                += apei.o
 obj-$(CONFIG_ACPI_APEI_GHES)   += ghes.o
 obj-$(CONFIG_ACPI_APEI_EINJ)   += einj.o
+obj-$(CONFIG_ACPI_APEI_ERST_DEBUG) += erst-dbg.o
 
 apei-y := apei-base.o hest.o cper.o erst.o
index 216e1e948ff6dcc5823289300453ab3516b48072..73fd0c7487c1ae0b1311f4d7e1c048ddc809153a 100644 (file)
@@ -482,14 +482,14 @@ err_unmap_ioport:
        list_for_each_entry(res, &resources->ioport, list) {
                if (res == res_bak)
                        break;
-               release_mem_region(res->start, res->end - res->start);
+               release_region(res->start, res->end - res->start);
        }
        res_bak = NULL;
 err_unmap_iomem:
        list_for_each_entry(res, &resources->iomem, list) {
                if (res == res_bak)
                        break;
-               release_region(res->start, res->end - res->start);
+               release_mem_region(res->start, res->end - res->start);
        }
        return -EINVAL;
 }
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
new file mode 100644 (file)
index 0000000..5281ddd
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * APEI Error Record Serialization Table debug support
+ *
+ * ERST is a way provided by APEI to save and retrieve hardware error
+ * infomation to and from a persistent store. This file provide the
+ * debugging/testing support for ERST kernel support and firmware
+ * implementation.
+ *
+ * Copyright 2010 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/uaccess.h>
+#include <acpi/apei.h>
+#include <linux/miscdevice.h>
+
+#include "apei-internal.h"
+
+#define ERST_DBG_PFX                   "ERST DBG: "
+
+#define ERST_DBG_RECORD_LEN_MAX                4096
+
+static void *erst_dbg_buf;
+static unsigned int erst_dbg_buf_len;
+
+/* Prevent erst_dbg_read/write from being invoked concurrently */
+static DEFINE_MUTEX(erst_dbg_mutex);
+
+static int erst_dbg_open(struct inode *inode, struct file *file)
+{
+       if (erst_disable)
+               return -ENODEV;
+
+       return nonseekable_open(inode, file);
+}
+
+static long erst_dbg_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+{
+       int rc;
+       u64 record_id;
+       u32 record_count;
+
+       switch (cmd) {
+       case APEI_ERST_CLEAR_RECORD:
+               rc = copy_from_user(&record_id, (void __user *)arg,
+                                   sizeof(record_id));
+               if (rc)
+                       return -EFAULT;
+               return erst_clear(record_id);
+       case APEI_ERST_GET_RECORD_COUNT:
+               rc = erst_get_record_count();
+               if (rc < 0)
+                       return rc;
+               record_count = rc;
+               rc = put_user(record_count, (u32 __user *)arg);
+               if (rc)
+                       return rc;
+               return 0;
+       default:
+               return -ENOTTY;
+       }
+}
+
+static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf,
+                            size_t usize, loff_t *off)
+{
+       int rc;
+       ssize_t len = 0;
+       u64 id;
+
+       if (*off != 0)
+               return -EINVAL;
+
+       if (mutex_lock_interruptible(&erst_dbg_mutex) != 0)
+               return -EINTR;
+
+retry_next:
+       rc = erst_get_next_record_id(&id);
+       if (rc)
+               goto out;
+       /* no more record */
+       if (id == APEI_ERST_INVALID_RECORD_ID)
+               goto out;
+retry:
+       rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len);
+       /* The record may be cleared by others, try read next record */
+       if (rc == -ENOENT)
+               goto retry_next;
+       if (rc < 0)
+               goto out;
+       if (len > ERST_DBG_RECORD_LEN_MAX) {
+               pr_warning(ERST_DBG_PFX
+                          "Record (ID: 0x%llx) length is too long: %zd\n",
+                          id, len);
+               rc = -EIO;
+               goto out;
+       }
+       if (len > erst_dbg_buf_len) {
+               kfree(erst_dbg_buf);
+               rc = -ENOMEM;
+               erst_dbg_buf = kmalloc(len, GFP_KERNEL);
+               if (!erst_dbg_buf)
+                       goto out;
+               erst_dbg_buf_len = len;
+               goto retry;
+       }
+
+       rc = -EINVAL;
+       if (len > usize)
+               goto out;
+
+       rc = -EFAULT;
+       if (copy_to_user(ubuf, erst_dbg_buf, len))
+               goto out;
+       rc = 0;
+out:
+       mutex_unlock(&erst_dbg_mutex);
+       return rc ? rc : len;
+}
+
+static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
+                             size_t usize, loff_t *off)
+{
+       int rc;
+       struct cper_record_header *rcd;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
+
+       if (usize > ERST_DBG_RECORD_LEN_MAX) {
+               pr_err(ERST_DBG_PFX "Too long record to be written\n");
+               return -EINVAL;
+       }
+
+       if (mutex_lock_interruptible(&erst_dbg_mutex))
+               return -EINTR;
+       if (usize > erst_dbg_buf_len) {
+               kfree(erst_dbg_buf);
+               rc = -ENOMEM;
+               erst_dbg_buf = kmalloc(usize, GFP_KERNEL);
+               if (!erst_dbg_buf)
+                       goto out;
+               erst_dbg_buf_len = usize;
+       }
+       rc = copy_from_user(erst_dbg_buf, ubuf, usize);
+       if (rc) {
+               rc = -EFAULT;
+               goto out;
+       }
+       rcd = erst_dbg_buf;
+       rc = -EINVAL;
+       if (rcd->record_length != usize)
+               goto out;
+
+       rc = erst_write(erst_dbg_buf);
+
+out:
+       mutex_unlock(&erst_dbg_mutex);
+       return rc < 0 ? rc : usize;
+}
+
+static const struct file_operations erst_dbg_ops = {
+       .owner          = THIS_MODULE,
+       .open           = erst_dbg_open,
+       .read           = erst_dbg_read,
+       .write          = erst_dbg_write,
+       .unlocked_ioctl = erst_dbg_ioctl,
+};
+
+static struct miscdevice erst_dbg_dev = {
+       .minor  = MISC_DYNAMIC_MINOR,
+       .name   = "erst_dbg",
+       .fops   = &erst_dbg_ops,
+};
+
+static __init int erst_dbg_init(void)
+{
+       return misc_register(&erst_dbg_dev);
+}
+
+static __exit void erst_dbg_exit(void)
+{
+       misc_deregister(&erst_dbg_dev);
+       kfree(erst_dbg_buf);
+}
+
+module_init(erst_dbg_init);
+module_exit(erst_dbg_exit);
+
+MODULE_AUTHOR("Huang Ying");
+MODULE_DESCRIPTION("APEI Error Record Serialization Table debug support");
+MODULE_LICENSE("GPL");
index fd0cc016a0992ec1a5cd498787241e2fd3b36f34..385a6059714a72dd32256685a2606586b92d771e 100644 (file)
@@ -41,6 +41,8 @@
 #include <linux/interrupt.h>
 #include <linux/cper.h>
 #include <linux/kdebug.h>
+#include <linux/platform_device.h>
+#include <linux/mutex.h>
 #include <acpi/apei.h>
 #include <acpi/atomicio.h>
 #include <acpi/hed.h>
@@ -87,6 +89,7 @@ struct ghes {
  * used for that.
  */
 static LIST_HEAD(ghes_sci);
+static DEFINE_MUTEX(ghes_list_mutex);
 
 static struct ghes *ghes_new(struct acpi_hest_generic *generic)
 {
@@ -132,26 +135,26 @@ static void ghes_fini(struct ghes *ghes)
 }
 
 enum {
-       GHES_SER_NO = 0x0,
-       GHES_SER_CORRECTED = 0x1,
-       GHES_SER_RECOVERABLE = 0x2,
-       GHES_SER_PANIC = 0x3,
+       GHES_SEV_NO = 0x0,
+       GHES_SEV_CORRECTED = 0x1,
+       GHES_SEV_RECOVERABLE = 0x2,
+       GHES_SEV_PANIC = 0x3,
 };
 
 static inline int ghes_severity(int severity)
 {
        switch (severity) {
-       case CPER_SER_INFORMATIONAL:
-               return GHES_SER_NO;
-       case CPER_SER_CORRECTED:
-               return GHES_SER_CORRECTED;
-       case CPER_SER_RECOVERABLE:
-               return GHES_SER_RECOVERABLE;
-       case CPER_SER_FATAL:
-               return GHES_SER_PANIC;
+       case CPER_SEV_INFORMATIONAL:
+               return GHES_SEV_NO;
+       case CPER_SEV_CORRECTED:
+               return GHES_SEV_CORRECTED;
+       case CPER_SEV_RECOVERABLE:
+               return GHES_SEV_RECOVERABLE;
+       case CPER_SEV_FATAL:
+               return GHES_SEV_PANIC;
        default:
                /* Unkown, go panic */
-               return GHES_SER_PANIC;
+               return GHES_SEV_PANIC;
        }
 }
 
@@ -237,16 +240,16 @@ static void ghes_clear_estatus(struct ghes *ghes)
 
 static void ghes_do_proc(struct ghes *ghes)
 {
-       int ser, processed = 0;
+       int sev, processed = 0;
        struct acpi_hest_generic_data *gdata;
 
-       ser = ghes_severity(ghes->estatus->error_severity);
+       sev = ghes_severity(ghes->estatus->error_severity);
        apei_estatus_for_each_section(ghes->estatus, gdata) {
 #ifdef CONFIG_X86_MCE
                if (!uuid_le_cmp(*(uuid_le *)gdata->section_type,
                                 CPER_SEC_PLATFORM_MEM)) {
                        apei_mce_report_mem_error(
-                               ser == GHES_SER_CORRECTED,
+                               sev == GHES_SEV_CORRECTED,
                                (struct cper_sec_mem_err *)(gdata+1));
                        processed = 1;
                }
@@ -293,18 +296,15 @@ static struct notifier_block ghes_notifier_sci = {
        .notifier_call = ghes_notify_sci,
 };
 
-static int hest_ghes_parse(struct acpi_hest_header *hest_hdr, void *data)
+static int __devinit ghes_probe(struct platform_device *ghes_dev)
 {
        struct acpi_hest_generic *generic;
        struct ghes *ghes = NULL;
-       int rc = 0;
+       int rc = -EINVAL;
 
-       if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
-               return 0;
-
-       generic = (struct acpi_hest_generic *)hest_hdr;
+       generic = ghes_dev->dev.platform_data;
        if (!generic->enabled)
-               return 0;
+               return -ENODEV;
 
        if (generic->error_block_length <
            sizeof(struct acpi_hest_generic_status)) {
@@ -327,62 +327,91 @@ static int hest_ghes_parse(struct acpi_hest_header *hest_hdr, void *data)
                ghes = NULL;
                goto err;
        }
-       switch (generic->notify.type) {
-       case ACPI_HEST_NOTIFY_POLLED:
-               pr_warning(GHES_PFX
-"Generic hardware error source: %d notified via POLL is not supported!\n",
-                          generic->header.source_id);
-               break;
-       case ACPI_HEST_NOTIFY_EXTERNAL:
-       case ACPI_HEST_NOTIFY_LOCAL:
-               pr_warning(GHES_PFX
-"Generic hardware error source: %d notified via IRQ is not supported!\n",
-                          generic->header.source_id);
-               break;
-       case ACPI_HEST_NOTIFY_SCI:
+       if (generic->notify.type == ACPI_HEST_NOTIFY_SCI) {
+               mutex_lock(&ghes_list_mutex);
                if (list_empty(&ghes_sci))
                        register_acpi_hed_notifier(&ghes_notifier_sci);
                list_add_rcu(&ghes->list, &ghes_sci);
-               break;
-       case ACPI_HEST_NOTIFY_NMI:
-               pr_warning(GHES_PFX
-"Generic hardware error source: %d notified via NMI is not supported!\n",
-                          generic->header.source_id);
-               break;
-       default:
-               pr_warning(FW_WARN GHES_PFX
-       "Unknown notification type: %u for generic hardware error source: %d\n",
-                          generic->notify.type, generic->header.source_id);
-               break;
+               mutex_unlock(&ghes_list_mutex);
+       } else {
+               unsigned char *notify = NULL;
+
+               switch (generic->notify.type) {
+               case ACPI_HEST_NOTIFY_POLLED:
+                       notify = "POLL";
+                       break;
+               case ACPI_HEST_NOTIFY_EXTERNAL:
+               case ACPI_HEST_NOTIFY_LOCAL:
+                       notify = "IRQ";
+                       break;
+               case ACPI_HEST_NOTIFY_NMI:
+                       notify = "NMI";
+                       break;
+               }
+               if (notify) {
+                       pr_warning(GHES_PFX
+"Generic hardware error source: %d notified via %s is not supported!\n",
+                                  generic->header.source_id, notify);
+               } else {
+                       pr_warning(FW_WARN GHES_PFX
+"Unknown notification type: %u for generic hardware error source: %d\n",
+                       generic->notify.type, generic->header.source_id);
+               }
+               rc = -ENODEV;
+               goto err;
        }
+       platform_set_drvdata(ghes_dev, ghes);
 
        return 0;
 err:
-       if (ghes)
+       if (ghes) {
                ghes_fini(ghes);
+               kfree(ghes);
+       }
        return rc;
 }
 
-static void ghes_cleanup(void)
+static int __devexit ghes_remove(struct platform_device *ghes_dev)
 {
-       struct ghes *ghes, *nghes;
+       struct ghes *ghes;
+       struct acpi_hest_generic *generic;
 
-       if (!list_empty(&ghes_sci))
-               unregister_acpi_hed_notifier(&ghes_notifier_sci);
+       ghes = platform_get_drvdata(ghes_dev);
+       generic = ghes->generic;
+
+       switch (generic->notify.type) {
+       case ACPI_HEST_NOTIFY_SCI:
+               mutex_lock(&ghes_list_mutex);
+               list_del_rcu(&ghes->list);
+               if (list_empty(&ghes_sci))
+                       unregister_acpi_hed_notifier(&ghes_notifier_sci);
+               mutex_unlock(&ghes_list_mutex);
+               break;
+       default:
+               BUG();
+               break;
+       }
 
        synchronize_rcu();
+       ghes_fini(ghes);
+       kfree(ghes);
 
-       list_for_each_entry_safe(ghes, nghes, &ghes_sci, list) {
-               list_del(&ghes->list);
-               ghes_fini(ghes);
-               kfree(ghes);
-       }
+       platform_set_drvdata(ghes_dev, NULL);
+
+       return 0;
 }
 
+static struct platform_driver ghes_platform_driver = {
+       .driver         = {
+               .name   = "GHES",
+               .owner  = THIS_MODULE,
+       },
+       .probe          = ghes_probe,
+       .remove         = ghes_remove,
+};
+
 static int __init ghes_init(void)
 {
-       int rc;
-
        if (acpi_disabled)
                return -ENODEV;
 
@@ -391,32 +420,12 @@ static int __init ghes_init(void)
                return -EINVAL;
        }
 
-       rc = apei_hest_parse(hest_ghes_parse, NULL);
-       if (rc) {
-               pr_err(GHES_PFX
-               "Error during parsing HEST generic hardware error sources.\n");
-               goto err_cleanup;
-       }
-
-       if (list_empty(&ghes_sci)) {
-               pr_info(GHES_PFX
-                       "No functional generic hardware error sources.\n");
-               rc = -ENODEV;
-               goto err_cleanup;
-       }
-
-       pr_info(GHES_PFX
-               "Generic Hardware Error Source support is initialized.\n");
-
-       return 0;
-err_cleanup:
-       ghes_cleanup();
-       return rc;
+       return platform_driver_register(&ghes_platform_driver);
 }
 
 static void __exit ghes_exit(void)
 {
-       ghes_cleanup();
+       platform_driver_unregister(&ghes_platform_driver);
 }
 
 module_init(ghes_init);
@@ -425,3 +434,4 @@ module_exit(ghes_exit);
 MODULE_AUTHOR("Huang Ying");
 MODULE_DESCRIPTION("APEI Generic Hardware Error Source support");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:GHES");
index e7f40d362cb37c9687602ef4eea1646bfea2f0db..343168d1826626c202171c3a53c5b5e4c2090a65 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/kdebug.h>
 #include <linux/highmem.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 #include <acpi/apei.h>
 
 #include "apei-internal.h"
@@ -47,11 +48,6 @@ EXPORT_SYMBOL_GPL(hest_disable);
 
 static struct acpi_table_hest *hest_tab;
 
-static int hest_void_parse(struct acpi_hest_header *hest_hdr, void *data)
-{
-       return 0;
-}
-
 static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
        [ACPI_HEST_TYPE_IA32_CHECK] = -1,       /* need further calculation */
        [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
@@ -125,6 +121,69 @@ int apei_hest_parse(apei_hest_func_t func, void *data)
 }
 EXPORT_SYMBOL_GPL(apei_hest_parse);
 
+struct ghes_arr {
+       struct platform_device **ghes_devs;
+       unsigned int count;
+};
+
+static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
+{
+       int *count = data;
+
+       if (hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR)
+               (*count)++;
+       return 0;
+}
+
+static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
+{
+       struct acpi_hest_generic *generic;
+       struct platform_device *ghes_dev;
+       struct ghes_arr *ghes_arr = data;
+       int rc;
+
+       if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
+               return 0;
+       generic = (struct acpi_hest_generic *)hest_hdr;
+       if (!generic->enabled)
+               return 0;
+       ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
+       if (!ghes_dev)
+               return -ENOMEM;
+       ghes_dev->dev.platform_data = generic;
+       rc = platform_device_add(ghes_dev);
+       if (rc)
+               goto err;
+       ghes_arr->ghes_devs[ghes_arr->count++] = ghes_dev;
+
+       return 0;
+err:
+       platform_device_put(ghes_dev);
+       return rc;
+}
+
+static int hest_ghes_dev_register(unsigned int ghes_count)
+{
+       int rc, i;
+       struct ghes_arr ghes_arr;
+
+       ghes_arr.count = 0;
+       ghes_arr.ghes_devs = kmalloc(sizeof(void *) * ghes_count, GFP_KERNEL);
+       if (!ghes_arr.ghes_devs)
+               return -ENOMEM;
+
+       rc = apei_hest_parse(hest_parse_ghes, &ghes_arr);
+       if (rc)
+               goto err;
+out:
+       kfree(ghes_arr.ghes_devs);
+       return rc;
+err:
+       for (i = 0; i < ghes_arr.count; i++)
+               platform_device_unregister(ghes_arr.ghes_devs[i]);
+       goto out;
+}
+
 static int __init setup_hest_disable(char *str)
 {
        hest_disable = 1;
@@ -137,6 +196,7 @@ static int __init hest_init(void)
 {
        acpi_status status;
        int rc = -ENODEV;
+       unsigned int ghes_count = 0;
 
        if (acpi_disabled)
                goto err;
@@ -158,7 +218,11 @@ static int __init hest_init(void)
                goto err;
        }
 
-       rc = apei_hest_parse(hest_void_parse, NULL);
+       rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
+       if (rc)
+               goto err;
+
+       rc = hest_ghes_dev_register(ghes_count);
        if (rc)
                goto err;
 
index c1d23cd71652baeed8e64f0f39a96693921fe81a..7136f24e3002c361c804ca57ee76219409c43119 100644 (file)
@@ -1036,6 +1036,7 @@ static int __init acpi_init(void)
        acpi_power_init();
        acpi_system_init();
        acpi_debug_init();
+       acpi_debugfs_init();
        acpi_sleep_proc_init();
        acpi_wakeup_device_init();
        return result;
index 146135e7a6a125731ec902e898bfe4b9364c0d6e..22476eab2b08abdcd96f0bb94596e4ff139c1de9 100644 (file)
@@ -197,80 +197,6 @@ static int param_get_trace_state(char *buffer, struct kernel_param *kp)
 module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
                  NULL, 0644);
 
-/* --------------------------------------------------------------------------
-                               DebugFS Interface
-   -------------------------------------------------------------------------- */
-
-static ssize_t cm_write(struct file *file, const char __user *user_buf,
-                       size_t count, loff_t *ppos)
-{
-       static char *buf;
-       static int uncopied_bytes;
-       struct acpi_table_header table;
-       acpi_status status;
-
-       if (!(*ppos)) {
-               /* parse the table header to get the table length */
-               if (count <= sizeof(struct acpi_table_header))
-                       return -EINVAL;
-               if (copy_from_user(&table, user_buf,
-                       sizeof(struct acpi_table_header)))
-                       return -EFAULT;
-               uncopied_bytes = table.length;
-               buf = kzalloc(uncopied_bytes, GFP_KERNEL);
-               if (!buf)
-                       return -ENOMEM;
-       }
-
-       if (uncopied_bytes < count) {
-               kfree(buf);
-               return -EINVAL;
-       }
-
-       if (copy_from_user(buf + (*ppos), user_buf, count)) {
-               kfree(buf);
-               return -EFAULT;
-       }
-
-       uncopied_bytes -= count;
-       *ppos += count;
-
-       if (!uncopied_bytes) {
-               status = acpi_install_method(buf);
-               kfree(buf);
-               if (ACPI_FAILURE(status))
-                       return -EINVAL;
-               add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
-       }
-
-       return count;
-}
-
-static const struct file_operations cm_fops = {
-       .write = cm_write,
-};
-
-static int acpi_debugfs_init(void)
-{
-       struct dentry *acpi_dir, *cm_dentry;
-
-       acpi_dir = debugfs_create_dir("acpi", NULL);
-       if (!acpi_dir)
-               goto err;
-
-       cm_dentry = debugfs_create_file("custom_method", S_IWUGO,
-                                       acpi_dir, NULL, &cm_fops);
-       if (!cm_dentry)
-               goto err;
-
-       return 0;
-
-err:
-       if (acpi_dir)
-               debugfs_remove(acpi_dir);
-       return -EINVAL;
-}
-
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
@@ -400,7 +326,6 @@ int __init acpi_procfs_init(void)
 
 int __init acpi_debug_init(void)
 {
-       acpi_debugfs_init();
        acpi_procfs_init();
        return 0;
 }
diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c
new file mode 100644 (file)
index 0000000..7de27d4
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * debugfs.c - ACPI debugfs interface to userspace.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/uaccess.h>
+#include <linux/debugfs.h>
+#include <acpi/acpi_drivers.h>
+
+#define _COMPONENT             ACPI_SYSTEM_COMPONENT
+ACPI_MODULE_NAME("debugfs");
+
+
+/* /sys/modules/acpi/parameters/aml_debug_output */
+
+module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
+                  bool, 0644);
+MODULE_PARM_DESC(aml_debug_output,
+                "To enable/disable the ACPI Debug Object output.");
+
+/* /sys/kernel/debug/acpi/custom_method */
+
+static ssize_t cm_write(struct file *file, const char __user * user_buf,
+                       size_t count, loff_t *ppos)
+{
+       static char *buf;
+       static int uncopied_bytes;
+       struct acpi_table_header table;
+       acpi_status status;
+
+       if (!(*ppos)) {
+               /* parse the table header to get the table length */
+               if (count <= sizeof(struct acpi_table_header))
+                       return -EINVAL;
+               if (copy_from_user(&table, user_buf,
+                                  sizeof(struct acpi_table_header)))
+                       return -EFAULT;
+               uncopied_bytes = table.length;
+               buf = kzalloc(uncopied_bytes, GFP_KERNEL);
+               if (!buf)
+                       return -ENOMEM;
+       }
+
+       if (uncopied_bytes < count) {
+               kfree(buf);
+               return -EINVAL;
+       }
+
+       if (copy_from_user(buf + (*ppos), user_buf, count)) {
+               kfree(buf);
+               return -EFAULT;
+       }
+
+       uncopied_bytes -= count;
+       *ppos += count;
+
+       if (!uncopied_bytes) {
+               status = acpi_install_method(buf);
+               kfree(buf);
+               if (ACPI_FAILURE(status))
+                       return -EINVAL;
+               add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
+       }
+
+       return count;
+}
+
+static const struct file_operations cm_fops = {
+       .write = cm_write,
+};
+
+int __init acpi_debugfs_init(void)
+{
+       struct dentry *acpi_dir, *cm_dentry;
+
+       acpi_dir = debugfs_create_dir("acpi", NULL);
+       if (!acpi_dir)
+               goto err;
+
+       cm_dentry = debugfs_create_file("custom_method", S_IWUGO,
+                                       acpi_dir, NULL, &cm_fops);
+       if (!cm_dentry)
+               goto err;
+
+       return 0;
+
+err:
+       if (acpi_dir)
+               debugfs_remove(acpi_dir);
+       return -EINVAL;
+}
index f8f190ec066e7a266101b0783a97e8f274f5a639..0650e343867e3897e07174cdc7785617659133bd 100644 (file)
@@ -30,6 +30,12 @@ int acpi_debug_init(void);
 static inline int acpi_debug_init(void) { return 0; }
 #endif
 
+#ifdef CONFIG_DEBUG_FS
+int acpi_debugfs_init(void);
+#else
+static inline int acpi_debugfs_init(void) { return 0; }
+#endif
+
 /* --------------------------------------------------------------------------
                                   Power Resource
    -------------------------------------------------------------------------- */
index 2862c781b37266aecee8052dac047aa2bcb31ef2..e4625f9198143bfd645d8d2bf644e0c6ec9582c1 100644 (file)
@@ -70,10 +70,10 @@ static int acpi_sleep_prepare(u32 acpi_state)
 
        }
        ACPI_FLUSH_CPU_CACHE();
-       acpi_enable_wakeup_device_prep(acpi_state);
 #endif
        printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n",
                acpi_state);
+       acpi_enable_wakeup_devices(acpi_state);
        acpi_enter_sleep_state_prep(acpi_state);
        return 0;
 }
@@ -118,6 +118,16 @@ static int acpi_pm_freeze(void)
        return 0;
 }
 
+/**
+ * acpi_pre_suspend - Enable wakeup devices, "freeze" EC and save NVS.
+ */
+static int acpi_pm_pre_suspend(void)
+{
+       acpi_pm_freeze();
+       suspend_nvs_save();
+       return 0;
+}
+
 /**
  *     __acpi_pm_prepare - Prepare the platform to enter the target state.
  *
@@ -127,11 +137,9 @@ static int acpi_pm_freeze(void)
 static int __acpi_pm_prepare(void)
 {
        int error = acpi_sleep_prepare(acpi_target_sleep_state);
-
-       suspend_nvs_save();
-
        if (error)
                acpi_target_sleep_state = ACPI_STATE_S0;
+
        return error;
 }
 
@@ -142,9 +150,8 @@ static int __acpi_pm_prepare(void)
 static int acpi_pm_prepare(void)
 {
        int error = __acpi_pm_prepare();
-
        if (!error)
-               acpi_pm_freeze();
+               acpi_pm_pre_suspend();
 
        return error;
 }
@@ -159,7 +166,6 @@ static void acpi_pm_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
-       suspend_nvs_free();
        acpi_ec_unblock_transactions();
 
        if (acpi_state == ACPI_STATE_S0)
@@ -167,7 +173,7 @@ static void acpi_pm_finish(void)
 
        printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n",
                acpi_state);
-       acpi_disable_wakeup_device(acpi_state);
+       acpi_disable_wakeup_devices(acpi_state);
        acpi_leave_sleep_state(acpi_state);
 
        /* reset firmware waking vector */
@@ -181,6 +187,7 @@ static void acpi_pm_finish(void)
  */
 static void acpi_pm_end(void)
 {
+       suspend_nvs_free();
        /*
         * This is necessary in case acpi_pm_finish() is not called during a
         * failing transition to a sleep state.
@@ -251,7 +258,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
        }
 
        local_irq_save(flags);
-       acpi_enable_wakeup_device(acpi_state);
        switch (acpi_state) {
        case ACPI_STATE_S1:
                barrier();
@@ -297,11 +303,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
 }
 
-static void acpi_suspend_finish(void)
-{
-       acpi_pm_finish();
-}
-
 static int acpi_suspend_state_valid(suspend_state_t pm_state)
 {
        u32 acpi_state;
@@ -323,7 +324,7 @@ static struct platform_suspend_ops acpi_suspend_ops = {
        .begin = acpi_suspend_begin,
        .prepare_late = acpi_pm_prepare,
        .enter = acpi_suspend_enter,
-       .wake = acpi_suspend_finish,
+       .wake = acpi_pm_finish,
        .end = acpi_pm_end,
 };
 
@@ -336,9 +337,9 @@ static struct platform_suspend_ops acpi_suspend_ops = {
 static int acpi_suspend_begin_old(suspend_state_t pm_state)
 {
        int error = acpi_suspend_begin(pm_state);
-
        if (!error)
                error = __acpi_pm_prepare();
+
        return error;
 }
 
@@ -349,9 +350,9 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state)
 static struct platform_suspend_ops acpi_suspend_ops_old = {
        .valid = acpi_suspend_state_valid,
        .begin = acpi_suspend_begin_old,
-       .prepare_late = acpi_pm_freeze,
+       .prepare_late = acpi_pm_pre_suspend,
        .enter = acpi_suspend_enter,
-       .wake = acpi_suspend_finish,
+       .wake = acpi_pm_finish,
        .end = acpi_pm_end,
        .recover = acpi_pm_finish,
 };
@@ -423,16 +424,6 @@ static int acpi_hibernation_begin(void)
        return error;
 }
 
-static int acpi_hibernation_pre_snapshot(void)
-{
-       int error = acpi_pm_prepare();
-
-       if (!error)
-               suspend_nvs_save();
-
-       return error;
-}
-
 static int acpi_hibernation_enter(void)
 {
        acpi_status status = AE_OK;
@@ -441,7 +432,6 @@ static int acpi_hibernation_enter(void)
        ACPI_FLUSH_CPU_CACHE();
 
        local_irq_save(flags);
-       acpi_enable_wakeup_device(ACPI_STATE_S4);
        /* This shouldn't return.  If it returns, we have a problem */
        status = acpi_enter_sleep_state(ACPI_STATE_S4);
        /* Reprogram control registers and execute _BFS */
@@ -481,7 +471,7 @@ static void acpi_pm_thaw(void)
 static struct platform_hibernation_ops acpi_hibernation_ops = {
        .begin = acpi_hibernation_begin,
        .end = acpi_pm_end,
-       .pre_snapshot = acpi_hibernation_pre_snapshot,
+       .pre_snapshot = acpi_pm_prepare,
        .finish = acpi_pm_finish,
        .prepare = acpi_pm_prepare,
        .enter = acpi_hibernation_enter,
@@ -517,13 +507,6 @@ static int acpi_hibernation_begin_old(void)
        return error;
 }
 
-static int acpi_hibernation_pre_snapshot_old(void)
-{
-       acpi_pm_freeze();
-       suspend_nvs_save();
-       return 0;
-}
-
 /*
  * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has
  * been requested.
@@ -531,7 +514,7 @@ static int acpi_hibernation_pre_snapshot_old(void)
 static struct platform_hibernation_ops acpi_hibernation_ops_old = {
        .begin = acpi_hibernation_begin_old,
        .end = acpi_pm_end,
-       .pre_snapshot = acpi_hibernation_pre_snapshot_old,
+       .pre_snapshot = acpi_pm_pre_suspend,
        .prepare = acpi_pm_freeze,
        .finish = acpi_pm_finish,
        .enter = acpi_hibernation_enter,
@@ -695,7 +678,6 @@ static void acpi_power_off(void)
        /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
        printk(KERN_DEBUG "%s called\n", __func__);
        local_irq_disable();
-       acpi_enable_wakeup_device(ACPI_STATE_S5);
        acpi_enter_sleep_state(ACPI_STATE_S5);
 }
 
index 25b8bd149284fb7f13de1018bf66c806dd855f9e..d8821805c3bc9ab4637732d5d7ee6f105620b83f 100644 (file)
@@ -2,9 +2,8 @@
 extern u8 sleep_states[];
 extern int acpi_suspend(u32 state);
 
-extern void acpi_enable_wakeup_device_prep(u8 sleep_state);
-extern void acpi_enable_wakeup_device(u8 sleep_state);
-extern void acpi_disable_wakeup_device(u8 sleep_state);
+extern void acpi_enable_wakeup_devices(u8 sleep_state);
+extern void acpi_disable_wakeup_devices(u8 sleep_state);
 
 extern struct list_head acpi_wakeup_device_list;
 extern struct mutex acpi_device_lock;
index 388747a7ef4fc261b4e09db7866bc86bb9b17570..dc6d1d9112fb58809a6db021a6eba031d7d2315b 100644 (file)
 ACPI_MODULE_NAME("wakeup_devices")
 
 /**
- * acpi_enable_wakeup_device_prep - Prepare wake-up devices.
+ * acpi_enable_wakeup_devices - Enable wake-up device GPEs.
  * @sleep_state: ACPI system sleep state.
  *
- * Enable all wake-up devices' power, unless the requested system sleep state is
- * too deep.
+ * Enable wakeup device power of devices with the state.enable flag set and set
+ * the wakeup enable mask bits in the GPE registers that correspond to wakeup
+ * devices.
  */
-void acpi_enable_wakeup_device_prep(u8 sleep_state)
+void acpi_enable_wakeup_devices(u8 sleep_state)
 {
        struct list_head *node, *next;
 
-       list_for_each_safe(node, next, &acpi_wakeup_device_list) {
-               struct acpi_device *dev = container_of(node,
-                                                      struct acpi_device,
-                                                      wakeup_list);
-
-               if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled
-                   || (sleep_state > (u32) dev->wakeup.sleep_state))
-                       continue;
-
-               acpi_enable_wakeup_device_power(dev, sleep_state);
-       }
-}
-
-/**
- * acpi_enable_wakeup_device - Enable wake-up device GPEs.
- * @sleep_state: ACPI system sleep state.
- *
- * Enable all wake-up devices' GPEs, with the assumption that
- * acpi_disable_all_gpes() was executed before, so we don't need to disable any
- * GPEs here.
- */
-void acpi_enable_wakeup_device(u8 sleep_state)
-{
-       struct list_head *node, *next;
-
-       /* 
-        * Caution: this routine must be invoked when interrupt is disabled 
-        * Refer ACPI2.0: P212
-        */
        list_for_each_safe(node, next, &acpi_wakeup_device_list) {
                struct acpi_device *dev =
                        container_of(node, struct acpi_device, wakeup_list);
@@ -68,6 +40,9 @@ void acpi_enable_wakeup_device(u8 sleep_state)
                    || sleep_state > (u32) dev->wakeup.sleep_state)
                        continue;
 
+               if (dev->wakeup.state.enabled)
+                       acpi_enable_wakeup_device_power(dev, sleep_state);
+
                /* The wake-up power should have been enabled already. */
                acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
                                ACPI_GPE_TYPE_WAKE);
@@ -75,13 +50,10 @@ void acpi_enable_wakeup_device(u8 sleep_state)
 }
 
 /**
- * acpi_disable_wakeup_device - Disable devices' wakeup capability.
+ * acpi_disable_wakeup_devices - Disable devices' wakeup capability.
  * @sleep_state: ACPI system sleep state.
- *
- * This function only affects devices with wakeup.state.enabled set, which means
- * that it reverses the changes made by acpi_enable_wakeup_device_prep().
  */
-void acpi_disable_wakeup_device(u8 sleep_state)
+void acpi_disable_wakeup_devices(u8 sleep_state)
 {
        struct list_head *node, *next;
 
index 9344216183a433a84210b5ebaef0efd57e6aa9c7..a7547150a705235f75f7949f89ebd99a8e3ba329 100644 (file)
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void)
 
                /* G33's GTT size defined in gmch_ctrl */
                pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl);
-               switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
-               case G33_PGETBL_SIZE_1M:
+               switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
+               case I830_GMCH_GMS_STOLEN_512:
+                       size = 512;
+                       break;
+               case I830_GMCH_GMS_STOLEN_1024:
                        size = 1024;
                        break;
-               case G33_PGETBL_SIZE_2M:
-                       size = 2048;
+               case I830_GMCH_GMS_STOLEN_8192:
+                       size = 8*1024;
                        break;
                default:
                        dev_info(&agp_bridge->dev->dev,
                                 "unknown page table size 0x%x, assuming 512KB\n",
-                               (gmch_ctrl & G33_PGETBL_SIZE_MASK));
+                               (gmch_ctrl & I830_GMCH_GMS_MASK));
                        size = 512;
                }
        } else {
index 24314a9cffe83875858b4d2b4aeb0ab5a68acf21..1030f8420137adb8ff7363eb259f9578026fe178 100644 (file)
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
 
 static int tpm_tis_pnp_resume(struct pnp_dev *dev)
 {
-       return tpm_pm_resume(&dev->dev);
+       struct tpm_chip *chip = pnp_get_drvdata(dev);
+       int ret;
+
+       ret = tpm_pm_resume(&dev->dev);
+       if (!ret)
+               tpm_continue_selftest(chip);
+
+       return ret;
 }
 
 static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
index 063b2184caf5506fc1e1a83e1cd6c8dc6f22b6c3..938b74ea9ffbee8e6c195baa2eae97520c7a07cb 100644 (file)
@@ -1077,6 +1077,7 @@ err_out_unregister:
 
 err_unlock_policy:
        unlock_policy_rwsem_write(cpu);
+       free_cpumask_var(policy->related_cpus);
 err_free_cpumask:
        free_cpumask_var(policy->cpus);
 err_free_policy:
@@ -1762,17 +1763,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
                        dprintk("governor switch\n");
 
                        /* end old governor */
-                       if (data->governor) {
-                               /*
-                                * Need to release the rwsem around governor
-                                * stop due to lock dependency between
-                                * cancel_delayed_work_sync and the read lock
-                                * taken in the delayed work handler.
-                                */
-                               unlock_policy_rwsem_write(data->cpu);
+                       if (data->governor)
                                __cpufreq_governor(data, CPUFREQ_GOV_STOP);
-                               lock_policy_rwsem_write(data->cpu);
-                       }
 
                        /* start new governor */
                        data->governor = policy->governor;
index cc9357da0e3442ad9666a415f80b3dd29321b6a0..e0187d16dd7c53fd240b58d62005e4c17df14bc4 100644 (file)
@@ -1300,7 +1300,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno,
                if (devno == 0)
                        return -ENODEV;
 
-               i7core_printk(KERN_ERR,
+               i7core_printk(KERN_INFO,
                        "Device not found: dev %02x.%d PCI ID %04x:%04x\n",
                        dev_descr->dev, dev_descr->func,
                        PCI_VENDOR_ID_INTEL, dev_descr->dev_id);
index f39b00a46eda36c1d6e6d265e7aa02245d012556..1052340e6802658db085627f501f3c6102347e67 100644 (file)
@@ -336,6 +336,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = {
        },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
 
 static struct of_platform_driver mpc85xx_pci_err_driver = {
        .probe = mpc85xx_pci_err_probe,
@@ -650,6 +651,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
        { .compatible = "fsl,p2020-l2-cache-controller", },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match);
 
 static struct of_platform_driver mpc85xx_l2_err_driver = {
        .probe = mpc85xx_l2_err_probe,
@@ -1126,6 +1128,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
        { .compatible = "fsl,p2020-memory-controller", },
        {},
 };
+MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
 
 static struct of_platform_driver mpc85xx_mc_err_driver = {
        .probe = mpc85xx_mc_err_probe,
index 3ca36542e3385b0c62a33b703e637fac31884c93..4e51fe3c1fc4f97594d96fcb9a4e719fa40b8edc 100644 (file)
@@ -893,10 +893,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low);
 void gpio_unexport(unsigned gpio)
 {
        struct gpio_desc        *desc;
-       int                     status = -EINVAL;
+       int                     status = 0;
 
-       if (!gpio_is_valid(gpio))
+       if (!gpio_is_valid(gpio)) {
+               status = -EINVAL;
                goto done;
+       }
 
        mutex_lock(&sysfs_lock);
 
@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio)
                        clear_bit(FLAG_EXPORT, &desc->flags);
                        put_device(dev);
                        device_unregister(dev);
-                       status = 0;
                } else
                        status = -ENODEV;
        }
index c1981861bbbdb418ab58f9c9400e6c41a9430216..f87bf104df7a4cc79b2991759c88e00246cf64d4 100644 (file)
@@ -864,8 +864,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid,
                mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0,
                                    false);
                mode->hdisplay = 1366;
-               mode->vsync_start = mode->vsync_start - 1;
-               mode->vsync_end = mode->vsync_end - 1;
+               mode->hsync_start = mode->hsync_start - 1;
+               mode->hsync_end = mode->hsync_end - 1;
                return mode;
        }
 
index aee83fa178f6a6dc60c7273eaaae29b43dbe000d..9214119c01540fb5244d3ca383adb1c5ee04722c 100644 (file)
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
                case FBC_NOT_TILED:
                        seq_printf(m, "scanout buffer not tiled");
                        break;
+               case FBC_MULTIPLE_PIPES:
+                       seq_printf(m, "multiple pipes are enabled");
+                       break;
                default:
                        seq_printf(m, "unknown reason");
                }
index f00c5ae9556ccb47358ce1f5267dd9cc5cb17a21..2305a1234f1e5727cf835227ff2422ed930ce097 100644 (file)
@@ -1300,7 +1300,7 @@ static void i915_cleanup_compression(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
 
        drm_mm_put_block(dev_priv->compressed_fb);
-       if (!IS_GM45(dev))
+       if (dev_priv->compressed_llb)
                drm_mm_put_block(dev_priv->compressed_llb);
 }
 
index d147ab2f5bfcabfc8bc82cd5ccdea93064fa4cf0..2e1744d37ad59e055f37f5c413c6ad3d6c56e02f 100644 (file)
@@ -215,6 +215,7 @@ enum no_fbc_reason {
        FBC_MODE_TOO_LARGE, /* mode too large for compression */
        FBC_BAD_PLANE, /* fbc not supported on plane */
        FBC_NOT_TILED, /* buffer not tiled */
+       FBC_MULTIPLE_PIPES, /* more than one pipe active */
 };
 
 enum intel_pch {
@@ -222,6 +223,8 @@ enum intel_pch {
        PCH_CPT,        /* Cougarpoint PCH */
 };
 
+#define QUIRK_PIPEA_FORCE (1<<0)
+
 struct intel_fbdev;
 
 typedef struct drm_i915_private {
@@ -337,6 +340,8 @@ typedef struct drm_i915_private {
        /* PCH chipset type */
        enum intel_pch pch_type;
 
+       unsigned long quirks;
+
        /* Register state */
        bool modeset_on_lid;
        u8 saveLBB;
index 51bd301cf10d9002555177d95b28e86703145d67..5aa747fc25a9b34161ead103fff6bdba37c092a8 100644 (file)
@@ -3647,6 +3647,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev,
        return ret;
 }
 
+
 int
 i915_gem_do_execbuffer(struct drm_device *dev, void *data,
                       struct drm_file *file_priv,
@@ -3794,7 +3795,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
                                unsigned long long total_size = 0;
                                int num_fences = 0;
                                for (i = 0; i < args->buffer_count; i++) {
-                                       obj_priv = object_list[i]->driver_private;
+                                       obj_priv = to_intel_bo(object_list[i]);
 
                                        total_size += object_list[i]->size;
                                        num_fences +=
index 6d9b0288272a7e0c4f424bd66de1964af60e9a22..cf41c672defe9415fc0b656357cb44af00758b7d 100644 (file)
 
 #define PCH_PP_STATUS          0xc7200
 #define PCH_PP_CONTROL         0xc7204
+#define  PANEL_UNLOCK_REGS     (0xabcd << 16)
 #define  EDP_FORCE_VDD         (1 << 3)
 #define  EDP_BLC_ENABLE                (1 << 2)
 #define  PANEL_POWER_RESET     (1 << 1)
index 68dcf36e2793f51fa42aeecb9b67037aa8515205..5e21b31198249349dc5e69265dbe20c8b0a23d02 100644 (file)
@@ -862,8 +862,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
        intel_clock_t clock;
        int max_n;
        bool found;
-       /* approximately equals target * 0.00488 */
-       int err_most = (target >> 8) + (target >> 10);
+       /* approximately equals target * 0.00585 */
+       int err_most = (target >> 8) + (target >> 9);
        found = false;
 
        if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
@@ -1180,8 +1180,12 @@ static void intel_update_fbc(struct drm_crtc *crtc,
        struct drm_framebuffer *fb = crtc->fb;
        struct intel_framebuffer *intel_fb;
        struct drm_i915_gem_object *obj_priv;
+       struct drm_crtc *tmp_crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        int plane = intel_crtc->plane;
+       int crtcs_enabled = 0;
+
+       DRM_DEBUG_KMS("\n");
 
        if (!i915_powersave)
                return;
@@ -1199,10 +1203,21 @@ static void intel_update_fbc(struct drm_crtc *crtc,
         * If FBC is already on, we just have to verify that we can
         * keep it that way...
         * Need to disable if:
+        *   - more than one pipe is active
         *   - changing FBC params (stride, fence, mode)
         *   - new fb is too large to fit in compressed buffer
         *   - going to an unsupported config (interlace, pixel multiply, etc.)
         */
+       list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) {
+               if (tmp_crtc->enabled)
+                       crtcs_enabled++;
+       }
+       DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled);
+       if (crtcs_enabled > 1) {
+               DRM_DEBUG_KMS("more than one pipe active, disabling compression\n");
+               dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES;
+               goto out_disable;
+       }
        if (intel_fb->obj->size > dev_priv->cfb_size) {
                DRM_DEBUG_KMS("framebuffer too large, disabling "
                                "compression\n");
@@ -1255,7 +1270,7 @@ out_disable:
        }
 }
 
-static int
+int
 intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj)
 {
        struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
@@ -2255,6 +2270,11 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
                        intel_wait_for_vblank(dev);
                }
 
+               /* Don't disable pipe A or pipe A PLLs if needed */
+               if (pipeconf_reg == PIPEACONF &&
+                   (dev_priv->quirks & QUIRK_PIPEA_FORCE))
+                       goto skip_pipe_off;
+
                /* Next, disable display pipes */
                temp = I915_READ(pipeconf_reg);
                if ((temp & PIPEACONF_ENABLE) != 0) {
@@ -2270,7 +2290,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
                        I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE);
                        I915_READ(dpll_reg);
                }
-
+       skip_pipe_off:
                /* Wait for the clocks to turn off. */
                udelay(150);
                break;
@@ -2356,8 +2376,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
                if (mode->clock * 3 > 27000 * 4)
                        return MODE_CLOCK_HIGH;
        }
-
-       drm_mode_set_crtcinfo(adjusted_mode, 0);
        return true;
 }
 
@@ -3736,6 +3754,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
                        if (dev_priv->lvds_dither) {
                                if (HAS_PCH_SPLIT(dev)) {
                                        pipeconf |= PIPE_ENABLE_DITHER;
+                                       pipeconf &= ~PIPE_DITHER_TYPE_MASK;
                                        pipeconf |= PIPE_DITHER_TYPE_ST01;
                                } else
                                        lvds |= LVDS_ENABLE_DITHER;
@@ -4412,7 +4431,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule)
                DRM_DEBUG_DRIVER("upclocking LVDS\n");
 
                /* Unlock panel regs */
-               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16));
+               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) |
+                          PANEL_UNLOCK_REGS);
 
                dpll &= ~DISPLAY_RATE_SELECT_FPA1;
                I915_WRITE(dpll_reg, dpll);
@@ -4455,7 +4475,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
                DRM_DEBUG_DRIVER("downclocking LVDS\n");
 
                /* Unlock panel regs */
-               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16));
+               I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) |
+                          PANEL_UNLOCK_REGS);
 
                dpll |= DISPLAY_RATE_SELECT_FPA1;
                I915_WRITE(dpll_reg, dpll);
@@ -4695,7 +4716,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        struct drm_gem_object *obj;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_unpin_work *work;
-       unsigned long flags;
+       unsigned long flags, offset;
        int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC;
        int ret, pipesrc;
        u32 flip_mask;
@@ -4762,19 +4783,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
                while (I915_READ(ISR) & flip_mask)
                        ;
 
+       /* Offset into the new buffer for cases of shared fbs between CRTCs */
+       offset = obj_priv->gtt_offset;
+       offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8);
+
        BEGIN_LP_RING(4);
        if (IS_I965G(dev)) {
                OUT_RING(MI_DISPLAY_FLIP |
                         MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
                OUT_RING(fb->pitch);
-               OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode);
+               OUT_RING(offset | obj_priv->tiling_mode);
                pipesrc = I915_READ(pipesrc_reg); 
                OUT_RING(pipesrc & 0x0fff0fff);
        } else {
                OUT_RING(MI_DISPLAY_FLIP_I915 |
                         MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
                OUT_RING(fb->pitch);
-               OUT_RING(obj_priv->gtt_offset);
+               OUT_RING(offset);
                OUT_RING(MI_NOOP);
        }
        ADVANCE_LP_RING();
@@ -5506,6 +5531,66 @@ static void intel_init_display(struct drm_device *dev)
        }
 }
 
+/*
+ * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend,
+ * resume, or other times.  This quirk makes sure that's the case for
+ * affected systems.
+ */
+static void quirk_pipea_force (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+
+       dev_priv->quirks |= QUIRK_PIPEA_FORCE;
+       DRM_DEBUG_DRIVER("applying pipe a force quirk\n");
+}
+
+struct intel_quirk {
+       int device;
+       int subsystem_vendor;
+       int subsystem_device;
+       void (*hook)(struct drm_device *dev);
+};
+
+struct intel_quirk intel_quirks[] = {
+       /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */
+       { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force },
+       /* HP Mini needs pipe A force quirk (LP: #322104) */
+       { 0x27ae,0x103c, 0x361a, quirk_pipea_force },
+
+       /* Thinkpad R31 needs pipe A force quirk */
+       { 0x3577, 0x1014, 0x0505, quirk_pipea_force },
+       /* Toshiba Protege R-205, S-209 needs pipe A force quirk */
+       { 0x2592, 0x1179, 0x0001, quirk_pipea_force },
+
+       /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */
+       { 0x3577,  0x1014, 0x0513, quirk_pipea_force },
+       /* ThinkPad X40 needs pipe A force quirk */
+
+       /* ThinkPad T60 needs pipe A force quirk (bug #16494) */
+       { 0x2782, 0x17aa, 0x201a, quirk_pipea_force },
+
+       /* 855 & before need to leave pipe A & dpll A up */
+       { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
+       { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force },
+};
+
+static void intel_init_quirks(struct drm_device *dev)
+{
+       struct pci_dev *d = dev->pdev;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) {
+               struct intel_quirk *q = &intel_quirks[i];
+
+               if (d->device == q->device &&
+                   (d->subsystem_vendor == q->subsystem_vendor ||
+                    q->subsystem_vendor == PCI_ANY_ID) &&
+                   (d->subsystem_device == q->subsystem_device ||
+                    q->subsystem_device == PCI_ANY_ID))
+                       q->hook(dev);
+       }
+}
+
 void intel_modeset_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -5518,6 +5603,8 @@ void intel_modeset_init(struct drm_device *dev)
 
        dev->mode_config.funcs = (void *)&intel_mode_funcs;
 
+       intel_init_quirks(dev);
+
        intel_init_display(dev);
 
        if (IS_I965G(dev)) {
index 1aac59e83bff0c45a0da94e1f083d40d9e30b396..5dde80f9e652ecc213353c59d6969c277869c874 100644 (file)
@@ -717,6 +717,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
        }
 }
 
+static void ironlake_edp_panel_on (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+       u32 pp, pp_status;
+
+       pp_status = I915_READ(PCH_PP_STATUS);
+       if (pp_status & PP_ON)
+               return;
+
+       pp = I915_READ(PCH_PP_CONTROL);
+       pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+       do {
+               pp_status = I915_READ(PCH_PP_STATUS);
+       } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout));
+
+       if (time_after(jiffies, timeout))
+               DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status);
+
+       pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD);
+       I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
+static void ironlake_edp_panel_off (struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       unsigned long timeout = jiffies + msecs_to_jiffies(5000);
+       u32 pp, pp_status;
+
+       pp = I915_READ(PCH_PP_CONTROL);
+       pp &= ~POWER_TARGET_ON;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+       do {
+               pp_status = I915_READ(PCH_PP_STATUS);
+       } while ((pp_status & PP_ON) && !time_after(jiffies, timeout));
+
+       if (time_after(jiffies, timeout))
+               DRM_DEBUG_KMS("panel off wait timed out\n");
+
+       /* Make sure VDD is enabled so DP AUX will work */
+       pp |= EDP_FORCE_VDD;
+       I915_WRITE(PCH_PP_CONTROL, pp);
+}
+
 static void ironlake_edp_backlight_on (struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
@@ -751,14 +796,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
        if (mode != DRM_MODE_DPMS_ON) {
                if (dp_reg & DP_PORT_EN) {
                        intel_dp_link_down(intel_encoder, dp_priv->DP);
-                       if (IS_eDP(intel_encoder))
+                       if (IS_eDP(intel_encoder)) {
                                ironlake_edp_backlight_off(dev);
+                               ironlake_edp_panel_off(dev);
+                       }
                }
        } else {
                if (!(dp_reg & DP_PORT_EN)) {
                        intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration);
-                       if (IS_eDP(intel_encoder))
+                       if (IS_eDP(intel_encoder)) {
+                               ironlake_edp_panel_on(dev);
                                ironlake_edp_backlight_on(dev);
+                       }
                }
        }
        dp_priv->dpms_mode = mode;
index 72206f37c4fb847c8d32d80c5c893fd3a68a5faa..2f7970be9051a2c5eb308b9a5a4eebc09e6b636c 100644 (file)
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev);
 extern void ironlake_enable_drps(struct drm_device *dev);
 extern void ironlake_disable_drps(struct drm_device *dev);
 
+extern int intel_pin_and_fence_fb_obj(struct drm_device *dev,
+                                     struct drm_gem_object *obj);
+
 extern int intel_framebuffer_init(struct drm_device *dev,
                                  struct intel_framebuffer *ifb,
                                  struct drm_mode_fb_cmd *mode_cmd,
index c3c505244e07367c3a8a3cb17698d60ef5ce5407..3e18c9e7729b6a475ce270d3329acf3d54288f1c 100644 (file)
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 
        mutex_lock(&dev->struct_mutex);
 
-       ret = i915_gem_object_pin(fbo, 64*1024);
+       ret = intel_pin_and_fence_fb_obj(dev, fbo);
        if (ret) {
                DRM_ERROR("failed to pin fb: %d\n", ret);
                goto out_unref;
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev,
 
        drm_framebuffer_cleanup(&ifb->base);
        if (ifb->obj)
-               drm_gem_object_unreference_unlocked(ifb->obj);
+               drm_gem_object_unreference(ifb->obj);
 
        return 0;
 }
index 31df55f0a0a7950a0e59ebce556fc30cde35b891..0eab8df5bf7e1c679b52752311e665e51d3ab21d 100644 (file)
@@ -599,6 +599,26 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
        return 0;
 }
 
+static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+{
+       DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident);
+       return 1;
+}
+
+/* The GPU hangs up on these systems if modeset is performed on LID open */
+static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+       {
+               .callback = intel_no_modeset_on_lid_dmi_callback,
+               .ident = "Toshiba Tecra A11",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
+               },
+       },
+
+       { }     /* terminating entry */
+};
+
 /*
  * Lid events. Note the use of 'modeset_on_lid':
  *  - we set it on lid close, and reset it on open
@@ -622,6 +642,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
         */
        if (connector)
                connector->status = connector->funcs->detect(connector);
+       /* Don't force modeset on machines where it causes a GPU lockup */
+       if (dmi_check_system(intel_no_modeset_on_lid))
+               return NOTIFY_OK;
        if (!acpi_lid_open()) {
                dev_priv->modeset_on_lid = 1;
                return NOTIFY_OK;
index 115d26b762cc2b3db9301c86e66d97505f6fd291..3fa6984d9896094c3b0318ff486186c6cdf7ebdd 100644 (file)
@@ -333,6 +333,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%s\n",
                        (cp == PM_PROFILE_AUTO) ? "auto" :
                        (cp == PM_PROFILE_LOW) ? "low" :
+                       (cp == PM_PROFILE_MID) ? "mid" :
                        (cp == PM_PROFILE_HIGH) ? "high" : "default");
 }
 
index 4917af96bae1d0be7472e32bf13784ec5ffb4412..2ed435bd4b6c18c426640140cf39908b1d065574 100644 (file)
@@ -539,9 +539,13 @@ static int mmci_get_cd(struct mmc_host *mmc)
        if (host->gpio_cd == -ENOSYS)
                status = host->plat->status(mmc_dev(host->mmc));
        else
-               status = gpio_get_value(host->gpio_cd);
+               status = !gpio_get_value(host->gpio_cd);
 
-       return !status;
+       /*
+        * Use positive logic throughout - status is zero for no card,
+        * non-zero for card inserted.
+        */
+       return status;
 }
 
 static const struct mmc_host_ops mmci_ops = {
index 8bd23687c530f2e244c7050091d14c05b8fa7901..bb0872a633157157501b5c2312cc6a73d642ed1b 100644 (file)
@@ -1062,6 +1062,10 @@ struct bnx2x {
 
        /* used to synchronize stats collecting */
        int                     stats_state;
+
+       /* used for synchronization of concurrent threads statistics handling */
+       spinlock_t              stats_lock;
+
        /* used by dmae command loader */
        struct dmae_command     stats_dmae;
        int                     executer_idx;
index 57ff5b3bcce6fcd58edc438998ea1bf1ca08ee63..46167c0817274b793348039ea50db4754003b98e 100644 (file)
@@ -57,8 +57,8 @@
 #include "bnx2x_init_ops.h"
 #include "bnx2x_dump.h"
 
-#define DRV_MODULE_VERSION     "1.52.53-1"
-#define DRV_MODULE_RELDATE     "2010/18/04"
+#define DRV_MODULE_VERSION     "1.52.53-2"
+#define DRV_MODULE_RELDATE     "2010/21/07"
 #define BNX2X_BC_VER           0x040200
 
 #include <linux/firmware.h>
@@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
                struct eth_query_ramrod_data ramrod_data = {0};
                int i, rc;
 
+               spin_lock_bh(&bp->stats_lock);
+
                ramrod_data.drv_counter = bp->stats_counter++;
                ramrod_data.collect_port = bp->port.pmf ? 1 : 0;
                for_each_queue(bp, i)
@@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
                        bp->spq_left++;
                        bp->stats_pending = 1;
                }
+
+               spin_unlock_bh(&bp->stats_lock);
        }
 }
 
@@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
        struct host_func_stats *fstats = bnx2x_sp(bp, func_stats);
        struct bnx2x_eth_stats *estats = &bp->eth_stats;
        int i;
+       u16 cur_stats_counter;
+
+       /* Make sure we use the value of the counter
+        * used for sending the last stats ramrod.
+        */
+       spin_lock_bh(&bp->stats_lock);
+       cur_stats_counter = bp->stats_counter - 1;
+       spin_unlock_bh(&bp->stats_lock);
 
        memcpy(&(fstats->total_bytes_received_hi),
               &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi),
@@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
                u32 diff;
 
                /* are storm stats valid? */
-               if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm"
                           "  xstorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, xclient->stats_counter, bp->stats_counter);
+                          i, xclient->stats_counter, cur_stats_counter + 1);
                        return -1;
                }
-               if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm"
                           "  tstorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, tclient->stats_counter, bp->stats_counter);
+                          i, tclient->stats_counter, cur_stats_counter + 1);
                        return -2;
                }
-               if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) !=
-                                                       bp->stats_counter) {
+               if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) {
                        DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm"
                           "  ustorm counter (0x%x) != stats_counter (0x%x)\n",
-                          i, uclient->stats_counter, bp->stats_counter);
+                          i, uclient->stats_counter, cur_stats_counter + 1);
                        return -4;
                }
 
@@ -4849,16 +4858,18 @@ static const struct {
 
 static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
 {
-       enum bnx2x_stats_state state = bp->stats_state;
+       enum bnx2x_stats_state state;
 
        if (unlikely(bp->panic))
                return;
 
-       bnx2x_stats_stm[state][event].action(bp);
+       /* Protect a state change flow */
+       spin_lock_bh(&bp->stats_lock);
+       state = bp->stats_state;
        bp->stats_state = bnx2x_stats_stm[state][event].next_state;
+       spin_unlock_bh(&bp->stats_lock);
 
-       /* Make sure the state has been "changed" */
-       smp_wmb();
+       bnx2x_stats_stm[state][event].action(bp);
 
        if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
                DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
@@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
 
        mutex_init(&bp->port.phy_mutex);
        mutex_init(&bp->fw_mb_mutex);
+       spin_lock_init(&bp->stats_lock);
 #ifdef BCM_CNIC
        mutex_init(&bp->cnic_mutex);
 #endif
index df483076eda6df4284e9e576fc522a0ff022af11..8d7dfd2f1e90cf1bd7d32fcc1a0aa1da87a61332 100644 (file)
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond)
 
        /*initialize packet type*/
        pk_type->type = cpu_to_be16(ETH_P_ARP);
-       pk_type->dev = NULL;
+       pk_type->dev = bond->dev;
        pk_type->func = rlb_arp_recv;
 
        /* register to receive ARPs */
index 1d973db27c32752241eb4ed8355163406e9e9fb7..d7de376d7178ad2b9470797d5cab92846277e363 100644 (file)
@@ -1022,7 +1022,7 @@ static const struct net_device_ops lance_netdev_ops = {
        .ndo_set_mac_address    = eth_mac_addr,
 };
 
-static int __init dec_lance_probe(struct device *bdev, const int type)
+static int __devinit dec_lance_probe(struct device *bdev, const int type)
 {
        static unsigned version_printed;
        static const char fmt[] = "declance%d";
@@ -1326,7 +1326,7 @@ static void __exit dec_lance_platform_remove(void)
 }
 
 #ifdef CONFIG_TC
-static int __init dec_lance_tc_probe(struct device *dev);
+static int __devinit dec_lance_tc_probe(struct device *dev);
 static int __exit dec_lance_tc_remove(struct device *dev);
 
 static const struct tc_device_id dec_lance_tc_table[] = {
@@ -1345,7 +1345,7 @@ static struct tc_driver dec_lance_tc_driver = {
        },
 };
 
-static int __init dec_lance_tc_probe(struct device *dev)
+static int __devinit dec_lance_tc_probe(struct device *dev)
 {
         int status = dec_lance_probe(dev, PMAD_LANCE);
         if (!status)
index 3881918f5382c4e1305e4c5127bfbb2180bb85cd..cea37e0837ff64d3ed4ae16ccc78f85557be9700 100644 (file)
@@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev,
        u16 eeprom_apme_mask = IGB_EEPROM_APME;
        u32 part_num;
 
+       /* Catch broken hardware that put the wrong VF device ID in
+        * the PCIe SR-IOV capability.
+        */
+       if (pdev->is_virtfn) {
+               WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
+                    pci_name(pdev), pdev->vendor, pdev->device);
+               return -EINVAL;
+       }
+
        err = pci_enable_device_mem(pdev);
        if (err)
                return err;
index 7b5d9764f317c3c776712009dde301c27d9c3b99..74d9b6df3029f3c67e9e85ff5a95a14c5ef6ff0b 100644 (file)
@@ -6492,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 #endif
        u32 part_num, eec;
 
+       /* Catch broken hardware that put the wrong VF device ID in
+        * the PCIe SR-IOV capability.
+        */
+       if (pdev->is_virtfn) {
+               WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
+                    pci_name(pdev), pdev->vendor, pdev->device);
+               return -EINVAL;
+       }
+
        err = pci_enable_device_mem(pdev);
        if (err)
                return err;
index 87e8d4cb40579a8947419446012b38896b29064c..f15fe2cf72ae1261fe6d0cde6ca263c2d0c54809 100644 (file)
@@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = {
        .ndo_validate_addr      = eth_validate_addr,
 };
 
-static void macvlan_setup(struct net_device *dev)
+void macvlan_common_setup(struct net_device *dev)
 {
        ether_setup(dev);
 
@@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev)
        dev->destructor         = free_netdev;
        dev->header_ops         = &macvlan_hard_header_ops,
        dev->ethtool_ops        = &macvlan_ethtool_ops;
+}
+EXPORT_SYMBOL_GPL(macvlan_common_setup);
+
+static void macvlan_setup(struct net_device *dev)
+{
+       macvlan_common_setup(dev);
        dev->tx_queue_len       = 0;
 }
 
@@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops)
        /* common fields */
        ops->priv_size          = sizeof(struct macvlan_dev);
        ops->get_tx_queues      = macvlan_get_tx_queues;
-       ops->setup              = macvlan_setup;
        ops->validate           = macvlan_validate;
        ops->maxtype            = IFLA_MACVLAN_MAX;
        ops->policy             = macvlan_policy;
@@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register);
 
 static struct rtnl_link_ops macvlan_link_ops = {
        .kind           = "macvlan",
+       .setup          = macvlan_setup,
        .newlink        = macvlan_newlink,
        .dellink        = macvlan_dellink,
 };
index a8a94e2f6ddcfc04917ab2ec39305ac26e69ecf2..ff02b836c3c4a3d23c6b78fc707508b40732d9f8 100644 (file)
@@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
 {
        struct macvtap_queue *q = macvtap_get_queue(dev, skb);
        if (!q)
-               return -ENOLINK;
+               goto drop;
+
+       if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len)
+               goto drop;
 
        skb_queue_tail(&q->sk.sk_receive_queue, skb);
        wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND);
-       return 0;
+       return NET_RX_SUCCESS;
+
+drop:
+       kfree_skb(skb);
+       return NET_RX_DROP;
 }
 
 /*
@@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev,
        macvlan_dellink(dev, head);
 }
 
+static void macvtap_setup(struct net_device *dev)
+{
+       macvlan_common_setup(dev);
+       dev->tx_queue_len = TUN_READQ_SIZE;
+}
+
 static struct rtnl_link_ops macvtap_link_ops __read_mostly = {
        .kind           = "macvtap",
+       .setup          = macvtap_setup,
        .newlink        = macvtap_newlink,
        .dellink        = macvtap_dellink,
 };
index 5e52c75892dfdb5bd878fb58b1fa715e72be5db3..7f3a53dcc6ef303ca91fa506703074195f549d11 100644 (file)
@@ -65,7 +65,7 @@ static int debug_level = ERR_DBG;
 
 /* DEBUG message print. */
 #define DBG_PRINT(dbg_level, fmt, args...) do {                        \
-       if (dbg_level >= debug_level)                           \
+       if (dbg_level <= debug_level)                           \
                pr_info(fmt, ##args);                           \
        } while (0)
 
index 6ad6fe706312ff4c2cff31034b37428275e2f230..63042596f0cf34962afe9c25133e27b0aa746701 100644 (file)
@@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
                                gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
                        else if (sinfo->gso_type & SKB_GSO_UDP)
                                gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
-                       else
-                               BUG();
+                       else {
+                               printk(KERN_ERR "tun: unexpected GSO type: "
+                                      "0x%x, gso_size %d, hdr_len %d\n",
+                                      sinfo->gso_type, gso.gso_size,
+                                      gso.hdr_len);
+                               print_hex_dump(KERN_ERR, "tun: ",
+                                              DUMP_PREFIX_NONE,
+                                              16, 1, skb->head,
+                                              min((int)gso.hdr_len, 64), true);
+                               WARN_ON_ONCE(1);
+                               return -EINVAL;
+                       }
                        if (sinfo->gso_type & SKB_GSO_TCP_ECN)
                                gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
                } else
index 2d7c96d7e865957df251046a7ba5193e94a0c423..eb80243e22df27315f7b271aa71593e4ebe534e9 100644 (file)
@@ -152,6 +152,7 @@ enum {
        /* Device IDs */
        USB_DEVICE_ID_I6050 = 0x0186,
        USB_DEVICE_ID_I6050_2 = 0x0188,
+       USB_DEVICE_ID_I6250 = 0x0187,
 };
 
 
index 0d5081d77dc045f01849676a54d1b13e39ae0b72..d3365ac85dde4639e455b35b65c805cdec1aa552 100644 (file)
@@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface,
        switch (id->idProduct) {
        case USB_DEVICE_ID_I6050:
        case USB_DEVICE_ID_I6050_2:
+       case USB_DEVICE_ID_I6250:
                i2400mu->i6050 = 1;
                break;
        default:
@@ -739,6 +740,7 @@ static
 struct usb_device_id i2400mu_id_table[] = {
        { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
        { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
+       { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
        { USB_DEVICE(0x8086, 0x0181) },
        { USB_DEVICE(0x8086, 0x1403) },
        { USB_DEVICE(0x8086, 0x1405) },
index ca6065b71b46fb463c914f61061304177f693d2c..e3e52913d83a49326e3319cd67e1a0275b302d39 100644 (file)
@@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
        int dma_type;
 
        if (edma)
-               dma_type = DMA_FROM_DEVICE;
-       else
                dma_type = DMA_BIDIRECTIONAL;
+       else
+               dma_type = DMA_FROM_DEVICE;
 
        qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP;
        spin_lock_bh(&sc->rx.rxbuflock);
index df4532e91b1a0da9627a7fc5916c2438a5829af1..f370476d5417d49b48540e49432c5f82b97cf53c 100644 (file)
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               unsigned long val,
                               struct cpufreq_freqs *freqs)
 {
-#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
        switch (val) {
        case CPUFREQ_PRECHANGE:
                if (freqs->new > freqs->old) {
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               "pre-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
-                       pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+                       pxa2xx_pcmcia_set_timing(skt);
                }
                break;
 
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
                               "post-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
-                       pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
+                       pxa2xx_pcmcia_set_timing(skt);
                }
                break;
        }
index 2afbeec8b7913f504a04beed44fc9ddee703c51b..84d3c43cf2bc83f92ea05c1a381d113f4f7b6375 100644 (file)
 struct ds278x_info;
 
 struct ds278x_battery_ops {
-       int     (*get_current)(struct ds278x_info *info, int *current_uA);
-       int     (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
-       int     (*get_capacity)(struct ds278x_info *info, int *capacity_uA);
-
+       int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
+       int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
+       int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
 };
 
 #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery)
@@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status)
        int current_uA;
        int capacity;
 
-       err = info->ops->get_current(info, &current_uA);
+       err = info->ops->get_battery_current(info, &current_uA);
        if (err)
                return err;
 
-       err = info->ops->get_capacity(info, &capacity);
+       err = info->ops->get_battery_capacity(info, &capacity);
        if (err)
                return err;
 
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
                break;
 
        case POWER_SUPPLY_PROP_CAPACITY:
-               ret = info->ops->get_capacity(info, &val->intval);
+               ret = info->ops->get_battery_capacity(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-               ret = info->ops->get_voltage(info, &val->intval);
+               ret = info->ops->get_battery_voltage(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_CURRENT_NOW:
-               ret = info->ops->get_current(info, &val->intval);
+               ret = info->ops->get_battery_current(info, &val->intval);
                break;
 
        case POWER_SUPPLY_PROP_TEMP:
@@ -307,14 +306,14 @@ enum ds278x_num_id {
 
 static struct ds278x_battery_ops ds278x_ops[] = {
        [DS2782] = {
-               .get_current  = ds2782_get_current,
-               .get_voltage  = ds2782_get_voltage,
-               .get_capacity = ds2782_get_capacity,
+               .get_battery_current  = ds2782_get_current,
+               .get_battery_voltage  = ds2782_get_voltage,
+               .get_battery_capacity = ds2782_get_capacity,
        },
        [DS2786] = {
-               .get_current  = ds2786_get_current,
-               .get_voltage  = ds2786_get_voltage,
-               .get_capacity = ds2786_get_capacity,
+               .get_battery_current  = ds2786_get_current,
+               .get_battery_voltage  = ds2786_get_voltage,
+               .get_battery_capacity = ds2786_get_capacity,
        }
 };
 
index 7b14a67bdca2df021e99b9615657da7d5bd3b361..11790990277a3dbd9a96ca2ba398f505480f5e19 100644 (file)
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg,
 {
        struct ab3100_regulator *abreg = reg->reg_data;
 
-       if (selector > abreg->voltages_len)
+       if (selector >= abreg->voltages_len)
                return -EINVAL;
        return abreg->typ_voltages[selector];
 }
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg)
        regval &= 0xE0;
        regval >>= 5;
 
-       if (regval > abreg->voltages_len) {
+       if (regval >= abreg->voltages_len) {
                dev_err(&reg->dev,
                        "regulator register %02x contains an illegal voltage setting\n",
                        abreg->regreg);
index 14b4576281c5e7e24fb5652d7383a6bb21df7dfe..8152d65220f5f342a7f312b326aff9c4047620c3 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/mfd/tps6507x.h>
@@ -101,9 +102,12 @@ struct tps_info {
        unsigned max_uV;
        u8 table_len;
        const u16 *table;
+
+       /* Does DCDC high or the low register defines output voltage? */
+       bool defdcdc_default;
 };
 
-static const struct tps_info tps6507x_pmic_regs[] = {
+static struct tps_info tps6507x_pmic_regs[] = {
        {
                .name = "VDCDC1",
                .min_uV = 725000,
@@ -145,7 +149,7 @@ struct tps6507x_pmic {
        struct regulator_desc desc[TPS6507X_NUM_REGULATOR];
        struct tps6507x_dev *mfd;
        struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR];
-       const struct tps_info *info[TPS6507X_NUM_REGULATOR];
+       struct tps_info *info[TPS6507X_NUM_REGULATOR];
        struct mutex io_lock;
 };
 static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg)
@@ -341,10 +345,16 @@ static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev)
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev,
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
 {
        struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent);
        static int desc_id;
-       const struct tps_info *info = &tps6507x_pmic_regs[0];
+       struct tps_info *info = &tps6507x_pmic_regs[0];
        struct regulator_init_data *init_data;
        struct regulator_dev *rdev;
        struct tps6507x_pmic *tps;
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
        for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
                /* Register the regulators */
                tps->info[i] = info;
+               if (init_data->driver_data) {
+                       struct tps6507x_reg_platform_data *data =
+                                                       init_data->driver_data;
+                       tps->info[i]->defdcdc_default = data->defdcdc_default;
+               }
+
                tps->desc[i].name = info->name;
                tps->desc[i].id = desc_id++;
                tps->desc[i].n_voltages = num_voltages[i];
index 723cd1fb4867191078e3488ce3ff8267c8ec8f63..0e6ed7db93643436eadaeee5fbc48b7fd8ed599f 100644 (file)
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
        if (ret != 0) {
                dev_err(wm8350->dev, "Failed to register regulator %d: %d\n",
                        reg, ret);
-               platform_device_del(pdev);
+               platform_device_put(pdev);
                wm8350->pmic.pdev[reg] = NULL;
        }
 
index 9718aaaa821534c876240e1f254166f800bbbd7f..600b890a3c150f926be508633c49436cfae1b113 100644 (file)
@@ -168,7 +168,7 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
-       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL,
                (data | RX8581_CTRL_STOP));
        if (err < 0) {
                dev_err(&client->dev, "Unable to write control register\n");
@@ -182,6 +182,20 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
+       /* get VLF and clear it */
+       data = i2c_smbus_read_byte_data(client, RX8581_REG_FLAG);
+       if (data < 0) {
+               dev_err(&client->dev, "Unable to read flag register\n");
+               return -EIO;
+       }
+
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
+               (data & ~(RX8581_FLAG_VLF)));
+       if (err != 0) {
+               dev_err(&client->dev, "Unable to write flag register\n");
+               return -EIO;
+       }
+
        /* Restart the clock */
        data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL);
        if (data < 0) {
@@ -189,8 +203,8 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
                return -EIO;
        }
 
-       err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG,
-               (data | ~(RX8581_CTRL_STOP)));
+       err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL,
+               (data & ~(RX8581_CTRL_STOP)));
        if (err != 0) {
                dev_err(&client->dev, "Unable to write control register\n");
                return -EIO;
index e3dbeda97179bccc814e424c705a53255ef61f54..fd068bc1bd0a11e5f7f698efa4d84f52a4df3073 100644 (file)
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
        if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
                return ZFCP_ERP_FAILED;
 
+       if (mempool_resize(act->adapter->pool.status_read_data,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
+       if (mempool_resize(act->adapter->pool.status_read_req,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
        atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
        if (zfcp_status_read_refill(act->adapter))
                return ZFCP_ERP_FAILED;
index 9ac6a6e4a6047531d142b86256c8266e5c411dfc..71663fb77310b5a51a9331d7210b978a444dd707 100644 (file)
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
 
        adapter->hydra_version = bottom->adapter_type;
        adapter->timer_ticks = bottom->timer_interval;
-       adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16);
+       adapter->stat_read_buf_num = max(bottom->status_read_buf_num,
+                                        (u16)FSF_STATUS_READS_RECOM);
 
        if (fc_host_permanent_port_name(shost) == -1)
                fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio,
        zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype,
                           req->qtcb, sizeof(struct fsf_qtcb));
 
-       if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) {
-               zfcp_fsf_req_free(req);
-               return ERR_PTR(-EIO);
-       }
-
        return req;
 }
 
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
        }
 
        /* use single, unchained SBAL if it can hold the request */
-       if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) {
+       if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) {
                zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req,
                                                sg_req, sg_resp);
                return 0;
index 28117e130e2c0848ddb64d3ac5c41c725fcd9bc9..6fa5e0453176e033b6c7367a07908cc15d035f8f 100644 (file)
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
        struct zfcp_qdio_queue *req_q = &qdio->req_q;
 
        spin_lock_bh(&qdio->req_q_lock);
-       if (atomic_read(&req_q->count))
+       if (atomic_read(&req_q->count) ||
+           !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
                return 1;
        spin_unlock_bh(&qdio->req_q_lock);
        return 0;
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
        spin_unlock_bh(&qdio->req_q_lock);
        ret = wait_event_interruptible_timeout(qdio->req_q_wq,
                               zfcp_qdio_sbal_check(qdio), 5 * HZ);
+
+       if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
+               return -EIO;
+
        if (ret > 0)
                return 0;
+
        if (!ret) {
                atomic_inc(&qdio->req_q_full);
                /* assume hanging outbound queue, try queue recovery */
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio)
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status);
        spin_unlock_bh(&qdio->req_q_lock);
 
+       wake_up(&qdio->req_q_wq);
+
        qdio_shutdown(qdio->adapter->ccw_device,
                      QDIO_FLAG_CLEANUP_USING_CLEAR);
 
index a864ccc0a342867d387c949e3e11b44ff071f95f..989b9a8ba72d7ab2cea41ad34797aa738f799129 100644 (file)
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto reg_crq_failed;
        }
 
+       queue->cur = 0;
+       spin_lock_init(&queue->lock);
+
+       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
+                    (unsigned long)hostdata);
+
        if (request_irq(vdev->irq,
                        rpavscsi_handle_event,
                        0, "ibmvscsi", (void *)hostdata) != 0) {
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto req_irq_failed;
        }
 
-       queue->cur = 0;
-       spin_lock_init(&queue->lock);
-
-       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
-                    (unsigned long)hostdata);
-
        return retrc;
 
       req_irq_failed:
+       tasklet_kill(&hostdata->srp_task);
        do {
                rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
        } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
index 82ea4a8226b0242040716134ab3f3efc19bdf254..f820cffb7f00e7f81fb00566711ee74efbbeab66 100644 (file)
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
 }
 
 /**
- * ipr_format_resource_path - Format the resource path for printing.
+ * ipr_format_res_path - Format the resource path for printing.
  * @res_path:  resource path
  * @buf:       buffer
  *
  * Return value:
  *     pointer to buffer
  **/
-static char *ipr_format_resource_path(u8 *res_path, char *buffer)
+static char *ipr_format_res_path(u8 *res_path, char *buffer, int len)
 {
        int i;
+       char *p = buffer;
 
-       sprintf(buffer, "%02X", res_path[0]);
-       for (i=1; res_path[i] != 0xff; i++)
-               sprintf(buffer, "%s-%02X", buffer, res_path[i]);
+       res_path[0] = '\0';
+       p += snprintf(p, buffer + len - p, "%02X", res_path[0]);
+       for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++)
+               p += snprintf(p, buffer + len - p, "-%02X", res_path[i]);
 
        return buffer;
 }
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
 
                if (res->sdev && new_path)
                        sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
        } else {
                res->flags = cfgtew->u.cfgte->flags;
                if (res->flags & IPR_IS_IOA_RESOURCE)
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err_separator;
 
                ipr_err("Device %d : %s", i + 1,
-                        ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(dev_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_log_ext_vpd(&dev_entry->vpd);
 
                ipr_err("-----New Device Information-----\n");
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n",
                                     path_active_desc[i].desc, path_state_desc[j].desc,
-                                    ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+                                    ipr_format_res_path(fabric->res_path, buffer,
+                                                        sizeof(buffer)));
                        return;
                }
        }
 
        ipr_err("Path state=%02X Resource Path=%s\n", path_state,
-               ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+               ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer)));
 }
 
 static const struct {
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n",
                                     path_status_desc[j].desc, path_type_desc[i].desc,
-                                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                                    ipr_format_res_path(cfg->res_path, buffer,
+                                                        sizeof(buffer)),
                                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
                        return;
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
        }
        ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s "
                     "WWN=%08X%08X\n", cfg->type_status,
-                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                    ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)),
                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
 }
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
 
        ipr_err("RAID %s Array Configuration: %s\n",
                error->protection_level,
-               ipr_format_resource_path(&error->last_res_path[0], &buffer[0]));
+               ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer)));
 
        ipr_err_separator;
 
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err("Array Member %d:\n", i);
                ipr_log_ext_vpd(&array_entry->vpd);
                ipr_err("Current Location: %s",
-                        ipr_format_resource_path(&array_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_err("Expected Location: %s",
-                        ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->expected_res_path,
+                                            buffer, sizeof(buffer)));
 
                ipr_err_separator;
        }
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = {
 };
 
 /**
- * ipr_show_resource_path - Show the resource path for this device.
+ * ipr_show_resource_path - Show the resource path or the resource address for
+ *                         this device.
  * @dev:       device struct
  * @buf:       buffer
  *
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut
 
        spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
        res = (struct ipr_resource_entry *)sdev->hostdata;
-       if (res)
+       if (res && ioa_cfg->sis64)
                len = snprintf(buf, PAGE_SIZE, "%s\n",
-                              ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                              ipr_format_res_path(res->res_path, buffer,
+                                                  sizeof(buffer)));
+       else if (res)
+               len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no,
+                              res->bus, res->target, res->lun);
+
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
        return len;
 }
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev)
                        scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
                if (ioa_cfg->sis64)
                        sdev_printk(KERN_INFO, sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
                return 0;
        }
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
index 9ecd2259eb398dcc0f1e88746df8555dca09e80d..b965f3587c9d8afba54420e461464cf19a524356 100644 (file)
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header {
        if (ipr_is_device(hostrcb)) {                                   \
                if ((hostrcb)->ioa_cfg->sis64) {                        \
                        printk(KERN_ERR IPR_NAME ": %s: " fmt,          \
-                               ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \
-                                       &hostrcb->rp_buffer[0]),        \
+                               ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \
+                                       hostrcb->rp_buffer,             \
+                                       sizeof(hostrcb->rp_buffer)),    \
                                __VA_ARGS__);                           \
                } else {                                                \
                        ipr_ra_err((hostrcb)->ioa_cfg,                  \
index eed3c2d8dd1ce010e13e143213b292e1f0ec1569..a182def7007d2c678b1712b9f7ca78fdc80042ca 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/io.h>
+#include <asm/ioctls.h>
 
 #include <asm/mach/serial_at91.h>
 #include <mach/board.h>
index 61d75507d5d0e8f385019f0917ef8f4f6b726ecb..162c95a088ed5efc2a747a1d739a44e30656de01 100644 (file)
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = {
        { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */
        { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */
        { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */
+       { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */
 
        /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
 
index 83e7bbbe97fa7421c3365f3c749d3c2622817fbb..70cccc75a362013267de1744c7d4b196d78a3a95 100644 (file)
@@ -1982,6 +1982,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
                    (portstatus & USB_PORT_STAT_ENABLE)) {
                        if (hub_is_wusb(hub))
                                udev->speed = USB_SPEED_WIRELESS;
+                       else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
+                               udev->speed = USB_SPEED_SUPER;
                        else if (portstatus & USB_PORT_STAT_HIGH_SPEED)
                                udev->speed = USB_SPEED_HIGH;
                        else if (portstatus & USB_PORT_STAT_LOW_SPEED)
index f22d03df8b1724fd8fdbc1b49667e9fa4936c478..db99c084df92edf8df98191f419cba6bbf4eb473 100644 (file)
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* Philips PSC805 audio device */
        { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
 
+       /* Artisman Watchdog Dongle */
+       { USB_DEVICE(0x04b4, 0x0526), .driver_info =
+                       USB_QUIRK_CONFIG_INTF_STRINGS },
+
        /* Roland SC-8820 */
        { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
 
@@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
        { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
 
+       /* Broadcom BCM92035DGROM BT dongle */
+       { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
+
        /* Action Semiconductor flash disk */
        { USB_DEVICE(0x10d6, 0x2200), .driver_info =
                        USB_QUIRK_STRING_FETCH_255 },
index 85b0d8921eae4fbfe14c86c1ac7bf1f9ffae3705..980762453a9c293d6bdda38bdc54317c55a3433c 100644 (file)
@@ -2561,7 +2561,7 @@ static void pxa_udc_shutdown(struct platform_device *_dev)
                udc_disable(udc);
 }
 
-#ifdef CONFIG_CPU_PXA27x
+#ifdef CONFIG_PXA27x
 extern void pxa27x_clear_otgph(void);
 #else
 #define pxa27x_clear_otgph()   do {} while (0)
index e724a051bfdd11bcd520ae90ff0b0c448883d13f..ea2b3c7ebee50d6d93e498ea2c37a995e2a5ed3e 100644 (file)
@@ -735,6 +735,10 @@ static void s3c2410_udc_handle_ep0_idle(struct s3c2410_udc *dev,
        else
                dev->ep0state = EP0_OUT_DATA_PHASE;
 
+       if (!dev->driver)
+               return;
+
+       /* deliver the request to the gadget driver */
        ret = dev->driver->setup(&dev->gadget, crq);
        if (ret < 0) {
                if (dev->req_config) {
index a18debdd79b8cec346f7f625baf66a47800affd1..418163894775e36ff129aa96ba107f7e6145ca20 100644 (file)
@@ -203,7 +203,7 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci *ohci)
        __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR);
 }
 
-#ifdef CONFIG_CPU_PXA27x
+#ifdef CONFIG_PXA27x
 extern void pxa27x_clear_otgph(void);
 #else
 #define pxa27x_clear_otgph()   do {} while (0)
index fd9e03afd91c1664344be73ed0000705fd31c6cc..2eb658d2639477bccb3051804fb6364dc79e29c0 100644 (file)
@@ -835,6 +835,27 @@ fail:
        return 0;
 }
 
+void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
+               struct usb_device *udev)
+{
+       struct xhci_virt_device *virt_dev;
+       struct xhci_ep_ctx      *ep0_ctx;
+       struct xhci_ring        *ep_ring;
+
+       virt_dev = xhci->devs[udev->slot_id];
+       ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0);
+       ep_ring = virt_dev->eps[0].ring;
+       /*
+        * FIXME we don't keep track of the dequeue pointer very well after a
+        * Set TR dequeue pointer, so we're setting the dequeue pointer of the
+        * host to our enqueue pointer.  This should only be called after a
+        * configured device has reset, so all control transfers should have
+        * been completed or cancelled before the reset.
+        */
+       ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue);
+       ep0_ctx->deq |= ep_ring->cycle_state;
+}
+
 /* Setup an xHCI virtual device for a Set Address command */
 int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev)
 {
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
        return EP_INTERVAL(interval);
 }
 
-/* The "Mult" field in the endpoint context is only set for SuperSpeed devices.
+/* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps.
  * High speed endpoint descriptors can define "the number of additional
  * transaction opportunities per microframe", but that goes in the Max Burst
  * endpoint context field.
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
 static inline u32 xhci_get_endpoint_mult(struct usb_device *udev,
                struct usb_host_endpoint *ep)
 {
-       if (udev->speed != USB_SPEED_SUPER)
+       if (udev->speed != USB_SPEED_SUPER ||
+                       !usb_endpoint_xfer_isoc(&ep->desc))
                return 0;
        return ep->ss_ep_comp.bmAttributes;
 }
index 94e6934edb09c0e3a06dd696a96c3d825719ede6..bfc99a93945506bc745d830cf0bd4efbfcc4a92e 100644 (file)
@@ -2380,16 +2380,19 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2,
                u32 field3, u32 field4, bool command_must_succeed)
 {
        int reserved_trbs = xhci->cmd_ring_reserved_trbs;
+       int ret;
+
        if (!command_must_succeed)
                reserved_trbs++;
 
-       if (!room_on_ring(xhci, xhci->cmd_ring, reserved_trbs)) {
-               if (!in_interrupt())
-                       xhci_err(xhci, "ERR: No room for command on command ring\n");
+       ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING,
+                       reserved_trbs, GFP_ATOMIC);
+       if (ret < 0) {
+               xhci_err(xhci, "ERR: No room for command on command ring\n");
                if (command_must_succeed)
                        xhci_err(xhci, "ERR: Reserved TRB counting for "
                                        "unfailable commands failed.\n");
-               return -ENOMEM;
+               return ret;
        }
        queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3,
                        field4 | xhci->cmd_ring->cycle_state);
index 27345cd04da0ccf99335064e2f37ad0950fb511f..3998f72cd0c4bbfb497517c81f48ca7ed6cafca0 100644 (file)
@@ -2134,6 +2134,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
        /* If this is a Set Address to an unconfigured device, setup ep 0 */
        if (!udev->config)
                xhci_setup_addressable_virt_dev(xhci, udev);
+       else
+               xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev);
        /* Otherwise, assume the core has the device configured how it wants */
        xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
        xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
index 8b4b7d39f79cafb927523e94d95a93f59dd1b9cf..6c7e3430ec935bee309fe74cec995592bfe1635b 100644 (file)
@@ -1292,6 +1292,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags);
 void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id);
 int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags);
 int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev);
+void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
+               struct usb_device *udev);
 unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc);
 unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc);
 unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index);
index 30d930386b651789f236809f04aa7cf67eab7dce..d25814c172b27403f67715d157d67dce553e0c67 100644 (file)
@@ -2436,7 +2436,8 @@ sisusb_open(struct inode *inode, struct file *file)
        }
 
        if (!sisusb->devinit) {
-               if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) {
+               if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH ||
+                   sisusb->sisusb_dev->speed == USB_SPEED_SUPER) {
                        if (sisusb_init_gfxdevice(sisusb, 0)) {
                                mutex_unlock(&sisusb->lock);
                                dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n");
@@ -3166,7 +3167,7 @@ static int sisusb_probe(struct usb_interface *intf,
 
        sisusb->present = 1;
 
-       if (dev->speed == USB_SPEED_HIGH) {
+       if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
                int initscreen = 1;
 #ifdef INCL_SISUSB_CON
                if (sisusb_first_vc > 0 &&
index 05c077f8f9acbd3c87fe99a945aa61878ca7471f..3c48e77a0aa2c6c73ec52fcb9832689bf557e5a0 100644 (file)
@@ -29,19 +29,6 @@ static void tusb_source_power(struct musb *musb, int is_on);
 #define TUSB_REV_MAJOR(reg_val)                ((reg_val >> 4) & 0xf)
 #define TUSB_REV_MINOR(reg_val)                (reg_val & 0xf)
 
-#ifdef CONFIG_PM
-/* REVISIT: These should be only needed if somebody implements off idle */
-void musb_platform_save_context(struct musb *musb,
-                       struct musb_context_registers *musb_context)
-{
-}
-
-void musb_platform_restore_context(struct musb *musb,
-                       struct musb_context_registers *musb_context)
-{
-}
-#endif
-
 /*
  * Checks the revision. We need to use the DMA register as 3.0 does not
  * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV.
index da7e334b0407a3ef0e210a56dcc02ea3f2a14db8..e298dc4baed771bdf88e6ea931ce74aab6c096cb 100644 (file)
@@ -691,6 +691,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
                .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
        { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
+       { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) },
        { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
@@ -737,6 +738,14 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
        { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) },
        { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
        { },                                    /* Optional parameter entry */
        { }                                     /* Terminating entry */
 };
index bbc159a1df45d330f926a6e003dadece3c1b4daa..d01946db8fac2fe5db6001fb2242fe8a551f6509 100644 (file)
 #define TELLDUS_VID                    0x1781  /* Vendor ID */
 #define TELLDUS_TELLSTICK_PID          0x0C30  /* RF control dongle 433 MHz using FT232RL */
 
+/*
+ * RT Systems programming cables for various ham radios
+ */
+#define RTSYSTEMS_VID                  0x2100  /* Vendor ID */
+#define RTSYSTEMS_SERIAL_VX7_PID       0x9e52  /* Serial converter for VX-7 Radios using FT232RL */
+
 /*
  * Bayer Ascensia Contour blood glucose meter USB-converter cable.
  * http://winglucofacts.com/cables/
 #define MJSG_SR_RADIO_PID      0x9379
 #define MJSG_XM_RADIO_PID      0x937A
 #define MJSG_HD_RADIO_PID      0x937C
+
+/*
+ * Xverve Signalyzer tools (http://www.signalyzer.com/)
+ */
+#define XVERVE_SIGNALYZER_ST_PID       0xBCA0
+#define XVERVE_SIGNALYZER_SLITE_PID    0xBCA1
+#define XVERVE_SIGNALYZER_SH2_PID      0xBCA2
+#define XVERVE_SIGNALYZER_SH4_PID      0xBCA4
+
index e280ad8e12f75898850eb03659d513ce1d1dee7b..5cd30e4345c62050aeacdfeddd4bca543a135fa1 100644 (file)
@@ -206,6 +206,7 @@ static void option_instat_callback(struct urb *urb);
 #define AMOI_PRODUCT_H01                       0x0800
 #define AMOI_PRODUCT_H01A                      0x7002
 #define AMOI_PRODUCT_H02                       0x0802
+#define AMOI_PRODUCT_SKYPEPHONE_S2             0x0407
 
 #define DELL_VENDOR_ID                         0x413C
 
@@ -302,6 +303,7 @@ static void option_instat_callback(struct urb *urb);
 #define QISDA_PRODUCT_H21_4512                 0x4512
 #define QISDA_PRODUCT_H21_4523                 0x4523
 #define QISDA_PRODUCT_H20_4515                 0x4515
+#define QISDA_PRODUCT_H20_4518                 0x4518
 #define QISDA_PRODUCT_H20_4519                 0x4519
 
 /* TLAYTECH PRODUCTS */
@@ -516,6 +518,7 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
        { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
+       { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) },
 
        { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) },             /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
        { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) },             /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
@@ -852,6 +855,7 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
+       { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) },
        { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) },
        { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) },
        { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */
index 93d72eb8cafc8deaa36a52e2632a6cee3429ce66..cde67cacb2c3e823773f49c922365473c9f4c82c 100644 (file)
@@ -51,6 +51,8 @@ static const struct usb_device_id id_table[] = {
        {USB_DEVICE(0x1f45, 0x0001)},   /* Unknown Gobi QDL device */
        {USB_DEVICE(0x413c, 0x8185)},   /* Dell Gobi 2000 QDL device (N0218, VU936) */
        {USB_DEVICE(0x413c, 0x8186)},   /* Dell Gobi 2000 Modem device (N0218, VU936) */
+       {USB_DEVICE(0x05c6, 0x9208)},   /* Generic Gobi 2000 QDL device */
+       {USB_DEVICE(0x05c6, 0x920b)},   /* Generic Gobi 2000 Modem device */
        {USB_DEVICE(0x05c6, 0x9224)},   /* Sony Gobi 2000 QDL device (N0279, VU730) */
        {USB_DEVICE(0x05c6, 0x9225)},   /* Sony Gobi 2000 Modem device (N0279, VU730) */
        {USB_DEVICE(0x05c6, 0x9244)},   /* Samsung Gobi 2000 QDL device (VL176) */
index ef0bdb08d7887b17c7a6a17bc933be7aa0680175..d47b56e9e8ce9dc22c423967f2ab73a4f0dd5db1 100644 (file)
@@ -245,6 +245,7 @@ static const struct usb_device_id id_table[] = {
        { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
        { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
        { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
+       { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */
        /* Sierra Wireless C597 */
        { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) },
        /* Sierra Wireless T598 */
index 44716427c51c9548562035ad81753616e5632158..64ec073e89de74bcc14a78b3e050efe55295f9b9 100644 (file)
@@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout)
 
        /* fill the common fields in the URB */
        us->current_urb->context = &urb_done;
-       us->current_urb->actual_length = 0;
-       us->current_urb->error_count = 0;
-       us->current_urb->status = 0;
+       us->current_urb->transfer_flags = 0;
 
        /* we assume that if transfer_buffer isn't us->iobuf then it
         * hasn't been mapped for DMA.  Yes, this is clunky, but it's
index 40f61320ce1665b156b04761b739b8c4bbc96862..34b2fc472fe8c917d08738b620aac63b49ea9914 100644 (file)
@@ -95,7 +95,7 @@ struct fb_bitfield rgb_bitfields[][4] =
        { { 8, 4, 0 },  { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
 };
 
-static struct fb_fix_screeninfo au1100fb_fix __initdata = {
+static struct fb_fix_screeninfo au1100fb_fix __devinitdata = {
        .id             = "AU1100 FB",
        .xpanstep       = 1,
        .ypanstep       = 1,
@@ -103,7 +103,7 @@ static struct fb_fix_screeninfo au1100fb_fix __initdata = {
        .accel          = FB_ACCEL_NONE,
 };
 
-static struct fb_var_screeninfo au1100fb_var __initdata = {
+static struct fb_var_screeninfo au1100fb_var __devinitdata = {
        .activate       = FB_ACTIVATE_NOW,
        .height         = -1,
        .width          = -1,
@@ -458,7 +458,7 @@ static struct fb_ops au1100fb_ops =
 
 /* AU1100 LCD controller device driver */
 
-static int __init au1100fb_drv_probe(struct platform_device *dev)
+static int __devinit au1100fb_drv_probe(struct platform_device *dev)
 {
        struct au1100fb_device *fbdev = NULL;
        struct resource *regs_res;
index 3a561df2e8a29d7b020913beef4a86fb705836a3..0c1afd13ddd3055be4c61abd56253edf38f7ac36 100644 (file)
@@ -388,6 +388,7 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                pseudo_val |= convert_bitfield(red, &var->red);
                pseudo_val |= convert_bitfield(green, &var->green);
                pseudo_val |= convert_bitfield(blue, &var->blue);
+               ret = 0;
                break;
        }
 
@@ -436,6 +437,8 @@ static void cyber2000fb_write_ramdac_ctrl(struct cfb_info *cfb)
        cyber2000fb_writeb(i | 4, 0x3cf, cfb);
        cyber2000fb_writeb(val, 0x3c6, cfb);
        cyber2000fb_writeb(i, 0x3cf, cfb);
+       /* prevent card lock-up observed on x86 with CyberPro 2000 */
+       cyber2000fb_readb(0x3cf, cfb);
 }
 
 static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw)
index 7d8c55d7fd28a42c5d73a7f9e5f226bd9362a799..ca3355e430bfd18ac5e55897fd4cab633d3772f8 100644 (file)
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16];
 static uint32_t gbe_cmap[256];
 static int gbe_turned_on; /* 0 turned off, 1 turned on */
 
-static char *mode_option __initdata = NULL;
+static char *mode_option __devinitdata = NULL;
 
 /* default CRT mode */
-static struct fb_var_screeninfo default_var_CRT __initdata = {
+static struct fb_var_screeninfo default_var_CRT __devinitdata = {
        /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
        .xres           = 640,
        .yres           = 480,
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __initdata = {
 };
 
 /* default LCD mode */
-static struct fb_var_screeninfo default_var_LCD __initdata = {
+static struct fb_var_screeninfo default_var_LCD __devinitdata = {
        /* 1600x1024, 8 bpp */
        .xres           = 1600,
        .yres           = 1024,
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __initdata = {
 
 /* default modedb mode */
 /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */
-static struct fb_videomode default_mode_CRT __initdata = {
+static struct fb_videomode default_mode_CRT __devinitdata = {
        .refresh        = 60,
        .xres           = 640,
        .yres           = 480,
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 /* 1600x1024 SGI flatpanel 1600sw */
-static struct fb_videomode default_mode_LCD __initdata = {
+static struct fb_videomode default_mode_LCD __devinitdata = {
        /* 1600x1024, 8 bpp */
        .xres           = 1600,
        .yres           = 1024,
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_videomode *default_mode __initdata = &default_mode_CRT;
-static struct fb_var_screeninfo *default_var __initdata = &default_var_CRT;
+static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT;
+static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT;
 
 static int flat_panel_enabled = 0;
 
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev)
  * Initialization
  */
 
-static int __init gbefb_setup(char *options)
+static int __devinit gbefb_setup(char *options)
 {
        char *this_opt;
 
index 0f361b6100d2b6dc671c1ff1297718e2e47735fc..0c69fa20251b681bfc1eaa03d886c615f11bc8de 100644 (file)
@@ -44,7 +44,7 @@ struct pmagbafb_par {
 };
 
 
-static struct fb_var_screeninfo pmagbafb_defined __initdata = {
+static struct fb_var_screeninfo pmagbafb_defined __devinitdata = {
        .xres           = 1024,
        .yres           = 864,
        .xres_virtual   = 1024,
@@ -68,7 +68,7 @@ static struct fb_var_screeninfo pmagbafb_defined __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_fix_screeninfo pmagbafb_fix __initdata = {
+static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = {
        .id             = "PMAG-BA",
        .smem_len       = (1024 * 1024),
        .type           = FB_TYPE_PACKED_PIXELS,
@@ -142,7 +142,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info)
 }
 
 
-static int __init pmagbafb_probe(struct device *dev)
+static int __devinit pmagbafb_probe(struct device *dev)
 {
        struct tc_dev *tdev = to_tc_dev(dev);
        resource_size_t start, len;
index 2de0806421b49b450c5a9c73b12aceec4719f3cd..22fcb9a3d5c0d0088d6f1d8294783f91989c7564 100644 (file)
@@ -45,7 +45,7 @@ struct pmagbbfb_par {
 };
 
 
-static struct fb_var_screeninfo pmagbbfb_defined __initdata = {
+static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = {
        .bits_per_pixel = 8,
        .red.length     = 8,
        .green.length   = 8,
@@ -58,7 +58,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __initdata = {
        .vmode          = FB_VMODE_NONINTERLACED,
 };
 
-static struct fb_fix_screeninfo pmagbbfb_fix __initdata = {
+static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = {
        .id             = "PMAGB-BA",
        .smem_len       = (2048 * 1024),
        .type           = FB_TYPE_PACKED_PIXELS,
@@ -148,7 +148,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info)
 /*
  * Set up screen parameters.
  */
-static void __init pmagbbfb_screen_setup(struct fb_info *info)
+static void __devinit pmagbbfb_screen_setup(struct fb_info *info)
 {
        struct pmagbbfb_par *par = info->par;
 
@@ -180,9 +180,9 @@ static void __init pmagbbfb_screen_setup(struct fb_info *info)
 /*
  * Determine oscillator configuration.
  */
-static void __init pmagbbfb_osc_setup(struct fb_info *info)
+static void __devinit pmagbbfb_osc_setup(struct fb_info *info)
 {
-       static unsigned int pmagbbfb_freqs[] __initdata = {
+       static unsigned int pmagbbfb_freqs[] __devinitdata = {
                130808, 119843, 104000, 92980, 74370, 72800,
                69197, 66000, 65000, 50350, 36000, 32000, 25175
        };
@@ -247,7 +247,7 @@ static void __init pmagbbfb_osc_setup(struct fb_info *info)
 };
 
 
-static int __init pmagbbfb_probe(struct device *dev)
+static int __devinit pmagbbfb_probe(struct device *dev)
 {
        struct tc_dev *tdev = to_tc_dev(dev);
        resource_size_t start, len;
index d61e3b28ce37a09caca5b5c40214b0e1ec109b22..36d961f342af5b95e4e79c42f4a82b5893a73823 100644 (file)
@@ -146,7 +146,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
                while (rdir->head < rdir->tail) {
                        p9stat_init(&st);
                        err = p9stat_read(rdir->buf + rdir->head,
-                                               buflen - rdir->head, &st,
+                                               rdir->tail - rdir->head, &st,
                                                fid->clnt->proto_version);
                        if (err) {
                                P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err);
index 04b8280582a94d2002cffb291b43f7fe586e6ff3..bc87b9c1d27ea8e253f5a1b9b395a287ede4106e 100644 (file)
@@ -2,7 +2,7 @@ config CEPH_FS
         tristate "Ceph distributed file system (EXPERIMENTAL)"
        depends on INET && EXPERIMENTAL
        select LIBCRC32C
-       select CONFIG_CRYPTO_AES
+       select CRYPTO_AES
        help
          Choose Y or M here to include support for mounting the
          experimental Ceph distributed file system.  Ceph is an extremely
index 74144d6389f0af2181d0f1e22fb4ae67c9839ca5..b81be9a5648792c3e6988855a903fb65473fa9c9 100644 (file)
@@ -627,7 +627,7 @@ retry:
        if (fmode >= 0)
                __ceph_get_fmode(ci, fmode);
        spin_unlock(&inode->i_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        }
 
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        return delayed;
 }
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
        else if (flushsnaps)
                ceph_flush_snaps(ci);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        if (put)
                iput(inode);
 }
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
                iput(inode);
        } else if (complete_capsnap) {
                ceph_flush_snaps(ci);
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        }
        if (drop_capsnap)
                iput(inode);
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
        if (queue_invalidate)
                ceph_queue_invalidate(inode);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        if (check_caps == 1)
                ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY,
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                                         struct ceph_inode_info,
                                         i_flushing_item)->vfs_inode);
                mdsc->num_cap_flushing--;
-               wake_up(&mdsc->cap_flushing_wq);
+               wake_up_all(&mdsc->cap_flushing_wq);
                dout(" inode %p now !flushing\n", inode);
 
                if (ci->i_dirty_caps == 0) {
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                }
        }
        spin_unlock(&mdsc->cap_dirty_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
 
 out:
        spin_unlock(&inode->i_lock);
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry,
                memcpy(*p, dentry->d_name.name, dentry->d_name.len);
                *p += dentry->d_name.len;
                rel->dname_seq = cpu_to_le32(di->lease_seq);
+               __ceph_mdsc_drop_dentry_lease(dentry);
        }
        spin_unlock(&dentry->d_lock);
        return ret;
index f85719310db2f7aa48d15dee2b3b278e5e8375e0..f94ed3c7f6a5a862a3276b4b222231ab4c40e97f 100644 (file)
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
        spin_lock(&inode->i_lock);
        if ((filp->f_pos == 2 || fi->dentry) &&
            !ceph_test_opt(client, NOASYNCREADDIR) &&
+           ceph_snap(inode) != CEPH_SNAPDIR &&
            (ci->i_ceph_flags & CEPH_I_COMPLETE) &&
            __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) {
                err = __dcache_readdir(filp, dirent, filldir);
@@ -1013,18 +1014,22 @@ out_touch:
 
 /*
  * When a dentry is released, clear the dir I_COMPLETE if it was part
- * of the current dir gen.
+ * of the current dir gen or if this is in the snapshot namespace.
  */
 static void ceph_dentry_release(struct dentry *dentry)
 {
        struct ceph_dentry_info *di = ceph_dentry(dentry);
        struct inode *parent_inode = dentry->d_parent->d_inode;
+       u64 snapid = ceph_snap(parent_inode);
 
-       if (parent_inode) {
+       dout("dentry_release %p parent %p\n", dentry, parent_inode);
+
+       if (parent_inode && snapid != CEPH_SNAPDIR) {
                struct ceph_inode_info *ci = ceph_inode(parent_inode);
 
                spin_lock(&parent_inode->i_lock);
-               if (ci->i_shared_gen == di->lease_shared_gen) {
+               if (ci->i_shared_gen == di->lease_shared_gen ||
+                   snapid <= CEPH_MAXSNAP) {
                        dout(" clearing %p complete (d_release)\n",
                             parent_inode);
                        ci->i_ceph_flags &= ~CEPH_I_COMPLETE;
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = {
 
 struct dentry_operations ceph_snapdir_dentry_ops = {
        .d_revalidate = ceph_snapdir_d_revalidate,
+       .d_release = ceph_dentry_release,
 };
 
 struct dentry_operations ceph_snap_dentry_ops = {
+       .d_release = ceph_dentry_release,
 };
index 6251a1574b9473b7e267c987cd6f9613e49eb57f..7c08698fad3ef6a3aa4502f7ff1b830cde33146f 100644 (file)
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file)
        kmem_cache_free(ceph_file_cachep, cf);
 
        /* wake up anyone waiting for caps on this inode */
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
index 8f9b9fe8ef9f4a84056c16289650d482a8c0c8ff..389f9dbd9949557add69369e6fc4ba68e2c84e69 100644 (file)
@@ -1199,8 +1199,10 @@ retry_lookup:
                                goto out;
                        }
                        err = ceph_init_dentry(dn);
-                       if (err < 0)
+                       if (err < 0) {
+                               dput(dn);
                                goto out;
+                       }
                } else if (dn->d_inode &&
                           (ceph_ino(dn->d_inode) != vino.ino ||
                            ceph_snap(dn->d_inode) != vino.snap)) {
@@ -1499,7 +1501,7 @@ retry:
        if (wrbuffer_refs == 0)
                ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 }
 
 
index 416c08d315db52a409e85cc094588d3b5bfceed5..dd440bd438a930a5dbd30cfa5e6ea63ae24f5947 100644 (file)
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
 
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        if (arg) {
                spin_lock(&inode->i_lock);
                ci->i_wanted_max_size = 0;
@@ -1564,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc,
        if (req->r_callback)
                req->r_callback(mdsc, req);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 }
 
 /*
@@ -1932,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
        if (head->safe) {
                req->r_got_safe = true;
                __unregister_request(mdsc, req);
-               complete(&req->r_safe_completion);
+               complete_all(&req->r_safe_completion);
 
                if (req->r_got_unsafe) {
                        /*
@@ -1947,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 
                        /* last unsafe request during umount? */
                        if (mdsc->stopping && !__get_oldest_req(mdsc))
-                               complete(&mdsc->safe_umount_waiters);
+                               complete_all(&mdsc->safe_umount_waiters);
                        mutex_unlock(&mdsc->mutex);
                        goto out;
                }
@@ -2126,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session,
                        pr_info("mds%d reconnect denied\n", session->s_mds);
                remove_session_caps(session);
                wake = 1; /* for good measure */
-               complete(&mdsc->session_close_waiters);
+               complete_all(&mdsc->session_close_waiters);
                kick_requests(mdsc, mds);
                break;
 
index cc115eafae11e23702cc38b7b015f8cf1d7c597c..54fe01c50706a935da2a9611677320bebae8b967 100644 (file)
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc,
 
 out:
        mutex_unlock(&monc->mutex);
-       wake_up(&client->auth_wq);
+       wake_up_all(&client->auth_wq);
 }
 
 /*
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc,
        }
        mutex_unlock(&monc->mutex);
        if (req) {
-               complete(&req->completion);
+               complete_all(&req->completion);
                put_generic_request(req);
        }
        return;
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
                                     monc->m_auth->front_max);
        if (ret < 0) {
                monc->client->auth_err = ret;
-               wake_up(&monc->client->auth_wq);
+               wake_up_all(&monc->client->auth_wq);
        } else if (ret > 0) {
                __send_prepared_auth_request(monc, ret);
        } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) {
index 92b7251a53f1415275ba8fd0a2d09f3b0cac6010..e38522347898046fe778df23bdc467c5d4248363 100644 (file)
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
        if (req->r_callback)
                req->r_callback(req, msg);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 
        if (flags & CEPH_OSD_FLAG_ONDISK) {
                if (req->r_safe_callback)
                        req->r_safe_callback(req, msg);
-               complete(&req->r_safe_completion);  /* fsync waiter */
+               complete_all(&req->r_safe_completion);  /* fsync waiter */
        }
 
 done:
@@ -1083,7 +1083,7 @@ done:
        if (newmap)
                kick_requests(osdc, NULL);
        up_read(&osdc->map_sem);
-       wake_up(&osdc->client->auth_wq);
+       wake_up_all(&osdc->client->auth_wq);
        return;
 
 bad:
index 277f8b33957757ef506f6ac18816699b6b8156da..416d46adbf87208544a1813ddfdadbabf4beb511 100644 (file)
@@ -831,12 +831,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                /* remove any? */
                while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping,
                                                node)->pgid, pgid) <= 0) {
-                       struct rb_node *cur = rbp;
+                       struct ceph_pg_mapping *cur =
+                               rb_entry(rbp, struct ceph_pg_mapping, node);
+                       
                        rbp = rb_next(rbp);
-                       dout(" removed pg_temp %llx\n",
-                            *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                              node)->pgid);
-                       rb_erase(cur, &map->pg_temp);
+                       dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+                       rb_erase(&cur->node, &map->pg_temp);
+                       kfree(cur);
                }
 
                if (pglen) {
@@ -852,19 +853,22 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                        for (j = 0; j < pglen; j++)
                                pg->osds[j] = ceph_decode_32(p);
                        err = __insert_pg_mapping(pg, &map->pg_temp);
-                       if (err)
+                       if (err) {
+                               kfree(pg);
                                goto bad;
+                       }
                        dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid,
                             pglen);
                }
        }
        while (rbp) {
-               struct rb_node *cur = rbp;
+               struct ceph_pg_mapping *cur =
+                       rb_entry(rbp, struct ceph_pg_mapping, node);
+
                rbp = rb_next(rbp);
-               dout(" removed pg_temp %llx\n",
-                    *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                      node)->pgid);
-               rb_erase(cur, &map->pg_temp);
+               dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+               rb_erase(&cur->node, &map->pg_temp);
+               kfree(cur);
        }
 
        /* ignore the rest */
index 49315cbf742d7ab22876b69349b6441723d850b7..853a968e82d74731b0c93083b238bca1ef5c96a1 100644 (file)
@@ -227,7 +227,7 @@ failed_put_cred:
        return ret;
 }
 
-void __exit cifs_exit_dns_resolver(void)
+void cifs_exit_dns_resolver(void)
 {
        key_revoke(dns_resolver_cache->thread_keyring);
        unregister_key_type(&key_type_dns_resolver);
index 26b9eaa9f5ee5898ae4241412e4127512fc95ec4..5d7f291df162731bb58abc124242211a88c0ad37 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifdef __KERNEL__
 extern int __init cifs_init_dns_resolver(void);
-extern void __exit cifs_exit_dns_resolver(void);
+extern void cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
 #endif /* KERNEL */
 
index 2d8dbce9d485e4a453903eb1f93473c5942155cc..46c4dd8dfcc3749acc04a03377c6740e280c519c 100644 (file)
@@ -31,9 +31,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux;
 
 static struct hlist_head *ecryptfs_daemon_hash;
 struct mutex ecryptfs_daemon_hash_mux;
-static int ecryptfs_hash_buckets;
+static int ecryptfs_hash_bits;
 #define ecryptfs_uid_hash(uid) \
-        hash_long((unsigned long)uid, ecryptfs_hash_buckets)
+        hash_long((unsigned long)uid, ecryptfs_hash_bits)
 
 static u32 ecryptfs_msg_counter;
 static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -486,18 +486,19 @@ int ecryptfs_init_messaging(void)
        }
        mutex_init(&ecryptfs_daemon_hash_mux);
        mutex_lock(&ecryptfs_daemon_hash_mux);
-       ecryptfs_hash_buckets = 1;
-       while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
-               ecryptfs_hash_buckets++;
+       ecryptfs_hash_bits = 1;
+       while (ecryptfs_number_of_users >> ecryptfs_hash_bits)
+               ecryptfs_hash_bits++;
        ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head)
-                                       * ecryptfs_hash_buckets), GFP_KERNEL);
+                                       * (1 << ecryptfs_hash_bits)),
+                                      GFP_KERNEL);
        if (!ecryptfs_daemon_hash) {
                rc = -ENOMEM;
                printk(KERN_ERR "%s: Failed to allocate memory\n", __func__);
                mutex_unlock(&ecryptfs_daemon_hash_mux);
                goto out;
        }
-       for (i = 0; i < ecryptfs_hash_buckets; i++)
+       for (i = 0; i < (1 << ecryptfs_hash_bits); i++)
                INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]);
        mutex_unlock(&ecryptfs_daemon_hash_mux);
        ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
@@ -554,7 +555,7 @@ void ecryptfs_release_messaging(void)
                int i;
 
                mutex_lock(&ecryptfs_daemon_hash_mux);
-               for (i = 0; i < ecryptfs_hash_buckets; i++) {
+               for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
                        int rc;
 
                        hlist_for_each_entry(daemon, elem,
index 26ca3361a8bcc3525758ed00c6186fb62494a6e3..6b48d7c268b24b65fae281e606fa32080490cf78 100644 (file)
@@ -1231,6 +1231,25 @@ static int do_filldir_main(struct gfs2_inode *dip, u64 *offset,
        return 0;
 }
 
+static void *gfs2_alloc_sort_buffer(unsigned size)
+{
+       void *ptr = NULL;
+
+       if (size < KMALLOC_MAX_SIZE)
+               ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN);
+       if (!ptr)
+               ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL);
+       return ptr;
+}
+
+static void gfs2_free_sort_buffer(void *ptr)
+{
+       if (is_vmalloc_addr(ptr))
+               vfree(ptr);
+       else
+               kfree(ptr);
+}
+
 static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                              filldir_t filldir, int *copied, unsigned *depth,
                              u64 leaf_no)
@@ -1271,7 +1290,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
         * 99 is the maximum number of entries that can fit in a single
         * leaf block.
         */
-       larr = vmalloc((leaves + entries + 99) * sizeof(void *));
+       larr = gfs2_alloc_sort_buffer((leaves + entries + 99) * sizeof(void *));
        if (!larr)
                goto out;
        darr = (const struct gfs2_dirent **)(larr + leaves);
@@ -1282,7 +1301,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        do {
                error = get_leaf(ip, lfn, &bh);
                if (error)
-                       goto out_kfree;
+                       goto out_free;
                lf = (struct gfs2_leaf *)bh->b_data;
                lfn = be64_to_cpu(lf->lf_next);
                if (lf->lf_entries) {
@@ -1291,7 +1310,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                                gfs2_dirent_gather, NULL, &g);
                        error = PTR_ERR(dent);
                        if (IS_ERR(dent))
-                               goto out_kfree;
+                               goto out_free;
                        if (entries2 != g.offset) {
                                fs_warn(sdp, "Number of entries corrupt in dir "
                                                "leaf %llu, entries2 (%u) != "
@@ -1300,7 +1319,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                        entries2, g.offset);
                                        
                                error = -EIO;
-                               goto out_kfree;
+                               goto out_free;
                        }
                        error = 0;
                        larr[leaf++] = bh;
@@ -1312,10 +1331,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        BUG_ON(entries2 != entries);
        error = do_filldir_main(ip, offset, opaque, filldir, darr,
                                entries, copied);
-out_kfree:
+out_free:
        for(i = 0; i < leaf; i++)
                brelse(larr[i]);
-       vfree(larr);
+       gfs2_free_sort_buffer(larr);
 out:
        return error;
 }
index 36a5e74f51b48ce00fdcb824874d7bcecdb7b8f0..f036153d9f50eaaa93bd8d8d6bc4da231a9f26d3 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pagemap.h>
 #include <linux/aio.h>
 #include <linux/gfp.h>
+#include <linux/swap.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -493,11 +494,19 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
  */
 static int nfs_release_page(struct page *page, gfp_t gfp)
 {
+       struct address_space *mapping = page->mapping;
+
        dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
 
        /* Only do I/O if gfp is a superset of GFP_KERNEL */
-       if ((gfp & GFP_KERNEL) == GFP_KERNEL)
-               nfs_wb_page(page->mapping->host, page);
+       if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) {
+               int how = FLUSH_SYNC;
+
+               /* Don't let kswapd deadlock waiting for OOM RPC calls */
+               if (current_is_kswapd())
+                       how = 0;
+               nfs_commit_inode(mapping->host, how);
+       }
        /* If PagePrivate() is set, then the page is not freeable */
        if (PagePrivate(page))
                return 0;
index 6bd19d843af7d21d0a6011589c46fb2d1586a955..df101d9f546ae294a4e370b77fa63c06bf5ab277 100644 (file)
@@ -105,7 +105,7 @@ static char nfs_root_name[256] __initdata = "";
 static __be32 servaddr __initdata = 0;
 
 /* Name of directory to mount */
-static char nfs_export_path[NFS_MAXPATHLEN] __initdata = { 0, };
+static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = { 0, };
 
 /* NFS-related data */
 static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */
index 91679e2631ee0ebaff79cd96fd6e3019ca5a49d8..9f81bdd91c559c9f082e8fb3067cfe444da8b6b6 100644 (file)
@@ -222,7 +222,7 @@ static void nfs_end_page_writeback(struct page *page)
                clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC);
 }
 
-static struct nfs_page *nfs_find_and_lock_request(struct page *page)
+static struct nfs_page *nfs_find_and_lock_request(struct page *page, bool nonblock)
 {
        struct inode *inode = page->mapping->host;
        struct nfs_page *req;
@@ -241,7 +241,10 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page)
                 *       request as dirty (in which case we don't care).
                 */
                spin_unlock(&inode->i_lock);
-               ret = nfs_wait_on_request(req);
+               if (!nonblock)
+                       ret = nfs_wait_on_request(req);
+               else
+                       ret = -EAGAIN;
                nfs_release_request(req);
                if (ret != 0)
                        return ERR_PTR(ret);
@@ -256,12 +259,12 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page)
  * May return an error if the user signalled nfs_wait_on_request().
  */
 static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
-                               struct page *page)
+                               struct page *page, bool nonblock)
 {
        struct nfs_page *req;
        int ret = 0;
 
-       req = nfs_find_and_lock_request(page);
+       req = nfs_find_and_lock_request(page, nonblock);
        if (!req)
                goto out;
        ret = PTR_ERR(req);
@@ -283,12 +286,20 @@ out:
 static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio)
 {
        struct inode *inode = page->mapping->host;
+       int ret;
 
        nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
        nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1);
 
        nfs_pageio_cond_complete(pgio, page->index);
-       return nfs_page_async_flush(pgio, page);
+       ret = nfs_page_async_flush(pgio, page,
+                       wbc->sync_mode == WB_SYNC_NONE ||
+                       wbc->nonblocking != 0);
+       if (ret == -EAGAIN) {
+               redirty_page_for_writepage(wbc, page);
+               ret = 0;
+       }
+       return ret;
 }
 
 /*
@@ -1379,7 +1390,7 @@ static const struct rpc_call_ops nfs_commit_ops = {
        .rpc_release = nfs_commit_release,
 };
 
-static int nfs_commit_inode(struct inode *inode, int how)
+int nfs_commit_inode(struct inode *inode, int how)
 {
        LIST_HEAD(head);
        int may_wait = how & FLUSH_SYNC;
@@ -1443,11 +1454,6 @@ out_mark_dirty:
        return ret;
 }
 #else
-static int nfs_commit_inode(struct inode *inode, int how)
-{
-       return 0;
-}
-
 static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc)
 {
        return 0;
@@ -1546,7 +1552,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
 
        nfs_fscache_release_page(page, GFP_KERNEL);
 
-       req = nfs_find_and_lock_request(page);
+       req = nfs_find_and_lock_request(page, false);
        ret = PTR_ERR(req);
        if (IS_ERR(req))
                goto out;
index 9b58d38bc911e27faccc7ed9ffb2c53f0885df4a..fff6572676aed7bd337b737da35221af8fa070bb 100644 (file)
@@ -176,7 +176,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
                if (tracer)
                        tpid = task_pid_nr_ns(tracer, ns);
        }
-       cred = get_cred((struct cred *) __task_cred(p));
+       cred = get_task_cred(p);
        seq_printf(m,
                "State:\t%s\n"
                "Tgid:\t%d\n"
index f71246bebfe4f1a83d766bee24dc7ec11ad5df09..a7ac78f8e67a4b458793d13f67f3263e58328b6b 100644 (file)
@@ -28,6 +28,7 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target,
        struct sysfs_dirent *target_sd = NULL;
        struct sysfs_dirent *sd = NULL;
        struct sysfs_addrm_cxt acxt;
+       enum kobj_ns_type ns_type;
        int error;
 
        BUG_ON(!name);
@@ -58,16 +59,29 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target,
        if (!sd)
                goto out_put;
 
-       if (sysfs_ns_type(parent_sd))
+       ns_type = sysfs_ns_type(parent_sd);
+       if (ns_type)
                sd->s_ns = target->ktype->namespace(target);
        sd->s_symlink.target_sd = target_sd;
        target_sd = NULL;       /* reference is now owned by the symlink */
 
        sysfs_addrm_start(&acxt, parent_sd);
-       if (warn)
-               error = sysfs_add_one(&acxt, sd);
-       else
-               error = __sysfs_add_one(&acxt, sd);
+       /* Symlinks must be between directories with the same ns_type */
+       if (!ns_type ||
+           (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) {
+               if (warn)
+                       error = sysfs_add_one(&acxt, sd);
+               else
+                       error = __sysfs_add_one(&acxt, sd);
+       } else {
+               error = -EINVAL;
+               WARN(1, KERN_WARNING
+                       "sysfs: symlink across ns_types %s/%s -> %s/%s\n",
+                       parent_sd->s_name,
+                       sd->s_name,
+                       sd->s_symlink.target_sd->s_parent->s_name,
+                       sd->s_symlink.target_sd->s_name);
+       }
        sysfs_addrm_finish(&acxt);
 
        if (error)
@@ -122,7 +136,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
 {
        const void *ns = NULL;
        spin_lock(&sysfs_assoc_lock);
-       if (targ->sd)
+       if (targ->sd && sysfs_ns_type(kobj->sd))
                ns = targ->sd->s_ns;
        spin_unlock(&sysfs_assoc_lock);
        sysfs_hash_and_remove(kobj->sd, ns, name);
index 1371cc997393a83224beb5ff8809e0a22e968b67..a6ea2ac40b9cdfe21be9a7a7a849b3fdbaa32db5 100644 (file)
@@ -67,7 +67,7 @@ extern u8 acpi_gbl_leave_wake_gpes_disabled;
 extern u8 acpi_gbl_use_default_register_widths;
 extern acpi_name acpi_gbl_trace_method_name;
 extern u32 acpi_gbl_trace_flags;
-extern u8 acpi_gbl_enable_aml_debug_object;
+extern u32 acpi_gbl_enable_aml_debug_object;
 extern u8 acpi_gbl_copy_dsdt_locally;
 extern u8 acpi_gbl_truncate_io_addresses;
 
index 4b38f905b7057d5eb015ee8c2b032f5b3cc8cf11..bf972f81e2a7233a1e269445101b4453c945b978 100644 (file)
  * Severity difinition for error_severity in struct cper_record_header
  * and section_severity in struct cper_section_descriptor
  */
-#define CPER_SER_RECOVERABLE                   0x0
-#define CPER_SER_FATAL                         0x1
-#define CPER_SER_CORRECTED                     0x2
-#define CPER_SER_INFORMATIONAL                 0x3
+#define CPER_SEV_RECOVERABLE                   0x0
+#define CPER_SEV_FATAL                         0x1
+#define CPER_SEV_CORRECTED                     0x2
+#define CPER_SEV_INFORMATIONAL                 0x3
 
 /*
  * Validation bits difinition for validation_bits in struct
index 75c0fa8813088c31148be71b7cbff77670b6e5d0..4d2c39573f3694cdeef07d83c6f141b4804a5f36 100644 (file)
@@ -153,6 +153,7 @@ struct cred {
 extern void __put_cred(struct cred *);
 extern void exit_creds(struct task_struct *);
 extern int copy_creds(struct task_struct *, unsigned long);
+extern const struct cred *get_task_cred(struct task_struct *);
 extern struct cred *cred_alloc_blank(void);
 extern struct cred *prepare_creds(void);
 extern struct cred *prepare_exec_creds(void);
@@ -273,33 +274,18 @@ static inline void put_cred(const struct cred *_cred)
  * @task: The task to query
  *
  * Access the objective credentials of a task.  The caller must hold the RCU
- * readlock.
+ * readlock or the task must be dead and unable to change its own credentials.
  *
- * The caller must make sure task doesn't go away, either by holding a ref on
- * task or by holding tasklist_lock to prevent it from being unlinked.
+ * The result of this function should not be passed directly to get_cred();
+ * rather get_task_cred() should be used instead.
  */
-#define __task_cred(task) \
-       ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held())))
-
-/**
- * get_task_cred - Get another task's objective credentials
- * @task: The task to query
- *
- * Get the objective credentials of a task, pinning them so that they can't go
- * away.  Accessing a task's credentials directly is not permitted.
- *
- * The caller must make sure task doesn't go away, either by holding a ref on
- * task or by holding tasklist_lock to prevent it from being unlinked.
- */
-#define get_task_cred(task)                            \
-({                                                     \
-       struct cred *__cred;                            \
-       rcu_read_lock();                                \
-       __cred = (struct cred *) __task_cred((task));   \
-       get_cred(__cred);                               \
-       rcu_read_unlock();                              \
-       __cred;                                         \
-})
+#define __task_cred(task)                                              \
+       ({                                                              \
+               const struct task_struct *__t = (task);                 \
+               rcu_dereference_check(__t->real_cred,                   \
+                                     rcu_read_lock_held() ||           \
+                                     task_is_dead(__t));               \
+       })
 
 /**
  * get_current_cred - Get the current task's subjective credentials
index 9ea047aca7955e7c654512b37648617d8c76c904..1ffaeffeff740f83e3e79b5d6e03b306410d6b3f 100644 (file)
@@ -67,6 +67,8 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
        }
 }
 
+extern void macvlan_common_setup(struct net_device *dev);
+
 extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
                                  struct nlattr *tb[], struct nlattr *data[],
                                  int (*receive)(struct sk_buff *skb),
index 77c2ae53431cccbdccf7932a84cd032e0b7e914c..bad4d121b16efa42fa161b2b525d1e73f42b8a71 100644 (file)
@@ -493,8 +493,15 @@ extern int nfs_wb_all(struct inode *inode);
 extern int nfs_wb_page(struct inode *inode, struct page* page);
 extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
 #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+extern int  nfs_commit_inode(struct inode *, int);
 extern struct nfs_write_data *nfs_commitdata_alloc(void);
 extern void nfs_commit_free(struct nfs_write_data *wdata);
+#else
+static inline int
+nfs_commit_inode(struct inode *inode, int how)
+{
+       return 0;
+}
 #endif
 
 static inline int
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h
new file mode 100644 (file)
index 0000000..4892f59
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * tps6507x.h  --  Voltage regulation for the Texas Instruments TPS6507X
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#ifndef REGULATOR_TPS6507X
+#define REGULATOR_TPS6507X
+
+/**
+ * tps6507x_reg_platform_data - platform data for tps6507x
+ * @defdcdc_default: Defines whether DCDC high or the low register controls
+ *     output voltage by default. Valid for DCDC2 and DCDC3 outputs only.
+ */
+struct tps6507x_reg_platform_data {
+       bool defdcdc_default;
+};
+
+#endif
index 747fcaedddb70d6cb0a49b43c0d2f2a6f23a693f..0478888c6899d3c59a1649d38dfdd58030f14918 100644 (file)
@@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!(
 
 #define task_is_traced(task)   ((task->state & __TASK_TRACED) != 0)
 #define task_is_stopped(task)  ((task->state & __TASK_STOPPED) != 0)
+#define task_is_dead(task)     ((task)->exit_state != 0)
 #define task_is_stopped_or_traced(task)        \
                        ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
 #define task_contributes_to_load(task) \
index ceac661cdfd5fdddb29314389f1e3e4bbca320ba..cfe2943690ff298cd3e938ecef2ddb8d49dfc229 100644 (file)
@@ -9,6 +9,7 @@ struct tcf_mirred {
        int                     tcfm_ifindex;
        int                     tcfm_ok_push;
        struct net_device       *tcfm_dev;
+       struct list_head        tcfm_list;
 };
 #define to_mirred(pc) \
        container_of(pc, struct tcf_mirred, common)
index a2d5504fbcc24abb44c44a158521617933df4367..60bc8b1e32e632eb2a51b318f1ae35486d01174f 100644 (file)
@@ -209,6 +209,31 @@ void exit_creds(struct task_struct *tsk)
        }
 }
 
+/**
+ * get_task_cred - Get another task's objective credentials
+ * @task: The task to query
+ *
+ * Get the objective credentials of a task, pinning them so that they can't go
+ * away.  Accessing a task's credentials directly is not permitted.
+ *
+ * The caller must also make sure task doesn't get deleted, either by holding a
+ * ref on task or by holding tasklist_lock to prevent it from being unlinked.
+ */
+const struct cred *get_task_cred(struct task_struct *task)
+{
+       const struct cred *cred;
+
+       rcu_read_lock();
+
+       do {
+               cred = __task_cred((task));
+               BUG_ON(!cred);
+       } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage));
+
+       rcu_read_unlock();
+       return cred;
+}
+
 /*
  * Allocate blank credentials, such that the credentials can be filled in at a
  * later date without risk of ENOMEM.
index 5d2d28197c827a840d98357c11c1e16b3dce92a2..6c562828c85c2d3d952c46be2de0b2cb0b3748a9 100644 (file)
@@ -787,7 +787,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
 
        /* Store the name of the last unloaded module for diagnostic purposes */
        strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
-       ddebug_remove_module(mod->name);
 
        free_module(mod);
        return 0;
@@ -1550,6 +1549,9 @@ static void free_module(struct module *mod)
        remove_sect_attrs(mod);
        mod_kobject_remove(mod);
 
+       /* Remove dynamic debug info */
+       ddebug_remove_module(mod->name);
+
        /* Arch-specific cleanup. */
        module_arch_cleanup(mod);
 
index 119b7ccdf39b8ee542d3f4d695bff3c9d5322987..bde42c6d3633f15cfe51b1eae8e3e56833e86955 100644 (file)
@@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                                return i ? : -EFAULT;
                        }
                        if (pages) {
-                               struct page *page = vm_normal_page(gate_vma, start, *pte);
+                               struct page *page;
+
+                               page = vm_normal_page(gate_vma, start, *pte);
+                               if (!page) {
+                                       if (!(gup_flags & FOLL_DUMP) &&
+                                            is_zero_pfn(pte_pfn(*pte)))
+                                               page = pte_page(*pte);
+                                       else {
+                                               pte_unmap(pte);
+                                               return i ? : -EFAULT;
+                                       }
+                               }
                                pages[i] = page;
-                               if (page)
-                                       get_page(page);
+                               get_page(page);
                        }
                        pte_unmap(pte);
                        if (vmas)
index 0ea10f849be862fff3219bc69ed4c5db0cbd9253..1f466e82ac339359ffa0587f0e1e1f324c0f5dd7 100644 (file)
@@ -1488,6 +1488,7 @@ static inline void net_timestamp_check(struct sk_buff *skb)
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
 {
        skb_orphan(skb);
+       nf_reset(skb);
 
        if (!(dev->flags & IFF_UP) ||
            (skb->len > (dev->mtu + dev->hard_header_len))) {
index 34432b4e96bb288931e8b6ebf2d8d78b5c6589c5..ce88293a34e263000dd93c0df5690885a857d797 100644 (file)
@@ -843,7 +843,9 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
        skb->network_header   += off;
        if (skb_mac_header_was_set(skb))
                skb->mac_header += off;
-       skb->csum_start       += nhead;
+       /* Only adjust this if it actually is csum_start rather than csum */
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
+               skb->csum_start += nhead;
        skb->cloned   = 0;
        skb->hdr_len  = 0;
        skb->nohdr    = 0;
@@ -930,7 +932,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
        copy_skb_header(n, skb);
 
        off                  = newheadroom - oldheadroom;
-       n->csum_start       += off;
+       if (n->ip_summed == CHECKSUM_PARTIAL)
+               n->csum_start += off;
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
        n->transport_header += off;
        n->network_header   += off;
index e1a698df5706a9bcff5889e4b734ad66d6dbfb55..784f34d11fdd2f5672949a8f31b302377e6e6fc7 100644 (file)
@@ -1760,7 +1760,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
 
        idev = ipv6_find_idev(dev);
        if (!idev)
-               return NULL;
+               return ERR_PTR(-ENOBUFS);
+
+       if (idev->cnf.disable_ipv6)
+               return ERR_PTR(-EACCES);
 
        /* Add default multicast route */
        addrconf_add_mroute(dev);
@@ -2129,8 +2132,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
        if (!dev)
                return -ENODEV;
 
-       if ((idev = addrconf_add_dev(dev)) == NULL)
-               return -ENOBUFS;
+       idev = addrconf_add_dev(dev);
+       if (IS_ERR(idev))
+               return PTR_ERR(idev);
 
        scope = ipv6_addr_scope(pfx);
 
@@ -2377,7 +2381,7 @@ static void addrconf_dev_config(struct net_device *dev)
        }
 
        idev = addrconf_add_dev(dev);
-       if (idev == NULL)
+       if (IS_ERR(idev))
                return;
 
        memset(&addr, 0, sizeof(struct in6_addr));
@@ -2468,7 +2472,7 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
        ASSERT_RTNL();
 
        idev = addrconf_add_dev(dev);
-       if (!idev) {
+       if (IS_ERR(idev)) {
                printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n");
                return;
        }
index c7000a6ca379a2e206be38292dd550a39b396a17..67ee34f57df7b02cb06e5d0d4e44944cc95feca7 100644 (file)
@@ -632,7 +632,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta)
        skb->dev = sta->sdata->dev;
        skb->protocol = eth_type_trans(skb, sta->sdata->dev);
        memset(skb->cb, 0, sizeof(skb->cb));
-       netif_rx(skb);
+       netif_rx_ni(skb);
 }
 
 static void sta_apply_parameters(struct ieee80211_local *local,
index c0b6863e3b87dbe91679638b83a169f099ab887f..1980b71c283ffbe9e50ac4f6326f91d41a40a6cb 100644 (file)
@@ -33,6 +33,7 @@
 static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1];
 static u32 mirred_idx_gen;
 static DEFINE_RWLOCK(mirred_lock);
+static LIST_HEAD(mirred_list);
 
 static struct tcf_hashinfo mirred_hash_info = {
        .htab   =       tcf_mirred_ht,
@@ -47,7 +48,9 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind)
                        m->tcf_bindcnt--;
                m->tcf_refcnt--;
                if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) {
-                       dev_put(m->tcfm_dev);
+                       list_del(&m->tcfm_list);
+                       if (m->tcfm_dev)
+                               dev_put(m->tcfm_dev);
                        tcf_hash_destroy(&m->common, &mirred_hash_info);
                        return 1;
                }
@@ -134,8 +137,10 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est,
                m->tcfm_ok_push = ok_push;
        }
        spin_unlock_bh(&m->tcf_lock);
-       if (ret == ACT_P_CREATED)
+       if (ret == ACT_P_CREATED) {
+               list_add(&m->tcfm_list, &mirred_list);
                tcf_hash_insert(pc, &mirred_hash_info);
+       }
 
        return ret;
 }
@@ -162,9 +167,14 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a,
        m->tcf_tm.lastuse = jiffies;
 
        dev = m->tcfm_dev;
+       if (!dev) {
+               printk_once(KERN_NOTICE "tc mirred: target device is gone\n");
+               goto out;
+       }
+
        if (!(dev->flags & IFF_UP)) {
                if (net_ratelimit())
-                       pr_notice("tc mirred to Houston: device %s is gone!\n",
+                       pr_notice("tc mirred to Houston: device %s is down\n",
                                  dev->name);
                goto out;
        }
@@ -232,6 +242,28 @@ nla_put_failure:
        return -1;
 }
 
+static int mirred_device_event(struct notifier_block *unused,
+                              unsigned long event, void *ptr)
+{
+       struct net_device *dev = ptr;
+       struct tcf_mirred *m;
+
+       if (event == NETDEV_UNREGISTER)
+               list_for_each_entry(m, &mirred_list, tcfm_list) {
+                       if (m->tcfm_dev == dev) {
+                               dev_put(dev);
+                               m->tcfm_dev = NULL;
+                       }
+               }
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block mirred_device_notifier = {
+       .notifier_call = mirred_device_event,
+};
+
+
 static struct tc_action_ops act_mirred_ops = {
        .kind           =       "mirred",
        .hinfo          =       &mirred_hash_info,
@@ -252,12 +284,17 @@ MODULE_LICENSE("GPL");
 
 static int __init mirred_init_module(void)
 {
+       int err = register_netdevice_notifier(&mirred_device_notifier);
+       if (err)
+               return err;
+
        pr_info("Mirror/redirect action on\n");
        return tcf_register_action(&act_mirred_ops);
 }
 
 static void __exit mirred_cleanup_module(void)
 {
+       unregister_netdevice_notifier(&mirred_device_notifier);
        tcf_unregister_action(&act_mirred_ops);
 }
 
index 86067ee786324b294be637b202b5c16e381724d0..2fc53961054ede2dc5cf3b1e62cede04a86c389a 100644 (file)
@@ -52,6 +52,10 @@ struct hdmi_spec {
         */
        struct hda_multi_out multiout;
        unsigned int codec_type;
+
+       /* misc flags */
+       /* PD bit indicates only the update, not the current state */
+       unsigned int old_pin_detect:1;
 };
 
 
@@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
  * Unsolicited events
  */
 
+static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
+                              struct hdmi_eld *eld);
+
 static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
 {
        struct hdmi_spec *spec = codec->spec;
@@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
        if (index < 0)
                return;
 
+       if (spec->old_pin_detect) {
+               if (pind)
+                       hdmi_present_sense(codec, tag, &spec->sink_eld[index]);
+               pind = spec->sink_eld[index].monitor_present;
+       }
+
        spec->sink_eld[index].monitor_present = pind;
        spec->sink_eld[index].eld_valid = eldv;
 
index 3c10c0b149f4c682d683a6ae21ae837b3fe18f4d..b0652acee9b2725541dc99df2af68513aa84009c 100644 (file)
@@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
 
        codec->spec = spec;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
+       spec->old_pin_detect = 1;
 
        if (hdmi_parse_codec(codec) < 0) {
                codec->spec = NULL;
@@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
        spec->multiout.max_channels = 8;
        spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
+       spec->old_pin_detect = 1;
 
        codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
 
@@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
        spec->multiout.max_channels = 2;
        spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
+       spec->old_pin_detect = 1;
 
        codec->patch_ops = nvhdmi_patch_ops_2ch;
 
index ff614dd824c1fe97cbfe9ee378b744676bc50e93..596ea2f12cf60a74504efc751a9566265d7b3aeb 100644 (file)
@@ -1267,11 +1267,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
        unsigned nid = 0;
        struct alc_spec *spec = codec->spec;
 
+       spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
+
        ass = codec->subsystem_id & 0xffff;
-       if (ass != codec->bus->pci->subsystem_device && (ass & 1)) {
-               spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
+       if (ass != codec->bus->pci->subsystem_device && (ass & 1))
                goto do_sku;
-       }
 
        nid = 0x1d;
        if (codec->vendor_id == 0x10ec0260)
@@ -5180,8 +5180,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids,
 #ifdef CONFIG_SND_HDA_INPUT_BEEP
 #define set_beep_amp(spec, nid, idx, dir) \
        ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
+
+static struct snd_pci_quirk beep_white_list[] = {
+       SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
+       {}
+};
+
+static inline int has_cdefine_beep(struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+       const struct snd_pci_quirk *q;
+       q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
+       if (q)
+               return q->value;
+       return spec->cdefine.enable_pcbeep;
+}
 #else
 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
+#define has_cdefine_beep(codec)                0
 #endif
 
 /*
@@ -10566,10 +10582,12 @@ static int patch_alc882(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC882_AUTO)
@@ -10619,7 +10637,7 @@ static int patch_alc882(struct hda_codec *codec)
 
        set_capture_mixer(codec);
 
-       if (spec->cdefine.enable_pcbeep)
+       if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
        if (board_config == ALC882_AUTO)
@@ -12435,7 +12453,7 @@ static int patch_alc262(struct hda_codec *codec)
                }
        }
 
-       if (!spec->no_analog) {
+       if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
                if (err < 0) {
                        alc_free(codec);
@@ -12486,7 +12504,7 @@ static int patch_alc262(struct hda_codec *codec)
        }
        if (!spec->cap_mixer && !spec->no_analog)
                set_capture_mixer(codec);
-       if (!spec->no_analog && spec->cdefine.enable_pcbeep)
+       if (!spec->no_analog && has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
        spec->vmaster_nid = 0x0c;
@@ -14458,10 +14476,12 @@ static int patch_alc269(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC269_AUTO)
@@ -14494,7 +14514,7 @@ static int patch_alc269(struct hda_codec *codec)
 
        if (!spec->cap_mixer)
                set_capture_mixer(codec);
-       if (spec->cdefine.enable_pcbeep)
+       if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
 
        if (board_config == ALC269_AUTO)
@@ -18691,10 +18711,12 @@ static int patch_alc662(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC662_AUTO)
@@ -18716,7 +18738,7 @@ static int patch_alc662(struct hda_codec *codec)
        if (!spec->cap_mixer)
                set_capture_mixer(codec);
 
-       if (spec->cdefine.enable_pcbeep) {
+       if (has_cdefine_beep(codec)) {
                switch (codec->vendor_id) {
                case 0x10ec0662:
                        set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
index 495be6e7193169fcdf22400a682915d4966c3cc9..24454c98d0ee9f62faa5fd56b37bd64e04d598fd 100644 (file)
@@ -300,7 +300,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = {
 };
 EXPORT_SYMBOL(au1xpsc_i2s_dai);
 
-static int __init au1xpsc_i2s_drvprobe(struct platform_device *pdev)
+static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 {
        struct resource *r;
        unsigned long sel;