diff options
177 files changed, 1675 insertions, 734 deletions
diff --git a/Documentation/acpi/method-customizing.txt b/Documentation/acpi/method-customizing.txt index e628cd23ca80..3e1d25aee3fb 100644 --- a/Documentation/acpi/method-customizing.txt +++ b/Documentation/acpi/method-customizing.txt | |||
@@ -19,6 +19,8 @@ Note: Only ACPI METHOD can be overridden, any other object types like | |||
19 | "Device", "OperationRegion", are not recognized. | 19 | "Device", "OperationRegion", are not recognized. |
20 | Note: The same ACPI control method can be overridden for many times, | 20 | Note: The same ACPI control method can be overridden for many times, |
21 | and it's always the latest one that used by Linux/kernel. | 21 | and it's always the latest one that used by Linux/kernel. |
22 | Note: To get the ACPI debug object output (Store (AAAA, Debug)), | ||
23 | please run "echo 1 > /sys/module/acpi/parameters/aml_debug_output". | ||
22 | 24 | ||
23 | 1. override an existing method | 25 | 1. override an existing method |
24 | a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, | 26 | a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, |
diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt index a2db35287003..995baf379c07 100644 --- a/Documentation/credentials.txt +++ b/Documentation/credentials.txt | |||
@@ -417,6 +417,9 @@ reference on them using: | |||
417 | This does all the RCU magic inside of it. The caller must call put_cred() on | 417 | This does all the RCU magic inside of it. The caller must call put_cred() on |
418 | the credentials so obtained when they're finished with. | 418 | the credentials so obtained when they're finished with. |
419 | 419 | ||
420 | [*] Note: The result of __task_cred() should not be passed directly to | ||
421 | get_cred() as this may race with commit_cred(). | ||
422 | |||
420 | There are a couple of convenience functions to access bits of another task's | 423 | There are a couple of convenience functions to access bits of another task's |
421 | credentials, hiding the RCU magic from the caller: | 424 | credentials, hiding the RCU magic from the caller: |
422 | 425 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index db3d0f5061f9..02f75fccac20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6243,6 +6243,8 @@ F: drivers/mmc/host/wbsd.* | |||
6243 | 6243 | ||
6244 | WATCHDOG DEVICE DRIVERS | 6244 | WATCHDOG DEVICE DRIVERS |
6245 | M: Wim Van Sebroeck <wim@iguana.be> | 6245 | M: Wim Van Sebroeck <wim@iguana.be> |
6246 | L: linux-watchdog@vger.kernel.org | ||
6247 | W: http://www.linux-watchdog.org/ | ||
6246 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git | 6248 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git |
6247 | S: Maintained | 6249 | S: Maintained |
6248 | F: Documentation/watchdog/ | 6250 | F: Documentation/watchdog/ |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 35 | 3 | SUBLEVEL = 35 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = |
5 | NAME = Sheep on Meth | 5 | NAME = Sheep on Meth |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 53faa9063a03..864a002137fe 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -71,6 +71,9 @@ targets := vmlinux vmlinux.lds \ | |||
71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
72 | font.o font.c head.o misc.o $(OBJS) | 72 | font.o font.c head.o misc.o $(OBJS) |
73 | 73 | ||
74 | # Make sure files are removed during clean | ||
75 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S | ||
76 | |||
74 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 77 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
75 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 78 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
76 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 79 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 6f80665f477e..9eaf65f43642 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -1028,13 +1028,12 @@ static int sa1111_remove(struct platform_device *pdev) | |||
1028 | struct sa1111 *sachip = platform_get_drvdata(pdev); | 1028 | struct sa1111 *sachip = platform_get_drvdata(pdev); |
1029 | 1029 | ||
1030 | if (sachip) { | 1030 | if (sachip) { |
1031 | __sa1111_remove(sachip); | ||
1032 | platform_set_drvdata(pdev, NULL); | ||
1033 | |||
1034 | #ifdef CONFIG_PM | 1031 | #ifdef CONFIG_PM |
1035 | kfree(sachip->saved_state); | 1032 | kfree(sachip->saved_state); |
1036 | sachip->saved_state = NULL; | 1033 | sachip->saved_state = NULL; |
1037 | #endif | 1034 | #endif |
1035 | __sa1111_remove(sachip); | ||
1036 | platform_set_drvdata(pdev, NULL); | ||
1038 | } | 1037 | } |
1039 | 1038 | ||
1040 | return 0; | 1039 | return 0; |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index c980156f3263..1261b1f928d9 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
28 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
29 | #include <asm/system.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 32 | * 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); | |||
179 | * IO port primitives for more information. | 180 | * IO port primitives for more information. |
180 | */ | 181 | */ |
181 | #ifdef __mem_pci | 182 | #ifdef __mem_pci |
182 | #define readb(c) ({ __u8 __v = __raw_readb(__mem_pci(c)); __v; }) | 183 | #define readb_relaxed(c) ({ u8 __v = __raw_readb(__mem_pci(c)); __v; }) |
183 | #define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \ | 184 | #define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \ |
184 | __raw_readw(__mem_pci(c))); __v; }) | 185 | __raw_readw(__mem_pci(c))); __v; }) |
185 | #define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \ | 186 | #define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \ |
186 | __raw_readl(__mem_pci(c))); __v; }) | 187 | __raw_readl(__mem_pci(c))); __v; }) |
187 | #define readb_relaxed(addr) readb(addr) | 188 | |
188 | #define readw_relaxed(addr) readw(addr) | 189 | #define writeb_relaxed(v,c) ((void)__raw_writeb(v,__mem_pci(c))) |
189 | #define readl_relaxed(addr) readl(addr) | 190 | #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ |
191 | cpu_to_le16(v),__mem_pci(c))) | ||
192 | #define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ | ||
193 | cpu_to_le32(v),__mem_pci(c))) | ||
194 | |||
195 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
196 | #define __iormb() rmb() | ||
197 | #define __iowmb() wmb() | ||
198 | #else | ||
199 | #define __iormb() do { } while (0) | ||
200 | #define __iowmb() do { } while (0) | ||
201 | #endif | ||
202 | |||
203 | #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) | ||
204 | #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) | ||
205 | #define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; }) | ||
206 | |||
207 | #define writeb(v,c) ({ __iowmb(); writeb_relaxed(v,c); }) | ||
208 | #define writew(v,c) ({ __iowmb(); writew_relaxed(v,c); }) | ||
209 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); }) | ||
190 | 210 | ||
191 | #define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l) | 211 | #define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l) |
192 | #define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l) | 212 | #define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l) |
193 | #define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) | 213 | #define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) |
194 | 214 | ||
195 | #define writeb(v,c) __raw_writeb(v,__mem_pci(c)) | ||
196 | #define writew(v,c) __raw_writew((__force __u16) \ | ||
197 | cpu_to_le16(v),__mem_pci(c)) | ||
198 | #define writel(v,c) __raw_writel((__force __u32) \ | ||
199 | cpu_to_le32(v),__mem_pci(c)) | ||
200 | |||
201 | #define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) | 215 | #define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) |
202 | #define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) | 216 | #define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) |
203 | #define writesl(p,d,l) __raw_writesl(__mem_pci(p),d,l) | 217 | #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); | |||
244 | * io{read,write}{8,16,32} macros | 258 | * io{read,write}{8,16,32} macros |
245 | */ | 259 | */ |
246 | #ifndef ioread8 | 260 | #ifndef ioread8 |
247 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) | 261 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __iormb(); __v; }) |
248 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; }) | 262 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; }) |
249 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; }) | 263 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; }) |
250 | 264 | ||
251 | #define iowrite8(v,p) __raw_writeb(v, p) | 265 | #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) |
252 | #define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p) | 266 | #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) |
253 | #define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p) | 267 | #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) |
254 | 268 | ||
255 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | 269 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) |
256 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | 270 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) |
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S index 59ff6fdc1e63..7d08b43d2c0e 100644 --- a/arch/arm/lib/csumpartialcopyuser.S +++ b/arch/arm/lib/csumpartialcopyuser.S | |||
@@ -71,7 +71,7 @@ | |||
71 | .pushsection .fixup,"ax" | 71 | .pushsection .fixup,"ax" |
72 | .align 4 | 72 | .align 4 |
73 | 9001: mov r4, #-EFAULT | 73 | 9001: mov r4, #-EFAULT |
74 | ldr r5, [fp, #4] @ *err_ptr | 74 | ldr r5, [sp, #8*4] @ *err_ptr |
75 | str r4, [r5] | 75 | str r4, [r5] |
76 | ldmia sp, {r1, r2} @ retrieve dst, len | 76 | ldmia sp, {r1, r2} @ retrieve dst, len |
77 | add r2, r2, r1 | 77 | add r2, r2, r1 |
diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S index fedd8076a689..072cc6b61ba3 100644 --- a/arch/arm/mach-clps711x/include/mach/debug-macro.S +++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S | |||
@@ -11,6 +11,7 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <mach/hardware.h> | ||
14 | #include <asm/hardware/clps7111.h> | 15 | #include <asm/hardware/clps7111.h> |
15 | 16 | ||
16 | .macro addruart, rx, tmp | 17 | .macro addruart, rx, tmp |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 2ec3095ffb7b..b280efb1fa12 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/mtd/physmap.h> | 26 | #include <linux/mtd/physmap.h> |
27 | #include <linux/regulator/machine.h> | 27 | #include <linux/regulator/machine.h> |
28 | #include <linux/regulator/tps6507x.h> | ||
28 | #include <linux/mfd/tps6507x.h> | 29 | #include <linux/mfd/tps6507x.h> |
29 | #include <linux/input/tps6507x-ts.h> | 30 | #include <linux/input/tps6507x-ts.h> |
30 | 31 | ||
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = { | |||
469 | }, | 470 | }, |
470 | }; | 471 | }; |
471 | 472 | ||
473 | /* We take advantage of the fact that both defdcdc{2,3} are tied high */ | ||
474 | static struct tps6507x_reg_platform_data tps6507x_platform_data = { | ||
475 | .defdcdc_default = true, | ||
476 | }; | ||
477 | |||
472 | struct regulator_init_data tps65070_regulator_data[] = { | 478 | struct regulator_init_data tps65070_regulator_data[] = { |
473 | /* dcdc1 */ | 479 | /* dcdc1 */ |
474 | { | 480 | { |
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = { | |||
494 | }, | 500 | }, |
495 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), | 501 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), |
496 | .consumer_supplies = tps65070_dcdc2_consumers, | 502 | .consumer_supplies = tps65070_dcdc2_consumers, |
503 | .driver_data = &tps6507x_platform_data, | ||
497 | }, | 504 | }, |
498 | 505 | ||
499 | /* dcdc3 */ | 506 | /* dcdc3 */ |
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = { | |||
507 | }, | 514 | }, |
508 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), | 515 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), |
509 | .consumer_supplies = tps65070_dcdc3_consumers, | 516 | .consumer_supplies = tps65070_dcdc3_consumers, |
517 | .driver_data = &tps6507x_platform_data, | ||
510 | }, | 518 | }, |
511 | 519 | ||
512 | /* ldo1 */ | 520 | /* ldo1 */ |
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index e3bc3f6f6b10..88b3dd89be89 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt); | |||
232 | 232 | ||
233 | unsigned long __pfn_to_bus(unsigned long pfn) | 233 | unsigned long __pfn_to_bus(unsigned long pfn) |
234 | { | 234 | { |
235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET)); | 235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET); |
236 | } | 236 | } |
237 | EXPORT_SYMBOL(__pfn_to_bus); | 237 | EXPORT_SYMBOL(__pfn_to_bus); |
238 | 238 | ||
diff --git a/arch/arm/mach-h720x/include/mach/debug-macro.S b/arch/arm/mach-h720x/include/mach/debug-macro.S index a9ee8f0d48b7..27cafd12f033 100644 --- a/arch/arm/mach-h720x/include/mach/debug-macro.S +++ b/arch/arm/mach-h720x/include/mach/debug-macro.S | |||
@@ -11,8 +11,10 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | .equ io_virt, IO_BASE | 14 | #include <mach/hardware.h> |
15 | .equ io_phys, IO_START | 15 | |
16 | .equ io_virt, IO_VIRT | ||
17 | .equ io_phys, IO_PHYS | ||
16 | 18 | ||
17 | .macro addruart, rx, tmp | 19 | .macro addruart, rx, tmp |
18 | mrc p15, 0, \rx, c1, c0 | 20 | mrc p15, 0, \rx, c1, c0 |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c index 7221c20b2afa..f781164e623f 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.c +++ b/arch/arm/mach-kirkwood/tsx1x-common.c | |||
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = { | |||
77 | }, | 77 | }, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | void qnap_tsx1x_register_flash(void) | 80 | void __init qnap_tsx1x_register_flash(void) |
81 | { | 81 | { |
82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, | 82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, |
83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); | 83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h index 9a592962a6ea..7fa037361b55 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.h +++ b/arch/arm/mach-kirkwood/tsx1x-common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H | 1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H |
2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H | 2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H |
3 | 3 | ||
4 | extern void qnap_tsx1x_register_flash(void); | 4 | extern void __init qnap_tsx1x_register_flash(void); |
5 | extern void qnap_tsx1x_power_off(void); | 5 | extern void qnap_tsx1x_power_off(void); |
6 | 6 | ||
7 | #endif | 7 | #endif |
diff --git a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S index 0859336a8e6d..5c934bdb7158 100644 --- a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S +++ b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S | |||
@@ -8,6 +8,7 @@ | |||
8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <asm/memory.h> | ||
11 | 12 | ||
12 | #include <mach/regs-board-a9m9750dev.h> | 13 | #include <mach/regs-board-a9m9750dev.h> |
13 | 14 | ||
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h index 1b12d324b087..770a68c46e81 100644 --- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h +++ b/arch/arm/mach-ns9xxx/include/mach/uncompress.h | |||
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base) | |||
20 | /* nothing */ | 20 | /* nothing */ |
21 | } | 21 | } |
22 | 22 | ||
23 | static int timeout; | ||
24 | |||
23 | static void putc_ns9360(char c, void __iomem *base) | 25 | static void putc_ns9360(char c, void __iomem *base) |
24 | { | 26 | { |
25 | static int t = 0x10000; | ||
26 | do { | 27 | do { |
27 | if (t) | 28 | if (timeout) |
28 | --t; | 29 | --timeout; |
29 | 30 | ||
30 | if (__raw_readl(base + 8) & (1 << 3)) { | 31 | if (__raw_readl(base + 8) & (1 << 3)) { |
31 | __raw_writeb(c, base + 16); | 32 | __raw_writeb(c, base + 16); |
32 | t = 0x10000; | 33 | timeout = 0x10000; |
33 | break; | 34 | break; |
34 | } | 35 | } |
35 | } while (t); | 36 | } while (timeout); |
36 | } | 37 | } |
37 | 38 | ||
38 | static void putc_a9m9750dev(char c, void __iomem *base) | 39 | static void putc_a9m9750dev(char c, void __iomem *base) |
39 | { | 40 | { |
40 | static int t = 0x10000; | ||
41 | do { | 41 | do { |
42 | if (t) | 42 | if (timeout) |
43 | --t; | 43 | --timeout; |
44 | 44 | ||
45 | if (__raw_readb(base + 5) & (1 << 5)) { | 45 | if (__raw_readb(base + 5) & (1 << 5)) { |
46 | __raw_writeb(c, base); | 46 | __raw_writeb(c, base); |
47 | t = 0x10000; | 47 | timeout = 0x10000; |
48 | break; | 48 | break; |
49 | } | 49 | } |
50 | } while (t); | 50 | } while (timeout); |
51 | 51 | ||
52 | } | 52 | } |
53 | 53 | ||
54 | static void putc_ns921x(char c, void __iomem *base) | 54 | static void putc_ns921x(char c, void __iomem *base) |
55 | { | 55 | { |
56 | static int t = 0x10000; | ||
57 | do { | 56 | do { |
58 | if (t) | 57 | if (timeout) |
59 | --t; | 58 | --timeout; |
60 | 59 | ||
61 | if (!(__raw_readl(base) & (1 << 11))) { | 60 | if (!(__raw_readl(base) & (1 << 11))) { |
62 | __raw_writeb(c, base + 0x0028); | 61 | __raw_writeb(c, base + 0x0028); |
63 | t = 0x10000; | 62 | timeout = 0x10000; |
64 | break; | 63 | break; |
65 | } | 64 | } |
66 | } while (t); | 65 | } while (timeout); |
67 | } | 66 | } |
68 | 67 | ||
69 | #define MSCS __REG(0xA0900184) | 68 | #define MSCS __REG(0xA0900184) |
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base) | |||
89 | 88 | ||
90 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) | 89 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) |
91 | { | 90 | { |
91 | timeout = 0x10000; | ||
92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { | 92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { |
93 | /* ns9360 or ns9750 */ | 93 | /* ns9360 or ns9750 */ |
94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { | 94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 45c23fd6df31..40b6ac2de876 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <mach/colibri.h> | 26 | #include <mach/colibri.h> |
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxafb.h> | 28 | #include <mach/pxafb.h> |
29 | #include <mach/audio.h> | ||
29 | 30 | ||
30 | #include "generic.h" | 31 | #include "generic.h" |
31 | #include "devices.h" | 32 | #include "devices.h" |
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void) | |||
145 | static inline void colibri_pxa300_init_lcd(void) {} | 146 | static inline void colibri_pxa300_init_lcd(void) {} |
146 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ | 147 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ |
147 | 148 | ||
148 | #if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE) | 149 | #if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE) |
149 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { | 150 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { |
150 | GPIO24_AC97_SYSCLK, | 151 | GPIO24_AC97_SYSCLK, |
151 | GPIO23_AC97_nACRESET, | 152 | GPIO23_AC97_nACRESET, |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 3d1dcb9ac08f..51ffa6afb675 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = { | |||
446 | static struct pxamci_platform_data corgi_mci_platform_data = { | 446 | static struct pxamci_platform_data corgi_mci_platform_data = { |
447 | .detect_delay_ms = 250, | 447 | .detect_delay_ms = 250, |
448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
449 | .gpio_card_detect = -1, | 449 | .gpio_card_detect = CORGI_GPIO_nSD_DETECT, |
450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, | 450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, |
451 | .gpio_power = CORGI_GPIO_SD_PWR, | 451 | .gpio_power = CORGI_GPIO_SD_PWR, |
452 | }; | 452 | }; |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d9816726a..268a9bc6be8a 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -256,13 +256,9 @@ static void init_sdram_rows(void) | |||
256 | 256 | ||
257 | static u32 mdrefr_dri(unsigned int freq) | 257 | static u32 mdrefr_dri(unsigned int freq) |
258 | { | 258 | { |
259 | u32 dri = 0; | 259 | u32 interval = freq * SDRAM_TREF / sdram_rows; |
260 | 260 | ||
261 | if (cpu_is_pxa25x()) | 261 | return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; |
262 | dri = ((freq * SDRAM_TREF) / (sdram_rows * 32)); | ||
263 | if (cpu_is_pxa27x()) | ||
264 | dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32; | ||
265 | return dri; | ||
266 | } | 262 | } |
267 | 263 | ||
268 | /* find a valid frequency point */ | 264 | /* find a valid frequency point */ |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 0af36177ff08..c059dac02b61 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void) | |||
41 | EXPORT_SYMBOL(pxa27x_clear_otgph); | 41 | EXPORT_SYMBOL(pxa27x_clear_otgph); |
42 | 42 | ||
43 | static unsigned long ac97_reset_config[] = { | 43 | static unsigned long ac97_reset_config[] = { |
44 | GPIO95_AC97_nRESET, | ||
45 | GPIO95_GPIO, | ||
46 | GPIO113_AC97_nRESET, | ||
47 | GPIO113_GPIO, | 44 | GPIO113_GPIO, |
45 | GPIO113_AC97_nRESET, | ||
46 | GPIO95_GPIO, | ||
47 | GPIO95_AC97_nRESET, | ||
48 | }; | 48 | }; |
49 | 49 | ||
50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) | 50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 595be19f8ad5..02e9fdeb8faf 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -237,7 +237,7 @@ static unsigned int realview_mmc_status(struct device *dev) | |||
237 | else | 237 | else |
238 | mask = 2; | 238 | mask = 2; |
239 | 239 | ||
240 | return !(readl(REALVIEW_SYSMCI) & mask); | 240 | return readl(REALVIEW_SYSMCI) & mask; |
241 | } | 241 | } |
242 | 242 | ||
243 | struct mmci_platform_data realview_mmc0_plat_data = { | 243 | struct mmci_platform_data realview_mmc0_plat_data = { |
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S index 50f071c5bf4d..5ea24d4d1ba6 100644 --- a/arch/arm/mach-shark/include/mach/debug-macro.S +++ b/arch/arm/mach-shark/include/mach/debug-macro.S | |||
@@ -20,6 +20,9 @@ | |||
20 | strb \rd, [\rx] | 20 | strb \rd, [\rx] |
21 | .endm | 21 | .endm |
22 | 22 | ||
23 | .macro waituart,rd,rx | ||
24 | .endm | ||
25 | |||
23 | .macro busyuart,rd,rx | 26 | .macro busyuart,rd,rx |
24 | mov \rd, #0 | 27 | mov \rd, #0 |
25 | 1001: add \rd, \rd, #1 | 28 | 1001: add \rd, \rd, #1 |
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h index 8552eb188b50..0271ca0a83df 100644 --- a/arch/arm/mach-ux500/include/mach/uncompress.h +++ b/arch/arm/mach-ux500/include/mach/uncompress.h | |||
@@ -30,22 +30,22 @@ | |||
30 | static void putc(const char c) | 30 | static void putc(const char c) |
31 | { | 31 | { |
32 | /* Do nothing if the UART is not enabled. */ | 32 | /* Do nothing if the UART is not enabled. */ |
33 | if (!(readb(U8500_UART_CR) & 0x1)) | 33 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) |
34 | return; | 34 | return; |
35 | 35 | ||
36 | if (c == '\n') | 36 | if (c == '\n') |
37 | putc('\r'); | 37 | putc('\r'); |
38 | 38 | ||
39 | while (readb(U8500_UART_FR) & (1 << 5)) | 39 | while (__raw_readb(U8500_UART_FR) & (1 << 5)) |
40 | barrier(); | 40 | barrier(); |
41 | writeb(c, U8500_UART_DR); | 41 | __raw_writeb(c, U8500_UART_DR); |
42 | } | 42 | } |
43 | 43 | ||
44 | static void flush(void) | 44 | static void flush(void) |
45 | { | 45 | { |
46 | if (!(readb(U8500_UART_CR) & 0x1)) | 46 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) |
47 | return; | 47 | return; |
48 | while (readb(U8500_UART_FR) & (1 << 3)) | 48 | while (__raw_readb(U8500_UART_FR) & (1 << 3)) |
49 | barrier(); | 49 | barrier(); |
50 | } | 50 | } |
51 | 51 | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index d250711b8c7a..c84239761cb4 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -241,7 +241,7 @@ static struct platform_device v2m_flash_device = { | |||
241 | 241 | ||
242 | static unsigned int v2m_mmci_status(struct device *dev) | 242 | static unsigned int v2m_mmci_status(struct device *dev) |
243 | { | 243 | { |
244 | return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0)); | 244 | return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0); |
245 | } | 245 | } |
246 | 246 | ||
247 | static struct mmci_platform_data v2m_mmci_data = { | 247 | static struct mmci_platform_data v2m_mmci_data = { |
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 642207e18198..83c56324a472 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = { | |||
93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), | 93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), |
94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), | 94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), |
95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), | 95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), |
96 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), | 96 | DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL), |
97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), | 97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), |
98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | 98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), |
99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), | 99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index df4955885b21..9982eb385c0f 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -32,14 +32,14 @@ static uint32_t l2x0_way_mask; /* Bitmask of active ways */ | |||
32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) | 32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) |
33 | { | 33 | { |
34 | /* wait for the operation to complete */ | 34 | /* wait for the operation to complete */ |
35 | while (readl(reg) & mask) | 35 | while (readl_relaxed(reg) & mask) |
36 | ; | 36 | ; |
37 | } | 37 | } |
38 | 38 | ||
39 | static inline void cache_sync(void) | 39 | static inline void cache_sync(void) |
40 | { | 40 | { |
41 | void __iomem *base = l2x0_base; | 41 | void __iomem *base = l2x0_base; |
42 | writel(0, base + L2X0_CACHE_SYNC); | 42 | writel_relaxed(0, base + L2X0_CACHE_SYNC); |
43 | cache_wait(base + L2X0_CACHE_SYNC, 1); | 43 | cache_wait(base + L2X0_CACHE_SYNC, 1); |
44 | } | 44 | } |
45 | 45 | ||
@@ -47,14 +47,14 @@ static inline void l2x0_clean_line(unsigned long addr) | |||
47 | { | 47 | { |
48 | void __iomem *base = l2x0_base; | 48 | void __iomem *base = l2x0_base; |
49 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); | 49 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); |
50 | writel(addr, base + L2X0_CLEAN_LINE_PA); | 50 | writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA); |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline void l2x0_inv_line(unsigned long addr) | 53 | static inline void l2x0_inv_line(unsigned long addr) |
54 | { | 54 | { |
55 | void __iomem *base = l2x0_base; | 55 | void __iomem *base = l2x0_base; |
56 | cache_wait(base + L2X0_INV_LINE_PA, 1); | 56 | cache_wait(base + L2X0_INV_LINE_PA, 1); |
57 | writel(addr, base + L2X0_INV_LINE_PA); | 57 | writel_relaxed(addr, base + L2X0_INV_LINE_PA); |
58 | } | 58 | } |
59 | 59 | ||
60 | #ifdef CONFIG_PL310_ERRATA_588369 | 60 | #ifdef CONFIG_PL310_ERRATA_588369 |
@@ -75,9 +75,9 @@ static inline void l2x0_flush_line(unsigned long addr) | |||
75 | 75 | ||
76 | /* Clean by PA followed by Invalidate by PA */ | 76 | /* Clean by PA followed by Invalidate by PA */ |
77 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); | 77 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); |
78 | writel(addr, base + L2X0_CLEAN_LINE_PA); | 78 | writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA); |
79 | cache_wait(base + L2X0_INV_LINE_PA, 1); | 79 | cache_wait(base + L2X0_INV_LINE_PA, 1); |
80 | writel(addr, base + L2X0_INV_LINE_PA); | 80 | writel_relaxed(addr, base + L2X0_INV_LINE_PA); |
81 | } | 81 | } |
82 | #else | 82 | #else |
83 | 83 | ||
@@ -90,7 +90,7 @@ static inline void l2x0_flush_line(unsigned long addr) | |||
90 | { | 90 | { |
91 | void __iomem *base = l2x0_base; | 91 | void __iomem *base = l2x0_base; |
92 | cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); | 92 | cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); |
93 | writel(addr, base + L2X0_CLEAN_INV_LINE_PA); | 93 | writel_relaxed(addr, base + L2X0_CLEAN_INV_LINE_PA); |
94 | } | 94 | } |
95 | #endif | 95 | #endif |
96 | 96 | ||
@@ -109,7 +109,7 @@ static inline void l2x0_inv_all(void) | |||
109 | 109 | ||
110 | /* invalidate all ways */ | 110 | /* invalidate all ways */ |
111 | spin_lock_irqsave(&l2x0_lock, flags); | 111 | spin_lock_irqsave(&l2x0_lock, flags); |
112 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); | 112 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | 113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
114 | cache_sync(); | 114 | cache_sync(); |
115 | spin_unlock_irqrestore(&l2x0_lock, flags); | 115 | spin_unlock_irqrestore(&l2x0_lock, flags); |
@@ -215,8 +215,8 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
215 | 215 | ||
216 | l2x0_base = base; | 216 | l2x0_base = base; |
217 | 217 | ||
218 | cache_id = readl(l2x0_base + L2X0_CACHE_ID); | 218 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); |
219 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | 219 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); |
220 | 220 | ||
221 | aux &= aux_mask; | 221 | aux &= aux_mask; |
222 | aux |= aux_val; | 222 | aux |= aux_val; |
@@ -248,15 +248,15 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
248 | * If you are booting from non-secure mode | 248 | * If you are booting from non-secure mode |
249 | * accessing the below registers will fault. | 249 | * accessing the below registers will fault. |
250 | */ | 250 | */ |
251 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { | 251 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { |
252 | 252 | ||
253 | /* l2x0 controller is disabled */ | 253 | /* l2x0 controller is disabled */ |
254 | writel(aux, l2x0_base + L2X0_AUX_CTRL); | 254 | writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); |
255 | 255 | ||
256 | l2x0_inv_all(); | 256 | l2x0_inv_all(); |
257 | 257 | ||
258 | /* enable L2X0 */ | 258 | /* enable L2X0 */ |
259 | writel(1, l2x0_base + L2X0_CTRL); | 259 | writel_relaxed(1, l2x0_base + L2X0_CTRL); |
260 | } | 260 | } |
261 | 261 | ||
262 | outer_cache.inv_range = l2x0_inv_range; | 262 | outer_cache.inv_range = l2x0_inv_range; |
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index 086816b205b8..6ab244062b4a 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c | |||
@@ -163,19 +163,22 @@ static DEFINE_PER_CPU(int, kmap_high_l1_vipt_depth); | |||
163 | 163 | ||
164 | void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte) | 164 | void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte) |
165 | { | 165 | { |
166 | unsigned int idx, cpu = smp_processor_id(); | 166 | unsigned int idx, cpu; |
167 | int *depth = &per_cpu(kmap_high_l1_vipt_depth, cpu); | 167 | int *depth; |
168 | unsigned long vaddr, flags; | 168 | unsigned long vaddr, flags; |
169 | pte_t pte, *ptep; | 169 | pte_t pte, *ptep; |
170 | 170 | ||
171 | if (!in_interrupt()) | ||
172 | preempt_disable(); | ||
173 | |||
174 | cpu = smp_processor_id(); | ||
175 | depth = &per_cpu(kmap_high_l1_vipt_depth, cpu); | ||
176 | |||
171 | idx = KM_L1_CACHE + KM_TYPE_NR * cpu; | 177 | idx = KM_L1_CACHE + KM_TYPE_NR * cpu; |
172 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 178 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
173 | ptep = TOP_PTE(vaddr); | 179 | ptep = TOP_PTE(vaddr); |
174 | pte = mk_pte(page, kmap_prot); | 180 | pte = mk_pte(page, kmap_prot); |
175 | 181 | ||
176 | if (!in_interrupt()) | ||
177 | preempt_disable(); | ||
178 | |||
179 | raw_local_irq_save(flags); | 182 | raw_local_irq_save(flags); |
180 | (*depth)++; | 183 | (*depth)++; |
181 | if (pte_val(*ptep) == pte_val(pte)) { | 184 | if (pte_val(*ptep) == pte_val(pte)) { |
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S index 1670734b7e51..37fa593884ee 100644 --- a/arch/arm/plat-spear/include/plat/debug-macro.S +++ b/arch/arm/plat-spear/include/plat/debug-macro.S | |||
@@ -17,8 +17,8 @@ | |||
17 | .macro addruart, rx | 17 | .macro addruart, rx |
18 | mrc p15, 0, \rx, c1, c0 | 18 | mrc p15, 0, \rx, c1, c0 |
19 | tst \rx, #1 @ MMU enabled? | 19 | tst \rx, #1 @ MMU enabled? |
20 | moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base | 20 | moveq \rx, #SPEAR_DBG_UART_BASE @ Physical base |
21 | movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base | 21 | movne \rx, #VA_SPEAR_DBG_UART_BASE @ Virtual base |
22 | .endm | 22 | .endm |
23 | 23 | ||
24 | .macro senduart, rd, rx | 24 | .macro senduart, rd, rx |
diff --git a/arch/avr32/include/asm/ioctls.h b/arch/avr32/include/asm/ioctls.h index 0cf2c0a4502b..e6ac0b661076 100644 --- a/arch/avr32/include/asm/ioctls.h +++ b/arch/avr32/include/asm/ioctls.h | |||
@@ -54,6 +54,9 @@ | |||
54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
56 | 56 | ||
57 | #define TIOCGRS485 0x542E | ||
58 | #define TIOCSRS485 0x542F | ||
59 | |||
57 | #define FIONCLEX 0x5450 | 60 | #define FIONCLEX 0x5450 |
58 | #define FIOCLEX 0x5451 | 61 | #define FIOCLEX 0x5451 |
59 | #define FIOASYNC 0x5452 | 62 | #define FIOASYNC 0x5452 |
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index c7f25bb1d068..61740201b311 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #define __ASM_ARCH_BOARD_H | 5 | #define __ASM_ARCH_BOARD_H |
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/serial.h> | ||
8 | 9 | ||
9 | #define GPIO_PIN_NONE (-1) | 10 | #define GPIO_PIN_NONE (-1) |
10 | 11 | ||
@@ -35,6 +36,7 @@ struct atmel_uart_data { | |||
35 | short use_dma_tx; /* use transmit DMA? */ | 36 | short use_dma_tx; /* use transmit DMA? */ |
36 | short use_dma_rx; /* use receive DMA? */ | 37 | short use_dma_rx; /* use receive DMA? */ |
37 | void __iomem *regs; /* virtual base address, if any */ | 38 | void __iomem *regs; /* virtual base address, if any */ |
39 | struct serial_rs485 rs485; /* rs485 settings */ | ||
38 | }; | 40 | }; |
39 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); | 41 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); |
40 | struct platform_device *at32_add_device_usart(unsigned int id); | 42 | struct platform_device *at32_add_device_usart(unsigned int id); |
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 2580e77624d2..f9e5622ebc95 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = { | |||
435 | static int __init au1xxx_platform_init(void) | 435 | static int __init au1xxx_platform_init(void) |
436 | { | 436 | { |
437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; | 437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; |
438 | int i; | 438 | int err, i; |
439 | 439 | ||
440 | /* Fill up uartclk. */ | 440 | /* Fill up uartclk. */ |
441 | for (i = 0; au1x00_uart_data[i].flags; i++) | 441 | for (i = 0; au1x00_uart_data[i].flags; i++) |
442 | au1x00_uart_data[i].uartclk = uartclk; | 442 | au1x00_uart_data[i].uartclk = uartclk; |
443 | 443 | ||
444 | err = platform_add_devices(au1xxx_platform_devices, | ||
445 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
444 | #ifndef CONFIG_SOC_AU1100 | 446 | #ifndef CONFIG_SOC_AU1100 |
445 | /* Register second MAC if enabled in pinfunc */ | 447 | /* Register second MAC if enabled in pinfunc */ |
446 | if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) | 448 | if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) |
447 | platform_device_register(&au1xxx_eth1_device); | 449 | platform_device_register(&au1xxx_eth1_device); |
448 | #endif | 450 | #endif |
449 | 451 | ||
450 | return platform_add_devices(au1xxx_platform_devices, | 452 | return err; |
451 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
452 | } | 453 | } |
453 | 454 | ||
454 | arch_initcall(au1xxx_platform_init); | 455 | arch_initcall(au1xxx_platform_init); |
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index a9f0336e1f1f..52d883d37dd7 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -67,8 +67,6 @@ static void mtx1_power_off(void) | |||
67 | 67 | ||
68 | void __init board_setup(void) | 68 | void __init board_setup(void) |
69 | { | 69 | { |
70 | alchemy_gpio2_enable(); | ||
71 | |||
72 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 70 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
73 | /* Enable USB power switch */ | 71 | /* Enable USB power switch */ |
74 | alchemy_gpio_direction_output(204, 0); | 72 | alchemy_gpio_direction_output(204, 0); |
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert) | |||
117 | 115 | ||
118 | if (assert && devsel != 0) | 116 | if (assert && devsel != 0) |
119 | /* Suppress signal to Cardbus */ | 117 | /* Suppress signal to Cardbus */ |
120 | gpio_set_value(1, 0); /* set EXT_IO3 OFF */ | 118 | alchemy_gpio_set_value(1, 0); /* set EXT_IO3 OFF */ |
121 | else | 119 | else |
122 | gpio_set_value(1, 1); /* set EXT_IO3 ON */ | 120 | alchemy_gpio_set_value(1, 1); /* set EXT_IO3 ON */ |
123 | 121 | ||
124 | au_sync_udelay(1); | 122 | udelay(1); |
125 | return 1; | 123 | return 1; |
126 | } | 124 | } |
127 | 125 | ||
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c index 9f544badd0b4..39c23366c5c7 100644 --- a/arch/mips/bcm63xx/dev-enet.c +++ b/arch/mips/bcm63xx/dev-enet.c | |||
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit, | |||
104 | if (unit > 1) | 104 | if (unit > 1) |
105 | return -ENODEV; | 105 | return -ENODEV; |
106 | 106 | ||
107 | if (unit == 1 && BCMCPU_IS_6338()) | ||
108 | return -ENODEV; | ||
109 | |||
107 | if (!shared_device_registered) { | 110 | if (!shared_device_registered) { |
108 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); | 111 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); |
109 | shared_res[0].end = shared_res[0].start; | 112 | shared_res[0].end = shared_res[0].start; |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 59dc0c7ef733..c63c56bfd184 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
434 | __asm__ __volatile__( | 434 | __asm__ __volatile__( |
435 | " .set mips3 \n" | 435 | " .set mips3 \n" |
436 | "1: lld %0, %1 # atomic64_add \n" | 436 | "1: lld %0, %1 # atomic64_add \n" |
437 | " addu %0, %2 \n" | 437 | " daddu %0, %2 \n" |
438 | " scd %0, %1 \n" | 438 | " scd %0, %1 \n" |
439 | " beqzl %0, 1b \n" | 439 | " beqzl %0, 1b \n" |
440 | " .set mips0 \n" | 440 | " .set mips0 \n" |
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
446 | __asm__ __volatile__( | 446 | __asm__ __volatile__( |
447 | " .set mips3 \n" | 447 | " .set mips3 \n" |
448 | "1: lld %0, %1 # atomic64_add \n" | 448 | "1: lld %0, %1 # atomic64_add \n" |
449 | " addu %0, %2 \n" | 449 | " daddu %0, %2 \n" |
450 | " scd %0, %1 \n" | 450 | " scd %0, %1 \n" |
451 | " beqz %0, 2f \n" | 451 | " beqz %0, 2f \n" |
452 | " .subsection 2 \n" | 452 | " .subsection 2 \n" |
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
479 | __asm__ __volatile__( | 479 | __asm__ __volatile__( |
480 | " .set mips3 \n" | 480 | " .set mips3 \n" |
481 | "1: lld %0, %1 # atomic64_sub \n" | 481 | "1: lld %0, %1 # atomic64_sub \n" |
482 | " subu %0, %2 \n" | 482 | " dsubu %0, %2 \n" |
483 | " scd %0, %1 \n" | 483 | " scd %0, %1 \n" |
484 | " beqzl %0, 1b \n" | 484 | " beqzl %0, 1b \n" |
485 | " .set mips0 \n" | 485 | " .set mips0 \n" |
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
491 | __asm__ __volatile__( | 491 | __asm__ __volatile__( |
492 | " .set mips3 \n" | 492 | " .set mips3 \n" |
493 | "1: lld %0, %1 # atomic64_sub \n" | 493 | "1: lld %0, %1 # atomic64_sub \n" |
494 | " subu %0, %2 \n" | 494 | " dsubu %0, %2 \n" |
495 | " scd %0, %1 \n" | 495 | " scd %0, %1 \n" |
496 | " beqz %0, 2f \n" | 496 | " beqz %0, 2f \n" |
497 | " .subsection 2 \n" | 497 | " .subsection 2 \n" |
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
524 | __asm__ __volatile__( | 524 | __asm__ __volatile__( |
525 | " .set mips3 \n" | 525 | " .set mips3 \n" |
526 | "1: lld %1, %2 # atomic64_add_return \n" | 526 | "1: lld %1, %2 # atomic64_add_return \n" |
527 | " addu %0, %1, %3 \n" | 527 | " daddu %0, %1, %3 \n" |
528 | " scd %0, %2 \n" | 528 | " scd %0, %2 \n" |
529 | " beqzl %0, 1b \n" | 529 | " beqzl %0, 1b \n" |
530 | " addu %0, %1, %3 \n" | 530 | " daddu %0, %1, %3 \n" |
531 | " .set mips0 \n" | 531 | " .set mips0 \n" |
532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
533 | : "Ir" (i), "m" (v->counter) | 533 | : "Ir" (i), "m" (v->counter) |
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
538 | __asm__ __volatile__( | 538 | __asm__ __volatile__( |
539 | " .set mips3 \n" | 539 | " .set mips3 \n" |
540 | "1: lld %1, %2 # atomic64_add_return \n" | 540 | "1: lld %1, %2 # atomic64_add_return \n" |
541 | " addu %0, %1, %3 \n" | 541 | " daddu %0, %1, %3 \n" |
542 | " scd %0, %2 \n" | 542 | " scd %0, %2 \n" |
543 | " beqz %0, 2f \n" | 543 | " beqz %0, 2f \n" |
544 | " addu %0, %1, %3 \n" | 544 | " daddu %0, %1, %3 \n" |
545 | " .subsection 2 \n" | 545 | " .subsection 2 \n" |
546 | "2: b 1b \n" | 546 | "2: b 1b \n" |
547 | " .previous \n" | 547 | " .previous \n" |
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
576 | __asm__ __volatile__( | 576 | __asm__ __volatile__( |
577 | " .set mips3 \n" | 577 | " .set mips3 \n" |
578 | "1: lld %1, %2 # atomic64_sub_return \n" | 578 | "1: lld %1, %2 # atomic64_sub_return \n" |
579 | " subu %0, %1, %3 \n" | 579 | " dsubu %0, %1, %3 \n" |
580 | " scd %0, %2 \n" | 580 | " scd %0, %2 \n" |
581 | " beqzl %0, 1b \n" | 581 | " beqzl %0, 1b \n" |
582 | " subu %0, %1, %3 \n" | 582 | " dsubu %0, %1, %3 \n" |
583 | " .set mips0 \n" | 583 | " .set mips0 \n" |
584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
585 | : "Ir" (i), "m" (v->counter) | 585 | : "Ir" (i), "m" (v->counter) |
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
590 | __asm__ __volatile__( | 590 | __asm__ __volatile__( |
591 | " .set mips3 \n" | 591 | " .set mips3 \n" |
592 | "1: lld %1, %2 # atomic64_sub_return \n" | 592 | "1: lld %1, %2 # atomic64_sub_return \n" |
593 | " subu %0, %1, %3 \n" | 593 | " dsubu %0, %1, %3 \n" |
594 | " scd %0, %2 \n" | 594 | " scd %0, %2 \n" |
595 | " beqz %0, 2f \n" | 595 | " beqz %0, 2f \n" |
596 | " subu %0, %1, %3 \n" | 596 | " dsubu %0, %1, %3 \n" |
597 | " .subsection 2 \n" | 597 | " .subsection 2 \n" |
598 | "2: b 1b \n" | 598 | "2: b 1b \n" |
599 | " .previous \n" | 599 | " .previous \n" |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 1b5a6648eb86..baa318a59c97 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -984,16 +984,17 @@ | |||
984 | #define __NR_perf_event_open (__NR_Linux + 296) | 984 | #define __NR_perf_event_open (__NR_Linux + 296) |
985 | #define __NR_accept4 (__NR_Linux + 297) | 985 | #define __NR_accept4 (__NR_Linux + 297) |
986 | #define __NR_recvmmsg (__NR_Linux + 298) | 986 | #define __NR_recvmmsg (__NR_Linux + 298) |
987 | #define __NR_getdents64 (__NR_Linux + 299) | ||
987 | 988 | ||
988 | /* | 989 | /* |
989 | * Offset of the last N32 flavoured syscall | 990 | * Offset of the last N32 flavoured syscall |
990 | */ | 991 | */ |
991 | #define __NR_Linux_syscalls 298 | 992 | #define __NR_Linux_syscalls 299 |
992 | 993 | ||
993 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 994 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
994 | 995 | ||
995 | #define __NR_N32_Linux 6000 | 996 | #define __NR_N32_Linux 6000 |
996 | #define __NR_N32_Linux_syscalls 298 | 997 | #define __NR_N32_Linux_syscalls 299 |
997 | 998 | ||
998 | #ifdef __KERNEL__ | 999 | #ifdef __KERNEL__ |
999 | 1000 | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index a5297e2a353a..a4faceea9d88 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table) | |||
419 | PTR sys_perf_event_open | 419 | PTR sys_perf_event_open |
420 | PTR sys_accept4 | 420 | PTR sys_accept4 |
421 | PTR compat_sys_recvmmsg | 421 | PTR compat_sys_recvmmsg |
422 | PTR sys_getdents | ||
422 | .size sysn32_call_table,.-sysn32_call_table | 423 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index b773c1112b14..e5cdfd603f8f 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c | |||
@@ -61,11 +61,9 @@ static int __init init_vdso(void) | |||
61 | 61 | ||
62 | vunmap(vdso); | 62 | vunmap(vdso); |
63 | 63 | ||
64 | pr_notice("init_vdso successfull\n"); | ||
65 | |||
66 | return 0; | 64 | return 0; |
67 | } | 65 | } |
68 | device_initcall(init_vdso); | 66 | subsys_initcall(init_vdso); |
69 | 67 | ||
70 | static unsigned long vdso_addr(unsigned long start) | 68 | static unsigned long vdso_addr(unsigned long start) |
71 | { | 69 | { |
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c index 2fbfa1a8c3a9..bf80921f2f56 100644 --- a/arch/mips/mti-malta/malta-pci.c +++ b/arch/mips/mti-malta/malta-pci.c | |||
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void) | |||
247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ | 247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ |
248 | ioport_resource.end = controller->io_resource->end; | 248 | ioport_resource.end = controller->io_resource->end; |
249 | 249 | ||
250 | controller->io_map_base = mips_io_port_base; | ||
251 | |||
250 | register_pci_controller(controller); | 252 | register_pci_controller(controller); |
251 | } | 253 | } |
252 | 254 | ||
diff --git a/arch/mips/nxp/pnx8550/common/pci.c b/arch/mips/nxp/pnx8550/common/pci.c index eee4f3dfc410..98e86ddb86cc 100644 --- a/arch/mips/nxp/pnx8550/common/pci.c +++ b/arch/mips/nxp/pnx8550/common/pci.c | |||
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops; | |||
44 | 44 | ||
45 | static struct pci_controller pnx8550_controller = { | 45 | static struct pci_controller pnx8550_controller = { |
46 | .pci_ops = &pnx8550_pci_ops, | 46 | .pci_ops = &pnx8550_pci_ops, |
47 | .io_map_base = PNX8550_PORT_BASE, | ||
47 | .io_resource = &pci_io_resource, | 48 | .io_resource = &pci_io_resource, |
48 | .mem_resource = &pci_mem_resource, | 49 | .mem_resource = &pci_mem_resource, |
49 | }; | 50 | }; |
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c index 2aed50fef10f..64246c9c875c 100644 --- a/arch/mips/nxp/pnx8550/common/setup.c +++ b/arch/mips/nxp/pnx8550/common/setup.c | |||
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void) | |||
113 | PNX8550_GLB2_ENAB_INTA_O = 0; | 113 | PNX8550_GLB2_ENAB_INTA_O = 0; |
114 | 114 | ||
115 | /* IO/MEM resources. */ | 115 | /* IO/MEM resources. */ |
116 | set_io_port_base(KSEG1); | 116 | set_io_port_base(PNX8550_PORT_BASE); |
117 | ioport_resource.start = 0; | 117 | ioport_resource.start = 0; |
118 | ioport_resource.end = ~0; | 118 | ioport_resource.end = ~0; |
119 | iomem_resource.start = 0; | 119 | iomem_resource.start = 0; |
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 04b31478a6d7..b7c03d80c88c 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c | |||
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = { | |||
944 | .pci_ops = &msp_pci_ops, | 944 | .pci_ops = &msp_pci_ops, |
945 | .mem_resource = &pci_mem_resource, | 945 | .mem_resource = &pci_mem_resource, |
946 | .mem_offset = 0, | 946 | .mem_offset = 0, |
947 | .io_map_base = MSP_PCI_IOSPACE_BASE, | ||
947 | .io_resource = &pci_io_resource, | 948 | .io_resource = &pci_io_resource, |
948 | .io_offset = 0 | 949 | .io_offset = 0 |
949 | }; | 950 | }; |
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c index 0357946f30e6..cf5e1a25cb7d 100644 --- a/arch/mips/pci/pci-yosemite.c +++ b/arch/mips/pci/pci-yosemite.c | |||
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void) | |||
54 | panic(ioremap_failed); | 54 | panic(ioremap_failed); |
55 | 55 | ||
56 | set_io_port_base(io_v_base); | 56 | set_io_port_base(io_v_base); |
57 | py_controller.io_map_base = io_v_base; | ||
57 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); | 58 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); |
58 | 59 | ||
59 | ioport_resource.end = TITAN_IO_SIZE - 1; | 60 | ioport_resource.end = TITAN_IO_SIZE - 1; |
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index 8ee77887306a..9ec523e4dd06 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -472,6 +472,9 @@ void __init configure_platform(void) | |||
472 | * it*/ | 472 | * it*/ |
473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; | 473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; |
474 | 474 | ||
475 | /* Cronus and Cronus Lite have the same register map */ | ||
476 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
477 | |||
475 | /* ASIC version will determine if this is a real CronusLite or | 478 | /* ASIC version will determine if this is a real CronusLite or |
476 | * Castrati(Cronus) */ | 479 | * Castrati(Cronus) */ |
477 | chipversion = asic_read(chipver3) << 24; | 480 | chipversion = asic_read(chipver3) << 24; |
@@ -484,8 +487,6 @@ void __init configure_platform(void) | |||
484 | else | 487 | else |
485 | asic = ASIC_CRONUSLITE; | 488 | asic = ASIC_CRONUSLITE; |
486 | 489 | ||
487 | /* Cronus and Cronus Lite have the same register map */ | ||
488 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
489 | gp_resources = non_dvr_cronuslite_resources; | 490 | gp_resources = non_dvr_cronuslite_resources; |
490 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " | 491 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " |
491 | "chipversion=0x%08X\n", | 492 | "chipversion=0x%08X\n", |
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c index 369872f6cf78..babcceecd2ea 100644 --- a/arch/powerpc/kernel/perf_event_fsl_emb.c +++ b/arch/powerpc/kernel/perf_event_fsl_emb.c | |||
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val, | |||
566 | * Finally record data if requested. | 566 | * Finally record data if requested. |
567 | */ | 567 | */ |
568 | if (record) { | 568 | if (record) { |
569 | struct perf_sample_data data = { | 569 | struct perf_sample_data data; |
570 | .period = event->hw.last_period, | 570 | |
571 | }; | 571 | perf_sample_data_init(&data, 0); |
572 | 572 | ||
573 | if (perf_event_overflow(event, nmi, &data, regs)) { | 573 | if (perf_event_overflow(event, nmi, &data, regs)) { |
574 | /* | 574 | /* |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index d5e3e6007447..bea9ee37ac9d 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -535,8 +535,16 @@ pgm_no_vtime2: | |||
535 | l %r3,__LC_PGM_ILC # load program interruption code | 535 | l %r3,__LC_PGM_ILC # load program interruption code |
536 | la %r8,0x7f | 536 | la %r8,0x7f |
537 | nr %r8,%r3 # clear per-event-bit and ilc | 537 | nr %r8,%r3 # clear per-event-bit and ilc |
538 | be BASED(pgm_exit) # only per or per+check ? | 538 | be BASED(pgm_exit2) # only per or per+check ? |
539 | b BASED(pgm_do_call) | 539 | l %r7,BASED(.Ljump_table) |
540 | sll %r8,2 | ||
541 | l %r7,0(%r8,%r7) # load address of handler routine | ||
542 | la %r2,SP_PTREGS(%r15) # address of register-save area | ||
543 | basr %r14,%r7 # branch to interrupt-handler | ||
544 | pgm_exit2: | ||
545 | TRACE_IRQS_ON | ||
546 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | ||
547 | b BASED(sysc_return) | ||
540 | 548 | ||
541 | # | 549 | # |
542 | # it was a single stepped SVC that is causing all the trouble | 550 | # it was a single stepped SVC that is causing all the trouble |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index e7192e1cb678..8bccec15ea90 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
@@ -544,8 +544,16 @@ pgm_no_vtime2: | |||
544 | lgf %r3,__LC_PGM_ILC # load program interruption code | 544 | lgf %r3,__LC_PGM_ILC # load program interruption code |
545 | lghi %r8,0x7f | 545 | lghi %r8,0x7f |
546 | ngr %r8,%r3 # clear per-event-bit and ilc | 546 | ngr %r8,%r3 # clear per-event-bit and ilc |
547 | je pgm_exit | 547 | je pgm_exit2 |
548 | j pgm_do_call | 548 | sll %r8,3 |
549 | larl %r1,pgm_check_table | ||
550 | lg %r1,0(%r8,%r1) # load address of handler routine | ||
551 | la %r2,SP_PTREGS(%r15) # address of register-save area | ||
552 | basr %r14,%r1 # branch to interrupt-handler | ||
553 | pgm_exit2: | ||
554 | TRACE_IRQS_ON | ||
555 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | ||
556 | j sysc_return | ||
549 | 557 | ||
550 | # | 558 | # |
551 | # it was a single stepped SVC that is causing all the trouble | 559 | # it was a single stepped SVC that is causing all the trouble |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index a2163c95eb98..15a7536452d5 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -524,8 +524,11 @@ void etr_switch_to_local(void) | |||
524 | if (!etr_eacr.sl) | 524 | if (!etr_eacr.sl) |
525 | return; | 525 | return; |
526 | disable_sync_clock(NULL); | 526 | disable_sync_clock(NULL); |
527 | set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events); | 527 | if (!test_and_set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events)) { |
528 | queue_work(time_sync_wq, &etr_work); | 528 | etr_eacr.es = etr_eacr.sl = 0; |
529 | etr_setr(&etr_eacr); | ||
530 | queue_work(time_sync_wq, &etr_work); | ||
531 | } | ||
529 | } | 532 | } |
530 | 533 | ||
531 | /* | 534 | /* |
@@ -539,8 +542,11 @@ void etr_sync_check(void) | |||
539 | if (!etr_eacr.es) | 542 | if (!etr_eacr.es) |
540 | return; | 543 | return; |
541 | disable_sync_clock(NULL); | 544 | disable_sync_clock(NULL); |
542 | set_bit(ETR_EVENT_SYNC_CHECK, &etr_events); | 545 | if (!test_and_set_bit(ETR_EVENT_SYNC_CHECK, &etr_events)) { |
543 | queue_work(time_sync_wq, &etr_work); | 546 | etr_eacr.es = 0; |
547 | etr_setr(&etr_eacr); | ||
548 | queue_work(time_sync_wq, &etr_work); | ||
549 | } | ||
544 | } | 550 | } |
545 | 551 | ||
546 | /* | 552 | /* |
@@ -902,7 +908,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib *aib, | |||
902 | * Do not try to get the alternate port aib if the clock | 908 | * Do not try to get the alternate port aib if the clock |
903 | * is not in sync yet. | 909 | * is not in sync yet. |
904 | */ | 910 | */ |
905 | if (!check_sync_clock()) | 911 | if (!eacr.es || !check_sync_clock()) |
906 | return eacr; | 912 | return eacr; |
907 | 913 | ||
908 | /* | 914 | /* |
@@ -1064,7 +1070,7 @@ static void etr_work_fn(struct work_struct *work) | |||
1064 | * If the clock is in sync just update the eacr and return. | 1070 | * If the clock is in sync just update the eacr and return. |
1065 | * If there is no valid sync port wait for a port update. | 1071 | * If there is no valid sync port wait for a port update. |
1066 | */ | 1072 | */ |
1067 | if (check_sync_clock() || sync_port < 0) { | 1073 | if ((eacr.es && check_sync_clock()) || sync_port < 0) { |
1068 | etr_update_eacr(eacr); | 1074 | etr_update_eacr(eacr); |
1069 | etr_set_tolec_timeout(now); | 1075 | etr_set_tolec_timeout(now); |
1070 | goto out_unlock; | 1076 | goto out_unlock; |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index ce7cde713e71..a36de5bbb622 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
371 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) |
372 | ret = -ENODEV; | 372 | return -ENODEV; |
373 | goto out_free; | ||
374 | } | ||
375 | 373 | ||
376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
377 | if (errors) { | 375 | if (errors) |
378 | ret = -ENODEV; | 376 | return -ENODEV; |
379 | goto out_free; | ||
380 | } | ||
381 | 377 | ||
382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
383 | if (!(supported & 0x1)) { | 379 | if (!(supported & 0x1)) |
384 | ret = -ENODEV; | 380 | return -ENODEV; |
385 | goto out_free; | ||
386 | } | ||
387 | 381 | ||
388 | out_free: | 382 | out_free: |
389 | kfree(output.pointer); | 383 | kfree(output.pointer); |
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void) | |||
397 | struct pcc_memory_resource *mem_resource; | 391 | struct pcc_memory_resource *mem_resource; |
398 | struct pcc_register_resource *reg_resource; | 392 | struct pcc_register_resource *reg_resource; |
399 | union acpi_object *out_obj, *member; | 393 | union acpi_object *out_obj, *member; |
400 | acpi_handle handle, osc_handle; | 394 | acpi_handle handle, osc_handle, pcch_handle; |
401 | int ret = 0; | 395 | int ret = 0; |
402 | 396 | ||
403 | status = acpi_get_handle(NULL, "\\_SB", &handle); | 397 | status = acpi_get_handle(NULL, "\\_SB", &handle); |
404 | if (ACPI_FAILURE(status)) | 398 | if (ACPI_FAILURE(status)) |
405 | return -ENODEV; | 399 | return -ENODEV; |
406 | 400 | ||
401 | status = acpi_get_handle(handle, "PCCH", &pcch_handle); | ||
402 | if (ACPI_FAILURE(status)) | ||
403 | return -ENODEV; | ||
404 | |||
407 | status = acpi_get_handle(handle, "_OSC", &osc_handle); | 405 | status = acpi_get_handle(handle, "_OSC", &osc_handle); |
408 | if (ACPI_SUCCESS(status)) { | 406 | if (ACPI_SUCCESS(status)) { |
409 | ret = pcc_cpufreq_do_osc(&osc_handle); | 407 | ret = pcc_cpufreq_do_osc(&osc_handle); |
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
543 | 541 | ||
544 | if (!pcch_virt_addr) { | 542 | if (!pcch_virt_addr) { |
545 | result = -1; | 543 | result = -1; |
546 | goto pcch_null; | 544 | goto out; |
547 | } | 545 | } |
548 | 546 | ||
549 | result = pcc_get_offset(cpu); | 547 | result = pcc_get_offset(cpu); |
550 | if (result) { | 548 | if (result) { |
551 | dprintk("init: PCCP evaluation failed\n"); | 549 | dprintk("init: PCCP evaluation failed\n"); |
552 | goto free; | 550 | goto out; |
553 | } | 551 | } |
554 | 552 | ||
555 | policy->max = policy->cpuinfo.max_freq = | 553 | policy->max = policy->cpuinfo.max_freq = |
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
558 | ioread32(&pcch_hdr->minimum_frequency) * 1000; | 556 | ioread32(&pcch_hdr->minimum_frequency) * 1000; |
559 | policy->cur = pcc_get_freq(cpu); | 557 | policy->cur = pcc_get_freq(cpu); |
560 | 558 | ||
559 | if (!policy->cur) { | ||
560 | dprintk("init: Unable to get current CPU frequency\n"); | ||
561 | result = -EINVAL; | ||
562 | goto out; | ||
563 | } | ||
564 | |||
561 | dprintk("init: policy->max is %d, policy->min is %d\n", | 565 | dprintk("init: policy->max is %d, policy->min is %d\n", |
562 | policy->max, policy->min); | 566 | policy->max, policy->min); |
563 | 567 | out: | |
564 | return 0; | ||
565 | free: | ||
566 | pcc_clear_mapping(); | ||
567 | free_percpu(pcc_cpu_info); | ||
568 | pcch_null: | ||
569 | return result; | 568 | return result; |
570 | } | 569 | } |
571 | 570 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 7ec2123838e6..3e90cce3dc8b 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data) | |||
1023 | } | 1023 | } |
1024 | if (max_latency == 0) { | 1024 | if (max_latency == 0) { |
1025 | /* | 1025 | /* |
1026 | * Fam 11h always returns 0 as transition latency. | 1026 | * Fam 11h and later may return 0 as transition latency. This |
1027 | * This is intended and means "very fast". While cpufreq core | 1027 | * is intended and means "very fast". While cpufreq core and |
1028 | * and governors currently can handle that gracefully, better | 1028 | * governors currently can handle that gracefully, better set it |
1029 | * set it to 1 to avoid problems in the future. | 1029 | * to 1 to avoid problems in the future. |
1030 | * For all others it's a BIOS bug. | ||
1031 | */ | 1030 | */ |
1032 | if (boot_cpu_data.x86 != 0x11) | 1031 | if (boot_cpu_data.x86 < 0x11) |
1033 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " | 1032 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " |
1034 | "latency\n"); | 1033 | "latency\n"); |
1035 | max_latency = 1; | 1034 | max_latency = 1; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce-apei.c b/arch/x86/kernel/cpu/mcheck/mce-apei.c index 745b54f9be89..8209472b27a5 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-apei.c +++ b/arch/x86/kernel/cpu/mcheck/mce-apei.c | |||
@@ -80,7 +80,7 @@ int apei_write_mce(struct mce *m) | |||
80 | rcd.hdr.revision = CPER_RECORD_REV; | 80 | rcd.hdr.revision = CPER_RECORD_REV; |
81 | rcd.hdr.signature_end = CPER_SIG_END; | 81 | rcd.hdr.signature_end = CPER_SIG_END; |
82 | rcd.hdr.section_count = 1; | 82 | rcd.hdr.section_count = 1; |
83 | rcd.hdr.error_severity = CPER_SER_FATAL; | 83 | rcd.hdr.error_severity = CPER_SEV_FATAL; |
84 | /* timestamp, platform_id, partition_id are all invalid */ | 84 | /* timestamp, platform_id, partition_id are all invalid */ |
85 | rcd.hdr.validation_bits = 0; | 85 | rcd.hdr.validation_bits = 0; |
86 | rcd.hdr.record_length = sizeof(rcd); | 86 | rcd.hdr.record_length = sizeof(rcd); |
@@ -96,7 +96,7 @@ int apei_write_mce(struct mce *m) | |||
96 | rcd.sec_hdr.validation_bits = 0; | 96 | rcd.sec_hdr.validation_bits = 0; |
97 | rcd.sec_hdr.flags = CPER_SEC_PRIMARY; | 97 | rcd.sec_hdr.flags = CPER_SEC_PRIMARY; |
98 | rcd.sec_hdr.section_type = CPER_SECTION_TYPE_MCE; | 98 | rcd.sec_hdr.section_type = CPER_SECTION_TYPE_MCE; |
99 | rcd.sec_hdr.section_severity = CPER_SER_FATAL; | 99 | rcd.sec_hdr.section_severity = CPER_SEV_FATAL; |
100 | 100 | ||
101 | memcpy(&rcd.mce, m, sizeof(*m)); | 101 | memcpy(&rcd.mce, m, sizeof(*m)); |
102 | 102 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index a198b7c87a12..ba390d731175 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init); | |||
964 | 964 | ||
965 | void hpet_disable(void) | 965 | void hpet_disable(void) |
966 | { | 966 | { |
967 | if (is_hpet_capable()) { | 967 | if (is_hpet_capable() && hpet_virt_address) { |
968 | unsigned int cfg = hpet_readl(HPET_CFG); | 968 | unsigned int cfg = hpet_readl(HPET_CFG); |
969 | 969 | ||
970 | if (hpet_legacy_int_enabled) { | 970 | if (hpet_legacy_int_enabled) { |
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 7c9f02c130f3..cafa7c80ac95 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = { | |||
276 | .cls = &i8259_sysdev_class, | 276 | .cls = &i8259_sysdev_class, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static int __init i8259A_init_sysfs(void) | ||
280 | { | ||
281 | int error = sysdev_class_register(&i8259_sysdev_class); | ||
282 | if (!error) | ||
283 | error = sysdev_register(&device_i8259A); | ||
284 | return error; | ||
285 | } | ||
286 | |||
287 | device_initcall(i8259A_init_sysfs); | ||
288 | |||
289 | static void mask_8259A(void) | 279 | static void mask_8259A(void) |
290 | { | 280 | { |
291 | unsigned long flags; | 281 | unsigned long flags; |
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = { | |||
407 | }; | 397 | }; |
408 | 398 | ||
409 | struct legacy_pic *legacy_pic = &default_legacy_pic; | 399 | struct legacy_pic *legacy_pic = &default_legacy_pic; |
400 | |||
401 | static int __init i8259A_init_sysfs(void) | ||
402 | { | ||
403 | int error; | ||
404 | |||
405 | if (legacy_pic != &default_legacy_pic) | ||
406 | return 0; | ||
407 | |||
408 | error = sysdev_class_register(&i8259_sysdev_class); | ||
409 | if (!error) | ||
410 | error = sysdev_register(&device_i8259A); | ||
411 | return error; | ||
412 | } | ||
413 | |||
414 | device_initcall(i8259A_init_sysfs); | ||
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index 4f4af75b9482..01ab17ae2ae7 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd) | |||
572 | return NOTIFY_STOP; | 572 | return NOTIFY_STOP; |
573 | } | 573 | } |
574 | 574 | ||
575 | #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP | ||
576 | int kgdb_ll_trap(int cmd, const char *str, | 575 | int kgdb_ll_trap(int cmd, const char *str, |
577 | struct pt_regs *regs, long err, int trap, int sig) | 576 | struct pt_regs *regs, long err, int trap, int sig) |
578 | { | 577 | { |
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str, | |||
590 | 589 | ||
591 | return __kgdb_notify(&args, cmd); | 590 | return __kgdb_notify(&args, cmd); |
592 | } | 591 | } |
593 | #endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */ | ||
594 | 592 | ||
595 | static int | 593 | static int |
596 | kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) | 594 | kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) |
@@ -625,6 +623,12 @@ int kgdb_arch_init(void) | |||
625 | return register_die_notifier(&kgdb_notifier); | 623 | return register_die_notifier(&kgdb_notifier); |
626 | } | 624 | } |
627 | 625 | ||
626 | static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi, | ||
627 | struct perf_sample_data *data, struct pt_regs *regs) | ||
628 | { | ||
629 | kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP); | ||
630 | } | ||
631 | |||
628 | void kgdb_arch_late(void) | 632 | void kgdb_arch_late(void) |
629 | { | 633 | { |
630 | int i, cpu; | 634 | int i, cpu; |
@@ -655,6 +659,7 @@ void kgdb_arch_late(void) | |||
655 | for_each_online_cpu(cpu) { | 659 | for_each_online_cpu(cpu) { |
656 | pevent = per_cpu_ptr(breakinfo[i].pev, cpu); | 660 | pevent = per_cpu_ptr(breakinfo[i].pev, cpu); |
657 | pevent[0]->hw.sample_period = 1; | 661 | pevent[0]->hw.sample_period = 1; |
662 | pevent[0]->overflow_handler = kgdb_hw_overflow_handler; | ||
658 | if (pevent[0]->destroy != NULL) { | 663 | if (pevent[0]->destroy != NULL) { |
659 | pevent[0]->destroy = NULL; | 664 | pevent[0]->destroy = NULL; |
660 | release_bp_slot(*pevent); | 665 | release_bp_slot(*pevent); |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 89d66ca4d87c..2331bdc2b549 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
342 | /* advance table_gfn when emulating 1gb pages with 4k */ | 342 | /* advance table_gfn when emulating 1gb pages with 4k */ |
343 | if (delta == 0) | 343 | if (delta == 0) |
344 | table_gfn += PT_INDEX(addr, level); | 344 | table_gfn += PT_INDEX(addr, level); |
345 | access &= gw->pte_access; | ||
345 | } else { | 346 | } else { |
346 | direct = 0; | 347 | direct = 0; |
347 | table_gfn = gw->table_gfn[level - 2]; | 348 | table_gfn = gw->table_gfn[level - 2]; |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 05d571f6f196..7fa89c39c64f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1562 | 1562 | ||
1563 | r = -ENOMEM; | 1563 | r = -ENOMEM; |
1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; | 1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; |
1565 | entries = vmalloc(size); | 1565 | entries = kmalloc(size, GFP_KERNEL); |
1566 | if (!entries) | 1566 | if (!entries) |
1567 | goto out; | 1567 | goto out; |
1568 | 1568 | ||
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1581 | r = n; | 1581 | r = n; |
1582 | 1582 | ||
1583 | out_free: | 1583 | out_free: |
1584 | vfree(entries); | 1584 | kfree(entries); |
1585 | out: | 1585 | out: |
1586 | return r; | 1586 | return r; |
1587 | } | 1587 | } |
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 6ee33169e1dc..7891904419fc 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile | |||
@@ -39,6 +39,7 @@ acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o | |||
39 | acpi-y += power.o | 39 | acpi-y += power.o |
40 | acpi-y += system.o event.o | 40 | acpi-y += system.o event.o |
41 | acpi-$(CONFIG_ACPI_DEBUG) += debug.o | 41 | acpi-$(CONFIG_ACPI_DEBUG) += debug.o |
42 | acpi-$(CONFIG_DEBUG_FS) += debugfs.o | ||
42 | acpi-$(CONFIG_ACPI_NUMA) += numa.o | 43 | acpi-$(CONFIG_ACPI_NUMA) += numa.o |
43 | acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o | 44 | acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o |
44 | ifdef CONFIG_ACPI_VIDEO | 45 | ifdef CONFIG_ACPI_VIDEO |
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 899d68afc3c5..92122292ef1f 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -115,7 +115,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE); | |||
115 | /* | 115 | /* |
116 | * Optionally enable output from the AML Debug Object. | 116 | * Optionally enable output from the AML Debug Object. |
117 | */ | 117 | */ |
118 | u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); | 118 | u32 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); |
119 | 119 | ||
120 | /* | 120 | /* |
121 | * Optionally copy the entire DSDT to local memory (instead of simply | 121 | * Optionally copy the entire DSDT to local memory (instead of simply |
diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index f8c668f27b5a..907e350f1c7d 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig | |||
@@ -28,3 +28,12 @@ config ACPI_APEI_EINJ | |||
28 | EINJ provides a hardware error injection mechanism, it is | 28 | EINJ provides a hardware error injection mechanism, it is |
29 | mainly used for debugging and testing the other parts of | 29 | mainly used for debugging and testing the other parts of |
30 | APEI and some other RAS features. | 30 | APEI and some other RAS features. |
31 | |||
32 | config ACPI_APEI_ERST_DEBUG | ||
33 | tristate "APEI Error Record Serialization Table (ERST) Debug Support" | ||
34 | depends on ACPI_APEI | ||
35 | help | ||
36 | ERST is a way provided by APEI to save and retrieve hardware | ||
37 | error infomation to and from a persistent store. Enable this | ||
38 | if you want to debugging and testing the ERST kernel support | ||
39 | and firmware implementation. | ||
diff --git a/drivers/acpi/apei/Makefile b/drivers/acpi/apei/Makefile index b13b03a17789..d1d1bc0a4ee1 100644 --- a/drivers/acpi/apei/Makefile +++ b/drivers/acpi/apei/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | obj-$(CONFIG_ACPI_APEI) += apei.o | 1 | obj-$(CONFIG_ACPI_APEI) += apei.o |
2 | obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o | 2 | obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o |
3 | obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o | 3 | obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o |
4 | obj-$(CONFIG_ACPI_APEI_ERST_DEBUG) += erst-dbg.o | ||
4 | 5 | ||
5 | apei-y := apei-base.o hest.o cper.o erst.o | 6 | apei-y := apei-base.o hest.o cper.o erst.o |
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 216e1e948ff6..73fd0c7487c1 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c | |||
@@ -482,14 +482,14 @@ err_unmap_ioport: | |||
482 | list_for_each_entry(res, &resources->ioport, list) { | 482 | list_for_each_entry(res, &resources->ioport, list) { |
483 | if (res == res_bak) | 483 | if (res == res_bak) |
484 | break; | 484 | break; |
485 | release_mem_region(res->start, res->end - res->start); | 485 | release_region(res->start, res->end - res->start); |
486 | } | 486 | } |
487 | res_bak = NULL; | 487 | res_bak = NULL; |
488 | err_unmap_iomem: | 488 | err_unmap_iomem: |
489 | list_for_each_entry(res, &resources->iomem, list) { | 489 | list_for_each_entry(res, &resources->iomem, list) { |
490 | if (res == res_bak) | 490 | if (res == res_bak) |
491 | break; | 491 | break; |
492 | release_region(res->start, res->end - res->start); | 492 | release_mem_region(res->start, res->end - res->start); |
493 | } | 493 | } |
494 | return -EINVAL; | 494 | return -EINVAL; |
495 | } | 495 | } |
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c new file mode 100644 index 000000000000..5281ddda2777 --- /dev/null +++ b/drivers/acpi/apei/erst-dbg.c | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * APEI Error Record Serialization Table debug support | ||
3 | * | ||
4 | * ERST is a way provided by APEI to save and retrieve hardware error | ||
5 | * infomation to and from a persistent store. This file provide the | ||
6 | * debugging/testing support for ERST kernel support and firmware | ||
7 | * implementation. | ||
8 | * | ||
9 | * Copyright 2010 Intel Corp. | ||
10 | * Author: Huang Ying <ying.huang@intel.com> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License version | ||
14 | * 2 as published by the Free Software Foundation. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
24 | */ | ||
25 | |||
26 | #include <linux/kernel.h> | ||
27 | #include <linux/module.h> | ||
28 | #include <linux/uaccess.h> | ||
29 | #include <acpi/apei.h> | ||
30 | #include <linux/miscdevice.h> | ||
31 | |||
32 | #include "apei-internal.h" | ||
33 | |||
34 | #define ERST_DBG_PFX "ERST DBG: " | ||
35 | |||
36 | #define ERST_DBG_RECORD_LEN_MAX 4096 | ||
37 | |||
38 | static void *erst_dbg_buf; | ||
39 | static unsigned int erst_dbg_buf_len; | ||
40 | |||
41 | /* Prevent erst_dbg_read/write from being invoked concurrently */ | ||
42 | static DEFINE_MUTEX(erst_dbg_mutex); | ||
43 | |||
44 | static int erst_dbg_open(struct inode *inode, struct file *file) | ||
45 | { | ||
46 | if (erst_disable) | ||
47 | return -ENODEV; | ||
48 | |||
49 | return nonseekable_open(inode, file); | ||
50 | } | ||
51 | |||
52 | static long erst_dbg_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | ||
53 | { | ||
54 | int rc; | ||
55 | u64 record_id; | ||
56 | u32 record_count; | ||
57 | |||
58 | switch (cmd) { | ||
59 | case APEI_ERST_CLEAR_RECORD: | ||
60 | rc = copy_from_user(&record_id, (void __user *)arg, | ||
61 | sizeof(record_id)); | ||
62 | if (rc) | ||
63 | return -EFAULT; | ||
64 | return erst_clear(record_id); | ||
65 | case APEI_ERST_GET_RECORD_COUNT: | ||
66 | rc = erst_get_record_count(); | ||
67 | if (rc < 0) | ||
68 | return rc; | ||
69 | record_count = rc; | ||
70 | rc = put_user(record_count, (u32 __user *)arg); | ||
71 | if (rc) | ||
72 | return rc; | ||
73 | return 0; | ||
74 | default: | ||
75 | return -ENOTTY; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf, | ||
80 | size_t usize, loff_t *off) | ||
81 | { | ||
82 | int rc; | ||
83 | ssize_t len = 0; | ||
84 | u64 id; | ||
85 | |||
86 | if (*off != 0) | ||
87 | return -EINVAL; | ||
88 | |||
89 | if (mutex_lock_interruptible(&erst_dbg_mutex) != 0) | ||
90 | return -EINTR; | ||
91 | |||
92 | retry_next: | ||
93 | rc = erst_get_next_record_id(&id); | ||
94 | if (rc) | ||
95 | goto out; | ||
96 | /* no more record */ | ||
97 | if (id == APEI_ERST_INVALID_RECORD_ID) | ||
98 | goto out; | ||
99 | retry: | ||
100 | rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len); | ||
101 | /* The record may be cleared by others, try read next record */ | ||
102 | if (rc == -ENOENT) | ||
103 | goto retry_next; | ||
104 | if (rc < 0) | ||
105 | goto out; | ||
106 | if (len > ERST_DBG_RECORD_LEN_MAX) { | ||
107 | pr_warning(ERST_DBG_PFX | ||
108 | "Record (ID: 0x%llx) length is too long: %zd\n", | ||
109 | id, len); | ||
110 | rc = -EIO; | ||
111 | goto out; | ||
112 | } | ||
113 | if (len > erst_dbg_buf_len) { | ||
114 | kfree(erst_dbg_buf); | ||
115 | rc = -ENOMEM; | ||
116 | erst_dbg_buf = kmalloc(len, GFP_KERNEL); | ||
117 | if (!erst_dbg_buf) | ||
118 | goto out; | ||
119 | erst_dbg_buf_len = len; | ||
120 | goto retry; | ||
121 | } | ||
122 | |||
123 | rc = -EINVAL; | ||
124 | if (len > usize) | ||
125 | goto out; | ||
126 | |||
127 | rc = -EFAULT; | ||
128 | if (copy_to_user(ubuf, erst_dbg_buf, len)) | ||
129 | goto out; | ||
130 | rc = 0; | ||
131 | out: | ||
132 | mutex_unlock(&erst_dbg_mutex); | ||
133 | return rc ? rc : len; | ||
134 | } | ||
135 | |||
136 | static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf, | ||
137 | size_t usize, loff_t *off) | ||
138 | { | ||
139 | int rc; | ||
140 | struct cper_record_header *rcd; | ||
141 | |||
142 | if (!capable(CAP_SYS_ADMIN)) | ||
143 | return -EPERM; | ||
144 | |||
145 | if (usize > ERST_DBG_RECORD_LEN_MAX) { | ||
146 | pr_err(ERST_DBG_PFX "Too long record to be written\n"); | ||
147 | return -EINVAL; | ||
148 | } | ||
149 | |||
150 | if (mutex_lock_interruptible(&erst_dbg_mutex)) | ||
151 | return -EINTR; | ||
152 | if (usize > erst_dbg_buf_len) { | ||
153 | kfree(erst_dbg_buf); | ||
154 | rc = -ENOMEM; | ||
155 | erst_dbg_buf = kmalloc(usize, GFP_KERNEL); | ||
156 | if (!erst_dbg_buf) | ||
157 | goto out; | ||
158 | erst_dbg_buf_len = usize; | ||
159 | } | ||
160 | rc = copy_from_user(erst_dbg_buf, ubuf, usize); | ||
161 | if (rc) { | ||
162 | rc = -EFAULT; | ||
163 | goto out; | ||
164 | } | ||
165 | rcd = erst_dbg_buf; | ||
166 | rc = -EINVAL; | ||
167 | if (rcd->record_length != usize) | ||
168 | goto out; | ||
169 | |||
170 | rc = erst_write(erst_dbg_buf); | ||
171 | |||
172 | out: | ||
173 | mutex_unlock(&erst_dbg_mutex); | ||
174 | return rc < 0 ? rc : usize; | ||
175 | } | ||
176 | |||
177 | static const struct file_operations erst_dbg_ops = { | ||
178 | .owner = THIS_MODULE, | ||
179 | .open = erst_dbg_open, | ||
180 | .read = erst_dbg_read, | ||
181 | .write = erst_dbg_write, | ||
182 | .unlocked_ioctl = erst_dbg_ioctl, | ||
183 | }; | ||
184 | |||
185 | static struct miscdevice erst_dbg_dev = { | ||
186 | .minor = MISC_DYNAMIC_MINOR, | ||
187 | .name = "erst_dbg", | ||
188 | .fops = &erst_dbg_ops, | ||
189 | }; | ||
190 | |||
191 | static __init int erst_dbg_init(void) | ||
192 | { | ||
193 | return misc_register(&erst_dbg_dev); | ||
194 | } | ||
195 | |||
196 | static __exit void erst_dbg_exit(void) | ||
197 | { | ||
198 | misc_deregister(&erst_dbg_dev); | ||
199 | kfree(erst_dbg_buf); | ||
200 | } | ||
201 | |||
202 | module_init(erst_dbg_init); | ||
203 | module_exit(erst_dbg_exit); | ||
204 | |||
205 | MODULE_AUTHOR("Huang Ying"); | ||
206 | MODULE_DESCRIPTION("APEI Error Record Serialization Table debug support"); | ||
207 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index fd0cc016a099..385a6059714a 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -41,6 +41,8 @@ | |||
41 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
42 | #include <linux/cper.h> | 42 | #include <linux/cper.h> |
43 | #include <linux/kdebug.h> | 43 | #include <linux/kdebug.h> |
44 | #include <linux/platform_device.h> | ||
45 | #include <linux/mutex.h> | ||
44 | #include <acpi/apei.h> | 46 | #include <acpi/apei.h> |
45 | #include <acpi/atomicio.h> | 47 | #include <acpi/atomicio.h> |
46 | #include <acpi/hed.h> | 48 | #include <acpi/hed.h> |
@@ -87,6 +89,7 @@ struct ghes { | |||
87 | * used for that. | 89 | * used for that. |
88 | */ | 90 | */ |
89 | static LIST_HEAD(ghes_sci); | 91 | static LIST_HEAD(ghes_sci); |
92 | static DEFINE_MUTEX(ghes_list_mutex); | ||
90 | 93 | ||
91 | static struct ghes *ghes_new(struct acpi_hest_generic *generic) | 94 | static struct ghes *ghes_new(struct acpi_hest_generic *generic) |
92 | { | 95 | { |
@@ -132,26 +135,26 @@ static void ghes_fini(struct ghes *ghes) | |||
132 | } | 135 | } |
133 | 136 | ||
134 | enum { | 137 | enum { |
135 | GHES_SER_NO = 0x0, | 138 | GHES_SEV_NO = 0x0, |
136 | GHES_SER_CORRECTED = 0x1, | 139 | GHES_SEV_CORRECTED = 0x1, |
137 | GHES_SER_RECOVERABLE = 0x2, | 140 | GHES_SEV_RECOVERABLE = 0x2, |
138 | GHES_SER_PANIC = 0x3, | 141 | GHES_SEV_PANIC = 0x3, |
139 | }; | 142 | }; |
140 | 143 | ||
141 | static inline int ghes_severity(int severity) | 144 | static inline int ghes_severity(int severity) |
142 | { | 145 | { |
143 | switch (severity) { | 146 | switch (severity) { |
144 | case CPER_SER_INFORMATIONAL: | 147 | case CPER_SEV_INFORMATIONAL: |
145 | return GHES_SER_NO; | 148 | return GHES_SEV_NO; |
146 | case CPER_SER_CORRECTED: | 149 | case CPER_SEV_CORRECTED: |
147 | return GHES_SER_CORRECTED; | 150 | return GHES_SEV_CORRECTED; |
148 | case CPER_SER_RECOVERABLE: | 151 | case CPER_SEV_RECOVERABLE: |
149 | return GHES_SER_RECOVERABLE; | 152 | return GHES_SEV_RECOVERABLE; |
150 | case CPER_SER_FATAL: | 153 | case CPER_SEV_FATAL: |
151 | return GHES_SER_PANIC; | 154 | return GHES_SEV_PANIC; |
152 | default: | 155 | default: |
153 | /* Unkown, go panic */ | 156 | /* Unkown, go panic */ |
154 | return GHES_SER_PANIC; | 157 | return GHES_SEV_PANIC; |
155 | } | 158 | } |
156 | } | 159 | } |
157 | 160 | ||
@@ -237,16 +240,16 @@ static void ghes_clear_estatus(struct ghes *ghes) | |||
237 | 240 | ||
238 | static void ghes_do_proc(struct ghes *ghes) | 241 | static void ghes_do_proc(struct ghes *ghes) |
239 | { | 242 | { |
240 | int ser, processed = 0; | 243 | int sev, processed = 0; |
241 | struct acpi_hest_generic_data *gdata; | 244 | struct acpi_hest_generic_data *gdata; |
242 | 245 | ||
243 | ser = ghes_severity(ghes->estatus->error_severity); | 246 | sev = ghes_severity(ghes->estatus->error_severity); |
244 | apei_estatus_for_each_section(ghes->estatus, gdata) { | 247 | apei_estatus_for_each_section(ghes->estatus, gdata) { |
245 | #ifdef CONFIG_X86_MCE | 248 | #ifdef CONFIG_X86_MCE |
246 | if (!uuid_le_cmp(*(uuid_le *)gdata->section_type, | 249 | if (!uuid_le_cmp(*(uuid_le *)gdata->section_type, |
247 | CPER_SEC_PLATFORM_MEM)) { | 250 | CPER_SEC_PLATFORM_MEM)) { |
248 | apei_mce_report_mem_error( | 251 | apei_mce_report_mem_error( |
249 | ser == GHES_SER_CORRECTED, | 252 | sev == GHES_SEV_CORRECTED, |
250 | (struct cper_sec_mem_err *)(gdata+1)); | 253 | (struct cper_sec_mem_err *)(gdata+1)); |
251 | processed = 1; | 254 | processed = 1; |
252 | } | 255 | } |
@@ -293,18 +296,15 @@ static struct notifier_block ghes_notifier_sci = { | |||
293 | .notifier_call = ghes_notify_sci, | 296 | .notifier_call = ghes_notify_sci, |
294 | }; | 297 | }; |
295 | 298 | ||
296 | static int hest_ghes_parse(struct acpi_hest_header *hest_hdr, void *data) | 299 | static int __devinit ghes_probe(struct platform_device *ghes_dev) |
297 | { | 300 | { |
298 | struct acpi_hest_generic *generic; | 301 | struct acpi_hest_generic *generic; |
299 | struct ghes *ghes = NULL; | 302 | struct ghes *ghes = NULL; |
300 | int rc = 0; | 303 | int rc = -EINVAL; |
301 | 304 | ||
302 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) | 305 | generic = ghes_dev->dev.platform_data; |
303 | return 0; | ||
304 | |||
305 | generic = (struct acpi_hest_generic *)hest_hdr; | ||
306 | if (!generic->enabled) | 306 | if (!generic->enabled) |
307 | return 0; | 307 | return -ENODEV; |
308 | 308 | ||
309 | if (generic->error_block_length < | 309 | if (generic->error_block_length < |
310 | sizeof(struct acpi_hest_generic_status)) { | 310 | sizeof(struct acpi_hest_generic_status)) { |
@@ -327,62 +327,91 @@ static int hest_ghes_parse(struct acpi_hest_header *hest_hdr, void *data) | |||
327 | ghes = NULL; | 327 | ghes = NULL; |
328 | goto err; | 328 | goto err; |
329 | } | 329 | } |
330 | switch (generic->notify.type) { | 330 | if (generic->notify.type == ACPI_HEST_NOTIFY_SCI) { |
331 | case ACPI_HEST_NOTIFY_POLLED: | 331 | mutex_lock(&ghes_list_mutex); |
332 | pr_warning(GHES_PFX | ||
333 | "Generic hardware error source: %d notified via POLL is not supported!\n", | ||
334 | generic->header.source_id); | ||
335 | break; | ||
336 | case ACPI_HEST_NOTIFY_EXTERNAL: | ||
337 | case ACPI_HEST_NOTIFY_LOCAL: | ||
338 | pr_warning(GHES_PFX | ||
339 | "Generic hardware error source: %d notified via IRQ is not supported!\n", | ||
340 | generic->header.source_id); | ||
341 | break; | ||
342 | case ACPI_HEST_NOTIFY_SCI: | ||
343 | if (list_empty(&ghes_sci)) | 332 | if (list_empty(&ghes_sci)) |
344 | register_acpi_hed_notifier(&ghes_notifier_sci); | 333 | register_acpi_hed_notifier(&ghes_notifier_sci); |
345 | list_add_rcu(&ghes->list, &ghes_sci); | 334 | list_add_rcu(&ghes->list, &ghes_sci); |
346 | break; | 335 | mutex_unlock(&ghes_list_mutex); |
347 | case ACPI_HEST_NOTIFY_NMI: | 336 | } else { |
348 | pr_warning(GHES_PFX | 337 | unsigned char *notify = NULL; |
349 | "Generic hardware error source: %d notified via NMI is not supported!\n", | 338 | |
350 | generic->header.source_id); | 339 | switch (generic->notify.type) { |
351 | break; | 340 | case ACPI_HEST_NOTIFY_POLLED: |
352 | default: | 341 | notify = "POLL"; |
353 | pr_warning(FW_WARN GHES_PFX | 342 | break; |
354 | "Unknown notification type: %u for generic hardware error source: %d\n", | 343 | case ACPI_HEST_NOTIFY_EXTERNAL: |
355 | generic->notify.type, generic->header.source_id); | 344 | case ACPI_HEST_NOTIFY_LOCAL: |
356 | break; | 345 | notify = "IRQ"; |
346 | break; | ||
347 | case ACPI_HEST_NOTIFY_NMI: | ||
348 | notify = "NMI"; | ||
349 | break; | ||
350 | } | ||
351 | if (notify) { | ||
352 | pr_warning(GHES_PFX | ||
353 | "Generic hardware error source: %d notified via %s is not supported!\n", | ||
354 | generic->header.source_id, notify); | ||
355 | } else { | ||
356 | pr_warning(FW_WARN GHES_PFX | ||
357 | "Unknown notification type: %u for generic hardware error source: %d\n", | ||
358 | generic->notify.type, generic->header.source_id); | ||
359 | } | ||
360 | rc = -ENODEV; | ||
361 | goto err; | ||
357 | } | 362 | } |
363 | platform_set_drvdata(ghes_dev, ghes); | ||
358 | 364 | ||
359 | return 0; | 365 | return 0; |
360 | err: | 366 | err: |
361 | if (ghes) | 367 | if (ghes) { |
362 | ghes_fini(ghes); | 368 | ghes_fini(ghes); |
369 | kfree(ghes); | ||
370 | } | ||
363 | return rc; | 371 | return rc; |
364 | } | 372 | } |
365 | 373 | ||
366 | static void ghes_cleanup(void) | 374 | static int __devexit ghes_remove(struct platform_device *ghes_dev) |
367 | { | 375 | { |
368 | struct ghes *ghes, *nghes; | 376 | struct ghes *ghes; |
377 | struct acpi_hest_generic *generic; | ||
369 | 378 | ||
370 | if (!list_empty(&ghes_sci)) | 379 | ghes = platform_get_drvdata(ghes_dev); |
371 | unregister_acpi_hed_notifier(&ghes_notifier_sci); | 380 | generic = ghes->generic; |
381 | |||
382 | switch (generic->notify.type) { | ||
383 | case ACPI_HEST_NOTIFY_SCI: | ||
384 | mutex_lock(&ghes_list_mutex); | ||
385 | list_del_rcu(&ghes->list); | ||
386 | if (list_empty(&ghes_sci)) | ||
387 | unregister_acpi_hed_notifier(&ghes_notifier_sci); | ||
388 | mutex_unlock(&ghes_list_mutex); | ||
389 | break; | ||
390 | default: | ||
391 | BUG(); | ||
392 | break; | ||
393 | } | ||
372 | 394 | ||
373 | synchronize_rcu(); | 395 | synchronize_rcu(); |
396 | ghes_fini(ghes); | ||
397 | kfree(ghes); | ||
374 | 398 | ||
375 | list_for_each_entry_safe(ghes, nghes, &ghes_sci, list) { | 399 | platform_set_drvdata(ghes_dev, NULL); |
376 | list_del(&ghes->list); | 400 | |
377 | ghes_fini(ghes); | 401 | return 0; |
378 | kfree(ghes); | ||
379 | } | ||
380 | } | 402 | } |
381 | 403 | ||
404 | static struct platform_driver ghes_platform_driver = { | ||
405 | .driver = { | ||
406 | .name = "GHES", | ||
407 | .owner = THIS_MODULE, | ||
408 | }, | ||
409 | .probe = ghes_probe, | ||
410 | .remove = ghes_remove, | ||
411 | }; | ||
412 | |||
382 | static int __init ghes_init(void) | 413 | static int __init ghes_init(void) |
383 | { | 414 | { |
384 | int rc; | ||
385 | |||
386 | if (acpi_disabled) | 415 | if (acpi_disabled) |
387 | return -ENODEV; | 416 | return -ENODEV; |
388 | 417 | ||
@@ -391,32 +420,12 @@ static int __init ghes_init(void) | |||
391 | return -EINVAL; | 420 | return -EINVAL; |
392 | } | 421 | } |
393 | 422 | ||
394 | rc = apei_hest_parse(hest_ghes_parse, NULL); | 423 | return platform_driver_register(&ghes_platform_driver); |
395 | if (rc) { | ||
396 | pr_err(GHES_PFX | ||
397 | "Error during parsing HEST generic hardware error sources.\n"); | ||
398 | goto err_cleanup; | ||
399 | } | ||
400 | |||
401 | if (list_empty(&ghes_sci)) { | ||
402 | pr_info(GHES_PFX | ||
403 | "No functional generic hardware error sources.\n"); | ||
404 | rc = -ENODEV; | ||
405 | goto err_cleanup; | ||
406 | } | ||
407 | |||
408 | pr_info(GHES_PFX | ||
409 | "Generic Hardware Error Source support is initialized.\n"); | ||
410 | |||
411 | return 0; | ||
412 | err_cleanup: | ||
413 | ghes_cleanup(); | ||
414 | return rc; | ||
415 | } | 424 | } |
416 | 425 | ||
417 | static void __exit ghes_exit(void) | 426 | static void __exit ghes_exit(void) |
418 | { | 427 | { |
419 | ghes_cleanup(); | 428 | platform_driver_unregister(&ghes_platform_driver); |
420 | } | 429 | } |
421 | 430 | ||
422 | module_init(ghes_init); | 431 | module_init(ghes_init); |
@@ -425,3 +434,4 @@ module_exit(ghes_exit); | |||
425 | MODULE_AUTHOR("Huang Ying"); | 434 | MODULE_AUTHOR("Huang Ying"); |
426 | MODULE_DESCRIPTION("APEI Generic Hardware Error Source support"); | 435 | MODULE_DESCRIPTION("APEI Generic Hardware Error Source support"); |
427 | MODULE_LICENSE("GPL"); | 436 | MODULE_LICENSE("GPL"); |
437 | MODULE_ALIAS("platform:GHES"); | ||
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index e7f40d362cb3..343168d18266 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/kdebug.h> | 34 | #include <linux/kdebug.h> |
35 | #include <linux/highmem.h> | 35 | #include <linux/highmem.h> |
36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
37 | #include <linux/platform_device.h> | ||
37 | #include <acpi/apei.h> | 38 | #include <acpi/apei.h> |
38 | 39 | ||
39 | #include "apei-internal.h" | 40 | #include "apei-internal.h" |
@@ -47,11 +48,6 @@ EXPORT_SYMBOL_GPL(hest_disable); | |||
47 | 48 | ||
48 | static struct acpi_table_hest *hest_tab; | 49 | static struct acpi_table_hest *hest_tab; |
49 | 50 | ||
50 | static int hest_void_parse(struct acpi_hest_header *hest_hdr, void *data) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { | 51 | static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { |
56 | [ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */ | 52 | [ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */ |
57 | [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1, | 53 | [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1, |
@@ -125,6 +121,69 @@ int apei_hest_parse(apei_hest_func_t func, void *data) | |||
125 | } | 121 | } |
126 | EXPORT_SYMBOL_GPL(apei_hest_parse); | 122 | EXPORT_SYMBOL_GPL(apei_hest_parse); |
127 | 123 | ||
124 | struct ghes_arr { | ||
125 | struct platform_device **ghes_devs; | ||
126 | unsigned int count; | ||
127 | }; | ||
128 | |||
129 | static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) | ||
130 | { | ||
131 | int *count = data; | ||
132 | |||
133 | if (hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR) | ||
134 | (*count)++; | ||
135 | return 0; | ||
136 | } | ||
137 | |||
138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) | ||
139 | { | ||
140 | struct acpi_hest_generic *generic; | ||
141 | struct platform_device *ghes_dev; | ||
142 | struct ghes_arr *ghes_arr = data; | ||
143 | int rc; | ||
144 | |||
145 | if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) | ||
146 | return 0; | ||
147 | generic = (struct acpi_hest_generic *)hest_hdr; | ||
148 | if (!generic->enabled) | ||
149 | return 0; | ||
150 | ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); | ||
151 | if (!ghes_dev) | ||
152 | return -ENOMEM; | ||
153 | ghes_dev->dev.platform_data = generic; | ||
154 | rc = platform_device_add(ghes_dev); | ||
155 | if (rc) | ||
156 | goto err; | ||
157 | ghes_arr->ghes_devs[ghes_arr->count++] = ghes_dev; | ||
158 | |||
159 | return 0; | ||
160 | err: | ||
161 | platform_device_put(ghes_dev); | ||
162 | return rc; | ||
163 | } | ||
164 | |||
165 | static int hest_ghes_dev_register(unsigned int ghes_count) | ||
166 | { | ||
167 | int rc, i; | ||
168 | struct ghes_arr ghes_arr; | ||
169 | |||
170 | ghes_arr.count = 0; | ||
171 | ghes_arr.ghes_devs = kmalloc(sizeof(void *) * ghes_count, GFP_KERNEL); | ||
172 | if (!ghes_arr.ghes_devs) | ||
173 | return -ENOMEM; | ||
174 | |||
175 | rc = apei_hest_parse(hest_parse_ghes, &ghes_arr); | ||
176 | if (rc) | ||
177 | goto err; | ||
178 | out: | ||
179 | kfree(ghes_arr.ghes_devs); | ||
180 | return rc; | ||
181 | err: | ||
182 | for (i = 0; i < ghes_arr.count; i++) | ||
183 | platform_device_unregister(ghes_arr.ghes_devs[i]); | ||
184 | goto out; | ||
185 | } | ||
186 | |||
128 | static int __init setup_hest_disable(char *str) | 187 | static int __init setup_hest_disable(char *str) |
129 | { | 188 | { |
130 | hest_disable = 1; | 189 | hest_disable = 1; |
@@ -137,6 +196,7 @@ static int __init hest_init(void) | |||
137 | { | 196 | { |
138 | acpi_status status; | 197 | acpi_status status; |
139 | int rc = -ENODEV; | 198 | int rc = -ENODEV; |
199 | unsigned int ghes_count = 0; | ||
140 | 200 | ||
141 | if (acpi_disabled) | 201 | if (acpi_disabled) |
142 | goto err; | 202 | goto err; |
@@ -158,7 +218,11 @@ static int __init hest_init(void) | |||
158 | goto err; | 218 | goto err; |
159 | } | 219 | } |
160 | 220 | ||
161 | rc = apei_hest_parse(hest_void_parse, NULL); | 221 | rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count); |
222 | if (rc) | ||
223 | goto err; | ||
224 | |||
225 | rc = hest_ghes_dev_register(ghes_count); | ||
162 | if (rc) | 226 | if (rc) |
163 | goto err; | 227 | goto err; |
164 | 228 | ||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c1d23cd71652..7136f24e3002 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -1036,6 +1036,7 @@ static int __init acpi_init(void) | |||
1036 | acpi_power_init(); | 1036 | acpi_power_init(); |
1037 | acpi_system_init(); | 1037 | acpi_system_init(); |
1038 | acpi_debug_init(); | 1038 | acpi_debug_init(); |
1039 | acpi_debugfs_init(); | ||
1039 | acpi_sleep_proc_init(); | 1040 | acpi_sleep_proc_init(); |
1040 | acpi_wakeup_device_init(); | 1041 | acpi_wakeup_device_init(); |
1041 | return result; | 1042 | return result; |
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index 146135e7a6a1..22476eab2b08 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c | |||
@@ -198,80 +198,6 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state, | |||
198 | NULL, 0644); | 198 | NULL, 0644); |
199 | 199 | ||
200 | /* -------------------------------------------------------------------------- | 200 | /* -------------------------------------------------------------------------- |
201 | DebugFS Interface | ||
202 | -------------------------------------------------------------------------- */ | ||
203 | |||
204 | static ssize_t cm_write(struct file *file, const char __user *user_buf, | ||
205 | size_t count, loff_t *ppos) | ||
206 | { | ||
207 | static char *buf; | ||
208 | static int uncopied_bytes; | ||
209 | struct acpi_table_header table; | ||
210 | acpi_status status; | ||
211 | |||
212 | if (!(*ppos)) { | ||
213 | /* parse the table header to get the table length */ | ||
214 | if (count <= sizeof(struct acpi_table_header)) | ||
215 | return -EINVAL; | ||
216 | if (copy_from_user(&table, user_buf, | ||
217 | sizeof(struct acpi_table_header))) | ||
218 | return -EFAULT; | ||
219 | uncopied_bytes = table.length; | ||
220 | buf = kzalloc(uncopied_bytes, GFP_KERNEL); | ||
221 | if (!buf) | ||
222 | return -ENOMEM; | ||
223 | } | ||
224 | |||
225 | if (uncopied_bytes < count) { | ||
226 | kfree(buf); | ||
227 | return -EINVAL; | ||
228 | } | ||
229 | |||
230 | if (copy_from_user(buf + (*ppos), user_buf, count)) { | ||
231 | kfree(buf); | ||
232 | return -EFAULT; | ||
233 | } | ||
234 | |||
235 | uncopied_bytes -= count; | ||
236 | *ppos += count; | ||
237 | |||
238 | if (!uncopied_bytes) { | ||
239 | status = acpi_install_method(buf); | ||
240 | kfree(buf); | ||
241 | if (ACPI_FAILURE(status)) | ||
242 | return -EINVAL; | ||
243 | add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); | ||
244 | } | ||
245 | |||
246 | return count; | ||
247 | } | ||
248 | |||
249 | static const struct file_operations cm_fops = { | ||
250 | .write = cm_write, | ||
251 | }; | ||
252 | |||
253 | static int acpi_debugfs_init(void) | ||
254 | { | ||
255 | struct dentry *acpi_dir, *cm_dentry; | ||
256 | |||
257 | acpi_dir = debugfs_create_dir("acpi", NULL); | ||
258 | if (!acpi_dir) | ||
259 | goto err; | ||
260 | |||
261 | cm_dentry = debugfs_create_file("custom_method", S_IWUGO, | ||
262 | acpi_dir, NULL, &cm_fops); | ||
263 | if (!cm_dentry) | ||
264 | goto err; | ||
265 | |||
266 | return 0; | ||
267 | |||
268 | err: | ||
269 | if (acpi_dir) | ||
270 | debugfs_remove(acpi_dir); | ||
271 | return -EINVAL; | ||
272 | } | ||
273 | |||
274 | /* -------------------------------------------------------------------------- | ||
275 | FS Interface (/proc) | 201 | FS Interface (/proc) |
276 | -------------------------------------------------------------------------- */ | 202 | -------------------------------------------------------------------------- */ |
277 | #ifdef CONFIG_ACPI_PROCFS | 203 | #ifdef CONFIG_ACPI_PROCFS |
@@ -400,7 +326,6 @@ int __init acpi_procfs_init(void) | |||
400 | 326 | ||
401 | int __init acpi_debug_init(void) | 327 | int __init acpi_debug_init(void) |
402 | { | 328 | { |
403 | acpi_debugfs_init(); | ||
404 | acpi_procfs_init(); | 329 | acpi_procfs_init(); |
405 | return 0; | 330 | return 0; |
406 | } | 331 | } |
diff --git a/drivers/acpi/debugfs.c b/drivers/acpi/debugfs.c new file mode 100644 index 000000000000..7de27d49c4b9 --- /dev/null +++ b/drivers/acpi/debugfs.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * debugfs.c - ACPI debugfs interface to userspace. | ||
3 | */ | ||
4 | |||
5 | #include <linux/init.h> | ||
6 | #include <linux/module.h> | ||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/uaccess.h> | ||
9 | #include <linux/debugfs.h> | ||
10 | #include <acpi/acpi_drivers.h> | ||
11 | |||
12 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | ||
13 | ACPI_MODULE_NAME("debugfs"); | ||
14 | |||
15 | |||
16 | /* /sys/modules/acpi/parameters/aml_debug_output */ | ||
17 | |||
18 | module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, | ||
19 | bool, 0644); | ||
20 | MODULE_PARM_DESC(aml_debug_output, | ||
21 | "To enable/disable the ACPI Debug Object output."); | ||
22 | |||
23 | /* /sys/kernel/debug/acpi/custom_method */ | ||
24 | |||
25 | static ssize_t cm_write(struct file *file, const char __user * user_buf, | ||
26 | size_t count, loff_t *ppos) | ||
27 | { | ||
28 | static char *buf; | ||
29 | static int uncopied_bytes; | ||
30 | struct acpi_table_header table; | ||
31 | acpi_status status; | ||
32 | |||
33 | if (!(*ppos)) { | ||
34 | /* parse the table header to get the table length */ | ||
35 | if (count <= sizeof(struct acpi_table_header)) | ||
36 | return -EINVAL; | ||
37 | if (copy_from_user(&table, user_buf, | ||
38 | sizeof(struct acpi_table_header))) | ||
39 | return -EFAULT; | ||
40 | uncopied_bytes = table.length; | ||
41 | buf = kzalloc(uncopied_bytes, GFP_KERNEL); | ||
42 | if (!buf) | ||
43 | return -ENOMEM; | ||
44 | } | ||
45 | |||
46 | if (uncopied_bytes < count) { | ||
47 | kfree(buf); | ||
48 | return -EINVAL; | ||
49 | } | ||
50 | |||
51 | if (copy_from_user(buf + (*ppos), user_buf, count)) { | ||
52 | kfree(buf); | ||
53 | return -EFAULT; | ||
54 | } | ||
55 | |||
56 | uncopied_bytes -= count; | ||
57 | *ppos += count; | ||
58 | |||
59 | if (!uncopied_bytes) { | ||
60 | status = acpi_install_method(buf); | ||
61 | kfree(buf); | ||
62 | if (ACPI_FAILURE(status)) | ||
63 | return -EINVAL; | ||
64 | add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); | ||
65 | } | ||
66 | |||
67 | return count; | ||
68 | } | ||
69 | |||
70 | static const struct file_operations cm_fops = { | ||
71 | .write = cm_write, | ||
72 | }; | ||
73 | |||
74 | int __init acpi_debugfs_init(void) | ||
75 | { | ||
76 | struct dentry *acpi_dir, *cm_dentry; | ||
77 | |||
78 | acpi_dir = debugfs_create_dir("acpi", NULL); | ||
79 | if (!acpi_dir) | ||
80 | goto err; | ||
81 | |||
82 | cm_dentry = debugfs_create_file("custom_method", S_IWUGO, | ||
83 | acpi_dir, NULL, &cm_fops); | ||
84 | if (!cm_dentry) | ||
85 | goto err; | ||
86 | |||
87 | return 0; | ||
88 | |||
89 | err: | ||
90 | if (acpi_dir) | ||
91 | debugfs_remove(acpi_dir); | ||
92 | return -EINVAL; | ||
93 | } | ||
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index f8f190ec066e..0650e343867e 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -30,6 +30,12 @@ int acpi_debug_init(void); | |||
30 | static inline int acpi_debug_init(void) { return 0; } | 30 | static inline int acpi_debug_init(void) { return 0; } |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #ifdef CONFIG_DEBUG_FS | ||
34 | int acpi_debugfs_init(void); | ||
35 | #else | ||
36 | static inline int acpi_debugfs_init(void) { return 0; } | ||
37 | #endif | ||
38 | |||
33 | /* -------------------------------------------------------------------------- | 39 | /* -------------------------------------------------------------------------- |
34 | Power Resource | 40 | Power Resource |
35 | -------------------------------------------------------------------------- */ | 41 | -------------------------------------------------------------------------- */ |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 2862c781b372..e4625f919814 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -70,10 +70,10 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
70 | 70 | ||
71 | } | 71 | } |
72 | ACPI_FLUSH_CPU_CACHE(); | 72 | ACPI_FLUSH_CPU_CACHE(); |
73 | acpi_enable_wakeup_device_prep(acpi_state); | ||
74 | #endif | 73 | #endif |
75 | printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n", | 74 | printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n", |
76 | acpi_state); | 75 | acpi_state); |
76 | acpi_enable_wakeup_devices(acpi_state); | ||
77 | acpi_enter_sleep_state_prep(acpi_state); | 77 | acpi_enter_sleep_state_prep(acpi_state); |
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
@@ -119,6 +119,16 @@ static int acpi_pm_freeze(void) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | /** | 121 | /** |
122 | * acpi_pre_suspend - Enable wakeup devices, "freeze" EC and save NVS. | ||
123 | */ | ||
124 | static int acpi_pm_pre_suspend(void) | ||
125 | { | ||
126 | acpi_pm_freeze(); | ||
127 | suspend_nvs_save(); | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | /** | ||
122 | * __acpi_pm_prepare - Prepare the platform to enter the target state. | 132 | * __acpi_pm_prepare - Prepare the platform to enter the target state. |
123 | * | 133 | * |
124 | * If necessary, set the firmware waking vector and do arch-specific | 134 | * If necessary, set the firmware waking vector and do arch-specific |
@@ -127,11 +137,9 @@ static int acpi_pm_freeze(void) | |||
127 | static int __acpi_pm_prepare(void) | 137 | static int __acpi_pm_prepare(void) |
128 | { | 138 | { |
129 | int error = acpi_sleep_prepare(acpi_target_sleep_state); | 139 | int error = acpi_sleep_prepare(acpi_target_sleep_state); |
130 | |||
131 | suspend_nvs_save(); | ||
132 | |||
133 | if (error) | 140 | if (error) |
134 | acpi_target_sleep_state = ACPI_STATE_S0; | 141 | acpi_target_sleep_state = ACPI_STATE_S0; |
142 | |||
135 | return error; | 143 | return error; |
136 | } | 144 | } |
137 | 145 | ||
@@ -142,9 +150,8 @@ static int __acpi_pm_prepare(void) | |||
142 | static int acpi_pm_prepare(void) | 150 | static int acpi_pm_prepare(void) |
143 | { | 151 | { |
144 | int error = __acpi_pm_prepare(); | 152 | int error = __acpi_pm_prepare(); |
145 | |||
146 | if (!error) | 153 | if (!error) |
147 | acpi_pm_freeze(); | 154 | acpi_pm_pre_suspend(); |
148 | 155 | ||
149 | return error; | 156 | return error; |
150 | } | 157 | } |
@@ -159,7 +166,6 @@ static void acpi_pm_finish(void) | |||
159 | { | 166 | { |
160 | u32 acpi_state = acpi_target_sleep_state; | 167 | u32 acpi_state = acpi_target_sleep_state; |
161 | 168 | ||
162 | suspend_nvs_free(); | ||
163 | acpi_ec_unblock_transactions(); | 169 | acpi_ec_unblock_transactions(); |
164 | 170 | ||
165 | if (acpi_state == ACPI_STATE_S0) | 171 | if (acpi_state == ACPI_STATE_S0) |
@@ -167,7 +173,7 @@ static void acpi_pm_finish(void) | |||
167 | 173 | ||
168 | printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n", | 174 | printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n", |
169 | acpi_state); | 175 | acpi_state); |
170 | acpi_disable_wakeup_device(acpi_state); | 176 | acpi_disable_wakeup_devices(acpi_state); |
171 | acpi_leave_sleep_state(acpi_state); | 177 | acpi_leave_sleep_state(acpi_state); |
172 | 178 | ||
173 | /* reset firmware waking vector */ | 179 | /* reset firmware waking vector */ |
@@ -181,6 +187,7 @@ static void acpi_pm_finish(void) | |||
181 | */ | 187 | */ |
182 | static void acpi_pm_end(void) | 188 | static void acpi_pm_end(void) |
183 | { | 189 | { |
190 | suspend_nvs_free(); | ||
184 | /* | 191 | /* |
185 | * This is necessary in case acpi_pm_finish() is not called during a | 192 | * This is necessary in case acpi_pm_finish() is not called during a |
186 | * failing transition to a sleep state. | 193 | * failing transition to a sleep state. |
@@ -251,7 +258,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
251 | } | 258 | } |
252 | 259 | ||
253 | local_irq_save(flags); | 260 | local_irq_save(flags); |
254 | acpi_enable_wakeup_device(acpi_state); | ||
255 | switch (acpi_state) { | 261 | switch (acpi_state) { |
256 | case ACPI_STATE_S1: | 262 | case ACPI_STATE_S1: |
257 | barrier(); | 263 | barrier(); |
@@ -297,11 +303,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
297 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; | 303 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; |
298 | } | 304 | } |
299 | 305 | ||
300 | static void acpi_suspend_finish(void) | ||
301 | { | ||
302 | acpi_pm_finish(); | ||
303 | } | ||
304 | |||
305 | static int acpi_suspend_state_valid(suspend_state_t pm_state) | 306 | static int acpi_suspend_state_valid(suspend_state_t pm_state) |
306 | { | 307 | { |
307 | u32 acpi_state; | 308 | u32 acpi_state; |
@@ -323,7 +324,7 @@ static struct platform_suspend_ops acpi_suspend_ops = { | |||
323 | .begin = acpi_suspend_begin, | 324 | .begin = acpi_suspend_begin, |
324 | .prepare_late = acpi_pm_prepare, | 325 | .prepare_late = acpi_pm_prepare, |
325 | .enter = acpi_suspend_enter, | 326 | .enter = acpi_suspend_enter, |
326 | .wake = acpi_suspend_finish, | 327 | .wake = acpi_pm_finish, |
327 | .end = acpi_pm_end, | 328 | .end = acpi_pm_end, |
328 | }; | 329 | }; |
329 | 330 | ||
@@ -336,9 +337,9 @@ static struct platform_suspend_ops acpi_suspend_ops = { | |||
336 | static int acpi_suspend_begin_old(suspend_state_t pm_state) | 337 | static int acpi_suspend_begin_old(suspend_state_t pm_state) |
337 | { | 338 | { |
338 | int error = acpi_suspend_begin(pm_state); | 339 | int error = acpi_suspend_begin(pm_state); |
339 | |||
340 | if (!error) | 340 | if (!error) |
341 | error = __acpi_pm_prepare(); | 341 | error = __acpi_pm_prepare(); |
342 | |||
342 | return error; | 343 | return error; |
343 | } | 344 | } |
344 | 345 | ||
@@ -349,9 +350,9 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state) | |||
349 | static struct platform_suspend_ops acpi_suspend_ops_old = { | 350 | static struct platform_suspend_ops acpi_suspend_ops_old = { |
350 | .valid = acpi_suspend_state_valid, | 351 | .valid = acpi_suspend_state_valid, |
351 | .begin = acpi_suspend_begin_old, | 352 | .begin = acpi_suspend_begin_old, |
352 | .prepare_late = acpi_pm_freeze, | 353 | .prepare_late = acpi_pm_pre_suspend, |
353 | .enter = acpi_suspend_enter, | 354 | .enter = acpi_suspend_enter, |
354 | .wake = acpi_suspend_finish, | 355 | .wake = acpi_pm_finish, |
355 | .end = acpi_pm_end, | 356 | .end = acpi_pm_end, |
356 | .recover = acpi_pm_finish, | 357 | .recover = acpi_pm_finish, |
357 | }; | 358 | }; |
@@ -423,16 +424,6 @@ static int acpi_hibernation_begin(void) | |||
423 | return error; | 424 | return error; |
424 | } | 425 | } |
425 | 426 | ||
426 | static int acpi_hibernation_pre_snapshot(void) | ||
427 | { | ||
428 | int error = acpi_pm_prepare(); | ||
429 | |||
430 | if (!error) | ||
431 | suspend_nvs_save(); | ||
432 | |||
433 | return error; | ||
434 | } | ||
435 | |||
436 | static int acpi_hibernation_enter(void) | 427 | static int acpi_hibernation_enter(void) |
437 | { | 428 | { |
438 | acpi_status status = AE_OK; | 429 | acpi_status status = AE_OK; |
@@ -441,7 +432,6 @@ static int acpi_hibernation_enter(void) | |||
441 | ACPI_FLUSH_CPU_CACHE(); | 432 | ACPI_FLUSH_CPU_CACHE(); |
442 | 433 | ||
443 | local_irq_save(flags); | 434 | local_irq_save(flags); |
444 | acpi_enable_wakeup_device(ACPI_STATE_S4); | ||
445 | /* This shouldn't return. If it returns, we have a problem */ | 435 | /* This shouldn't return. If it returns, we have a problem */ |
446 | status = acpi_enter_sleep_state(ACPI_STATE_S4); | 436 | status = acpi_enter_sleep_state(ACPI_STATE_S4); |
447 | /* Reprogram control registers and execute _BFS */ | 437 | /* Reprogram control registers and execute _BFS */ |
@@ -481,7 +471,7 @@ static void acpi_pm_thaw(void) | |||
481 | static struct platform_hibernation_ops acpi_hibernation_ops = { | 471 | static struct platform_hibernation_ops acpi_hibernation_ops = { |
482 | .begin = acpi_hibernation_begin, | 472 | .begin = acpi_hibernation_begin, |
483 | .end = acpi_pm_end, | 473 | .end = acpi_pm_end, |
484 | .pre_snapshot = acpi_hibernation_pre_snapshot, | 474 | .pre_snapshot = acpi_pm_prepare, |
485 | .finish = acpi_pm_finish, | 475 | .finish = acpi_pm_finish, |
486 | .prepare = acpi_pm_prepare, | 476 | .prepare = acpi_pm_prepare, |
487 | .enter = acpi_hibernation_enter, | 477 | .enter = acpi_hibernation_enter, |
@@ -517,13 +507,6 @@ static int acpi_hibernation_begin_old(void) | |||
517 | return error; | 507 | return error; |
518 | } | 508 | } |
519 | 509 | ||
520 | static int acpi_hibernation_pre_snapshot_old(void) | ||
521 | { | ||
522 | acpi_pm_freeze(); | ||
523 | suspend_nvs_save(); | ||
524 | return 0; | ||
525 | } | ||
526 | |||
527 | /* | 510 | /* |
528 | * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has | 511 | * The following callbacks are used if the pre-ACPI 2.0 suspend ordering has |
529 | * been requested. | 512 | * been requested. |
@@ -531,7 +514,7 @@ static int acpi_hibernation_pre_snapshot_old(void) | |||
531 | static struct platform_hibernation_ops acpi_hibernation_ops_old = { | 514 | static struct platform_hibernation_ops acpi_hibernation_ops_old = { |
532 | .begin = acpi_hibernation_begin_old, | 515 | .begin = acpi_hibernation_begin_old, |
533 | .end = acpi_pm_end, | 516 | .end = acpi_pm_end, |
534 | .pre_snapshot = acpi_hibernation_pre_snapshot_old, | 517 | .pre_snapshot = acpi_pm_pre_suspend, |
535 | .prepare = acpi_pm_freeze, | 518 | .prepare = acpi_pm_freeze, |
536 | .finish = acpi_pm_finish, | 519 | .finish = acpi_pm_finish, |
537 | .enter = acpi_hibernation_enter, | 520 | .enter = acpi_hibernation_enter, |
@@ -695,7 +678,6 @@ static void acpi_power_off(void) | |||
695 | /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ | 678 | /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ |
696 | printk(KERN_DEBUG "%s called\n", __func__); | 679 | printk(KERN_DEBUG "%s called\n", __func__); |
697 | local_irq_disable(); | 680 | local_irq_disable(); |
698 | acpi_enable_wakeup_device(ACPI_STATE_S5); | ||
699 | acpi_enter_sleep_state(ACPI_STATE_S5); | 681 | acpi_enter_sleep_state(ACPI_STATE_S5); |
700 | } | 682 | } |
701 | 683 | ||
diff --git a/drivers/acpi/sleep.h b/drivers/acpi/sleep.h index 25b8bd149284..d8821805c3bc 100644 --- a/drivers/acpi/sleep.h +++ b/drivers/acpi/sleep.h | |||
@@ -2,9 +2,8 @@ | |||
2 | extern u8 sleep_states[]; | 2 | extern u8 sleep_states[]; |
3 | extern int acpi_suspend(u32 state); | 3 | extern int acpi_suspend(u32 state); |
4 | 4 | ||
5 | extern void acpi_enable_wakeup_device_prep(u8 sleep_state); | 5 | extern void acpi_enable_wakeup_devices(u8 sleep_state); |
6 | extern void acpi_enable_wakeup_device(u8 sleep_state); | 6 | extern void acpi_disable_wakeup_devices(u8 sleep_state); |
7 | extern void acpi_disable_wakeup_device(u8 sleep_state); | ||
8 | 7 | ||
9 | extern struct list_head acpi_wakeup_device_list; | 8 | extern struct list_head acpi_wakeup_device_list; |
10 | extern struct mutex acpi_device_lock; | 9 | extern struct mutex acpi_device_lock; |
diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c index 388747a7ef4f..dc6d1d9112fb 100644 --- a/drivers/acpi/wakeup.c +++ b/drivers/acpi/wakeup.c | |||
@@ -21,46 +21,18 @@ | |||
21 | ACPI_MODULE_NAME("wakeup_devices") | 21 | ACPI_MODULE_NAME("wakeup_devices") |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * acpi_enable_wakeup_device_prep - Prepare wake-up devices. | 24 | * acpi_enable_wakeup_devices - Enable wake-up device GPEs. |
25 | * @sleep_state: ACPI system sleep state. | 25 | * @sleep_state: ACPI system sleep state. |
26 | * | 26 | * |
27 | * Enable all wake-up devices' power, unless the requested system sleep state is | 27 | * Enable wakeup device power of devices with the state.enable flag set and set |
28 | * too deep. | 28 | * the wakeup enable mask bits in the GPE registers that correspond to wakeup |
29 | * devices. | ||
29 | */ | 30 | */ |
30 | void acpi_enable_wakeup_device_prep(u8 sleep_state) | 31 | void acpi_enable_wakeup_devices(u8 sleep_state) |
31 | { | 32 | { |
32 | struct list_head *node, *next; | 33 | struct list_head *node, *next; |
33 | 34 | ||
34 | list_for_each_safe(node, next, &acpi_wakeup_device_list) { | 35 | list_for_each_safe(node, next, &acpi_wakeup_device_list) { |
35 | struct acpi_device *dev = container_of(node, | ||
36 | struct acpi_device, | ||
37 | wakeup_list); | ||
38 | |||
39 | if (!dev->wakeup.flags.valid || !dev->wakeup.state.enabled | ||
40 | || (sleep_state > (u32) dev->wakeup.sleep_state)) | ||
41 | continue; | ||
42 | |||
43 | acpi_enable_wakeup_device_power(dev, sleep_state); | ||
44 | } | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * acpi_enable_wakeup_device - Enable wake-up device GPEs. | ||
49 | * @sleep_state: ACPI system sleep state. | ||
50 | * | ||
51 | * Enable all wake-up devices' GPEs, with the assumption that | ||
52 | * acpi_disable_all_gpes() was executed before, so we don't need to disable any | ||
53 | * GPEs here. | ||
54 | */ | ||
55 | void acpi_enable_wakeup_device(u8 sleep_state) | ||
56 | { | ||
57 | struct list_head *node, *next; | ||
58 | |||
59 | /* | ||
60 | * Caution: this routine must be invoked when interrupt is disabled | ||
61 | * Refer ACPI2.0: P212 | ||
62 | */ | ||
63 | list_for_each_safe(node, next, &acpi_wakeup_device_list) { | ||
64 | struct acpi_device *dev = | 36 | struct acpi_device *dev = |
65 | container_of(node, struct acpi_device, wakeup_list); | 37 | container_of(node, struct acpi_device, wakeup_list); |
66 | 38 | ||
@@ -68,6 +40,9 @@ void acpi_enable_wakeup_device(u8 sleep_state) | |||
68 | || sleep_state > (u32) dev->wakeup.sleep_state) | 40 | || sleep_state > (u32) dev->wakeup.sleep_state) |
69 | continue; | 41 | continue; |
70 | 42 | ||
43 | if (dev->wakeup.state.enabled) | ||
44 | acpi_enable_wakeup_device_power(dev, sleep_state); | ||
45 | |||
71 | /* The wake-up power should have been enabled already. */ | 46 | /* The wake-up power should have been enabled already. */ |
72 | acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number, | 47 | acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number, |
73 | ACPI_GPE_TYPE_WAKE); | 48 | ACPI_GPE_TYPE_WAKE); |
@@ -75,13 +50,10 @@ void acpi_enable_wakeup_device(u8 sleep_state) | |||
75 | } | 50 | } |
76 | 51 | ||
77 | /** | 52 | /** |
78 | * acpi_disable_wakeup_device - Disable devices' wakeup capability. | 53 | * acpi_disable_wakeup_devices - Disable devices' wakeup capability. |
79 | * @sleep_state: ACPI system sleep state. | 54 | * @sleep_state: ACPI system sleep state. |
80 | * | ||
81 | * This function only affects devices with wakeup.state.enabled set, which means | ||
82 | * that it reverses the changes made by acpi_enable_wakeup_device_prep(). | ||
83 | */ | 55 | */ |
84 | void acpi_disable_wakeup_device(u8 sleep_state) | 56 | void acpi_disable_wakeup_devices(u8 sleep_state) |
85 | { | 57 | { |
86 | struct list_head *node, *next; | 58 | struct list_head *node, *next; |
87 | 59 | ||
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9344216183a4..a7547150a705 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void) | |||
1216 | 1216 | ||
1217 | /* G33's GTT size defined in gmch_ctrl */ | 1217 | /* G33's GTT size defined in gmch_ctrl */ |
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | 1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); |
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | 1219 | switch (gmch_ctrl & I830_GMCH_GMS_MASK) { |
1220 | case G33_PGETBL_SIZE_1M: | 1220 | case I830_GMCH_GMS_STOLEN_512: |
1221 | size = 512; | ||
1222 | break; | ||
1223 | case I830_GMCH_GMS_STOLEN_1024: | ||
1221 | size = 1024; | 1224 | size = 1024; |
1222 | break; | 1225 | break; |
1223 | case G33_PGETBL_SIZE_2M: | 1226 | case I830_GMCH_GMS_STOLEN_8192: |
1224 | size = 2048; | 1227 | size = 8*1024; |
1225 | break; | 1228 | break; |
1226 | default: | 1229 | default: |
1227 | dev_info(&agp_bridge->dev->dev, | 1230 | dev_info(&agp_bridge->dev->dev, |
1228 | "unknown page table size 0x%x, assuming 512KB\n", | 1231 | "unknown page table size 0x%x, assuming 512KB\n", |
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | 1232 | (gmch_ctrl & I830_GMCH_GMS_MASK)); |
1230 | size = 512; | 1233 | size = 512; |
1231 | } | 1234 | } |
1232 | } else { | 1235 | } else { |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 24314a9cffe8..1030f8420137 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
623 | 623 | ||
624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
625 | { | 625 | { |
626 | return tpm_pm_resume(&dev->dev); | 626 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
627 | int ret; | ||
628 | |||
629 | ret = tpm_pm_resume(&dev->dev); | ||
630 | if (!ret) | ||
631 | tpm_continue_selftest(chip); | ||
632 | |||
633 | return ret; | ||
627 | } | 634 | } |
628 | 635 | ||
629 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { | 636 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 063b2184caf5..938b74ea9ffb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1077,6 +1077,7 @@ err_out_unregister: | |||
1077 | 1077 | ||
1078 | err_unlock_policy: | 1078 | err_unlock_policy: |
1079 | unlock_policy_rwsem_write(cpu); | 1079 | unlock_policy_rwsem_write(cpu); |
1080 | free_cpumask_var(policy->related_cpus); | ||
1080 | err_free_cpumask: | 1081 | err_free_cpumask: |
1081 | free_cpumask_var(policy->cpus); | 1082 | free_cpumask_var(policy->cpus); |
1082 | err_free_policy: | 1083 | err_free_policy: |
@@ -1762,17 +1763,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, | |||
1762 | dprintk("governor switch\n"); | 1763 | dprintk("governor switch\n"); |
1763 | 1764 | ||
1764 | /* end old governor */ | 1765 | /* end old governor */ |
1765 | if (data->governor) { | 1766 | if (data->governor) |
1766 | /* | ||
1767 | * Need to release the rwsem around governor | ||
1768 | * stop due to lock dependency between | ||
1769 | * cancel_delayed_work_sync and the read lock | ||
1770 | * taken in the delayed work handler. | ||
1771 | */ | ||
1772 | unlock_policy_rwsem_write(data->cpu); | ||
1773 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1767 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
1774 | lock_policy_rwsem_write(data->cpu); | ||
1775 | } | ||
1776 | 1768 | ||
1777 | /* start new governor */ | 1769 | /* start new governor */ |
1778 | data->governor = policy->governor; | 1770 | data->governor = policy->governor; |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index cc9357da0e34..e0187d16dd7c 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1300,7 +1300,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1300 | if (devno == 0) | 1300 | if (devno == 0) |
1301 | return -ENODEV; | 1301 | return -ENODEV; |
1302 | 1302 | ||
1303 | i7core_printk(KERN_ERR, | 1303 | i7core_printk(KERN_INFO, |
1304 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", | 1304 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", |
1305 | dev_descr->dev, dev_descr->func, | 1305 | dev_descr->dev, dev_descr->func, |
1306 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); | 1306 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); |
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index f39b00a46eda..1052340e6802 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c | |||
@@ -336,6 +336,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = { | |||
336 | }, | 336 | }, |
337 | {}, | 337 | {}, |
338 | }; | 338 | }; |
339 | MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match); | ||
339 | 340 | ||
340 | static struct of_platform_driver mpc85xx_pci_err_driver = { | 341 | static struct of_platform_driver mpc85xx_pci_err_driver = { |
341 | .probe = mpc85xx_pci_err_probe, | 342 | .probe = mpc85xx_pci_err_probe, |
@@ -650,6 +651,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = { | |||
650 | { .compatible = "fsl,p2020-l2-cache-controller", }, | 651 | { .compatible = "fsl,p2020-l2-cache-controller", }, |
651 | {}, | 652 | {}, |
652 | }; | 653 | }; |
654 | MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match); | ||
653 | 655 | ||
654 | static struct of_platform_driver mpc85xx_l2_err_driver = { | 656 | static struct of_platform_driver mpc85xx_l2_err_driver = { |
655 | .probe = mpc85xx_l2_err_probe, | 657 | .probe = mpc85xx_l2_err_probe, |
@@ -1126,6 +1128,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = { | |||
1126 | { .compatible = "fsl,p2020-memory-controller", }, | 1128 | { .compatible = "fsl,p2020-memory-controller", }, |
1127 | {}, | 1129 | {}, |
1128 | }; | 1130 | }; |
1131 | MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); | ||
1129 | 1132 | ||
1130 | static struct of_platform_driver mpc85xx_mc_err_driver = { | 1133 | static struct of_platform_driver mpc85xx_mc_err_driver = { |
1131 | .probe = mpc85xx_mc_err_probe, | 1134 | .probe = mpc85xx_mc_err_probe, |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3ca36542e338..4e51fe3c1fc4 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -893,10 +893,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low); | |||
893 | void gpio_unexport(unsigned gpio) | 893 | void gpio_unexport(unsigned gpio) |
894 | { | 894 | { |
895 | struct gpio_desc *desc; | 895 | struct gpio_desc *desc; |
896 | int status = -EINVAL; | 896 | int status = 0; |
897 | 897 | ||
898 | if (!gpio_is_valid(gpio)) | 898 | if (!gpio_is_valid(gpio)) { |
899 | status = -EINVAL; | ||
899 | goto done; | 900 | goto done; |
901 | } | ||
900 | 902 | ||
901 | mutex_lock(&sysfs_lock); | 903 | mutex_lock(&sysfs_lock); |
902 | 904 | ||
@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio) | |||
911 | clear_bit(FLAG_EXPORT, &desc->flags); | 913 | clear_bit(FLAG_EXPORT, &desc->flags); |
912 | put_device(dev); | 914 | put_device(dev); |
913 | device_unregister(dev); | 915 | device_unregister(dev); |
914 | status = 0; | ||
915 | } else | 916 | } else |
916 | status = -ENODEV; | 917 | status = -ENODEV; |
917 | } | 918 | } |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index c1981861bbbd..f87bf104df7a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -864,8 +864,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid, | |||
864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, | 864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, |
865 | false); | 865 | false); |
866 | mode->hdisplay = 1366; | 866 | mode->hdisplay = 1366; |
867 | mode->vsync_start = mode->vsync_start - 1; | 867 | mode->hsync_start = mode->hsync_start - 1; |
868 | mode->vsync_end = mode->vsync_end - 1; | 868 | mode->hsync_end = mode->hsync_end - 1; |
869 | return mode; | 869 | return mode; |
870 | } | 870 | } |
871 | 871 | ||
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index aee83fa178f6..9214119c0154 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused) | |||
605 | case FBC_NOT_TILED: | 605 | case FBC_NOT_TILED: |
606 | seq_printf(m, "scanout buffer not tiled"); | 606 | seq_printf(m, "scanout buffer not tiled"); |
607 | break; | 607 | break; |
608 | case FBC_MULTIPLE_PIPES: | ||
609 | seq_printf(m, "multiple pipes are enabled"); | ||
610 | break; | ||
608 | default: | 611 | default: |
609 | seq_printf(m, "unknown reason"); | 612 | seq_printf(m, "unknown reason"); |
610 | } | 613 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f00c5ae9556c..2305a1234f1e 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1300,7 +1300,7 @@ static void i915_cleanup_compression(struct drm_device *dev) | |||
1300 | struct drm_i915_private *dev_priv = dev->dev_private; | 1300 | struct drm_i915_private *dev_priv = dev->dev_private; |
1301 | 1301 | ||
1302 | drm_mm_put_block(dev_priv->compressed_fb); | 1302 | drm_mm_put_block(dev_priv->compressed_fb); |
1303 | if (!IS_GM45(dev)) | 1303 | if (dev_priv->compressed_llb) |
1304 | drm_mm_put_block(dev_priv->compressed_llb); | 1304 | drm_mm_put_block(dev_priv->compressed_llb); |
1305 | } | 1305 | } |
1306 | 1306 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d147ab2f5bfc..2e1744d37ad5 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -215,6 +215,7 @@ enum no_fbc_reason { | |||
215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ | 215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ |
216 | FBC_BAD_PLANE, /* fbc not supported on plane */ | 216 | FBC_BAD_PLANE, /* fbc not supported on plane */ |
217 | FBC_NOT_TILED, /* buffer not tiled */ | 217 | FBC_NOT_TILED, /* buffer not tiled */ |
218 | FBC_MULTIPLE_PIPES, /* more than one pipe active */ | ||
218 | }; | 219 | }; |
219 | 220 | ||
220 | enum intel_pch { | 221 | enum intel_pch { |
@@ -222,6 +223,8 @@ enum intel_pch { | |||
222 | PCH_CPT, /* Cougarpoint PCH */ | 223 | PCH_CPT, /* Cougarpoint PCH */ |
223 | }; | 224 | }; |
224 | 225 | ||
226 | #define QUIRK_PIPEA_FORCE (1<<0) | ||
227 | |||
225 | struct intel_fbdev; | 228 | struct intel_fbdev; |
226 | 229 | ||
227 | typedef struct drm_i915_private { | 230 | typedef struct drm_i915_private { |
@@ -337,6 +340,8 @@ typedef struct drm_i915_private { | |||
337 | /* PCH chipset type */ | 340 | /* PCH chipset type */ |
338 | enum intel_pch pch_type; | 341 | enum intel_pch pch_type; |
339 | 342 | ||
343 | unsigned long quirks; | ||
344 | |||
340 | /* Register state */ | 345 | /* Register state */ |
341 | bool modeset_on_lid; | 346 | bool modeset_on_lid; |
342 | u8 saveLBB; | 347 | u8 saveLBB; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 51bd301cf10d..5aa747fc25a9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3647,6 +3647,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev, | |||
3647 | return ret; | 3647 | return ret; |
3648 | } | 3648 | } |
3649 | 3649 | ||
3650 | |||
3650 | int | 3651 | int |
3651 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, | 3652 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, |
3652 | struct drm_file *file_priv, | 3653 | struct drm_file *file_priv, |
@@ -3794,7 +3795,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3794 | unsigned long long total_size = 0; | 3795 | unsigned long long total_size = 0; |
3795 | int num_fences = 0; | 3796 | int num_fences = 0; |
3796 | for (i = 0; i < args->buffer_count; i++) { | 3797 | for (i = 0; i < args->buffer_count; i++) { |
3797 | obj_priv = object_list[i]->driver_private; | 3798 | obj_priv = to_intel_bo(object_list[i]); |
3798 | 3799 | ||
3799 | total_size += object_list[i]->size; | 3800 | total_size += object_list[i]->size; |
3800 | num_fences += | 3801 | num_fences += |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 6d9b0288272a..cf41c672defe 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2869,6 +2869,7 @@ | |||
2869 | 2869 | ||
2870 | #define PCH_PP_STATUS 0xc7200 | 2870 | #define PCH_PP_STATUS 0xc7200 |
2871 | #define PCH_PP_CONTROL 0xc7204 | 2871 | #define PCH_PP_CONTROL 0xc7204 |
2872 | #define PANEL_UNLOCK_REGS (0xabcd << 16) | ||
2872 | #define EDP_FORCE_VDD (1 << 3) | 2873 | #define EDP_FORCE_VDD (1 << 3) |
2873 | #define EDP_BLC_ENABLE (1 << 2) | 2874 | #define EDP_BLC_ENABLE (1 << 2) |
2874 | #define PANEL_POWER_RESET (1 << 1) | 2875 | #define PANEL_POWER_RESET (1 << 1) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 68dcf36e2793..5e21b3119824 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -862,8 +862,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
862 | intel_clock_t clock; | 862 | intel_clock_t clock; |
863 | int max_n; | 863 | int max_n; |
864 | bool found; | 864 | bool found; |
865 | /* approximately equals target * 0.00488 */ | 865 | /* approximately equals target * 0.00585 */ |
866 | int err_most = (target >> 8) + (target >> 10); | 866 | int err_most = (target >> 8) + (target >> 9); |
867 | found = false; | 867 | found = false; |
868 | 868 | ||
869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | 869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { |
@@ -1180,8 +1180,12 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1180 | struct drm_framebuffer *fb = crtc->fb; | 1180 | struct drm_framebuffer *fb = crtc->fb; |
1181 | struct intel_framebuffer *intel_fb; | 1181 | struct intel_framebuffer *intel_fb; |
1182 | struct drm_i915_gem_object *obj_priv; | 1182 | struct drm_i915_gem_object *obj_priv; |
1183 | struct drm_crtc *tmp_crtc; | ||
1183 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1184 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1184 | int plane = intel_crtc->plane; | 1185 | int plane = intel_crtc->plane; |
1186 | int crtcs_enabled = 0; | ||
1187 | |||
1188 | DRM_DEBUG_KMS("\n"); | ||
1185 | 1189 | ||
1186 | if (!i915_powersave) | 1190 | if (!i915_powersave) |
1187 | return; | 1191 | return; |
@@ -1199,10 +1203,21 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1199 | * If FBC is already on, we just have to verify that we can | 1203 | * If FBC is already on, we just have to verify that we can |
1200 | * keep it that way... | 1204 | * keep it that way... |
1201 | * Need to disable if: | 1205 | * Need to disable if: |
1206 | * - more than one pipe is active | ||
1202 | * - changing FBC params (stride, fence, mode) | 1207 | * - changing FBC params (stride, fence, mode) |
1203 | * - new fb is too large to fit in compressed buffer | 1208 | * - new fb is too large to fit in compressed buffer |
1204 | * - going to an unsupported config (interlace, pixel multiply, etc.) | 1209 | * - going to an unsupported config (interlace, pixel multiply, etc.) |
1205 | */ | 1210 | */ |
1211 | list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { | ||
1212 | if (tmp_crtc->enabled) | ||
1213 | crtcs_enabled++; | ||
1214 | } | ||
1215 | DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled); | ||
1216 | if (crtcs_enabled > 1) { | ||
1217 | DRM_DEBUG_KMS("more than one pipe active, disabling compression\n"); | ||
1218 | dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES; | ||
1219 | goto out_disable; | ||
1220 | } | ||
1206 | if (intel_fb->obj->size > dev_priv->cfb_size) { | 1221 | if (intel_fb->obj->size > dev_priv->cfb_size) { |
1207 | DRM_DEBUG_KMS("framebuffer too large, disabling " | 1222 | DRM_DEBUG_KMS("framebuffer too large, disabling " |
1208 | "compression\n"); | 1223 | "compression\n"); |
@@ -1255,7 +1270,7 @@ out_disable: | |||
1255 | } | 1270 | } |
1256 | } | 1271 | } |
1257 | 1272 | ||
1258 | static int | 1273 | int |
1259 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) | 1274 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) |
1260 | { | 1275 | { |
1261 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 1276 | 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) | |||
2255 | intel_wait_for_vblank(dev); | 2270 | intel_wait_for_vblank(dev); |
2256 | } | 2271 | } |
2257 | 2272 | ||
2273 | /* Don't disable pipe A or pipe A PLLs if needed */ | ||
2274 | if (pipeconf_reg == PIPEACONF && | ||
2275 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | ||
2276 | goto skip_pipe_off; | ||
2277 | |||
2258 | /* Next, disable display pipes */ | 2278 | /* Next, disable display pipes */ |
2259 | temp = I915_READ(pipeconf_reg); | 2279 | temp = I915_READ(pipeconf_reg); |
2260 | if ((temp & PIPEACONF_ENABLE) != 0) { | 2280 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -2270,7 +2290,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2270 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); | 2290 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); |
2271 | I915_READ(dpll_reg); | 2291 | I915_READ(dpll_reg); |
2272 | } | 2292 | } |
2273 | 2293 | skip_pipe_off: | |
2274 | /* Wait for the clocks to turn off. */ | 2294 | /* Wait for the clocks to turn off. */ |
2275 | udelay(150); | 2295 | udelay(150); |
2276 | break; | 2296 | break; |
@@ -2356,8 +2376,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
2356 | if (mode->clock * 3 > 27000 * 4) | 2376 | if (mode->clock * 3 > 27000 * 4) |
2357 | return MODE_CLOCK_HIGH; | 2377 | return MODE_CLOCK_HIGH; |
2358 | } | 2378 | } |
2359 | |||
2360 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
2361 | return true; | 2379 | return true; |
2362 | } | 2380 | } |
2363 | 2381 | ||
@@ -3736,6 +3754,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3736 | if (dev_priv->lvds_dither) { | 3754 | if (dev_priv->lvds_dither) { |
3737 | if (HAS_PCH_SPLIT(dev)) { | 3755 | if (HAS_PCH_SPLIT(dev)) { |
3738 | pipeconf |= PIPE_ENABLE_DITHER; | 3756 | pipeconf |= PIPE_ENABLE_DITHER; |
3757 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; | ||
3739 | pipeconf |= PIPE_DITHER_TYPE_ST01; | 3758 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3740 | } else | 3759 | } else |
3741 | lvds |= LVDS_ENABLE_DITHER; | 3760 | lvds |= LVDS_ENABLE_DITHER; |
@@ -4412,7 +4431,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule) | |||
4412 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); | 4431 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); |
4413 | 4432 | ||
4414 | /* Unlock panel regs */ | 4433 | /* Unlock panel regs */ |
4415 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4434 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4435 | PANEL_UNLOCK_REGS); | ||
4416 | 4436 | ||
4417 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; | 4437 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; |
4418 | I915_WRITE(dpll_reg, dpll); | 4438 | I915_WRITE(dpll_reg, dpll); |
@@ -4455,7 +4475,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc) | |||
4455 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); | 4475 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); |
4456 | 4476 | ||
4457 | /* Unlock panel regs */ | 4477 | /* Unlock panel regs */ |
4458 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4478 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4479 | PANEL_UNLOCK_REGS); | ||
4459 | 4480 | ||
4460 | dpll |= DISPLAY_RATE_SELECT_FPA1; | 4481 | dpll |= DISPLAY_RATE_SELECT_FPA1; |
4461 | I915_WRITE(dpll_reg, dpll); | 4482 | I915_WRITE(dpll_reg, dpll); |
@@ -4695,7 +4716,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4695 | struct drm_gem_object *obj; | 4716 | struct drm_gem_object *obj; |
4696 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4717 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4697 | struct intel_unpin_work *work; | 4718 | struct intel_unpin_work *work; |
4698 | unsigned long flags; | 4719 | unsigned long flags, offset; |
4699 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4720 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; |
4700 | int ret, pipesrc; | 4721 | int ret, pipesrc; |
4701 | u32 flip_mask; | 4722 | u32 flip_mask; |
@@ -4762,19 +4783,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4762 | while (I915_READ(ISR) & flip_mask) | 4783 | while (I915_READ(ISR) & flip_mask) |
4763 | ; | 4784 | ; |
4764 | 4785 | ||
4786 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ | ||
4787 | offset = obj_priv->gtt_offset; | ||
4788 | offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8); | ||
4789 | |||
4765 | BEGIN_LP_RING(4); | 4790 | BEGIN_LP_RING(4); |
4766 | if (IS_I965G(dev)) { | 4791 | if (IS_I965G(dev)) { |
4767 | OUT_RING(MI_DISPLAY_FLIP | | 4792 | OUT_RING(MI_DISPLAY_FLIP | |
4768 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4793 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4769 | OUT_RING(fb->pitch); | 4794 | OUT_RING(fb->pitch); |
4770 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); | 4795 | OUT_RING(offset | obj_priv->tiling_mode); |
4771 | pipesrc = I915_READ(pipesrc_reg); | 4796 | pipesrc = I915_READ(pipesrc_reg); |
4772 | OUT_RING(pipesrc & 0x0fff0fff); | 4797 | OUT_RING(pipesrc & 0x0fff0fff); |
4773 | } else { | 4798 | } else { |
4774 | OUT_RING(MI_DISPLAY_FLIP_I915 | | 4799 | OUT_RING(MI_DISPLAY_FLIP_I915 | |
4775 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4800 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4776 | OUT_RING(fb->pitch); | 4801 | OUT_RING(fb->pitch); |
4777 | OUT_RING(obj_priv->gtt_offset); | 4802 | OUT_RING(offset); |
4778 | OUT_RING(MI_NOOP); | 4803 | OUT_RING(MI_NOOP); |
4779 | } | 4804 | } |
4780 | ADVANCE_LP_RING(); | 4805 | ADVANCE_LP_RING(); |
@@ -5506,6 +5531,66 @@ static void intel_init_display(struct drm_device *dev) | |||
5506 | } | 5531 | } |
5507 | } | 5532 | } |
5508 | 5533 | ||
5534 | /* | ||
5535 | * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend, | ||
5536 | * resume, or other times. This quirk makes sure that's the case for | ||
5537 | * affected systems. | ||
5538 | */ | ||
5539 | static void quirk_pipea_force (struct drm_device *dev) | ||
5540 | { | ||
5541 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5542 | |||
5543 | dev_priv->quirks |= QUIRK_PIPEA_FORCE; | ||
5544 | DRM_DEBUG_DRIVER("applying pipe a force quirk\n"); | ||
5545 | } | ||
5546 | |||
5547 | struct intel_quirk { | ||
5548 | int device; | ||
5549 | int subsystem_vendor; | ||
5550 | int subsystem_device; | ||
5551 | void (*hook)(struct drm_device *dev); | ||
5552 | }; | ||
5553 | |||
5554 | struct intel_quirk intel_quirks[] = { | ||
5555 | /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */ | ||
5556 | { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force }, | ||
5557 | /* HP Mini needs pipe A force quirk (LP: #322104) */ | ||
5558 | { 0x27ae,0x103c, 0x361a, quirk_pipea_force }, | ||
5559 | |||
5560 | /* Thinkpad R31 needs pipe A force quirk */ | ||
5561 | { 0x3577, 0x1014, 0x0505, quirk_pipea_force }, | ||
5562 | /* Toshiba Protege R-205, S-209 needs pipe A force quirk */ | ||
5563 | { 0x2592, 0x1179, 0x0001, quirk_pipea_force }, | ||
5564 | |||
5565 | /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */ | ||
5566 | { 0x3577, 0x1014, 0x0513, quirk_pipea_force }, | ||
5567 | /* ThinkPad X40 needs pipe A force quirk */ | ||
5568 | |||
5569 | /* ThinkPad T60 needs pipe A force quirk (bug #16494) */ | ||
5570 | { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, | ||
5571 | |||
5572 | /* 855 & before need to leave pipe A & dpll A up */ | ||
5573 | { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5574 | { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5575 | }; | ||
5576 | |||
5577 | static void intel_init_quirks(struct drm_device *dev) | ||
5578 | { | ||
5579 | struct pci_dev *d = dev->pdev; | ||
5580 | int i; | ||
5581 | |||
5582 | for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) { | ||
5583 | struct intel_quirk *q = &intel_quirks[i]; | ||
5584 | |||
5585 | if (d->device == q->device && | ||
5586 | (d->subsystem_vendor == q->subsystem_vendor || | ||
5587 | q->subsystem_vendor == PCI_ANY_ID) && | ||
5588 | (d->subsystem_device == q->subsystem_device || | ||
5589 | q->subsystem_device == PCI_ANY_ID)) | ||
5590 | q->hook(dev); | ||
5591 | } | ||
5592 | } | ||
5593 | |||
5509 | void intel_modeset_init(struct drm_device *dev) | 5594 | void intel_modeset_init(struct drm_device *dev) |
5510 | { | 5595 | { |
5511 | struct drm_i915_private *dev_priv = dev->dev_private; | 5596 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5518,6 +5603,8 @@ void intel_modeset_init(struct drm_device *dev) | |||
5518 | 5603 | ||
5519 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 5604 | dev->mode_config.funcs = (void *)&intel_mode_funcs; |
5520 | 5605 | ||
5606 | intel_init_quirks(dev); | ||
5607 | |||
5521 | intel_init_display(dev); | 5608 | intel_init_display(dev); |
5522 | 5609 | ||
5523 | if (IS_I965G(dev)) { | 5610 | if (IS_I965G(dev)) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1aac59e83bff..5dde80f9e652 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -717,6 +717,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
717 | } | 717 | } |
718 | } | 718 | } |
719 | 719 | ||
720 | static void ironlake_edp_panel_on (struct drm_device *dev) | ||
721 | { | ||
722 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
723 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
724 | u32 pp, pp_status; | ||
725 | |||
726 | pp_status = I915_READ(PCH_PP_STATUS); | ||
727 | if (pp_status & PP_ON) | ||
728 | return; | ||
729 | |||
730 | pp = I915_READ(PCH_PP_CONTROL); | ||
731 | pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON; | ||
732 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
733 | do { | ||
734 | pp_status = I915_READ(PCH_PP_STATUS); | ||
735 | } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout)); | ||
736 | |||
737 | if (time_after(jiffies, timeout)) | ||
738 | DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status); | ||
739 | |||
740 | pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD); | ||
741 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
742 | } | ||
743 | |||
744 | static void ironlake_edp_panel_off (struct drm_device *dev) | ||
745 | { | ||
746 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
747 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
748 | u32 pp, pp_status; | ||
749 | |||
750 | pp = I915_READ(PCH_PP_CONTROL); | ||
751 | pp &= ~POWER_TARGET_ON; | ||
752 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
753 | do { | ||
754 | pp_status = I915_READ(PCH_PP_STATUS); | ||
755 | } while ((pp_status & PP_ON) && !time_after(jiffies, timeout)); | ||
756 | |||
757 | if (time_after(jiffies, timeout)) | ||
758 | DRM_DEBUG_KMS("panel off wait timed out\n"); | ||
759 | |||
760 | /* Make sure VDD is enabled so DP AUX will work */ | ||
761 | pp |= EDP_FORCE_VDD; | ||
762 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
763 | } | ||
764 | |||
720 | static void ironlake_edp_backlight_on (struct drm_device *dev) | 765 | static void ironlake_edp_backlight_on (struct drm_device *dev) |
721 | { | 766 | { |
722 | struct drm_i915_private *dev_priv = dev->dev_private; | 767 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -751,14 +796,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
751 | if (mode != DRM_MODE_DPMS_ON) { | 796 | if (mode != DRM_MODE_DPMS_ON) { |
752 | if (dp_reg & DP_PORT_EN) { | 797 | if (dp_reg & DP_PORT_EN) { |
753 | intel_dp_link_down(intel_encoder, dp_priv->DP); | 798 | intel_dp_link_down(intel_encoder, dp_priv->DP); |
754 | if (IS_eDP(intel_encoder)) | 799 | if (IS_eDP(intel_encoder)) { |
755 | ironlake_edp_backlight_off(dev); | 800 | ironlake_edp_backlight_off(dev); |
801 | ironlake_edp_panel_off(dev); | ||
802 | } | ||
756 | } | 803 | } |
757 | } else { | 804 | } else { |
758 | if (!(dp_reg & DP_PORT_EN)) { | 805 | if (!(dp_reg & DP_PORT_EN)) { |
759 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); | 806 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); |
760 | if (IS_eDP(intel_encoder)) | 807 | if (IS_eDP(intel_encoder)) { |
808 | ironlake_edp_panel_on(dev); | ||
761 | ironlake_edp_backlight_on(dev); | 809 | ironlake_edp_backlight_on(dev); |
810 | } | ||
762 | } | 811 | } |
763 | } | 812 | } |
764 | dp_priv->dpms_mode = mode; | 813 | dp_priv->dpms_mode = mode; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 72206f37c4fb..2f7970be9051 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev); | |||
215 | extern void ironlake_enable_drps(struct drm_device *dev); | 215 | extern void ironlake_enable_drps(struct drm_device *dev); |
216 | extern void ironlake_disable_drps(struct drm_device *dev); | 216 | extern void ironlake_disable_drps(struct drm_device *dev); |
217 | 217 | ||
218 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, | ||
219 | struct drm_gem_object *obj); | ||
220 | |||
218 | extern int intel_framebuffer_init(struct drm_device *dev, | 221 | extern int intel_framebuffer_init(struct drm_device *dev, |
219 | struct intel_framebuffer *ifb, | 222 | struct intel_framebuffer *ifb, |
220 | struct drm_mode_fb_cmd *mode_cmd, | 223 | struct drm_mode_fb_cmd *mode_cmd, |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index c3c505244e07..3e18c9e7729b 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
98 | 98 | ||
99 | mutex_lock(&dev->struct_mutex); | 99 | mutex_lock(&dev->struct_mutex); |
100 | 100 | ||
101 | ret = i915_gem_object_pin(fbo, 64*1024); | 101 | ret = intel_pin_and_fence_fb_obj(dev, fbo); |
102 | if (ret) { | 102 | if (ret) { |
103 | DRM_ERROR("failed to pin fb: %d\n", ret); | 103 | DRM_ERROR("failed to pin fb: %d\n", ret); |
104 | goto out_unref; | 104 | goto out_unref; |
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev, | |||
236 | 236 | ||
237 | drm_framebuffer_cleanup(&ifb->base); | 237 | drm_framebuffer_cleanup(&ifb->base); |
238 | if (ifb->obj) | 238 | if (ifb->obj) |
239 | drm_gem_object_unreference_unlocked(ifb->obj); | 239 | drm_gem_object_unreference(ifb->obj); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 31df55f0a0a7..0eab8df5bf7e 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -599,6 +599,26 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
599 | return 0; | 599 | return 0; |
600 | } | 600 | } |
601 | 601 | ||
602 | static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id) | ||
603 | { | ||
604 | DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident); | ||
605 | return 1; | ||
606 | } | ||
607 | |||
608 | /* The GPU hangs up on these systems if modeset is performed on LID open */ | ||
609 | static const struct dmi_system_id intel_no_modeset_on_lid[] = { | ||
610 | { | ||
611 | .callback = intel_no_modeset_on_lid_dmi_callback, | ||
612 | .ident = "Toshiba Tecra A11", | ||
613 | .matches = { | ||
614 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
615 | DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"), | ||
616 | }, | ||
617 | }, | ||
618 | |||
619 | { } /* terminating entry */ | ||
620 | }; | ||
621 | |||
602 | /* | 622 | /* |
603 | * Lid events. Note the use of 'modeset_on_lid': | 623 | * Lid events. Note the use of 'modeset_on_lid': |
604 | * - we set it on lid close, and reset it on open | 624 | * - 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, | |||
622 | */ | 642 | */ |
623 | if (connector) | 643 | if (connector) |
624 | connector->status = connector->funcs->detect(connector); | 644 | connector->status = connector->funcs->detect(connector); |
645 | /* Don't force modeset on machines where it causes a GPU lockup */ | ||
646 | if (dmi_check_system(intel_no_modeset_on_lid)) | ||
647 | return NOTIFY_OK; | ||
625 | if (!acpi_lid_open()) { | 648 | if (!acpi_lid_open()) { |
626 | dev_priv->modeset_on_lid = 1; | 649 | dev_priv->modeset_on_lid = 1; |
627 | return NOTIFY_OK; | 650 | return NOTIFY_OK; |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 115d26b762cc..3fa6984d9896 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -333,6 +333,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, | |||
333 | return snprintf(buf, PAGE_SIZE, "%s\n", | 333 | return snprintf(buf, PAGE_SIZE, "%s\n", |
334 | (cp == PM_PROFILE_AUTO) ? "auto" : | 334 | (cp == PM_PROFILE_AUTO) ? "auto" : |
335 | (cp == PM_PROFILE_LOW) ? "low" : | 335 | (cp == PM_PROFILE_LOW) ? "low" : |
336 | (cp == PM_PROFILE_MID) ? "mid" : | ||
336 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); | 337 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); |
337 | } | 338 | } |
338 | 339 | ||
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4917af96bae1..2ed435bd4b6c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -539,9 +539,13 @@ static int mmci_get_cd(struct mmc_host *mmc) | |||
539 | if (host->gpio_cd == -ENOSYS) | 539 | if (host->gpio_cd == -ENOSYS) |
540 | status = host->plat->status(mmc_dev(host->mmc)); | 540 | status = host->plat->status(mmc_dev(host->mmc)); |
541 | else | 541 | else |
542 | status = gpio_get_value(host->gpio_cd); | 542 | status = !gpio_get_value(host->gpio_cd); |
543 | 543 | ||
544 | return !status; | 544 | /* |
545 | * Use positive logic throughout - status is zero for no card, | ||
546 | * non-zero for card inserted. | ||
547 | */ | ||
548 | return status; | ||
545 | } | 549 | } |
546 | 550 | ||
547 | static const struct mmc_host_ops mmci_ops = { | 551 | static const struct mmc_host_ops mmci_ops = { |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8bd23687c530..bb0872a63315 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -1062,6 +1062,10 @@ struct bnx2x { | |||
1062 | 1062 | ||
1063 | /* used to synchronize stats collecting */ | 1063 | /* used to synchronize stats collecting */ |
1064 | int stats_state; | 1064 | int stats_state; |
1065 | |||
1066 | /* used for synchronization of concurrent threads statistics handling */ | ||
1067 | spinlock_t stats_lock; | ||
1068 | |||
1065 | /* used by dmae command loader */ | 1069 | /* used by dmae command loader */ |
1066 | struct dmae_command stats_dmae; | 1070 | struct dmae_command stats_dmae; |
1067 | int executer_idx; | 1071 | int executer_idx; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 57ff5b3bcce6..46167c081727 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -57,8 +57,8 @@ | |||
57 | #include "bnx2x_init_ops.h" | 57 | #include "bnx2x_init_ops.h" |
58 | #include "bnx2x_dump.h" | 58 | #include "bnx2x_dump.h" |
59 | 59 | ||
60 | #define DRV_MODULE_VERSION "1.52.53-1" | 60 | #define DRV_MODULE_VERSION "1.52.53-2" |
61 | #define DRV_MODULE_RELDATE "2010/18/04" | 61 | #define DRV_MODULE_RELDATE "2010/21/07" |
62 | #define BNX2X_BC_VER 0x040200 | 62 | #define BNX2X_BC_VER 0x040200 |
63 | 63 | ||
64 | #include <linux/firmware.h> | 64 | #include <linux/firmware.h> |
@@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3789 | struct eth_query_ramrod_data ramrod_data = {0}; | 3789 | struct eth_query_ramrod_data ramrod_data = {0}; |
3790 | int i, rc; | 3790 | int i, rc; |
3791 | 3791 | ||
3792 | spin_lock_bh(&bp->stats_lock); | ||
3793 | |||
3792 | ramrod_data.drv_counter = bp->stats_counter++; | 3794 | ramrod_data.drv_counter = bp->stats_counter++; |
3793 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; | 3795 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; |
3794 | for_each_queue(bp, i) | 3796 | for_each_queue(bp, i) |
@@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3802 | bp->spq_left++; | 3804 | bp->spq_left++; |
3803 | bp->stats_pending = 1; | 3805 | bp->stats_pending = 1; |
3804 | } | 3806 | } |
3807 | |||
3808 | spin_unlock_bh(&bp->stats_lock); | ||
3805 | } | 3809 | } |
3806 | } | 3810 | } |
3807 | 3811 | ||
@@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4367 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); | 4371 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); |
4368 | struct bnx2x_eth_stats *estats = &bp->eth_stats; | 4372 | struct bnx2x_eth_stats *estats = &bp->eth_stats; |
4369 | int i; | 4373 | int i; |
4374 | u16 cur_stats_counter; | ||
4375 | |||
4376 | /* Make sure we use the value of the counter | ||
4377 | * used for sending the last stats ramrod. | ||
4378 | */ | ||
4379 | spin_lock_bh(&bp->stats_lock); | ||
4380 | cur_stats_counter = bp->stats_counter - 1; | ||
4381 | spin_unlock_bh(&bp->stats_lock); | ||
4370 | 4382 | ||
4371 | memcpy(&(fstats->total_bytes_received_hi), | 4383 | memcpy(&(fstats->total_bytes_received_hi), |
4372 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), | 4384 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), |
@@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4394 | u32 diff; | 4406 | u32 diff; |
4395 | 4407 | ||
4396 | /* are storm stats valid? */ | 4408 | /* are storm stats valid? */ |
4397 | if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) != | 4409 | if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) { |
4398 | bp->stats_counter) { | ||
4399 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" | 4410 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" |
4400 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", | 4411 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", |
4401 | i, xclient->stats_counter, bp->stats_counter); | 4412 | i, xclient->stats_counter, cur_stats_counter + 1); |
4402 | return -1; | 4413 | return -1; |
4403 | } | 4414 | } |
4404 | if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) != | 4415 | if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) { |
4405 | bp->stats_counter) { | ||
4406 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" | 4416 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" |
4407 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", | 4417 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", |
4408 | i, tclient->stats_counter, bp->stats_counter); | 4418 | i, tclient->stats_counter, cur_stats_counter + 1); |
4409 | return -2; | 4419 | return -2; |
4410 | } | 4420 | } |
4411 | if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) != | 4421 | if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) { |
4412 | bp->stats_counter) { | ||
4413 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" | 4422 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" |
4414 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", | 4423 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", |
4415 | i, uclient->stats_counter, bp->stats_counter); | 4424 | i, uclient->stats_counter, cur_stats_counter + 1); |
4416 | return -4; | 4425 | return -4; |
4417 | } | 4426 | } |
4418 | 4427 | ||
@@ -4849,16 +4858,18 @@ static const struct { | |||
4849 | 4858 | ||
4850 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) | 4859 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) |
4851 | { | 4860 | { |
4852 | enum bnx2x_stats_state state = bp->stats_state; | 4861 | enum bnx2x_stats_state state; |
4853 | 4862 | ||
4854 | if (unlikely(bp->panic)) | 4863 | if (unlikely(bp->panic)) |
4855 | return; | 4864 | return; |
4856 | 4865 | ||
4857 | bnx2x_stats_stm[state][event].action(bp); | 4866 | /* Protect a state change flow */ |
4867 | spin_lock_bh(&bp->stats_lock); | ||
4868 | state = bp->stats_state; | ||
4858 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; | 4869 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; |
4870 | spin_unlock_bh(&bp->stats_lock); | ||
4859 | 4871 | ||
4860 | /* Make sure the state has been "changed" */ | 4872 | bnx2x_stats_stm[state][event].action(bp); |
4861 | smp_wmb(); | ||
4862 | 4873 | ||
4863 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) | 4874 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) |
4864 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", | 4875 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", |
@@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
9908 | 9919 | ||
9909 | mutex_init(&bp->port.phy_mutex); | 9920 | mutex_init(&bp->port.phy_mutex); |
9910 | mutex_init(&bp->fw_mb_mutex); | 9921 | mutex_init(&bp->fw_mb_mutex); |
9922 | spin_lock_init(&bp->stats_lock); | ||
9911 | #ifdef BCM_CNIC | 9923 | #ifdef BCM_CNIC |
9912 | mutex_init(&bp->cnic_mutex); | 9924 | mutex_init(&bp->cnic_mutex); |
9913 | #endif | 9925 | #endif |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index df483076eda6..8d7dfd2f1e90 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond) | |||
822 | 822 | ||
823 | /*initialize packet type*/ | 823 | /*initialize packet type*/ |
824 | pk_type->type = cpu_to_be16(ETH_P_ARP); | 824 | pk_type->type = cpu_to_be16(ETH_P_ARP); |
825 | pk_type->dev = NULL; | 825 | pk_type->dev = bond->dev; |
826 | pk_type->func = rlb_arp_recv; | 826 | pk_type->func = rlb_arp_recv; |
827 | 827 | ||
828 | /* register to receive ARPs */ | 828 | /* register to receive ARPs */ |
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 1d973db27c32..d7de376d7178 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c | |||
@@ -1022,7 +1022,7 @@ static const struct net_device_ops lance_netdev_ops = { | |||
1022 | .ndo_set_mac_address = eth_mac_addr, | 1022 | .ndo_set_mac_address = eth_mac_addr, |
1023 | }; | 1023 | }; |
1024 | 1024 | ||
1025 | static int __init dec_lance_probe(struct device *bdev, const int type) | 1025 | static int __devinit dec_lance_probe(struct device *bdev, const int type) |
1026 | { | 1026 | { |
1027 | static unsigned version_printed; | 1027 | static unsigned version_printed; |
1028 | static const char fmt[] = "declance%d"; | 1028 | static const char fmt[] = "declance%d"; |
@@ -1326,7 +1326,7 @@ static void __exit dec_lance_platform_remove(void) | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | #ifdef CONFIG_TC | 1328 | #ifdef CONFIG_TC |
1329 | static int __init dec_lance_tc_probe(struct device *dev); | 1329 | static int __devinit dec_lance_tc_probe(struct device *dev); |
1330 | static int __exit dec_lance_tc_remove(struct device *dev); | 1330 | static int __exit dec_lance_tc_remove(struct device *dev); |
1331 | 1331 | ||
1332 | static const struct tc_device_id dec_lance_tc_table[] = { | 1332 | static const struct tc_device_id dec_lance_tc_table[] = { |
@@ -1345,7 +1345,7 @@ static struct tc_driver dec_lance_tc_driver = { | |||
1345 | }, | 1345 | }, |
1346 | }; | 1346 | }; |
1347 | 1347 | ||
1348 | static int __init dec_lance_tc_probe(struct device *dev) | 1348 | static int __devinit dec_lance_tc_probe(struct device *dev) |
1349 | { | 1349 | { |
1350 | int status = dec_lance_probe(dev, PMAD_LANCE); | 1350 | int status = dec_lance_probe(dev, PMAD_LANCE); |
1351 | if (!status) | 1351 | if (!status) |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 3881918f5382..cea37e0837ff 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; | 1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; |
1723 | u32 part_num; | 1723 | u32 part_num; |
1724 | 1724 | ||
1725 | /* Catch broken hardware that put the wrong VF device ID in | ||
1726 | * the PCIe SR-IOV capability. | ||
1727 | */ | ||
1728 | if (pdev->is_virtfn) { | ||
1729 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
1730 | pci_name(pdev), pdev->vendor, pdev->device); | ||
1731 | return -EINVAL; | ||
1732 | } | ||
1733 | |||
1725 | err = pci_enable_device_mem(pdev); | 1734 | err = pci_enable_device_mem(pdev); |
1726 | if (err) | 1735 | if (err) |
1727 | return err; | 1736 | return err; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7b5d9764f317..74d9b6df3029 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -6492,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6492 | #endif | 6492 | #endif |
6493 | u32 part_num, eec; | 6493 | u32 part_num, eec; |
6494 | 6494 | ||
6495 | /* Catch broken hardware that put the wrong VF device ID in | ||
6496 | * the PCIe SR-IOV capability. | ||
6497 | */ | ||
6498 | if (pdev->is_virtfn) { | ||
6499 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
6500 | pci_name(pdev), pdev->vendor, pdev->device); | ||
6501 | return -EINVAL; | ||
6502 | } | ||
6503 | |||
6495 | err = pci_enable_device_mem(pdev); | 6504 | err = pci_enable_device_mem(pdev); |
6496 | if (err) | 6505 | if (err) |
6497 | return err; | 6506 | return err; |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 87e8d4cb4057..f15fe2cf72ae 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = { | |||
499 | .ndo_validate_addr = eth_validate_addr, | 499 | .ndo_validate_addr = eth_validate_addr, |
500 | }; | 500 | }; |
501 | 501 | ||
502 | static void macvlan_setup(struct net_device *dev) | 502 | void macvlan_common_setup(struct net_device *dev) |
503 | { | 503 | { |
504 | ether_setup(dev); | 504 | ether_setup(dev); |
505 | 505 | ||
@@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev) | |||
508 | dev->destructor = free_netdev; | 508 | dev->destructor = free_netdev; |
509 | dev->header_ops = &macvlan_hard_header_ops, | 509 | dev->header_ops = &macvlan_hard_header_ops, |
510 | dev->ethtool_ops = &macvlan_ethtool_ops; | 510 | dev->ethtool_ops = &macvlan_ethtool_ops; |
511 | } | ||
512 | EXPORT_SYMBOL_GPL(macvlan_common_setup); | ||
513 | |||
514 | static void macvlan_setup(struct net_device *dev) | ||
515 | { | ||
516 | macvlan_common_setup(dev); | ||
511 | dev->tx_queue_len = 0; | 517 | dev->tx_queue_len = 0; |
512 | } | 518 | } |
513 | 519 | ||
@@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops) | |||
705 | /* common fields */ | 711 | /* common fields */ |
706 | ops->priv_size = sizeof(struct macvlan_dev); | 712 | ops->priv_size = sizeof(struct macvlan_dev); |
707 | ops->get_tx_queues = macvlan_get_tx_queues; | 713 | ops->get_tx_queues = macvlan_get_tx_queues; |
708 | ops->setup = macvlan_setup; | ||
709 | ops->validate = macvlan_validate; | 714 | ops->validate = macvlan_validate; |
710 | ops->maxtype = IFLA_MACVLAN_MAX; | 715 | ops->maxtype = IFLA_MACVLAN_MAX; |
711 | ops->policy = macvlan_policy; | 716 | ops->policy = macvlan_policy; |
@@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register); | |||
719 | 724 | ||
720 | static struct rtnl_link_ops macvlan_link_ops = { | 725 | static struct rtnl_link_ops macvlan_link_ops = { |
721 | .kind = "macvlan", | 726 | .kind = "macvlan", |
727 | .setup = macvlan_setup, | ||
722 | .newlink = macvlan_newlink, | 728 | .newlink = macvlan_newlink, |
723 | .dellink = macvlan_dellink, | 729 | .dellink = macvlan_dellink, |
724 | }; | 730 | }; |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index a8a94e2f6ddc..ff02b836c3c4 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb) | |||
180 | { | 180 | { |
181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); | 181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); |
182 | if (!q) | 182 | if (!q) |
183 | return -ENOLINK; | 183 | goto drop; |
184 | |||
185 | if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len) | ||
186 | goto drop; | ||
184 | 187 | ||
185 | skb_queue_tail(&q->sk.sk_receive_queue, skb); | 188 | skb_queue_tail(&q->sk.sk_receive_queue, skb); |
186 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); | 189 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); |
187 | return 0; | 190 | return NET_RX_SUCCESS; |
191 | |||
192 | drop: | ||
193 | kfree_skb(skb); | ||
194 | return NET_RX_DROP; | ||
188 | } | 195 | } |
189 | 196 | ||
190 | /* | 197 | /* |
@@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev, | |||
235 | macvlan_dellink(dev, head); | 242 | macvlan_dellink(dev, head); |
236 | } | 243 | } |
237 | 244 | ||
245 | static void macvtap_setup(struct net_device *dev) | ||
246 | { | ||
247 | macvlan_common_setup(dev); | ||
248 | dev->tx_queue_len = TUN_READQ_SIZE; | ||
249 | } | ||
250 | |||
238 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { | 251 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { |
239 | .kind = "macvtap", | 252 | .kind = "macvtap", |
253 | .setup = macvtap_setup, | ||
240 | .newlink = macvtap_newlink, | 254 | .newlink = macvtap_newlink, |
241 | .dellink = macvtap_dellink, | 255 | .dellink = macvtap_dellink, |
242 | }; | 256 | }; |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 5e52c75892df..7f3a53dcc6ef 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -65,7 +65,7 @@ static int debug_level = ERR_DBG; | |||
65 | 65 | ||
66 | /* DEBUG message print. */ | 66 | /* DEBUG message print. */ |
67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ | 67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ |
68 | if (dbg_level >= debug_level) \ | 68 | if (dbg_level <= debug_level) \ |
69 | pr_info(fmt, ##args); \ | 69 | pr_info(fmt, ##args); \ |
70 | } while (0) | 70 | } while (0) |
71 | 71 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6ad6fe706312..63042596f0cf 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun, | |||
736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
737 | else if (sinfo->gso_type & SKB_GSO_UDP) | 737 | else if (sinfo->gso_type & SKB_GSO_UDP) |
738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; | 738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; |
739 | else | 739 | else { |
740 | BUG(); | 740 | printk(KERN_ERR "tun: unexpected GSO type: " |
741 | "0x%x, gso_size %d, hdr_len %d\n", | ||
742 | sinfo->gso_type, gso.gso_size, | ||
743 | gso.hdr_len); | ||
744 | print_hex_dump(KERN_ERR, "tun: ", | ||
745 | DUMP_PREFIX_NONE, | ||
746 | 16, 1, skb->head, | ||
747 | min((int)gso.hdr_len, 64), true); | ||
748 | WARN_ON_ONCE(1); | ||
749 | return -EINVAL; | ||
750 | } | ||
741 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) | 751 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) |
742 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; | 752 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; |
743 | } else | 753 | } else |
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h index 2d7c96d7e865..eb80243e22df 100644 --- a/drivers/net/wimax/i2400m/i2400m-usb.h +++ b/drivers/net/wimax/i2400m/i2400m-usb.h | |||
@@ -152,6 +152,7 @@ enum { | |||
152 | /* Device IDs */ | 152 | /* Device IDs */ |
153 | USB_DEVICE_ID_I6050 = 0x0186, | 153 | USB_DEVICE_ID_I6050 = 0x0186, |
154 | USB_DEVICE_ID_I6050_2 = 0x0188, | 154 | USB_DEVICE_ID_I6050_2 = 0x0188, |
155 | USB_DEVICE_ID_I6250 = 0x0187, | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | 158 | ||
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index 0d5081d77dc0..d3365ac85dde 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface, | |||
491 | switch (id->idProduct) { | 491 | switch (id->idProduct) { |
492 | case USB_DEVICE_ID_I6050: | 492 | case USB_DEVICE_ID_I6050: |
493 | case USB_DEVICE_ID_I6050_2: | 493 | case USB_DEVICE_ID_I6050_2: |
494 | case USB_DEVICE_ID_I6250: | ||
494 | i2400mu->i6050 = 1; | 495 | i2400mu->i6050 = 1; |
495 | break; | 496 | break; |
496 | default: | 497 | default: |
@@ -739,6 +740,7 @@ static | |||
739 | struct usb_device_id i2400mu_id_table[] = { | 740 | struct usb_device_id i2400mu_id_table[] = { |
740 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, | 741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, |
741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, | 742 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, |
743 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, | ||
742 | { USB_DEVICE(0x8086, 0x0181) }, | 744 | { USB_DEVICE(0x8086, 0x0181) }, |
743 | { USB_DEVICE(0x8086, 0x1403) }, | 745 | { USB_DEVICE(0x8086, 0x1403) }, |
744 | { USB_DEVICE(0x8086, 0x1405) }, | 746 | { USB_DEVICE(0x8086, 0x1405) }, |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index ca6065b71b46..e3e52913d83a 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
844 | int dma_type; | 844 | int dma_type; |
845 | 845 | ||
846 | if (edma) | 846 | if (edma) |
847 | dma_type = DMA_FROM_DEVICE; | ||
848 | else | ||
849 | dma_type = DMA_BIDIRECTIONAL; | 847 | dma_type = DMA_BIDIRECTIONAL; |
848 | else | ||
849 | dma_type = DMA_FROM_DEVICE; | ||
850 | 850 | ||
851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; | 851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; |
852 | spin_lock_bh(&sc->rx.rxbuflock); | 852 | spin_lock_bh(&sc->rx.rxbuflock); |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index df4532e91b1a..f370476d5417 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
178 | unsigned long val, | 178 | unsigned long val, |
179 | struct cpufreq_freqs *freqs) | 179 | struct cpufreq_freqs *freqs) |
180 | { | 180 | { |
181 | #warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock" | ||
182 | switch (val) { | 181 | switch (val) { |
183 | case CPUFREQ_PRECHANGE: | 182 | case CPUFREQ_PRECHANGE: |
184 | if (freqs->new > freqs->old) { | 183 | if (freqs->new > freqs->old) { |
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
186 | "pre-updating\n", | 185 | "pre-updating\n", |
187 | freqs->new / 1000, (freqs->new / 100) % 10, | 186 | freqs->new / 1000, (freqs->new / 100) % 10, |
188 | freqs->old / 1000, (freqs->old / 100) % 10); | 187 | freqs->old / 1000, (freqs->old / 100) % 10); |
189 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 188 | pxa2xx_pcmcia_set_timing(skt); |
190 | } | 189 | } |
191 | break; | 190 | break; |
192 | 191 | ||
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
196 | "post-updating\n", | 195 | "post-updating\n", |
197 | freqs->new / 1000, (freqs->new / 100) % 10, | 196 | freqs->new / 1000, (freqs->new / 100) % 10, |
198 | freqs->old / 1000, (freqs->old / 100) % 10); | 197 | freqs->old / 1000, (freqs->old / 100) % 10); |
199 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 198 | pxa2xx_pcmcia_set_timing(skt); |
200 | } | 199 | } |
201 | break; | 200 | break; |
202 | } | 201 | } |
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c index 2afbeec8b791..84d3c43cf2bc 100644 --- a/drivers/power/ds2782_battery.c +++ b/drivers/power/ds2782_battery.c | |||
@@ -43,10 +43,9 @@ | |||
43 | struct ds278x_info; | 43 | struct ds278x_info; |
44 | 44 | ||
45 | struct ds278x_battery_ops { | 45 | struct ds278x_battery_ops { |
46 | int (*get_current)(struct ds278x_info *info, int *current_uA); | 46 | int (*get_battery_current)(struct ds278x_info *info, int *current_uA); |
47 | int (*get_voltage)(struct ds278x_info *info, int *voltage_uA); | 47 | int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA); |
48 | int (*get_capacity)(struct ds278x_info *info, int *capacity_uA); | 48 | int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA); |
49 | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) | 51 | #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) | |||
213 | int current_uA; | 212 | int current_uA; |
214 | int capacity; | 213 | int capacity; |
215 | 214 | ||
216 | err = info->ops->get_current(info, ¤t_uA); | 215 | err = info->ops->get_battery_current(info, ¤t_uA); |
217 | if (err) | 216 | if (err) |
218 | return err; | 217 | return err; |
219 | 218 | ||
220 | err = info->ops->get_capacity(info, &capacity); | 219 | err = info->ops->get_battery_capacity(info, &capacity); |
221 | if (err) | 220 | if (err) |
222 | return err; | 221 | return err; |
223 | 222 | ||
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy, | |||
246 | break; | 245 | break; |
247 | 246 | ||
248 | case POWER_SUPPLY_PROP_CAPACITY: | 247 | case POWER_SUPPLY_PROP_CAPACITY: |
249 | ret = info->ops->get_capacity(info, &val->intval); | 248 | ret = info->ops->get_battery_capacity(info, &val->intval); |
250 | break; | 249 | break; |
251 | 250 | ||
252 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | 251 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: |
253 | ret = info->ops->get_voltage(info, &val->intval); | 252 | ret = info->ops->get_battery_voltage(info, &val->intval); |
254 | break; | 253 | break; |
255 | 254 | ||
256 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 255 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
257 | ret = info->ops->get_current(info, &val->intval); | 256 | ret = info->ops->get_battery_current(info, &val->intval); |
258 | break; | 257 | break; |
259 | 258 | ||
260 | case POWER_SUPPLY_PROP_TEMP: | 259 | case POWER_SUPPLY_PROP_TEMP: |
@@ -307,14 +306,14 @@ enum ds278x_num_id { | |||
307 | 306 | ||
308 | static struct ds278x_battery_ops ds278x_ops[] = { | 307 | static struct ds278x_battery_ops ds278x_ops[] = { |
309 | [DS2782] = { | 308 | [DS2782] = { |
310 | .get_current = ds2782_get_current, | 309 | .get_battery_current = ds2782_get_current, |
311 | .get_voltage = ds2782_get_voltage, | 310 | .get_battery_voltage = ds2782_get_voltage, |
312 | .get_capacity = ds2782_get_capacity, | 311 | .get_battery_capacity = ds2782_get_capacity, |
313 | }, | 312 | }, |
314 | [DS2786] = { | 313 | [DS2786] = { |
315 | .get_current = ds2786_get_current, | 314 | .get_battery_current = ds2786_get_current, |
316 | .get_voltage = ds2786_get_voltage, | 315 | .get_battery_voltage = ds2786_get_voltage, |
317 | .get_capacity = ds2786_get_capacity, | 316 | .get_battery_capacity = ds2786_get_capacity, |
318 | } | 317 | } |
319 | }; | 318 | }; |
320 | 319 | ||
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 7b14a67bdca2..11790990277a 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg, | |||
286 | { | 286 | { |
287 | struct ab3100_regulator *abreg = reg->reg_data; | 287 | struct ab3100_regulator *abreg = reg->reg_data; |
288 | 288 | ||
289 | if (selector > abreg->voltages_len) | 289 | if (selector >= abreg->voltages_len) |
290 | return -EINVAL; | 290 | return -EINVAL; |
291 | return abreg->typ_voltages[selector]; | 291 | return abreg->typ_voltages[selector]; |
292 | } | 292 | } |
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg) | |||
318 | regval &= 0xE0; | 318 | regval &= 0xE0; |
319 | regval >>= 5; | 319 | regval >>= 5; |
320 | 320 | ||
321 | if (regval > abreg->voltages_len) { | 321 | if (regval >= abreg->voltages_len) { |
322 | dev_err(®->dev, | 322 | dev_err(®->dev, |
323 | "regulator register %02x contains an illegal voltage setting\n", | 323 | "regulator register %02x contains an illegal voltage setting\n", |
324 | abreg->regreg); | 324 | abreg->regreg); |
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 14b4576281c5..8152d65220f5 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/regulator/driver.h> | 23 | #include <linux/regulator/driver.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/regulator/tps6507x.h> | ||
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/mfd/tps6507x.h> | 28 | #include <linux/mfd/tps6507x.h> |
@@ -101,9 +102,12 @@ struct tps_info { | |||
101 | unsigned max_uV; | 102 | unsigned max_uV; |
102 | u8 table_len; | 103 | u8 table_len; |
103 | const u16 *table; | 104 | const u16 *table; |
105 | |||
106 | /* Does DCDC high or the low register defines output voltage? */ | ||
107 | bool defdcdc_default; | ||
104 | }; | 108 | }; |
105 | 109 | ||
106 | static const struct tps_info tps6507x_pmic_regs[] = { | 110 | static struct tps_info tps6507x_pmic_regs[] = { |
107 | { | 111 | { |
108 | .name = "VDCDC1", | 112 | .name = "VDCDC1", |
109 | .min_uV = 725000, | 113 | .min_uV = 725000, |
@@ -145,7 +149,7 @@ struct tps6507x_pmic { | |||
145 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; | 149 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; |
146 | struct tps6507x_dev *mfd; | 150 | struct tps6507x_dev *mfd; |
147 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; | 151 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; |
148 | const struct tps_info *info[TPS6507X_NUM_REGULATOR]; | 152 | struct tps_info *info[TPS6507X_NUM_REGULATOR]; |
149 | struct mutex io_lock; | 153 | struct mutex io_lock; |
150 | }; | 154 | }; |
151 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) | 155 | 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) | |||
341 | reg = TPS6507X_REG_DEFDCDC1; | 345 | reg = TPS6507X_REG_DEFDCDC1; |
342 | break; | 346 | break; |
343 | case TPS6507X_DCDC_2: | 347 | case TPS6507X_DCDC_2: |
344 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 348 | if (tps->info[dcdc]->defdcdc_default) |
349 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
350 | else | ||
351 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
345 | break; | 352 | break; |
346 | case TPS6507X_DCDC_3: | 353 | case TPS6507X_DCDC_3: |
347 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 354 | if (tps->info[dcdc]->defdcdc_default) |
355 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
356 | else | ||
357 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
348 | break; | 358 | break; |
349 | default: | 359 | default: |
350 | return -EINVAL; | 360 | return -EINVAL; |
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev, | |||
370 | reg = TPS6507X_REG_DEFDCDC1; | 380 | reg = TPS6507X_REG_DEFDCDC1; |
371 | break; | 381 | break; |
372 | case TPS6507X_DCDC_2: | 382 | case TPS6507X_DCDC_2: |
373 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 383 | if (tps->info[dcdc]->defdcdc_default) |
384 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
385 | else | ||
386 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
374 | break; | 387 | break; |
375 | case TPS6507X_DCDC_3: | 388 | case TPS6507X_DCDC_3: |
376 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 389 | if (tps->info[dcdc]->defdcdc_default) |
390 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
391 | else | ||
392 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
377 | break; | 393 | break; |
378 | default: | 394 | default: |
379 | return -EINVAL; | 395 | return -EINVAL; |
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
532 | { | 548 | { |
533 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); | 549 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); |
534 | static int desc_id; | 550 | static int desc_id; |
535 | const struct tps_info *info = &tps6507x_pmic_regs[0]; | 551 | struct tps_info *info = &tps6507x_pmic_regs[0]; |
536 | struct regulator_init_data *init_data; | 552 | struct regulator_init_data *init_data; |
537 | struct regulator_dev *rdev; | 553 | struct regulator_dev *rdev; |
538 | struct tps6507x_pmic *tps; | 554 | struct tps6507x_pmic *tps; |
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
569 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { | 585 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { |
570 | /* Register the regulators */ | 586 | /* Register the regulators */ |
571 | tps->info[i] = info; | 587 | tps->info[i] = info; |
588 | if (init_data->driver_data) { | ||
589 | struct tps6507x_reg_platform_data *data = | ||
590 | init_data->driver_data; | ||
591 | tps->info[i]->defdcdc_default = data->defdcdc_default; | ||
592 | } | ||
593 | |||
572 | tps->desc[i].name = info->name; | 594 | tps->desc[i].name = info->name; |
573 | tps->desc[i].id = desc_id++; | 595 | tps->desc[i].id = desc_id++; |
574 | tps->desc[i].n_voltages = num_voltages[i]; | 596 | tps->desc[i].n_voltages = num_voltages[i]; |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 723cd1fb4867..0e6ed7db9364 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | |||
1495 | if (ret != 0) { | 1495 | if (ret != 0) { |
1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", | 1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", |
1497 | reg, ret); | 1497 | reg, ret); |
1498 | platform_device_del(pdev); | 1498 | platform_device_put(pdev); |
1499 | wm8350->pmic.pdev[reg] = NULL; | 1499 | wm8350->pmic.pdev[reg] = NULL; |
1500 | } | 1500 | } |
1501 | 1501 | ||
diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c index 9718aaaa8215..600b890a3c15 100644 --- a/drivers/rtc/rtc-rx8581.c +++ b/drivers/rtc/rtc-rx8581.c | |||
@@ -168,7 +168,7 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
168 | return -EIO; | 168 | return -EIO; |
169 | } | 169 | } |
170 | 170 | ||
171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
172 | (data | RX8581_CTRL_STOP)); | 172 | (data | RX8581_CTRL_STOP)); |
173 | if (err < 0) { | 173 | if (err < 0) { |
174 | dev_err(&client->dev, "Unable to write control register\n"); | 174 | 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) | |||
182 | return -EIO; | 182 | return -EIO; |
183 | } | 183 | } |
184 | 184 | ||
185 | /* get VLF and clear it */ | ||
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_FLAG); | ||
187 | if (data < 0) { | ||
188 | dev_err(&client->dev, "Unable to read flag register\n"); | ||
189 | return -EIO; | ||
190 | } | ||
191 | |||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | ||
193 | (data & ~(RX8581_FLAG_VLF))); | ||
194 | if (err != 0) { | ||
195 | dev_err(&client->dev, "Unable to write flag register\n"); | ||
196 | return -EIO; | ||
197 | } | ||
198 | |||
185 | /* Restart the clock */ | 199 | /* Restart the clock */ |
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); | 200 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); |
187 | if (data < 0) { | 201 | if (data < 0) { |
@@ -189,8 +203,8 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
189 | return -EIO; | 203 | return -EIO; |
190 | } | 204 | } |
191 | 205 | ||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 206 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
193 | (data | ~(RX8581_CTRL_STOP))); | 207 | (data & ~(RX8581_CTRL_STOP))); |
194 | if (err != 0) { | 208 | if (err != 0) { |
195 | dev_err(&client->dev, "Unable to write control register\n"); | 209 | dev_err(&client->dev, "Unable to write control register\n"); |
196 | return -EIO; | 210 | return -EIO; |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index e3dbeda97179..fd068bc1bd0a 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) | |||
714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) | 714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) |
715 | return ZFCP_ERP_FAILED; | 715 | return ZFCP_ERP_FAILED; |
716 | 716 | ||
717 | if (mempool_resize(act->adapter->pool.status_read_data, | ||
718 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
719 | return ZFCP_ERP_FAILED; | ||
720 | |||
721 | if (mempool_resize(act->adapter->pool.status_read_req, | ||
722 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
723 | return ZFCP_ERP_FAILED; | ||
724 | |||
717 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); | 725 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); |
718 | if (zfcp_status_read_refill(act->adapter)) | 726 | if (zfcp_status_read_refill(act->adapter)) |
719 | return ZFCP_ERP_FAILED; | 727 | return ZFCP_ERP_FAILED; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9ac6a6e4a604..71663fb77310 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | |||
496 | 496 | ||
497 | adapter->hydra_version = bottom->adapter_type; | 497 | adapter->hydra_version = bottom->adapter_type; |
498 | adapter->timer_ticks = bottom->timer_interval; | 498 | adapter->timer_ticks = bottom->timer_interval; |
499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16); | 499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, |
500 | (u16)FSF_STATUS_READS_RECOM); | ||
500 | 501 | ||
501 | if (fc_host_permanent_port_name(shost) == -1) | 502 | if (fc_host_permanent_port_name(shost) == -1) |
502 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); | 503 | 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, | |||
719 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, | 720 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, |
720 | req->qtcb, sizeof(struct fsf_qtcb)); | 721 | req->qtcb, sizeof(struct fsf_qtcb)); |
721 | 722 | ||
722 | if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) { | ||
723 | zfcp_fsf_req_free(req); | ||
724 | return ERR_PTR(-EIO); | ||
725 | } | ||
726 | |||
727 | return req; | 723 | return req; |
728 | } | 724 | } |
729 | 725 | ||
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, | |||
981 | } | 977 | } |
982 | 978 | ||
983 | /* use single, unchained SBAL if it can hold the request */ | 979 | /* use single, unchained SBAL if it can hold the request */ |
984 | if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) { | 980 | if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) { |
985 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, | 981 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, |
986 | sg_req, sg_resp); | 982 | sg_req, sg_resp); |
987 | return 0; | 983 | return 0; |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 28117e130e2c..6fa5e0453176 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio) | |||
251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; | 251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; |
252 | 252 | ||
253 | spin_lock_bh(&qdio->req_q_lock); | 253 | spin_lock_bh(&qdio->req_q_lock); |
254 | if (atomic_read(&req_q->count)) | 254 | if (atomic_read(&req_q->count) || |
255 | !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
255 | return 1; | 256 | return 1; |
256 | spin_unlock_bh(&qdio->req_q_lock); | 257 | spin_unlock_bh(&qdio->req_q_lock); |
257 | return 0; | 258 | return 0; |
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio) | |||
274 | spin_unlock_bh(&qdio->req_q_lock); | 275 | spin_unlock_bh(&qdio->req_q_lock); |
275 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, | 276 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, |
276 | zfcp_qdio_sbal_check(qdio), 5 * HZ); | 277 | zfcp_qdio_sbal_check(qdio), 5 * HZ); |
278 | |||
279 | if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
280 | return -EIO; | ||
281 | |||
277 | if (ret > 0) | 282 | if (ret > 0) |
278 | return 0; | 283 | return 0; |
284 | |||
279 | if (!ret) { | 285 | if (!ret) { |
280 | atomic_inc(&qdio->req_q_full); | 286 | atomic_inc(&qdio->req_q_full); |
281 | /* assume hanging outbound queue, try queue recovery */ | 287 | /* assume hanging outbound queue, try queue recovery */ |
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio) | |||
375 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); | 381 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); |
376 | spin_unlock_bh(&qdio->req_q_lock); | 382 | spin_unlock_bh(&qdio->req_q_lock); |
377 | 383 | ||
384 | wake_up(&qdio->req_q_wq); | ||
385 | |||
378 | qdio_shutdown(qdio->adapter->ccw_device, | 386 | qdio_shutdown(qdio->adapter->ccw_device, |
379 | QDIO_FLAG_CLEANUP_USING_CLEAR); | 387 | QDIO_FLAG_CLEANUP_USING_CLEAR); |
380 | 388 | ||
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index a864ccc0a342..989b9a8ba72d 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c | |||
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
277 | goto reg_crq_failed; | 277 | goto reg_crq_failed; |
278 | } | 278 | } |
279 | 279 | ||
280 | queue->cur = 0; | ||
281 | spin_lock_init(&queue->lock); | ||
282 | |||
283 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
284 | (unsigned long)hostdata); | ||
285 | |||
280 | if (request_irq(vdev->irq, | 286 | if (request_irq(vdev->irq, |
281 | rpavscsi_handle_event, | 287 | rpavscsi_handle_event, |
282 | 0, "ibmvscsi", (void *)hostdata) != 0) { | 288 | 0, "ibmvscsi", (void *)hostdata) != 0) { |
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
291 | goto req_irq_failed; | 297 | goto req_irq_failed; |
292 | } | 298 | } |
293 | 299 | ||
294 | queue->cur = 0; | ||
295 | spin_lock_init(&queue->lock); | ||
296 | |||
297 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
298 | (unsigned long)hostdata); | ||
299 | |||
300 | return retrc; | 300 | return retrc; |
301 | 301 | ||
302 | req_irq_failed: | 302 | req_irq_failed: |
303 | tasklet_kill(&hostdata->srp_task); | ||
303 | do { | 304 | do { |
304 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); | 305 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); |
305 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); | 306 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 82ea4a8226b0..f820cffb7f00 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res, | |||
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | /** | 1131 | /** |
1132 | * ipr_format_resource_path - Format the resource path for printing. | 1132 | * ipr_format_res_path - Format the resource path for printing. |
1133 | * @res_path: resource path | 1133 | * @res_path: resource path |
1134 | * @buf: buffer | 1134 | * @buf: buffer |
1135 | * | 1135 | * |
1136 | * Return value: | 1136 | * Return value: |
1137 | * pointer to buffer | 1137 | * pointer to buffer |
1138 | **/ | 1138 | **/ |
1139 | static char *ipr_format_resource_path(u8 *res_path, char *buffer) | 1139 | static char *ipr_format_res_path(u8 *res_path, char *buffer, int len) |
1140 | { | 1140 | { |
1141 | int i; | 1141 | int i; |
1142 | char *p = buffer; | ||
1142 | 1143 | ||
1143 | sprintf(buffer, "%02X", res_path[0]); | 1144 | res_path[0] = '\0'; |
1144 | for (i=1; res_path[i] != 0xff; i++) | 1145 | p += snprintf(p, buffer + len - p, "%02X", res_path[0]); |
1145 | sprintf(buffer, "%s-%02X", buffer, res_path[i]); | 1146 | for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++) |
1147 | p += snprintf(p, buffer + len - p, "-%02X", res_path[i]); | ||
1146 | 1148 | ||
1147 | return buffer; | 1149 | return buffer; |
1148 | } | 1150 | } |
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res, | |||
1187 | 1189 | ||
1188 | if (res->sdev && new_path) | 1190 | if (res->sdev && new_path) |
1189 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", | 1191 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", |
1190 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 1192 | ipr_format_res_path(res->res_path, buffer, |
1193 | sizeof(buffer))); | ||
1191 | } else { | 1194 | } else { |
1192 | res->flags = cfgtew->u.cfgte->flags; | 1195 | res->flags = cfgtew->u.cfgte->flags; |
1193 | if (res->flags & IPR_IS_IOA_RESOURCE) | 1196 | if (res->flags & IPR_IS_IOA_RESOURCE) |
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1573 | ipr_err_separator; | 1576 | ipr_err_separator; |
1574 | 1577 | ||
1575 | ipr_err("Device %d : %s", i + 1, | 1578 | ipr_err("Device %d : %s", i + 1, |
1576 | ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0])); | 1579 | ipr_format_res_path(dev_entry->res_path, buffer, |
1580 | sizeof(buffer))); | ||
1577 | ipr_log_ext_vpd(&dev_entry->vpd); | 1581 | ipr_log_ext_vpd(&dev_entry->vpd); |
1578 | 1582 | ||
1579 | ipr_err("-----New Device Information-----\n"); | 1583 | ipr_err("-----New Device Information-----\n"); |
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb, | |||
1919 | 1923 | ||
1920 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", | 1924 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", |
1921 | path_active_desc[i].desc, path_state_desc[j].desc, | 1925 | path_active_desc[i].desc, path_state_desc[j].desc, |
1922 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1926 | ipr_format_res_path(fabric->res_path, buffer, |
1927 | sizeof(buffer))); | ||
1923 | return; | 1928 | return; |
1924 | } | 1929 | } |
1925 | } | 1930 | } |
1926 | 1931 | ||
1927 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, | 1932 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, |
1928 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1933 | ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer))); |
1929 | } | 1934 | } |
1930 | 1935 | ||
1931 | static const struct { | 1936 | static const struct { |
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2066 | 2071 | ||
2067 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", | 2072 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", |
2068 | path_status_desc[j].desc, path_type_desc[i].desc, | 2073 | path_status_desc[j].desc, path_type_desc[i].desc, |
2069 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2074 | ipr_format_res_path(cfg->res_path, buffer, |
2075 | sizeof(buffer)), | ||
2070 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2076 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2071 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2077 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2072 | return; | 2078 | return; |
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2074 | } | 2080 | } |
2075 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " | 2081 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " |
2076 | "WWN=%08X%08X\n", cfg->type_status, | 2082 | "WWN=%08X%08X\n", cfg->type_status, |
2077 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2083 | ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)), |
2078 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2084 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2079 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2085 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2080 | } | 2086 | } |
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2139 | 2145 | ||
2140 | ipr_err("RAID %s Array Configuration: %s\n", | 2146 | ipr_err("RAID %s Array Configuration: %s\n", |
2141 | error->protection_level, | 2147 | error->protection_level, |
2142 | ipr_format_resource_path(&error->last_res_path[0], &buffer[0])); | 2148 | ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer))); |
2143 | 2149 | ||
2144 | ipr_err_separator; | 2150 | ipr_err_separator; |
2145 | 2151 | ||
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2160 | ipr_err("Array Member %d:\n", i); | 2166 | ipr_err("Array Member %d:\n", i); |
2161 | ipr_log_ext_vpd(&array_entry->vpd); | 2167 | ipr_log_ext_vpd(&array_entry->vpd); |
2162 | ipr_err("Current Location: %s", | 2168 | ipr_err("Current Location: %s", |
2163 | ipr_format_resource_path(&array_entry->res_path[0], &buffer[0])); | 2169 | ipr_format_res_path(array_entry->res_path, buffer, |
2170 | sizeof(buffer))); | ||
2164 | ipr_err("Expected Location: %s", | 2171 | ipr_err("Expected Location: %s", |
2165 | ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0])); | 2172 | ipr_format_res_path(array_entry->expected_res_path, |
2173 | buffer, sizeof(buffer))); | ||
2166 | 2174 | ||
2167 | ipr_err_separator; | 2175 | ipr_err_separator; |
2168 | } | 2176 | } |
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = { | |||
4079 | }; | 4087 | }; |
4080 | 4088 | ||
4081 | /** | 4089 | /** |
4082 | * ipr_show_resource_path - Show the resource path for this device. | 4090 | * ipr_show_resource_path - Show the resource path or the resource address for |
4091 | * this device. | ||
4083 | * @dev: device struct | 4092 | * @dev: device struct |
4084 | * @buf: buffer | 4093 | * @buf: buffer |
4085 | * | 4094 | * |
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut | |||
4097 | 4106 | ||
4098 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | 4107 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); |
4099 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4108 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4100 | if (res) | 4109 | if (res && ioa_cfg->sis64) |
4101 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 4110 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
4102 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4111 | ipr_format_res_path(res->res_path, buffer, |
4112 | sizeof(buffer))); | ||
4113 | else if (res) | ||
4114 | len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no, | ||
4115 | res->bus, res->target, res->lun); | ||
4116 | |||
4103 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4117 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
4104 | return len; | 4118 | return len; |
4105 | } | 4119 | } |
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev) | |||
4351 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); | 4365 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); |
4352 | if (ioa_cfg->sis64) | 4366 | if (ioa_cfg->sis64) |
4353 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", | 4367 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", |
4354 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4368 | ipr_format_res_path(res->res_path, buffer, |
4369 | sizeof(buffer))); | ||
4355 | return 0; | 4370 | return 0; |
4356 | } | 4371 | } |
4357 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4372 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 9ecd2259eb39..b965f3587c9d 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header { | |||
1684 | if (ipr_is_device(hostrcb)) { \ | 1684 | if (ipr_is_device(hostrcb)) { \ |
1685 | if ((hostrcb)->ioa_cfg->sis64) { \ | 1685 | if ((hostrcb)->ioa_cfg->sis64) { \ |
1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ | 1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ |
1687 | ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \ | 1687 | ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \ |
1688 | &hostrcb->rp_buffer[0]), \ | 1688 | hostrcb->rp_buffer, \ |
1689 | sizeof(hostrcb->rp_buffer)), \ | ||
1689 | __VA_ARGS__); \ | 1690 | __VA_ARGS__); \ |
1690 | } else { \ | 1691 | } else { \ |
1691 | ipr_ra_err((hostrcb)->ioa_cfg, \ | 1692 | ipr_ra_err((hostrcb)->ioa_cfg, \ |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index eed3c2d8dd1c..a182def7007d 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/uaccess.h> | 41 | #include <linux/uaccess.h> |
42 | 42 | ||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/ioctls.h> | ||
44 | 45 | ||
45 | #include <asm/mach/serial_at91.h> | 46 | #include <asm/mach/serial_at91.h> |
46 | #include <mach/board.h> | 47 | #include <mach/board.h> |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 61d75507d5d0..162c95a088ed 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = { | |||
1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ | 1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ |
1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ | 1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ |
1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ | 1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ |
1599 | { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ | ||
1599 | 1600 | ||
1600 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ | 1601 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
1601 | 1602 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 83e7bbbe97fa..70cccc75a362 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1982,6 +1982,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
1982 | (portstatus & USB_PORT_STAT_ENABLE)) { | 1982 | (portstatus & USB_PORT_STAT_ENABLE)) { |
1983 | if (hub_is_wusb(hub)) | 1983 | if (hub_is_wusb(hub)) |
1984 | udev->speed = USB_SPEED_WIRELESS; | 1984 | udev->speed = USB_SPEED_WIRELESS; |
1985 | else if (portstatus & USB_PORT_STAT_SUPER_SPEED) | ||
1986 | udev->speed = USB_SPEED_SUPER; | ||
1985 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) | 1987 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) |
1986 | udev->speed = USB_SPEED_HIGH; | 1988 | udev->speed = USB_SPEED_HIGH; |
1987 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) | 1989 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index f22d03df8b17..db99c084df92 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
41 | /* Philips PSC805 audio device */ | 41 | /* Philips PSC805 audio device */ |
42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, | 42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, |
43 | 43 | ||
44 | /* Artisman Watchdog Dongle */ | ||
45 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = | ||
46 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
47 | |||
44 | /* Roland SC-8820 */ | 48 | /* Roland SC-8820 */ |
45 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, | 49 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, |
46 | 50 | ||
@@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
64 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ | 68 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ |
65 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, | 69 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, |
66 | 70 | ||
71 | /* Broadcom BCM92035DGROM BT dongle */ | ||
72 | { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
73 | |||
67 | /* Action Semiconductor flash disk */ | 74 | /* Action Semiconductor flash disk */ |
68 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = | 75 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = |
69 | USB_QUIRK_STRING_FETCH_255 }, | 76 | USB_QUIRK_STRING_FETCH_255 }, |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index 85b0d8921eae..980762453a9c 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -2561,7 +2561,7 @@ static void pxa_udc_shutdown(struct platform_device *_dev) | |||
2561 | udc_disable(udc); | 2561 | udc_disable(udc); |
2562 | } | 2562 | } |
2563 | 2563 | ||
2564 | #ifdef CONFIG_CPU_PXA27x | 2564 | #ifdef CONFIG_PXA27x |
2565 | extern void pxa27x_clear_otgph(void); | 2565 | extern void pxa27x_clear_otgph(void); |
2566 | #else | 2566 | #else |
2567 | #define pxa27x_clear_otgph() do {} while (0) | 2567 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index e724a051bfdd..ea2b3c7ebee5 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -735,6 +735,10 @@ static void s3c2410_udc_handle_ep0_idle(struct s3c2410_udc *dev, | |||
735 | else | 735 | else |
736 | dev->ep0state = EP0_OUT_DATA_PHASE; | 736 | dev->ep0state = EP0_OUT_DATA_PHASE; |
737 | 737 | ||
738 | if (!dev->driver) | ||
739 | return; | ||
740 | |||
741 | /* deliver the request to the gadget driver */ | ||
738 | ret = dev->driver->setup(&dev->gadget, crq); | 742 | ret = dev->driver->setup(&dev->gadget, crq); |
739 | if (ret < 0) { | 743 | if (ret < 0) { |
740 | if (dev->req_config) { | 744 | if (dev->req_config) { |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index a18debdd79b8..418163894775 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -203,7 +203,7 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci *ohci) | |||
203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); | 203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); |
204 | } | 204 | } |
205 | 205 | ||
206 | #ifdef CONFIG_CPU_PXA27x | 206 | #ifdef CONFIG_PXA27x |
207 | extern void pxa27x_clear_otgph(void); | 207 | extern void pxa27x_clear_otgph(void); |
208 | #else | 208 | #else |
209 | #define pxa27x_clear_otgph() do {} while (0) | 209 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index fd9e03afd91c..2eb658d26394 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -835,6 +835,27 @@ fail: | |||
835 | return 0; | 835 | return 0; |
836 | } | 836 | } |
837 | 837 | ||
838 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
839 | struct usb_device *udev) | ||
840 | { | ||
841 | struct xhci_virt_device *virt_dev; | ||
842 | struct xhci_ep_ctx *ep0_ctx; | ||
843 | struct xhci_ring *ep_ring; | ||
844 | |||
845 | virt_dev = xhci->devs[udev->slot_id]; | ||
846 | ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0); | ||
847 | ep_ring = virt_dev->eps[0].ring; | ||
848 | /* | ||
849 | * FIXME we don't keep track of the dequeue pointer very well after a | ||
850 | * Set TR dequeue pointer, so we're setting the dequeue pointer of the | ||
851 | * host to our enqueue pointer. This should only be called after a | ||
852 | * configured device has reset, so all control transfers should have | ||
853 | * been completed or cancelled before the reset. | ||
854 | */ | ||
855 | ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue); | ||
856 | ep0_ctx->deq |= ep_ring->cycle_state; | ||
857 | } | ||
858 | |||
838 | /* Setup an xHCI virtual device for a Set Address command */ | 859 | /* Setup an xHCI virtual device for a Set Address command */ |
839 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) | 860 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) |
840 | { | 861 | { |
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1002 | return EP_INTERVAL(interval); | 1023 | return EP_INTERVAL(interval); |
1003 | } | 1024 | } |
1004 | 1025 | ||
1005 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | 1026 | /* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps. |
1006 | * High speed endpoint descriptors can define "the number of additional | 1027 | * High speed endpoint descriptors can define "the number of additional |
1007 | * transaction opportunities per microframe", but that goes in the Max Burst | 1028 | * transaction opportunities per microframe", but that goes in the Max Burst |
1008 | * endpoint context field. | 1029 | * endpoint context field. |
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1010 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | 1031 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, |
1011 | struct usb_host_endpoint *ep) | 1032 | struct usb_host_endpoint *ep) |
1012 | { | 1033 | { |
1013 | if (udev->speed != USB_SPEED_SUPER) | 1034 | if (udev->speed != USB_SPEED_SUPER || |
1035 | !usb_endpoint_xfer_isoc(&ep->desc)) | ||
1014 | return 0; | 1036 | return 0; |
1015 | return ep->ss_ep_comp.bmAttributes; | 1037 | return ep->ss_ep_comp.bmAttributes; |
1016 | } | 1038 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 94e6934edb09..bfc99a939455 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2380,16 +2380,19 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2, | |||
2380 | u32 field3, u32 field4, bool command_must_succeed) | 2380 | u32 field3, u32 field4, bool command_must_succeed) |
2381 | { | 2381 | { |
2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; | 2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; |
2383 | int ret; | ||
2384 | |||
2383 | if (!command_must_succeed) | 2385 | if (!command_must_succeed) |
2384 | reserved_trbs++; | 2386 | reserved_trbs++; |
2385 | 2387 | ||
2386 | if (!room_on_ring(xhci, xhci->cmd_ring, reserved_trbs)) { | 2388 | ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING, |
2387 | if (!in_interrupt()) | 2389 | reserved_trbs, GFP_ATOMIC); |
2388 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | 2390 | if (ret < 0) { |
2391 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | ||
2389 | if (command_must_succeed) | 2392 | if (command_must_succeed) |
2390 | xhci_err(xhci, "ERR: Reserved TRB counting for " | 2393 | xhci_err(xhci, "ERR: Reserved TRB counting for " |
2391 | "unfailable commands failed.\n"); | 2394 | "unfailable commands failed.\n"); |
2392 | return -ENOMEM; | 2395 | return ret; |
2393 | } | 2396 | } |
2394 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, | 2397 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, |
2395 | field4 | xhci->cmd_ring->cycle_state); | 2398 | field4 | xhci->cmd_ring->cycle_state); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 27345cd04da0..3998f72cd0c4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2134,6 +2134,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ | 2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ |
2135 | if (!udev->config) | 2135 | if (!udev->config) |
2136 | xhci_setup_addressable_virt_dev(xhci, udev); | 2136 | xhci_setup_addressable_virt_dev(xhci, udev); |
2137 | else | ||
2138 | xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev); | ||
2137 | /* Otherwise, assume the core has the device configured how it wants */ | 2139 | /* Otherwise, assume the core has the device configured how it wants */ |
2138 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); | 2140 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); |
2139 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); | 2141 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 8b4b7d39f79c..6c7e3430ec93 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1292,6 +1292,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags); | |||
1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); | 1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); |
1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); | 1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); |
1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); | 1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); |
1295 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
1296 | struct usb_device *udev); | ||
1295 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); | 1297 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); |
1296 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); | 1298 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); |
1297 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); | 1299 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 30d930386b65..d25814c172b2 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -2436,7 +2436,8 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2436 | } | 2436 | } |
2437 | 2437 | ||
2438 | if (!sisusb->devinit) { | 2438 | if (!sisusb->devinit) { |
2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) { | 2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH || |
2440 | sisusb->sisusb_dev->speed == USB_SPEED_SUPER) { | ||
2440 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2441 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2441 | mutex_unlock(&sisusb->lock); | 2442 | mutex_unlock(&sisusb->lock); |
2442 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); | 2443 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); |
@@ -3166,7 +3167,7 @@ static int sisusb_probe(struct usb_interface *intf, | |||
3166 | 3167 | ||
3167 | sisusb->present = 1; | 3168 | sisusb->present = 1; |
3168 | 3169 | ||
3169 | if (dev->speed == USB_SPEED_HIGH) { | 3170 | if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) { |
3170 | int initscreen = 1; | 3171 | int initscreen = 1; |
3171 | #ifdef INCL_SISUSB_CON | 3172 | #ifdef INCL_SISUSB_CON |
3172 | if (sisusb_first_vc > 0 && | 3173 | if (sisusb_first_vc > 0 && |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 05c077f8f9ac..3c48e77a0aa2 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -29,19 +29,6 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
31 | 31 | ||
32 | #ifdef CONFIG_PM | ||
33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
34 | void musb_platform_save_context(struct musb *musb, | ||
35 | struct musb_context_registers *musb_context) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void musb_platform_restore_context(struct musb *musb, | ||
40 | struct musb_context_registers *musb_context) | ||
41 | { | ||
42 | } | ||
43 | #endif | ||
44 | |||
45 | /* | 32 | /* |
46 | * Checks the revision. We need to use the DMA register as 3.0 does not | 33 | * Checks the revision. We need to use the DMA register as 3.0 does not |
47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index da7e334b0407..e298dc4baed7 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -691,6 +691,7 @@ static struct usb_device_id id_table_combined [] = { | |||
691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), | 691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), |
692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
694 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | ||
694 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 695 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
695 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 696 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
696 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 697 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
@@ -737,6 +738,14 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, | 738 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, |
738 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, | 739 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, |
739 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, | 740 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, |
741 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), | ||
742 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
743 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), | ||
744 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
745 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), | ||
746 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
747 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), | ||
748 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
740 | { }, /* Optional parameter entry */ | 749 | { }, /* Optional parameter entry */ |
741 | { } /* Terminating entry */ | 750 | { } /* Terminating entry */ |
742 | }; | 751 | }; |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index bbc159a1df45..d01946db8fac 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -696,6 +696,12 @@ | |||
696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ | 696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ |
697 | 697 | ||
698 | /* | 698 | /* |
699 | * RT Systems programming cables for various ham radios | ||
700 | */ | ||
701 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | ||
702 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | ||
703 | |||
704 | /* | ||
699 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. | 705 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. |
700 | * http://winglucofacts.com/cables/ | 706 | * http://winglucofacts.com/cables/ |
701 | */ | 707 | */ |
@@ -1017,3 +1023,12 @@ | |||
1017 | #define MJSG_SR_RADIO_PID 0x9379 | 1023 | #define MJSG_SR_RADIO_PID 0x9379 |
1018 | #define MJSG_XM_RADIO_PID 0x937A | 1024 | #define MJSG_XM_RADIO_PID 0x937A |
1019 | #define MJSG_HD_RADIO_PID 0x937C | 1025 | #define MJSG_HD_RADIO_PID 0x937C |
1026 | |||
1027 | /* | ||
1028 | * Xverve Signalyzer tools (http://www.signalyzer.com/) | ||
1029 | */ | ||
1030 | #define XVERVE_SIGNALYZER_ST_PID 0xBCA0 | ||
1031 | #define XVERVE_SIGNALYZER_SLITE_PID 0xBCA1 | ||
1032 | #define XVERVE_SIGNALYZER_SH2_PID 0xBCA2 | ||
1033 | #define XVERVE_SIGNALYZER_SH4_PID 0xBCA4 | ||
1034 | |||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e280ad8e12f7..5cd30e4345c6 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -206,6 +206,7 @@ static void option_instat_callback(struct urb *urb); | |||
206 | #define AMOI_PRODUCT_H01 0x0800 | 206 | #define AMOI_PRODUCT_H01 0x0800 |
207 | #define AMOI_PRODUCT_H01A 0x7002 | 207 | #define AMOI_PRODUCT_H01A 0x7002 |
208 | #define AMOI_PRODUCT_H02 0x0802 | 208 | #define AMOI_PRODUCT_H02 0x0802 |
209 | #define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407 | ||
209 | 210 | ||
210 | #define DELL_VENDOR_ID 0x413C | 211 | #define DELL_VENDOR_ID 0x413C |
211 | 212 | ||
@@ -302,6 +303,7 @@ static void option_instat_callback(struct urb *urb); | |||
302 | #define QISDA_PRODUCT_H21_4512 0x4512 | 303 | #define QISDA_PRODUCT_H21_4512 0x4512 |
303 | #define QISDA_PRODUCT_H21_4523 0x4523 | 304 | #define QISDA_PRODUCT_H21_4523 0x4523 |
304 | #define QISDA_PRODUCT_H20_4515 0x4515 | 305 | #define QISDA_PRODUCT_H20_4515 0x4515 |
306 | #define QISDA_PRODUCT_H20_4518 0x4518 | ||
305 | #define QISDA_PRODUCT_H20_4519 0x4519 | 307 | #define QISDA_PRODUCT_H20_4519 0x4519 |
306 | 308 | ||
307 | /* TLAYTECH PRODUCTS */ | 309 | /* TLAYTECH PRODUCTS */ |
@@ -516,6 +518,7 @@ static const struct usb_device_id option_ids[] = { | |||
516 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
517 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 519 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, | 520 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, |
521 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) }, | ||
519 | 522 | ||
520 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | 523 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ |
521 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | 524 | { 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[] = { | |||
852 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, | 855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, |
853 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, | 856 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, |
854 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, | 857 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, |
858 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) }, | ||
855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, | 859 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, |
856 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, | 860 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, |
857 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ | 861 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 93d72eb8cafc..cde67cacb2c3 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -51,6 +51,8 @@ static const struct usb_device_id id_table[] = { | |||
51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ | 52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ |
53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
54 | {USB_DEVICE(0x05c6, 0x9208)}, /* Generic Gobi 2000 QDL device */ | ||
55 | {USB_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | ||
54 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ | 56 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ |
55 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 57 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
56 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ | 58 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ef0bdb08d788..d47b56e9e8ce 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -245,6 +245,7 @@ static const struct usb_device_id id_table[] = { | |||
245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ | 246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ |
247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ | 247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ |
248 | { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */ | ||
248 | /* Sierra Wireless C597 */ | 249 | /* Sierra Wireless C597 */ |
249 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, | 250 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, |
250 | /* Sierra Wireless T598 */ | 251 | /* Sierra Wireless T598 */ |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 44716427c51c..64ec073e89de 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) | |||
139 | 139 | ||
140 | /* fill the common fields in the URB */ | 140 | /* fill the common fields in the URB */ |
141 | us->current_urb->context = &urb_done; | 141 | us->current_urb->context = &urb_done; |
142 | us->current_urb->actual_length = 0; | 142 | us->current_urb->transfer_flags = 0; |
143 | us->current_urb->error_count = 0; | ||
144 | us->current_urb->status = 0; | ||
145 | 143 | ||
146 | /* we assume that if transfer_buffer isn't us->iobuf then it | 144 | /* we assume that if transfer_buffer isn't us->iobuf then it |
147 | * hasn't been mapped for DMA. Yes, this is clunky, but it's | 145 | * hasn't been mapped for DMA. Yes, this is clunky, but it's |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 40f61320ce16..34b2fc472fe8 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -95,7 +95,7 @@ struct fb_bitfield rgb_bitfields[][4] = | |||
95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, | 95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static struct fb_fix_screeninfo au1100fb_fix __initdata = { | 98 | static struct fb_fix_screeninfo au1100fb_fix __devinitdata = { |
99 | .id = "AU1100 FB", | 99 | .id = "AU1100 FB", |
100 | .xpanstep = 1, | 100 | .xpanstep = 1, |
101 | .ypanstep = 1, | 101 | .ypanstep = 1, |
@@ -103,7 +103,7 @@ static struct fb_fix_screeninfo au1100fb_fix __initdata = { | |||
103 | .accel = FB_ACCEL_NONE, | 103 | .accel = FB_ACCEL_NONE, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct fb_var_screeninfo au1100fb_var __initdata = { | 106 | static struct fb_var_screeninfo au1100fb_var __devinitdata = { |
107 | .activate = FB_ACTIVATE_NOW, | 107 | .activate = FB_ACTIVATE_NOW, |
108 | .height = -1, | 108 | .height = -1, |
109 | .width = -1, | 109 | .width = -1, |
@@ -458,7 +458,7 @@ static struct fb_ops au1100fb_ops = | |||
458 | 458 | ||
459 | /* AU1100 LCD controller device driver */ | 459 | /* AU1100 LCD controller device driver */ |
460 | 460 | ||
461 | static int __init au1100fb_drv_probe(struct platform_device *dev) | 461 | static int __devinit au1100fb_drv_probe(struct platform_device *dev) |
462 | { | 462 | { |
463 | struct au1100fb_device *fbdev = NULL; | 463 | struct au1100fb_device *fbdev = NULL; |
464 | struct resource *regs_res; | 464 | struct resource *regs_res; |
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 3a561df2e8a2..0c1afd13ddd3 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c | |||
@@ -388,6 +388,7 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
388 | pseudo_val |= convert_bitfield(red, &var->red); | 388 | pseudo_val |= convert_bitfield(red, &var->red); |
389 | pseudo_val |= convert_bitfield(green, &var->green); | 389 | pseudo_val |= convert_bitfield(green, &var->green); |
390 | pseudo_val |= convert_bitfield(blue, &var->blue); | 390 | pseudo_val |= convert_bitfield(blue, &var->blue); |
391 | ret = 0; | ||
391 | break; | 392 | break; |
392 | } | 393 | } |
393 | 394 | ||
@@ -436,6 +437,8 @@ static void cyber2000fb_write_ramdac_ctrl(struct cfb_info *cfb) | |||
436 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); | 437 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); |
437 | cyber2000fb_writeb(val, 0x3c6, cfb); | 438 | cyber2000fb_writeb(val, 0x3c6, cfb); |
438 | cyber2000fb_writeb(i, 0x3cf, cfb); | 439 | cyber2000fb_writeb(i, 0x3cf, cfb); |
440 | /* prevent card lock-up observed on x86 with CyberPro 2000 */ | ||
441 | cyber2000fb_readb(0x3cf, cfb); | ||
439 | } | 442 | } |
440 | 443 | ||
441 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) | 444 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) |
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 7d8c55d7fd28..ca3355e430bf 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16]; | |||
91 | static uint32_t gbe_cmap[256]; | 91 | static uint32_t gbe_cmap[256]; |
92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ | 92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ |
93 | 93 | ||
94 | static char *mode_option __initdata = NULL; | 94 | static char *mode_option __devinitdata = NULL; |
95 | 95 | ||
96 | /* default CRT mode */ | 96 | /* default CRT mode */ |
97 | static struct fb_var_screeninfo default_var_CRT __initdata = { | 97 | static struct fb_var_screeninfo default_var_CRT __devinitdata = { |
98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ | 98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ |
99 | .xres = 640, | 99 | .xres = 640, |
100 | .yres = 480, | 100 | .yres = 480, |
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __initdata = { | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* default LCD mode */ | 127 | /* default LCD mode */ |
128 | static struct fb_var_screeninfo default_var_LCD __initdata = { | 128 | static struct fb_var_screeninfo default_var_LCD __devinitdata = { |
129 | /* 1600x1024, 8 bpp */ | 129 | /* 1600x1024, 8 bpp */ |
130 | .xres = 1600, | 130 | .xres = 1600, |
131 | .yres = 1024, | 131 | .yres = 1024, |
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __initdata = { | |||
157 | 157 | ||
158 | /* default modedb mode */ | 158 | /* default modedb mode */ |
159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ | 159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ |
160 | static struct fb_videomode default_mode_CRT __initdata = { | 160 | static struct fb_videomode default_mode_CRT __devinitdata = { |
161 | .refresh = 60, | 161 | .refresh = 60, |
162 | .xres = 640, | 162 | .xres = 640, |
163 | .yres = 480, | 163 | .yres = 480, |
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __initdata = { | |||
172 | .vmode = FB_VMODE_NONINTERLACED, | 172 | .vmode = FB_VMODE_NONINTERLACED, |
173 | }; | 173 | }; |
174 | /* 1600x1024 SGI flatpanel 1600sw */ | 174 | /* 1600x1024 SGI flatpanel 1600sw */ |
175 | static struct fb_videomode default_mode_LCD __initdata = { | 175 | static struct fb_videomode default_mode_LCD __devinitdata = { |
176 | /* 1600x1024, 8 bpp */ | 176 | /* 1600x1024, 8 bpp */ |
177 | .xres = 1600, | 177 | .xres = 1600, |
178 | .yres = 1024, | 178 | .yres = 1024, |
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __initdata = { | |||
186 | .vmode = FB_VMODE_NONINTERLACED, | 186 | .vmode = FB_VMODE_NONINTERLACED, |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static struct fb_videomode *default_mode __initdata = &default_mode_CRT; | 189 | static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT; |
190 | static struct fb_var_screeninfo *default_var __initdata = &default_var_CRT; | 190 | static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT; |
191 | 191 | ||
192 | static int flat_panel_enabled = 0; | 192 | static int flat_panel_enabled = 0; |
193 | 193 | ||
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev) | |||
1098 | * Initialization | 1098 | * Initialization |
1099 | */ | 1099 | */ |
1100 | 1100 | ||
1101 | static int __init gbefb_setup(char *options) | 1101 | static int __devinit gbefb_setup(char *options) |
1102 | { | 1102 | { |
1103 | char *this_opt; | 1103 | char *this_opt; |
1104 | 1104 | ||
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 0f361b6100d2..0c69fa20251b 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c | |||
@@ -44,7 +44,7 @@ struct pmagbafb_par { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | 46 | ||
47 | static struct fb_var_screeninfo pmagbafb_defined __initdata = { | 47 | static struct fb_var_screeninfo pmagbafb_defined __devinitdata = { |
48 | .xres = 1024, | 48 | .xres = 1024, |
49 | .yres = 864, | 49 | .yres = 864, |
50 | .xres_virtual = 1024, | 50 | .xres_virtual = 1024, |
@@ -68,7 +68,7 @@ static struct fb_var_screeninfo pmagbafb_defined __initdata = { | |||
68 | .vmode = FB_VMODE_NONINTERLACED, | 68 | .vmode = FB_VMODE_NONINTERLACED, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct fb_fix_screeninfo pmagbafb_fix __initdata = { | 71 | static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = { |
72 | .id = "PMAG-BA", | 72 | .id = "PMAG-BA", |
73 | .smem_len = (1024 * 1024), | 73 | .smem_len = (1024 * 1024), |
74 | .type = FB_TYPE_PACKED_PIXELS, | 74 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -142,7 +142,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info) | |||
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | static int __init pmagbafb_probe(struct device *dev) | 145 | static int __devinit pmagbafb_probe(struct device *dev) |
146 | { | 146 | { |
147 | struct tc_dev *tdev = to_tc_dev(dev); | 147 | struct tc_dev *tdev = to_tc_dev(dev); |
148 | resource_size_t start, len; | 148 | resource_size_t start, len; |
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 2de0806421b4..22fcb9a3d5c0 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c | |||
@@ -45,7 +45,7 @@ struct pmagbbfb_par { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | 47 | ||
48 | static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | 48 | static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = { |
49 | .bits_per_pixel = 8, | 49 | .bits_per_pixel = 8, |
50 | .red.length = 8, | 50 | .red.length = 8, |
51 | .green.length = 8, | 51 | .green.length = 8, |
@@ -58,7 +58,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | |||
58 | .vmode = FB_VMODE_NONINTERLACED, | 58 | .vmode = FB_VMODE_NONINTERLACED, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct fb_fix_screeninfo pmagbbfb_fix __initdata = { | 61 | static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = { |
62 | .id = "PMAGB-BA", | 62 | .id = "PMAGB-BA", |
63 | .smem_len = (2048 * 1024), | 63 | .smem_len = (2048 * 1024), |
64 | .type = FB_TYPE_PACKED_PIXELS, | 64 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -148,7 +148,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info) | |||
148 | /* | 148 | /* |
149 | * Set up screen parameters. | 149 | * Set up screen parameters. |
150 | */ | 150 | */ |
151 | static void __init pmagbbfb_screen_setup(struct fb_info *info) | 151 | static void __devinit pmagbbfb_screen_setup(struct fb_info *info) |
152 | { | 152 | { |
153 | struct pmagbbfb_par *par = info->par; | 153 | struct pmagbbfb_par *par = info->par; |
154 | 154 | ||
@@ -180,9 +180,9 @@ static void __init pmagbbfb_screen_setup(struct fb_info *info) | |||
180 | /* | 180 | /* |
181 | * Determine oscillator configuration. | 181 | * Determine oscillator configuration. |
182 | */ | 182 | */ |
183 | static void __init pmagbbfb_osc_setup(struct fb_info *info) | 183 | static void __devinit pmagbbfb_osc_setup(struct fb_info *info) |
184 | { | 184 | { |
185 | static unsigned int pmagbbfb_freqs[] __initdata = { | 185 | static unsigned int pmagbbfb_freqs[] __devinitdata = { |
186 | 130808, 119843, 104000, 92980, 74370, 72800, | 186 | 130808, 119843, 104000, 92980, 74370, 72800, |
187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 | 187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 |
188 | }; | 188 | }; |
@@ -247,7 +247,7 @@ static void __init pmagbbfb_osc_setup(struct fb_info *info) | |||
247 | }; | 247 | }; |
248 | 248 | ||
249 | 249 | ||
250 | static int __init pmagbbfb_probe(struct device *dev) | 250 | static int __devinit pmagbbfb_probe(struct device *dev) |
251 | { | 251 | { |
252 | struct tc_dev *tdev = to_tc_dev(dev); | 252 | struct tc_dev *tdev = to_tc_dev(dev); |
253 | resource_size_t start, len; | 253 | resource_size_t start, len; |
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index d61e3b28ce37..36d961f342af 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c | |||
@@ -146,7 +146,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
146 | while (rdir->head < rdir->tail) { | 146 | while (rdir->head < rdir->tail) { |
147 | p9stat_init(&st); | 147 | p9stat_init(&st); |
148 | err = p9stat_read(rdir->buf + rdir->head, | 148 | err = p9stat_read(rdir->buf + rdir->head, |
149 | buflen - rdir->head, &st, | 149 | rdir->tail - rdir->head, &st, |
150 | fid->clnt->proto_version); | 150 | fid->clnt->proto_version); |
151 | if (err) { | 151 | if (err) { |
152 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); | 152 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); |
diff --git a/fs/ceph/Kconfig b/fs/ceph/Kconfig index 04b8280582a9..bc87b9c1d27e 100644 --- a/fs/ceph/Kconfig +++ b/fs/ceph/Kconfig | |||
@@ -2,7 +2,7 @@ config CEPH_FS | |||
2 | tristate "Ceph distributed file system (EXPERIMENTAL)" | 2 | tristate "Ceph distributed file system (EXPERIMENTAL)" |
3 | depends on INET && EXPERIMENTAL | 3 | depends on INET && EXPERIMENTAL |
4 | select LIBCRC32C | 4 | select LIBCRC32C |
5 | select CONFIG_CRYPTO_AES | 5 | select CRYPTO_AES |
6 | help | 6 | help |
7 | Choose Y or M here to include support for mounting the | 7 | Choose Y or M here to include support for mounting the |
8 | experimental Ceph distributed file system. Ceph is an extremely | 8 | experimental Ceph distributed file system. Ceph is an extremely |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 74144d6389f0..b81be9a56487 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -627,7 +627,7 @@ retry: | |||
627 | if (fmode >= 0) | 627 | if (fmode >= 0) |
628 | __ceph_get_fmode(ci, fmode); | 628 | __ceph_get_fmode(ci, fmode); |
629 | spin_unlock(&inode->i_lock); | 629 | spin_unlock(&inode->i_lock); |
630 | wake_up(&ci->i_cap_wq); | 630 | wake_up_all(&ci->i_cap_wq); |
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | if (wake) | 1183 | if (wake) |
1184 | wake_up(&ci->i_cap_wq); | 1184 | wake_up_all(&ci->i_cap_wq); |
1185 | 1185 | ||
1186 | return delayed; | 1186 | return delayed; |
1187 | } | 1187 | } |
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had) | |||
2153 | else if (flushsnaps) | 2153 | else if (flushsnaps) |
2154 | ceph_flush_snaps(ci); | 2154 | ceph_flush_snaps(ci); |
2155 | if (wake) | 2155 | if (wake) |
2156 | wake_up(&ci->i_cap_wq); | 2156 | wake_up_all(&ci->i_cap_wq); |
2157 | if (put) | 2157 | if (put) |
2158 | iput(inode); | 2158 | iput(inode); |
2159 | } | 2159 | } |
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, | |||
2229 | iput(inode); | 2229 | iput(inode); |
2230 | } else if (complete_capsnap) { | 2230 | } else if (complete_capsnap) { |
2231 | ceph_flush_snaps(ci); | 2231 | ceph_flush_snaps(ci); |
2232 | wake_up(&ci->i_cap_wq); | 2232 | wake_up_all(&ci->i_cap_wq); |
2233 | } | 2233 | } |
2234 | if (drop_capsnap) | 2234 | if (drop_capsnap) |
2235 | iput(inode); | 2235 | iput(inode); |
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2405 | if (queue_invalidate) | 2405 | if (queue_invalidate) |
2406 | ceph_queue_invalidate(inode); | 2406 | ceph_queue_invalidate(inode); |
2407 | if (wake) | 2407 | if (wake) |
2408 | wake_up(&ci->i_cap_wq); | 2408 | wake_up_all(&ci->i_cap_wq); |
2409 | 2409 | ||
2410 | if (check_caps == 1) | 2410 | if (check_caps == 1) |
2411 | ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY, | 2411 | 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, | |||
2460 | struct ceph_inode_info, | 2460 | struct ceph_inode_info, |
2461 | i_flushing_item)->vfs_inode); | 2461 | i_flushing_item)->vfs_inode); |
2462 | mdsc->num_cap_flushing--; | 2462 | mdsc->num_cap_flushing--; |
2463 | wake_up(&mdsc->cap_flushing_wq); | 2463 | wake_up_all(&mdsc->cap_flushing_wq); |
2464 | dout(" inode %p now !flushing\n", inode); | 2464 | dout(" inode %p now !flushing\n", inode); |
2465 | 2465 | ||
2466 | if (ci->i_dirty_caps == 0) { | 2466 | if (ci->i_dirty_caps == 0) { |
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, | |||
2472 | } | 2472 | } |
2473 | } | 2473 | } |
2474 | spin_unlock(&mdsc->cap_dirty_lock); | 2474 | spin_unlock(&mdsc->cap_dirty_lock); |
2475 | wake_up(&ci->i_cap_wq); | 2475 | wake_up_all(&ci->i_cap_wq); |
2476 | 2476 | ||
2477 | out: | 2477 | out: |
2478 | spin_unlock(&inode->i_lock); | 2478 | spin_unlock(&inode->i_lock); |
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry, | |||
2984 | memcpy(*p, dentry->d_name.name, dentry->d_name.len); | 2984 | memcpy(*p, dentry->d_name.name, dentry->d_name.len); |
2985 | *p += dentry->d_name.len; | 2985 | *p += dentry->d_name.len; |
2986 | rel->dname_seq = cpu_to_le32(di->lease_seq); | 2986 | rel->dname_seq = cpu_to_le32(di->lease_seq); |
2987 | __ceph_mdsc_drop_dentry_lease(dentry); | ||
2987 | } | 2988 | } |
2988 | spin_unlock(&dentry->d_lock); | 2989 | spin_unlock(&dentry->d_lock); |
2989 | return ret; | 2990 | return ret; |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index f85719310db2..f94ed3c7f6a5 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
266 | spin_lock(&inode->i_lock); | 266 | spin_lock(&inode->i_lock); |
267 | if ((filp->f_pos == 2 || fi->dentry) && | 267 | if ((filp->f_pos == 2 || fi->dentry) && |
268 | !ceph_test_opt(client, NOASYNCREADDIR) && | 268 | !ceph_test_opt(client, NOASYNCREADDIR) && |
269 | ceph_snap(inode) != CEPH_SNAPDIR && | ||
269 | (ci->i_ceph_flags & CEPH_I_COMPLETE) && | 270 | (ci->i_ceph_flags & CEPH_I_COMPLETE) && |
270 | __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) { | 271 | __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) { |
271 | err = __dcache_readdir(filp, dirent, filldir); | 272 | err = __dcache_readdir(filp, dirent, filldir); |
@@ -1013,18 +1014,22 @@ out_touch: | |||
1013 | 1014 | ||
1014 | /* | 1015 | /* |
1015 | * When a dentry is released, clear the dir I_COMPLETE if it was part | 1016 | * When a dentry is released, clear the dir I_COMPLETE if it was part |
1016 | * of the current dir gen. | 1017 | * of the current dir gen or if this is in the snapshot namespace. |
1017 | */ | 1018 | */ |
1018 | static void ceph_dentry_release(struct dentry *dentry) | 1019 | static void ceph_dentry_release(struct dentry *dentry) |
1019 | { | 1020 | { |
1020 | struct ceph_dentry_info *di = ceph_dentry(dentry); | 1021 | struct ceph_dentry_info *di = ceph_dentry(dentry); |
1021 | struct inode *parent_inode = dentry->d_parent->d_inode; | 1022 | struct inode *parent_inode = dentry->d_parent->d_inode; |
1023 | u64 snapid = ceph_snap(parent_inode); | ||
1022 | 1024 | ||
1023 | if (parent_inode) { | 1025 | dout("dentry_release %p parent %p\n", dentry, parent_inode); |
1026 | |||
1027 | if (parent_inode && snapid != CEPH_SNAPDIR) { | ||
1024 | struct ceph_inode_info *ci = ceph_inode(parent_inode); | 1028 | struct ceph_inode_info *ci = ceph_inode(parent_inode); |
1025 | 1029 | ||
1026 | spin_lock(&parent_inode->i_lock); | 1030 | spin_lock(&parent_inode->i_lock); |
1027 | if (ci->i_shared_gen == di->lease_shared_gen) { | 1031 | if (ci->i_shared_gen == di->lease_shared_gen || |
1032 | snapid <= CEPH_MAXSNAP) { | ||
1028 | dout(" clearing %p complete (d_release)\n", | 1033 | dout(" clearing %p complete (d_release)\n", |
1029 | parent_inode); | 1034 | parent_inode); |
1030 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | 1035 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; |
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = { | |||
1241 | 1246 | ||
1242 | struct dentry_operations ceph_snapdir_dentry_ops = { | 1247 | struct dentry_operations ceph_snapdir_dentry_ops = { |
1243 | .d_revalidate = ceph_snapdir_d_revalidate, | 1248 | .d_revalidate = ceph_snapdir_d_revalidate, |
1249 | .d_release = ceph_dentry_release, | ||
1244 | }; | 1250 | }; |
1245 | 1251 | ||
1246 | struct dentry_operations ceph_snap_dentry_ops = { | 1252 | struct dentry_operations ceph_snap_dentry_ops = { |
1253 | .d_release = ceph_dentry_release, | ||
1247 | }; | 1254 | }; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6251a1574b94..7c08698fad3e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file) | |||
265 | kmem_cache_free(ceph_file_cachep, cf); | 265 | kmem_cache_free(ceph_file_cachep, cf); |
266 | 266 | ||
267 | /* wake up anyone waiting for caps on this inode */ | 267 | /* wake up anyone waiting for caps on this inode */ |
268 | wake_up(&ci->i_cap_wq); | 268 | wake_up_all(&ci->i_cap_wq); |
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8f9b9fe8ef9f..389f9dbd9949 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1199,8 +1199,10 @@ retry_lookup: | |||
1199 | goto out; | 1199 | goto out; |
1200 | } | 1200 | } |
1201 | err = ceph_init_dentry(dn); | 1201 | err = ceph_init_dentry(dn); |
1202 | if (err < 0) | 1202 | if (err < 0) { |
1203 | dput(dn); | ||
1203 | goto out; | 1204 | goto out; |
1205 | } | ||
1204 | } else if (dn->d_inode && | 1206 | } else if (dn->d_inode && |
1205 | (ceph_ino(dn->d_inode) != vino.ino || | 1207 | (ceph_ino(dn->d_inode) != vino.ino || |
1206 | ceph_snap(dn->d_inode) != vino.snap)) { | 1208 | ceph_snap(dn->d_inode) != vino.snap)) { |
@@ -1499,7 +1501,7 @@ retry: | |||
1499 | if (wrbuffer_refs == 0) | 1501 | if (wrbuffer_refs == 0) |
1500 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); | 1502 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); |
1501 | if (wake) | 1503 | if (wake) |
1502 | wake_up(&ci->i_cap_wq); | 1504 | wake_up_all(&ci->i_cap_wq); |
1503 | } | 1505 | } |
1504 | 1506 | ||
1505 | 1507 | ||
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 416c08d315db..dd440bd438a9 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, | |||
868 | { | 868 | { |
869 | struct ceph_inode_info *ci = ceph_inode(inode); | 869 | struct ceph_inode_info *ci = ceph_inode(inode); |
870 | 870 | ||
871 | wake_up(&ci->i_cap_wq); | 871 | wake_up_all(&ci->i_cap_wq); |
872 | if (arg) { | 872 | if (arg) { |
873 | spin_lock(&inode->i_lock); | 873 | spin_lock(&inode->i_lock); |
874 | ci->i_wanted_max_size = 0; | 874 | ci->i_wanted_max_size = 0; |
@@ -1564,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc, | |||
1564 | if (req->r_callback) | 1564 | if (req->r_callback) |
1565 | req->r_callback(mdsc, req); | 1565 | req->r_callback(mdsc, req); |
1566 | else | 1566 | else |
1567 | complete(&req->r_completion); | 1567 | complete_all(&req->r_completion); |
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | /* | 1570 | /* |
@@ -1932,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1932 | if (head->safe) { | 1932 | if (head->safe) { |
1933 | req->r_got_safe = true; | 1933 | req->r_got_safe = true; |
1934 | __unregister_request(mdsc, req); | 1934 | __unregister_request(mdsc, req); |
1935 | complete(&req->r_safe_completion); | 1935 | complete_all(&req->r_safe_completion); |
1936 | 1936 | ||
1937 | if (req->r_got_unsafe) { | 1937 | if (req->r_got_unsafe) { |
1938 | /* | 1938 | /* |
@@ -1947,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1947 | 1947 | ||
1948 | /* last unsafe request during umount? */ | 1948 | /* last unsafe request during umount? */ |
1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) | 1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) |
1950 | complete(&mdsc->safe_umount_waiters); | 1950 | complete_all(&mdsc->safe_umount_waiters); |
1951 | mutex_unlock(&mdsc->mutex); | 1951 | mutex_unlock(&mdsc->mutex); |
1952 | goto out; | 1952 | goto out; |
1953 | } | 1953 | } |
@@ -2126,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session, | |||
2126 | pr_info("mds%d reconnect denied\n", session->s_mds); | 2126 | pr_info("mds%d reconnect denied\n", session->s_mds); |
2127 | remove_session_caps(session); | 2127 | remove_session_caps(session); |
2128 | wake = 1; /* for good measure */ | 2128 | wake = 1; /* for good measure */ |
2129 | complete(&mdsc->session_close_waiters); | 2129 | complete_all(&mdsc->session_close_waiters); |
2130 | kick_requests(mdsc, mds); | 2130 | kick_requests(mdsc, mds); |
2131 | break; | 2131 | break; |
2132 | 2132 | ||
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index cc115eafae11..54fe01c50706 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc, | |||
345 | 345 | ||
346 | out: | 346 | out: |
347 | mutex_unlock(&monc->mutex); | 347 | mutex_unlock(&monc->mutex); |
348 | wake_up(&client->auth_wq); | 348 | wake_up_all(&client->auth_wq); |
349 | } | 349 | } |
350 | 350 | ||
351 | /* | 351 | /* |
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc, | |||
462 | } | 462 | } |
463 | mutex_unlock(&monc->mutex); | 463 | mutex_unlock(&monc->mutex); |
464 | if (req) { | 464 | if (req) { |
465 | complete(&req->completion); | 465 | complete_all(&req->completion); |
466 | put_generic_request(req); | 466 | put_generic_request(req); |
467 | } | 467 | } |
468 | return; | 468 | return; |
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc, | |||
718 | monc->m_auth->front_max); | 718 | monc->m_auth->front_max); |
719 | if (ret < 0) { | 719 | if (ret < 0) { |
720 | monc->client->auth_err = ret; | 720 | monc->client->auth_err = ret; |
721 | wake_up(&monc->client->auth_wq); | 721 | wake_up_all(&monc->client->auth_wq); |
722 | } else if (ret > 0) { | 722 | } else if (ret > 0) { |
723 | __send_prepared_auth_request(monc, ret); | 723 | __send_prepared_auth_request(monc, ret); |
724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { | 724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { |
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c index 92b7251a53f1..e38522347898 100644 --- a/fs/ceph/osd_client.c +++ b/fs/ceph/osd_client.c | |||
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
862 | if (req->r_callback) | 862 | if (req->r_callback) |
863 | req->r_callback(req, msg); | 863 | req->r_callback(req, msg); |
864 | else | 864 | else |
865 | complete(&req->r_completion); | 865 | complete_all(&req->r_completion); |
866 | 866 | ||
867 | if (flags & CEPH_OSD_FLAG_ONDISK) { | 867 | if (flags & CEPH_OSD_FLAG_ONDISK) { |
868 | if (req->r_safe_callback) | 868 | if (req->r_safe_callback) |
869 | req->r_safe_callback(req, msg); | 869 | req->r_safe_callback(req, msg); |
870 | complete(&req->r_safe_completion); /* fsync waiter */ | 870 | complete_all(&req->r_safe_completion); /* fsync waiter */ |
871 | } | 871 | } |
872 | 872 | ||
873 | done: | 873 | done: |
@@ -1083,7 +1083,7 @@ done: | |||
1083 | if (newmap) | 1083 | if (newmap) |
1084 | kick_requests(osdc, NULL); | 1084 | kick_requests(osdc, NULL); |
1085 | up_read(&osdc->map_sem); | 1085 | up_read(&osdc->map_sem); |
1086 | wake_up(&osdc->client->auth_wq); | 1086 | wake_up_all(&osdc->client->auth_wq); |
1087 | return; | 1087 | return; |
1088 | 1088 | ||
1089 | bad: | 1089 | bad: |
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index 277f8b339577..416d46adbf87 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c | |||
@@ -831,12 +831,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
831 | /* remove any? */ | 831 | /* remove any? */ |
832 | while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping, | 832 | while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping, |
833 | node)->pgid, pgid) <= 0) { | 833 | node)->pgid, pgid) <= 0) { |
834 | struct rb_node *cur = rbp; | 834 | struct ceph_pg_mapping *cur = |
835 | rb_entry(rbp, struct ceph_pg_mapping, node); | ||
836 | |||
835 | rbp = rb_next(rbp); | 837 | rbp = rb_next(rbp); |
836 | dout(" removed pg_temp %llx\n", | 838 | dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid); |
837 | *(u64 *)&rb_entry(cur, struct ceph_pg_mapping, | 839 | rb_erase(&cur->node, &map->pg_temp); |
838 | node)->pgid); | 840 | kfree(cur); |
839 | rb_erase(cur, &map->pg_temp); | ||
840 | } | 841 | } |
841 | 842 | ||
842 | if (pglen) { | 843 | if (pglen) { |
@@ -852,19 +853,22 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
852 | for (j = 0; j < pglen; j++) | 853 | for (j = 0; j < pglen; j++) |
853 | pg->osds[j] = ceph_decode_32(p); | 854 | pg->osds[j] = ceph_decode_32(p); |
854 | err = __insert_pg_mapping(pg, &map->pg_temp); | 855 | err = __insert_pg_mapping(pg, &map->pg_temp); |
855 | if (err) | 856 | if (err) { |
857 | kfree(pg); | ||
856 | goto bad; | 858 | goto bad; |
859 | } | ||
857 | dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid, | 860 | dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid, |
858 | pglen); | 861 | pglen); |
859 | } | 862 | } |
860 | } | 863 | } |
861 | while (rbp) { | 864 | while (rbp) { |
862 | struct rb_node *cur = rbp; | 865 | struct ceph_pg_mapping *cur = |
866 | rb_entry(rbp, struct ceph_pg_mapping, node); | ||
867 | |||
863 | rbp = rb_next(rbp); | 868 | rbp = rb_next(rbp); |
864 | dout(" removed pg_temp %llx\n", | 869 | dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid); |
865 | *(u64 *)&rb_entry(cur, struct ceph_pg_mapping, | 870 | rb_erase(&cur->node, &map->pg_temp); |
866 | node)->pgid); | 871 | kfree(cur); |
867 | rb_erase(cur, &map->pg_temp); | ||
868 | } | 872 | } |
869 | 873 | ||
870 | /* ignore the rest */ | 874 | /* ignore the rest */ |
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index 49315cbf742d..853a968e82d7 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c | |||
@@ -227,7 +227,7 @@ failed_put_cred: | |||
227 | return ret; | 227 | return ret; |
228 | } | 228 | } |
229 | 229 | ||
230 | void __exit cifs_exit_dns_resolver(void) | 230 | void cifs_exit_dns_resolver(void) |
231 | { | 231 | { |
232 | key_revoke(dns_resolver_cache->thread_keyring); | 232 | key_revoke(dns_resolver_cache->thread_keyring); |
233 | unregister_key_type(&key_type_dns_resolver); | 233 | unregister_key_type(&key_type_dns_resolver); |
diff --git a/fs/cifs/dns_resolve.h b/fs/cifs/dns_resolve.h index 26b9eaa9f5ee..5d7f291df162 100644 --- a/fs/cifs/dns_resolve.h +++ b/fs/cifs/dns_resolve.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
27 | extern int __init cifs_init_dns_resolver(void); | 27 | extern int __init cifs_init_dns_resolver(void); |
28 | extern void __exit cifs_exit_dns_resolver(void); | 28 | extern void cifs_exit_dns_resolver(void); |
29 | extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr); | 29 | extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr); |
30 | #endif /* KERNEL */ | 30 | #endif /* KERNEL */ |
31 | 31 | ||
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 2d8dbce9d485..46c4dd8dfcc3 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
@@ -31,9 +31,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux; | |||
31 | 31 | ||
32 | static struct hlist_head *ecryptfs_daemon_hash; | 32 | static struct hlist_head *ecryptfs_daemon_hash; |
33 | struct mutex ecryptfs_daemon_hash_mux; | 33 | struct mutex ecryptfs_daemon_hash_mux; |
34 | static int ecryptfs_hash_buckets; | 34 | static int ecryptfs_hash_bits; |
35 | #define ecryptfs_uid_hash(uid) \ | 35 | #define ecryptfs_uid_hash(uid) \ |
36 | hash_long((unsigned long)uid, ecryptfs_hash_buckets) | 36 | hash_long((unsigned long)uid, ecryptfs_hash_bits) |
37 | 37 | ||
38 | static u32 ecryptfs_msg_counter; | 38 | static u32 ecryptfs_msg_counter; |
39 | static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; | 39 | static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; |
@@ -486,18 +486,19 @@ int ecryptfs_init_messaging(void) | |||
486 | } | 486 | } |
487 | mutex_init(&ecryptfs_daemon_hash_mux); | 487 | mutex_init(&ecryptfs_daemon_hash_mux); |
488 | mutex_lock(&ecryptfs_daemon_hash_mux); | 488 | mutex_lock(&ecryptfs_daemon_hash_mux); |
489 | ecryptfs_hash_buckets = 1; | 489 | ecryptfs_hash_bits = 1; |
490 | while (ecryptfs_number_of_users >> ecryptfs_hash_buckets) | 490 | while (ecryptfs_number_of_users >> ecryptfs_hash_bits) |
491 | ecryptfs_hash_buckets++; | 491 | ecryptfs_hash_bits++; |
492 | ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head) | 492 | ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head) |
493 | * ecryptfs_hash_buckets), GFP_KERNEL); | 493 | * (1 << ecryptfs_hash_bits)), |
494 | GFP_KERNEL); | ||
494 | if (!ecryptfs_daemon_hash) { | 495 | if (!ecryptfs_daemon_hash) { |
495 | rc = -ENOMEM; | 496 | rc = -ENOMEM; |
496 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); | 497 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); |
497 | mutex_unlock(&ecryptfs_daemon_hash_mux); | 498 | mutex_unlock(&ecryptfs_daemon_hash_mux); |
498 | goto out; | 499 | goto out; |
499 | } | 500 | } |
500 | for (i = 0; i < ecryptfs_hash_buckets; i++) | 501 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) |
501 | INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]); | 502 | INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]); |
502 | mutex_unlock(&ecryptfs_daemon_hash_mux); | 503 | mutex_unlock(&ecryptfs_daemon_hash_mux); |
503 | ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx) | 504 | ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx) |
@@ -554,7 +555,7 @@ void ecryptfs_release_messaging(void) | |||
554 | int i; | 555 | int i; |
555 | 556 | ||
556 | mutex_lock(&ecryptfs_daemon_hash_mux); | 557 | mutex_lock(&ecryptfs_daemon_hash_mux); |
557 | for (i = 0; i < ecryptfs_hash_buckets; i++) { | 558 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) { |
558 | int rc; | 559 | int rc; |
559 | 560 | ||
560 | hlist_for_each_entry(daemon, elem, | 561 | hlist_for_each_entry(daemon, elem, |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 26ca3361a8bc..6b48d7c268b2 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1231,6 +1231,25 @@ static int do_filldir_main(struct gfs2_inode *dip, u64 *offset, | |||
1231 | return 0; | 1231 | return 0; |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | static void *gfs2_alloc_sort_buffer(unsigned size) | ||
1235 | { | ||
1236 | void *ptr = NULL; | ||
1237 | |||
1238 | if (size < KMALLOC_MAX_SIZE) | ||
1239 | ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN); | ||
1240 | if (!ptr) | ||
1241 | ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL); | ||
1242 | return ptr; | ||
1243 | } | ||
1244 | |||
1245 | static void gfs2_free_sort_buffer(void *ptr) | ||
1246 | { | ||
1247 | if (is_vmalloc_addr(ptr)) | ||
1248 | vfree(ptr); | ||
1249 | else | ||
1250 | kfree(ptr); | ||
1251 | } | ||
1252 | |||
1234 | static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | 1253 | static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, |
1235 | filldir_t filldir, int *copied, unsigned *depth, | 1254 | filldir_t filldir, int *copied, unsigned *depth, |
1236 | u64 leaf_no) | 1255 | u64 leaf_no) |
@@ -1271,7 +1290,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1271 | * 99 is the maximum number of entries that can fit in a single | 1290 | * 99 is the maximum number of entries that can fit in a single |
1272 | * leaf block. | 1291 | * leaf block. |
1273 | */ | 1292 | */ |
1274 | larr = vmalloc((leaves + entries + 99) * sizeof(void *)); | 1293 | larr = gfs2_alloc_sort_buffer((leaves + entries + 99) * sizeof(void *)); |
1275 | if (!larr) | 1294 | if (!larr) |
1276 | goto out; | 1295 | goto out; |
1277 | darr = (const struct gfs2_dirent **)(larr + leaves); | 1296 | darr = (const struct gfs2_dirent **)(larr + leaves); |
@@ -1282,7 +1301,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1282 | do { | 1301 | do { |
1283 | error = get_leaf(ip, lfn, &bh); | 1302 | error = get_leaf(ip, lfn, &bh); |
1284 | if (error) | 1303 | if (error) |
1285 | goto out_kfree; | 1304 | goto out_free; |
1286 | lf = (struct gfs2_leaf *)bh->b_data; | 1305 | lf = (struct gfs2_leaf *)bh->b_data; |
1287 | lfn = be64_to_cpu(lf->lf_next); | 1306 | lfn = be64_to_cpu(lf->lf_next); |
1288 | if (lf->lf_entries) { | 1307 | if (lf->lf_entries) { |
@@ -1291,7 +1310,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1291 | gfs2_dirent_gather, NULL, &g); | 1310 | gfs2_dirent_gather, NULL, &g); |
1292 | error = PTR_ERR(dent); | 1311 | error = PTR_ERR(dent); |
1293 | if (IS_ERR(dent)) | 1312 | if (IS_ERR(dent)) |
1294 | goto out_kfree; | 1313 | goto out_free; |
1295 | if (entries2 != g.offset) { | 1314 | if (entries2 != g.offset) { |
1296 | fs_warn(sdp, "Number of entries corrupt in dir " | 1315 | fs_warn(sdp, "Number of entries corrupt in dir " |
1297 | "leaf %llu, entries2 (%u) != " | 1316 | "leaf %llu, entries2 (%u) != " |
@@ -1300,7 +1319,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1300 | entries2, g.offset); | 1319 | entries2, g.offset); |
1301 | 1320 | ||
1302 | error = -EIO; | 1321 | error = -EIO; |
1303 | goto out_kfree; | 1322 | goto out_free; |
1304 | } | 1323 | } |
1305 | error = 0; | 1324 | error = 0; |
1306 | larr[leaf++] = bh; | 1325 | larr[leaf++] = bh; |
@@ -1312,10 +1331,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1312 | BUG_ON(entries2 != entries); | 1331 | BUG_ON(entries2 != entries); |
1313 | error = do_filldir_main(ip, offset, opaque, filldir, darr, | 1332 | error = do_filldir_main(ip, offset, opaque, filldir, darr, |
1314 | entries, copied); | 1333 | entries, copied); |
1315 | out_kfree: | 1334 | out_free: |
1316 | for(i = 0; i < leaf; i++) | 1335 | for(i = 0; i < leaf; i++) |
1317 | brelse(larr[i]); | 1336 | brelse(larr[i]); |
1318 | vfree(larr); | 1337 | gfs2_free_sort_buffer(larr); |
1319 | out: | 1338 | out: |
1320 | return error; | 1339 | return error; |
1321 | } | 1340 | } |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 36a5e74f51b4..f036153d9f50 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/pagemap.h> | 27 | #include <linux/pagemap.h> |
28 | #include <linux/aio.h> | 28 | #include <linux/aio.h> |
29 | #include <linux/gfp.h> | 29 | #include <linux/gfp.h> |
30 | #include <linux/swap.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
@@ -493,11 +494,19 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset) | |||
493 | */ | 494 | */ |
494 | static int nfs_release_page(struct page *page, gfp_t gfp) | 495 | static int nfs_release_page(struct page *page, gfp_t gfp) |
495 | { | 496 | { |
497 | struct address_space *mapping = page->mapping; | ||
498 | |||
496 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | 499 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); |
497 | 500 | ||
498 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ | 501 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ |
499 | if ((gfp & GFP_KERNEL) == GFP_KERNEL) | 502 | if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) { |
500 | nfs_wb_page(page->mapping->host, page); | 503 | int how = FLUSH_SYNC; |
504 | |||
505 | /* Don't let kswapd deadlock waiting for OOM RPC calls */ | ||
506 | if (current_is_kswapd()) | ||
507 | how = 0; | ||
508 | nfs_commit_inode(mapping->host, how); | ||
509 | } | ||
501 | /* If PagePrivate() is set, then the page is not freeable */ | 510 | /* If PagePrivate() is set, then the page is not freeable */ |
502 | if (PagePrivate(page)) | 511 | if (PagePrivate(page)) |
503 | return 0; | 512 | return 0; |
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index 6bd19d843af7..df101d9f546a 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c | |||
@@ -105,7 +105,7 @@ static char nfs_root_name[256] __initdata = ""; | |||
105 | static __be32 servaddr __initdata = 0; | 105 | static __be32 servaddr __initdata = 0; |
106 | 106 | ||
107 | /* Name of directory to mount */ | 107 | /* Name of directory to mount */ |
108 | static char nfs_export_path[NFS_MAXPATHLEN] __initdata = { 0, }; | 108 | static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = { 0, }; |
109 | 109 | ||
110 | /* NFS-related data */ | 110 | /* NFS-related data */ |
111 | static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */ | 111 | static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */ |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 91679e2631ee..9f81bdd91c55 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -222,7 +222,7 @@ static void nfs_end_page_writeback(struct page *page) | |||
222 | clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC); | 222 | clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC); |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct nfs_page *nfs_find_and_lock_request(struct page *page) | 225 | static struct nfs_page *nfs_find_and_lock_request(struct page *page, bool nonblock) |
226 | { | 226 | { |
227 | struct inode *inode = page->mapping->host; | 227 | struct inode *inode = page->mapping->host; |
228 | struct nfs_page *req; | 228 | struct nfs_page *req; |
@@ -241,7 +241,10 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page) | |||
241 | * request as dirty (in which case we don't care). | 241 | * request as dirty (in which case we don't care). |
242 | */ | 242 | */ |
243 | spin_unlock(&inode->i_lock); | 243 | spin_unlock(&inode->i_lock); |
244 | ret = nfs_wait_on_request(req); | 244 | if (!nonblock) |
245 | ret = nfs_wait_on_request(req); | ||
246 | else | ||
247 | ret = -EAGAIN; | ||
245 | nfs_release_request(req); | 248 | nfs_release_request(req); |
246 | if (ret != 0) | 249 | if (ret != 0) |
247 | return ERR_PTR(ret); | 250 | return ERR_PTR(ret); |
@@ -256,12 +259,12 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page) | |||
256 | * May return an error if the user signalled nfs_wait_on_request(). | 259 | * May return an error if the user signalled nfs_wait_on_request(). |
257 | */ | 260 | */ |
258 | static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, | 261 | static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, |
259 | struct page *page) | 262 | struct page *page, bool nonblock) |
260 | { | 263 | { |
261 | struct nfs_page *req; | 264 | struct nfs_page *req; |
262 | int ret = 0; | 265 | int ret = 0; |
263 | 266 | ||
264 | req = nfs_find_and_lock_request(page); | 267 | req = nfs_find_and_lock_request(page, nonblock); |
265 | if (!req) | 268 | if (!req) |
266 | goto out; | 269 | goto out; |
267 | ret = PTR_ERR(req); | 270 | ret = PTR_ERR(req); |
@@ -283,12 +286,20 @@ out: | |||
283 | static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) | 286 | static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) |
284 | { | 287 | { |
285 | struct inode *inode = page->mapping->host; | 288 | struct inode *inode = page->mapping->host; |
289 | int ret; | ||
286 | 290 | ||
287 | nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); | 291 | nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); |
288 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); | 292 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); |
289 | 293 | ||
290 | nfs_pageio_cond_complete(pgio, page->index); | 294 | nfs_pageio_cond_complete(pgio, page->index); |
291 | return nfs_page_async_flush(pgio, page); | 295 | ret = nfs_page_async_flush(pgio, page, |
296 | wbc->sync_mode == WB_SYNC_NONE || | ||
297 | wbc->nonblocking != 0); | ||
298 | if (ret == -EAGAIN) { | ||
299 | redirty_page_for_writepage(wbc, page); | ||
300 | ret = 0; | ||
301 | } | ||
302 | return ret; | ||
292 | } | 303 | } |
293 | 304 | ||
294 | /* | 305 | /* |
@@ -1379,7 +1390,7 @@ static const struct rpc_call_ops nfs_commit_ops = { | |||
1379 | .rpc_release = nfs_commit_release, | 1390 | .rpc_release = nfs_commit_release, |
1380 | }; | 1391 | }; |
1381 | 1392 | ||
1382 | static int nfs_commit_inode(struct inode *inode, int how) | 1393 | int nfs_commit_inode(struct inode *inode, int how) |
1383 | { | 1394 | { |
1384 | LIST_HEAD(head); | 1395 | LIST_HEAD(head); |
1385 | int may_wait = how & FLUSH_SYNC; | 1396 | int may_wait = how & FLUSH_SYNC; |
@@ -1443,11 +1454,6 @@ out_mark_dirty: | |||
1443 | return ret; | 1454 | return ret; |
1444 | } | 1455 | } |
1445 | #else | 1456 | #else |
1446 | static int nfs_commit_inode(struct inode *inode, int how) | ||
1447 | { | ||
1448 | return 0; | ||
1449 | } | ||
1450 | |||
1451 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) | 1457 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) |
1452 | { | 1458 | { |
1453 | return 0; | 1459 | return 0; |
@@ -1546,7 +1552,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | |||
1546 | 1552 | ||
1547 | nfs_fscache_release_page(page, GFP_KERNEL); | 1553 | nfs_fscache_release_page(page, GFP_KERNEL); |
1548 | 1554 | ||
1549 | req = nfs_find_and_lock_request(page); | 1555 | req = nfs_find_and_lock_request(page, false); |
1550 | ret = PTR_ERR(req); | 1556 | ret = PTR_ERR(req); |
1551 | if (IS_ERR(req)) | 1557 | if (IS_ERR(req)) |
1552 | goto out; | 1558 | goto out; |
diff --git a/fs/proc/array.c b/fs/proc/array.c index 9b58d38bc911..fff6572676ae 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -176,7 +176,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
176 | if (tracer) | 176 | if (tracer) |
177 | tpid = task_pid_nr_ns(tracer, ns); | 177 | tpid = task_pid_nr_ns(tracer, ns); |
178 | } | 178 | } |
179 | cred = get_cred((struct cred *) __task_cred(p)); | 179 | cred = get_task_cred(p); |
180 | seq_printf(m, | 180 | seq_printf(m, |
181 | "State:\t%s\n" | 181 | "State:\t%s\n" |
182 | "Tgid:\t%d\n" | 182 | "Tgid:\t%d\n" |
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index f71246bebfe4..a7ac78f8e67a 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -28,6 +28,7 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, | |||
28 | struct sysfs_dirent *target_sd = NULL; | 28 | struct sysfs_dirent *target_sd = NULL; |
29 | struct sysfs_dirent *sd = NULL; | 29 | struct sysfs_dirent *sd = NULL; |
30 | struct sysfs_addrm_cxt acxt; | 30 | struct sysfs_addrm_cxt acxt; |
31 | enum kobj_ns_type ns_type; | ||
31 | int error; | 32 | int error; |
32 | 33 | ||
33 | BUG_ON(!name); | 34 | BUG_ON(!name); |
@@ -58,16 +59,29 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, | |||
58 | if (!sd) | 59 | if (!sd) |
59 | goto out_put; | 60 | goto out_put; |
60 | 61 | ||
61 | if (sysfs_ns_type(parent_sd)) | 62 | ns_type = sysfs_ns_type(parent_sd); |
63 | if (ns_type) | ||
62 | sd->s_ns = target->ktype->namespace(target); | 64 | sd->s_ns = target->ktype->namespace(target); |
63 | sd->s_symlink.target_sd = target_sd; | 65 | sd->s_symlink.target_sd = target_sd; |
64 | target_sd = NULL; /* reference is now owned by the symlink */ | 66 | target_sd = NULL; /* reference is now owned by the symlink */ |
65 | 67 | ||
66 | sysfs_addrm_start(&acxt, parent_sd); | 68 | sysfs_addrm_start(&acxt, parent_sd); |
67 | if (warn) | 69 | /* Symlinks must be between directories with the same ns_type */ |
68 | error = sysfs_add_one(&acxt, sd); | 70 | if (!ns_type || |
69 | else | 71 | (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) { |
70 | error = __sysfs_add_one(&acxt, sd); | 72 | if (warn) |
73 | error = sysfs_add_one(&acxt, sd); | ||
74 | else | ||
75 | error = __sysfs_add_one(&acxt, sd); | ||
76 | } else { | ||
77 | error = -EINVAL; | ||
78 | WARN(1, KERN_WARNING | ||
79 | "sysfs: symlink across ns_types %s/%s -> %s/%s\n", | ||
80 | parent_sd->s_name, | ||
81 | sd->s_name, | ||
82 | sd->s_symlink.target_sd->s_parent->s_name, | ||
83 | sd->s_symlink.target_sd->s_name); | ||
84 | } | ||
71 | sysfs_addrm_finish(&acxt); | 85 | sysfs_addrm_finish(&acxt); |
72 | 86 | ||
73 | if (error) | 87 | if (error) |
@@ -122,7 +136,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, | |||
122 | { | 136 | { |
123 | const void *ns = NULL; | 137 | const void *ns = NULL; |
124 | spin_lock(&sysfs_assoc_lock); | 138 | spin_lock(&sysfs_assoc_lock); |
125 | if (targ->sd) | 139 | if (targ->sd && sysfs_ns_type(kobj->sd)) |
126 | ns = targ->sd->s_ns; | 140 | ns = targ->sd->s_ns; |
127 | spin_unlock(&sysfs_assoc_lock); | 141 | spin_unlock(&sysfs_assoc_lock); |
128 | sysfs_hash_and_remove(kobj->sd, ns, name); | 142 | sysfs_hash_and_remove(kobj->sd, ns, name); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 1371cc997393..a6ea2ac40b9c 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -67,7 +67,7 @@ extern u8 acpi_gbl_leave_wake_gpes_disabled; | |||
67 | extern u8 acpi_gbl_use_default_register_widths; | 67 | extern u8 acpi_gbl_use_default_register_widths; |
68 | extern acpi_name acpi_gbl_trace_method_name; | 68 | extern acpi_name acpi_gbl_trace_method_name; |
69 | extern u32 acpi_gbl_trace_flags; | 69 | extern u32 acpi_gbl_trace_flags; |
70 | extern u8 acpi_gbl_enable_aml_debug_object; | 70 | extern u32 acpi_gbl_enable_aml_debug_object; |
71 | extern u8 acpi_gbl_copy_dsdt_locally; | 71 | extern u8 acpi_gbl_copy_dsdt_locally; |
72 | extern u8 acpi_gbl_truncate_io_addresses; | 72 | extern u8 acpi_gbl_truncate_io_addresses; |
73 | 73 | ||
diff --git a/include/linux/cper.h b/include/linux/cper.h index 4b38f905b705..bf972f81e2a7 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -39,10 +39,10 @@ | |||
39 | * Severity difinition for error_severity in struct cper_record_header | 39 | * Severity difinition for error_severity in struct cper_record_header |
40 | * and section_severity in struct cper_section_descriptor | 40 | * and section_severity in struct cper_section_descriptor |
41 | */ | 41 | */ |
42 | #define CPER_SER_RECOVERABLE 0x0 | 42 | #define CPER_SEV_RECOVERABLE 0x0 |
43 | #define CPER_SER_FATAL 0x1 | 43 | #define CPER_SEV_FATAL 0x1 |
44 | #define CPER_SER_CORRECTED 0x2 | 44 | #define CPER_SEV_CORRECTED 0x2 |
45 | #define CPER_SER_INFORMATIONAL 0x3 | 45 | #define CPER_SEV_INFORMATIONAL 0x3 |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Validation bits difinition for validation_bits in struct | 48 | * Validation bits difinition for validation_bits in struct |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 75c0fa881308..4d2c39573f36 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -153,6 +153,7 @@ struct cred { | |||
153 | extern void __put_cred(struct cred *); | 153 | extern void __put_cred(struct cred *); |
154 | extern void exit_creds(struct task_struct *); | 154 | extern void exit_creds(struct task_struct *); |
155 | extern int copy_creds(struct task_struct *, unsigned long); | 155 | extern int copy_creds(struct task_struct *, unsigned long); |
156 | extern const struct cred *get_task_cred(struct task_struct *); | ||
156 | extern struct cred *cred_alloc_blank(void); | 157 | extern struct cred *cred_alloc_blank(void); |
157 | extern struct cred *prepare_creds(void); | 158 | extern struct cred *prepare_creds(void); |
158 | extern struct cred *prepare_exec_creds(void); | 159 | extern struct cred *prepare_exec_creds(void); |
@@ -273,33 +274,18 @@ static inline void put_cred(const struct cred *_cred) | |||
273 | * @task: The task to query | 274 | * @task: The task to query |
274 | * | 275 | * |
275 | * Access the objective credentials of a task. The caller must hold the RCU | 276 | * Access the objective credentials of a task. The caller must hold the RCU |
276 | * readlock. | 277 | * readlock or the task must be dead and unable to change its own credentials. |
277 | * | 278 | * |
278 | * The caller must make sure task doesn't go away, either by holding a ref on | 279 | * The result of this function should not be passed directly to get_cred(); |
279 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * rather get_task_cred() should be used instead. |
280 | */ | 281 | */ |
281 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
282 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held()))) | 283 | ({ \ |
283 | 284 | const struct task_struct *__t = (task); \ | |
284 | /** | 285 | rcu_dereference_check(__t->real_cred, \ |
285 | * get_task_cred - Get another task's objective credentials | 286 | rcu_read_lock_held() || \ |
286 | * @task: The task to query | 287 | task_is_dead(__t)); \ |
287 | * | 288 | }) |
288 | * Get the objective credentials of a task, pinning them so that they can't go | ||
289 | * away. Accessing a task's credentials directly is not permitted. | ||
290 | * | ||
291 | * The caller must make sure task doesn't go away, either by holding a ref on | ||
292 | * task or by holding tasklist_lock to prevent it from being unlinked. | ||
293 | */ | ||
294 | #define get_task_cred(task) \ | ||
295 | ({ \ | ||
296 | struct cred *__cred; \ | ||
297 | rcu_read_lock(); \ | ||
298 | __cred = (struct cred *) __task_cred((task)); \ | ||
299 | get_cred(__cred); \ | ||
300 | rcu_read_unlock(); \ | ||
301 | __cred; \ | ||
302 | }) | ||
303 | 289 | ||
304 | /** | 290 | /** |
305 | * get_current_cred - Get the current task's subjective credentials | 291 | * get_current_cred - Get the current task's subjective credentials |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 9ea047aca795..1ffaeffeff74 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -67,6 +67,8 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | extern void macvlan_common_setup(struct net_device *dev); | ||
71 | |||
70 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 72 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
71 | struct nlattr *tb[], struct nlattr *data[], | 73 | struct nlattr *tb[], struct nlattr *data[], |
72 | int (*receive)(struct sk_buff *skb), | 74 | int (*receive)(struct sk_buff *skb), |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 77c2ae53431c..bad4d121b16e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -493,8 +493,15 @@ extern int nfs_wb_all(struct inode *inode); | |||
493 | extern int nfs_wb_page(struct inode *inode, struct page* page); | 493 | extern int nfs_wb_page(struct inode *inode, struct page* page); |
494 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | 494 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); |
495 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 495 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
496 | extern int nfs_commit_inode(struct inode *, int); | ||
496 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 497 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
497 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 498 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
499 | #else | ||
500 | static inline int | ||
501 | nfs_commit_inode(struct inode *inode, int how) | ||
502 | { | ||
503 | return 0; | ||
504 | } | ||
498 | #endif | 505 | #endif |
499 | 506 | ||
500 | static inline int | 507 | static inline int |
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h new file mode 100644 index 000000000000..4892f591bab1 --- /dev/null +++ b/include/linux/regulator/tps6507x.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * tps6507x.h -- Voltage regulation for the Texas Instruments TPS6507X | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef REGULATOR_TPS6507X | ||
21 | #define REGULATOR_TPS6507X | ||
22 | |||
23 | /** | ||
24 | * tps6507x_reg_platform_data - platform data for tps6507x | ||
25 | * @defdcdc_default: Defines whether DCDC high or the low register controls | ||
26 | * output voltage by default. Valid for DCDC2 and DCDC3 outputs only. | ||
27 | */ | ||
28 | struct tps6507x_reg_platform_data { | ||
29 | bool defdcdc_default; | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 747fcaedddb7..0478888c6899 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!( | |||
214 | 214 | ||
215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
217 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
217 | #define task_is_stopped_or_traced(task) \ | 218 | #define task_is_stopped_or_traced(task) \ |
218 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 219 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
219 | #define task_contributes_to_load(task) \ | 220 | #define task_contributes_to_load(task) \ |
diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h index ceac661cdfd5..cfe2943690ff 100644 --- a/include/net/tc_act/tc_mirred.h +++ b/include/net/tc_act/tc_mirred.h | |||
@@ -9,6 +9,7 @@ struct tcf_mirred { | |||
9 | int tcfm_ifindex; | 9 | int tcfm_ifindex; |
10 | int tcfm_ok_push; | 10 | int tcfm_ok_push; |
11 | struct net_device *tcfm_dev; | 11 | struct net_device *tcfm_dev; |
12 | struct list_head tcfm_list; | ||
12 | }; | 13 | }; |
13 | #define to_mirred(pc) \ | 14 | #define to_mirred(pc) \ |
14 | container_of(pc, struct tcf_mirred, common) | 15 | container_of(pc, struct tcf_mirred, common) |
diff --git a/kernel/cred.c b/kernel/cred.c index a2d5504fbcc2..60bc8b1e32e6 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -209,6 +209,31 @@ void exit_creds(struct task_struct *tsk) | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | /** | ||
213 | * get_task_cred - Get another task's objective credentials | ||
214 | * @task: The task to query | ||
215 | * | ||
216 | * Get the objective credentials of a task, pinning them so that they can't go | ||
217 | * away. Accessing a task's credentials directly is not permitted. | ||
218 | * | ||
219 | * The caller must also make sure task doesn't get deleted, either by holding a | ||
220 | * ref on task or by holding tasklist_lock to prevent it from being unlinked. | ||
221 | */ | ||
222 | const struct cred *get_task_cred(struct task_struct *task) | ||
223 | { | ||
224 | const struct cred *cred; | ||
225 | |||
226 | rcu_read_lock(); | ||
227 | |||
228 | do { | ||
229 | cred = __task_cred((task)); | ||
230 | BUG_ON(!cred); | ||
231 | } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage)); | ||
232 | |||
233 | rcu_read_unlock(); | ||
234 | return cred; | ||
235 | } | ||
236 | |||
212 | /* | 237 | /* |
213 | * Allocate blank credentials, such that the credentials can be filled in at a | 238 | * Allocate blank credentials, such that the credentials can be filled in at a |
214 | * later date without risk of ENOMEM. | 239 | * later date without risk of ENOMEM. |
diff --git a/kernel/module.c b/kernel/module.c index 5d2d28197c82..6c562828c85c 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -787,7 +787,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
787 | 787 | ||
788 | /* Store the name of the last unloaded module for diagnostic purposes */ | 788 | /* Store the name of the last unloaded module for diagnostic purposes */ |
789 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); | 789 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); |
790 | ddebug_remove_module(mod->name); | ||
791 | 790 | ||
792 | free_module(mod); | 791 | free_module(mod); |
793 | return 0; | 792 | return 0; |
@@ -1550,6 +1549,9 @@ static void free_module(struct module *mod) | |||
1550 | remove_sect_attrs(mod); | 1549 | remove_sect_attrs(mod); |
1551 | mod_kobject_remove(mod); | 1550 | mod_kobject_remove(mod); |
1552 | 1551 | ||
1552 | /* Remove dynamic debug info */ | ||
1553 | ddebug_remove_module(mod->name); | ||
1554 | |||
1553 | /* Arch-specific cleanup. */ | 1555 | /* Arch-specific cleanup. */ |
1554 | module_arch_cleanup(mod); | 1556 | module_arch_cleanup(mod); |
1555 | 1557 | ||
diff --git a/mm/memory.c b/mm/memory.c index 119b7ccdf39b..bde42c6d3633 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1394 | return i ? : -EFAULT; | 1394 | return i ? : -EFAULT; |
1395 | } | 1395 | } |
1396 | if (pages) { | 1396 | if (pages) { |
1397 | struct page *page = vm_normal_page(gate_vma, start, *pte); | 1397 | struct page *page; |
1398 | |||
1399 | page = vm_normal_page(gate_vma, start, *pte); | ||
1400 | if (!page) { | ||
1401 | if (!(gup_flags & FOLL_DUMP) && | ||
1402 | is_zero_pfn(pte_pfn(*pte))) | ||
1403 | page = pte_page(*pte); | ||
1404 | else { | ||
1405 | pte_unmap(pte); | ||
1406 | return i ? : -EFAULT; | ||
1407 | } | ||
1408 | } | ||
1398 | pages[i] = page; | 1409 | pages[i] = page; |
1399 | if (page) | 1410 | get_page(page); |
1400 | get_page(page); | ||
1401 | } | 1411 | } |
1402 | pte_unmap(pte); | 1412 | pte_unmap(pte); |
1403 | if (vmas) | 1413 | if (vmas) |
diff --git a/net/core/dev.c b/net/core/dev.c index 0ea10f849be8..1f466e82ac33 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1488,6 +1488,7 @@ static inline void net_timestamp_check(struct sk_buff *skb) | |||
1488 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | 1488 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) |
1489 | { | 1489 | { |
1490 | skb_orphan(skb); | 1490 | skb_orphan(skb); |
1491 | nf_reset(skb); | ||
1491 | 1492 | ||
1492 | if (!(dev->flags & IFF_UP) || | 1493 | if (!(dev->flags & IFF_UP) || |
1493 | (skb->len > (dev->mtu + dev->hard_header_len))) { | 1494 | (skb->len > (dev->mtu + dev->hard_header_len))) { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 34432b4e96bb..ce88293a34e2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -843,7 +843,9 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, | |||
843 | skb->network_header += off; | 843 | skb->network_header += off; |
844 | if (skb_mac_header_was_set(skb)) | 844 | if (skb_mac_header_was_set(skb)) |
845 | skb->mac_header += off; | 845 | skb->mac_header += off; |
846 | skb->csum_start += nhead; | 846 | /* Only adjust this if it actually is csum_start rather than csum */ |
847 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
848 | skb->csum_start += nhead; | ||
847 | skb->cloned = 0; | 849 | skb->cloned = 0; |
848 | skb->hdr_len = 0; | 850 | skb->hdr_len = 0; |
849 | skb->nohdr = 0; | 851 | skb->nohdr = 0; |
@@ -930,7 +932,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | |||
930 | copy_skb_header(n, skb); | 932 | copy_skb_header(n, skb); |
931 | 933 | ||
932 | off = newheadroom - oldheadroom; | 934 | off = newheadroom - oldheadroom; |
933 | n->csum_start += off; | 935 | if (n->ip_summed == CHECKSUM_PARTIAL) |
936 | n->csum_start += off; | ||
934 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 937 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
935 | n->transport_header += off; | 938 | n->transport_header += off; |
936 | n->network_header += off; | 939 | n->network_header += off; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e1a698df5706..784f34d11fdd 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1760,7 +1760,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) | |||
1760 | 1760 | ||
1761 | idev = ipv6_find_idev(dev); | 1761 | idev = ipv6_find_idev(dev); |
1762 | if (!idev) | 1762 | if (!idev) |
1763 | return NULL; | 1763 | return ERR_PTR(-ENOBUFS); |
1764 | |||
1765 | if (idev->cnf.disable_ipv6) | ||
1766 | return ERR_PTR(-EACCES); | ||
1764 | 1767 | ||
1765 | /* Add default multicast route */ | 1768 | /* Add default multicast route */ |
1766 | addrconf_add_mroute(dev); | 1769 | addrconf_add_mroute(dev); |
@@ -2129,8 +2132,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, | |||
2129 | if (!dev) | 2132 | if (!dev) |
2130 | return -ENODEV; | 2133 | return -ENODEV; |
2131 | 2134 | ||
2132 | if ((idev = addrconf_add_dev(dev)) == NULL) | 2135 | idev = addrconf_add_dev(dev); |
2133 | return -ENOBUFS; | 2136 | if (IS_ERR(idev)) |
2137 | return PTR_ERR(idev); | ||
2134 | 2138 | ||
2135 | scope = ipv6_addr_scope(pfx); | 2139 | scope = ipv6_addr_scope(pfx); |
2136 | 2140 | ||
@@ -2377,7 +2381,7 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2377 | } | 2381 | } |
2378 | 2382 | ||
2379 | idev = addrconf_add_dev(dev); | 2383 | idev = addrconf_add_dev(dev); |
2380 | if (idev == NULL) | 2384 | if (IS_ERR(idev)) |
2381 | return; | 2385 | return; |
2382 | 2386 | ||
2383 | memset(&addr, 0, sizeof(struct in6_addr)); | 2387 | memset(&addr, 0, sizeof(struct in6_addr)); |
@@ -2468,7 +2472,7 @@ static void addrconf_ip6_tnl_config(struct net_device *dev) | |||
2468 | ASSERT_RTNL(); | 2472 | ASSERT_RTNL(); |
2469 | 2473 | ||
2470 | idev = addrconf_add_dev(dev); | 2474 | idev = addrconf_add_dev(dev); |
2471 | if (!idev) { | 2475 | if (IS_ERR(idev)) { |
2472 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); | 2476 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); |
2473 | return; | 2477 | return; |
2474 | } | 2478 | } |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index c7000a6ca379..67ee34f57df7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -632,7 +632,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta) | |||
632 | skb->dev = sta->sdata->dev; | 632 | skb->dev = sta->sdata->dev; |
633 | skb->protocol = eth_type_trans(skb, sta->sdata->dev); | 633 | skb->protocol = eth_type_trans(skb, sta->sdata->dev); |
634 | memset(skb->cb, 0, sizeof(skb->cb)); | 634 | memset(skb->cb, 0, sizeof(skb->cb)); |
635 | netif_rx(skb); | 635 | netif_rx_ni(skb); |
636 | } | 636 | } |
637 | 637 | ||
638 | static void sta_apply_parameters(struct ieee80211_local *local, | 638 | static void sta_apply_parameters(struct ieee80211_local *local, |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index c0b6863e3b87..1980b71c283f 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -33,6 +33,7 @@ | |||
33 | static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1]; | 33 | static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1]; |
34 | static u32 mirred_idx_gen; | 34 | static u32 mirred_idx_gen; |
35 | static DEFINE_RWLOCK(mirred_lock); | 35 | static DEFINE_RWLOCK(mirred_lock); |
36 | static LIST_HEAD(mirred_list); | ||
36 | 37 | ||
37 | static struct tcf_hashinfo mirred_hash_info = { | 38 | static struct tcf_hashinfo mirred_hash_info = { |
38 | .htab = tcf_mirred_ht, | 39 | .htab = tcf_mirred_ht, |
@@ -47,7 +48,9 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind) | |||
47 | m->tcf_bindcnt--; | 48 | m->tcf_bindcnt--; |
48 | m->tcf_refcnt--; | 49 | m->tcf_refcnt--; |
49 | if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { | 50 | if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { |
50 | dev_put(m->tcfm_dev); | 51 | list_del(&m->tcfm_list); |
52 | if (m->tcfm_dev) | ||
53 | dev_put(m->tcfm_dev); | ||
51 | tcf_hash_destroy(&m->common, &mirred_hash_info); | 54 | tcf_hash_destroy(&m->common, &mirred_hash_info); |
52 | return 1; | 55 | return 1; |
53 | } | 56 | } |
@@ -134,8 +137,10 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, | |||
134 | m->tcfm_ok_push = ok_push; | 137 | m->tcfm_ok_push = ok_push; |
135 | } | 138 | } |
136 | spin_unlock_bh(&m->tcf_lock); | 139 | spin_unlock_bh(&m->tcf_lock); |
137 | if (ret == ACT_P_CREATED) | 140 | if (ret == ACT_P_CREATED) { |
141 | list_add(&m->tcfm_list, &mirred_list); | ||
138 | tcf_hash_insert(pc, &mirred_hash_info); | 142 | tcf_hash_insert(pc, &mirred_hash_info); |
143 | } | ||
139 | 144 | ||
140 | return ret; | 145 | return ret; |
141 | } | 146 | } |
@@ -162,9 +167,14 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a, | |||
162 | m->tcf_tm.lastuse = jiffies; | 167 | m->tcf_tm.lastuse = jiffies; |
163 | 168 | ||
164 | dev = m->tcfm_dev; | 169 | dev = m->tcfm_dev; |
170 | if (!dev) { | ||
171 | printk_once(KERN_NOTICE "tc mirred: target device is gone\n"); | ||
172 | goto out; | ||
173 | } | ||
174 | |||
165 | if (!(dev->flags & IFF_UP)) { | 175 | if (!(dev->flags & IFF_UP)) { |
166 | if (net_ratelimit()) | 176 | if (net_ratelimit()) |
167 | pr_notice("tc mirred to Houston: device %s is gone!\n", | 177 | pr_notice("tc mirred to Houston: device %s is down\n", |
168 | dev->name); | 178 | dev->name); |
169 | goto out; | 179 | goto out; |
170 | } | 180 | } |
@@ -232,6 +242,28 @@ nla_put_failure: | |||
232 | return -1; | 242 | return -1; |
233 | } | 243 | } |
234 | 244 | ||
245 | static int mirred_device_event(struct notifier_block *unused, | ||
246 | unsigned long event, void *ptr) | ||
247 | { | ||
248 | struct net_device *dev = ptr; | ||
249 | struct tcf_mirred *m; | ||
250 | |||
251 | if (event == NETDEV_UNREGISTER) | ||
252 | list_for_each_entry(m, &mirred_list, tcfm_list) { | ||
253 | if (m->tcfm_dev == dev) { | ||
254 | dev_put(dev); | ||
255 | m->tcfm_dev = NULL; | ||
256 | } | ||
257 | } | ||
258 | |||
259 | return NOTIFY_DONE; | ||
260 | } | ||
261 | |||
262 | static struct notifier_block mirred_device_notifier = { | ||
263 | .notifier_call = mirred_device_event, | ||
264 | }; | ||
265 | |||
266 | |||
235 | static struct tc_action_ops act_mirred_ops = { | 267 | static struct tc_action_ops act_mirred_ops = { |
236 | .kind = "mirred", | 268 | .kind = "mirred", |
237 | .hinfo = &mirred_hash_info, | 269 | .hinfo = &mirred_hash_info, |
@@ -252,12 +284,17 @@ MODULE_LICENSE("GPL"); | |||
252 | 284 | ||
253 | static int __init mirred_init_module(void) | 285 | static int __init mirred_init_module(void) |
254 | { | 286 | { |
287 | int err = register_netdevice_notifier(&mirred_device_notifier); | ||
288 | if (err) | ||
289 | return err; | ||
290 | |||
255 | pr_info("Mirror/redirect action on\n"); | 291 | pr_info("Mirror/redirect action on\n"); |
256 | return tcf_register_action(&act_mirred_ops); | 292 | return tcf_register_action(&act_mirred_ops); |
257 | } | 293 | } |
258 | 294 | ||
259 | static void __exit mirred_cleanup_module(void) | 295 | static void __exit mirred_cleanup_module(void) |
260 | { | 296 | { |
297 | unregister_netdevice_notifier(&mirred_device_notifier); | ||
261 | tcf_unregister_action(&act_mirred_ops); | 298 | tcf_unregister_action(&act_mirred_ops); |
262 | } | 299 | } |
263 | 300 | ||
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 86067ee78632..2fc53961054e 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -52,6 +52,10 @@ struct hdmi_spec { | |||
52 | */ | 52 | */ |
53 | struct hda_multi_out multiout; | 53 | struct hda_multi_out multiout; |
54 | unsigned int codec_type; | 54 | unsigned int codec_type; |
55 | |||
56 | /* misc flags */ | ||
57 | /* PD bit indicates only the update, not the current state */ | ||
58 | unsigned int old_pin_detect:1; | ||
55 | }; | 59 | }; |
56 | 60 | ||
57 | 61 | ||
@@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid, | |||
616 | * Unsolicited events | 620 | * Unsolicited events |
617 | */ | 621 | */ |
618 | 622 | ||
623 | static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, | ||
624 | struct hdmi_eld *eld); | ||
625 | |||
619 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 626 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
620 | { | 627 | { |
621 | struct hdmi_spec *spec = codec->spec; | 628 | struct hdmi_spec *spec = codec->spec; |
@@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
632 | if (index < 0) | 639 | if (index < 0) |
633 | return; | 640 | return; |
634 | 641 | ||
642 | if (spec->old_pin_detect) { | ||
643 | if (pind) | ||
644 | hdmi_present_sense(codec, tag, &spec->sink_eld[index]); | ||
645 | pind = spec->sink_eld[index].monitor_present; | ||
646 | } | ||
647 | |||
635 | spec->sink_eld[index].monitor_present = pind; | 648 | spec->sink_eld[index].monitor_present = pind; |
636 | spec->sink_eld[index].eld_valid = eldv; | 649 | spec->sink_eld[index].eld_valid = eldv; |
637 | 650 | ||
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 3c10c0b149f4..b0652acee9b2 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec) | |||
478 | 478 | ||
479 | codec->spec = spec; | 479 | codec->spec = spec; |
480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; | 480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; |
481 | spec->old_pin_detect = 1; | ||
481 | 482 | ||
482 | if (hdmi_parse_codec(codec) < 0) { | 483 | if (hdmi_parse_codec(codec) < 0) { |
483 | codec->spec = NULL; | 484 | codec->spec = NULL; |
@@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) | |||
508 | spec->multiout.max_channels = 8; | 509 | spec->multiout.max_channels = 8; |
509 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 510 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
510 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 511 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
512 | spec->old_pin_detect = 1; | ||
511 | 513 | ||
512 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; | 514 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; |
513 | 515 | ||
@@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) | |||
528 | spec->multiout.max_channels = 2; | 530 | spec->multiout.max_channels = 2; |
529 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 531 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
530 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 532 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
533 | spec->old_pin_detect = 1; | ||
531 | 534 | ||
532 | codec->patch_ops = nvhdmi_patch_ops_2ch; | 535 | codec->patch_ops = nvhdmi_patch_ops_2ch; |
533 | 536 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ff614dd824c1..596ea2f12cf6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1267,11 +1267,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) | |||
1267 | unsigned nid = 0; | 1267 | unsigned nid = 0; |
1268 | struct alc_spec *spec = codec->spec; | 1268 | struct alc_spec *spec = codec->spec; |
1269 | 1269 | ||
1270 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1271 | |||
1270 | ass = codec->subsystem_id & 0xffff; | 1272 | ass = codec->subsystem_id & 0xffff; |
1271 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { | 1273 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
1272 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1273 | goto do_sku; | 1274 | goto do_sku; |
1274 | } | ||
1275 | 1275 | ||
1276 | nid = 0x1d; | 1276 | nid = 0x1d; |
1277 | if (codec->vendor_id == 0x10ec0260) | 1277 | if (codec->vendor_id == 0x10ec0260) |
@@ -5180,8 +5180,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, | |||
5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
5181 | #define set_beep_amp(spec, nid, idx, dir) \ | 5181 | #define set_beep_amp(spec, nid, idx, dir) \ |
5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | 5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
5183 | |||
5184 | static struct snd_pci_quirk beep_white_list[] = { | ||
5185 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), | ||
5186 | {} | ||
5187 | }; | ||
5188 | |||
5189 | static inline int has_cdefine_beep(struct hda_codec *codec) | ||
5190 | { | ||
5191 | struct alc_spec *spec = codec->spec; | ||
5192 | const struct snd_pci_quirk *q; | ||
5193 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); | ||
5194 | if (q) | ||
5195 | return q->value; | ||
5196 | return spec->cdefine.enable_pcbeep; | ||
5197 | } | ||
5183 | #else | 5198 | #else |
5184 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | 5199 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
5200 | #define has_cdefine_beep(codec) 0 | ||
5185 | #endif | 5201 | #endif |
5186 | 5202 | ||
5187 | /* | 5203 | /* |
@@ -10566,10 +10582,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
10566 | } | 10582 | } |
10567 | } | 10583 | } |
10568 | 10584 | ||
10569 | err = snd_hda_attach_beep_device(codec, 0x1); | 10585 | if (has_cdefine_beep(codec)) { |
10570 | if (err < 0) { | 10586 | err = snd_hda_attach_beep_device(codec, 0x1); |
10571 | alc_free(codec); | 10587 | if (err < 0) { |
10572 | return err; | 10588 | alc_free(codec); |
10589 | return err; | ||
10590 | } | ||
10573 | } | 10591 | } |
10574 | 10592 | ||
10575 | if (board_config != ALC882_AUTO) | 10593 | if (board_config != ALC882_AUTO) |
@@ -10619,7 +10637,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
10619 | 10637 | ||
10620 | set_capture_mixer(codec); | 10638 | set_capture_mixer(codec); |
10621 | 10639 | ||
10622 | if (spec->cdefine.enable_pcbeep) | 10640 | if (has_cdefine_beep(codec)) |
10623 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10641 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
10624 | 10642 | ||
10625 | if (board_config == ALC882_AUTO) | 10643 | if (board_config == ALC882_AUTO) |
@@ -12435,7 +12453,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12435 | } | 12453 | } |
12436 | } | 12454 | } |
12437 | 12455 | ||
12438 | if (!spec->no_analog) { | 12456 | if (!spec->no_analog && has_cdefine_beep(codec)) { |
12439 | err = snd_hda_attach_beep_device(codec, 0x1); | 12457 | err = snd_hda_attach_beep_device(codec, 0x1); |
12440 | if (err < 0) { | 12458 | if (err < 0) { |
12441 | alc_free(codec); | 12459 | alc_free(codec); |
@@ -12486,7 +12504,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12486 | } | 12504 | } |
12487 | if (!spec->cap_mixer && !spec->no_analog) | 12505 | if (!spec->cap_mixer && !spec->no_analog) |
12488 | set_capture_mixer(codec); | 12506 | set_capture_mixer(codec); |
12489 | if (!spec->no_analog && spec->cdefine.enable_pcbeep) | 12507 | if (!spec->no_analog && has_cdefine_beep(codec)) |
12490 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 12508 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
12491 | 12509 | ||
12492 | spec->vmaster_nid = 0x0c; | 12510 | spec->vmaster_nid = 0x0c; |
@@ -14458,10 +14476,12 @@ static int patch_alc269(struct hda_codec *codec) | |||
14458 | } | 14476 | } |
14459 | } | 14477 | } |
14460 | 14478 | ||
14461 | err = snd_hda_attach_beep_device(codec, 0x1); | 14479 | if (has_cdefine_beep(codec)) { |
14462 | if (err < 0) { | 14480 | err = snd_hda_attach_beep_device(codec, 0x1); |
14463 | alc_free(codec); | 14481 | if (err < 0) { |
14464 | return err; | 14482 | alc_free(codec); |
14483 | return err; | ||
14484 | } | ||
14465 | } | 14485 | } |
14466 | 14486 | ||
14467 | if (board_config != ALC269_AUTO) | 14487 | if (board_config != ALC269_AUTO) |
@@ -14494,7 +14514,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
14494 | 14514 | ||
14495 | if (!spec->cap_mixer) | 14515 | if (!spec->cap_mixer) |
14496 | set_capture_mixer(codec); | 14516 | set_capture_mixer(codec); |
14497 | if (spec->cdefine.enable_pcbeep) | 14517 | if (has_cdefine_beep(codec)) |
14498 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14518 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
14499 | 14519 | ||
14500 | if (board_config == ALC269_AUTO) | 14520 | if (board_config == ALC269_AUTO) |
@@ -18691,10 +18711,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
18691 | } | 18711 | } |
18692 | } | 18712 | } |
18693 | 18713 | ||
18694 | err = snd_hda_attach_beep_device(codec, 0x1); | 18714 | if (has_cdefine_beep(codec)) { |
18695 | if (err < 0) { | 18715 | err = snd_hda_attach_beep_device(codec, 0x1); |
18696 | alc_free(codec); | 18716 | if (err < 0) { |
18697 | return err; | 18717 | alc_free(codec); |
18718 | return err; | ||
18719 | } | ||
18698 | } | 18720 | } |
18699 | 18721 | ||
18700 | if (board_config != ALC662_AUTO) | 18722 | if (board_config != ALC662_AUTO) |
@@ -18716,7 +18738,7 @@ static int patch_alc662(struct hda_codec *codec) | |||
18716 | if (!spec->cap_mixer) | 18738 | if (!spec->cap_mixer) |
18717 | set_capture_mixer(codec); | 18739 | set_capture_mixer(codec); |
18718 | 18740 | ||
18719 | if (spec->cdefine.enable_pcbeep) { | 18741 | if (has_cdefine_beep(codec)) { |
18720 | switch (codec->vendor_id) { | 18742 | switch (codec->vendor_id) { |
18721 | case 0x10ec0662: | 18743 | case 0x10ec0662: |
18722 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 18744 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 495be6e71931..24454c98d0ee 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c | |||
@@ -300,7 +300,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = { | |||
300 | }; | 300 | }; |
301 | EXPORT_SYMBOL(au1xpsc_i2s_dai); | 301 | EXPORT_SYMBOL(au1xpsc_i2s_dai); |
302 | 302 | ||
303 | static int __init au1xpsc_i2s_drvprobe(struct platform_device *pdev) | 303 | static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev) |
304 | { | 304 | { |
305 | struct resource *r; | 305 | struct resource *r; |
306 | unsigned long sel; | 306 | unsigned long sel; |