diff options
37 files changed, 355 insertions, 161 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2651b1da1c56..136f263ed47b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1087,6 +1087,20 @@ if !MMU | |||
1087 | source "arch/arm/Kconfig-nommu" | 1087 | source "arch/arm/Kconfig-nommu" |
1088 | endif | 1088 | endif |
1089 | 1089 | ||
1090 | config PJ4B_ERRATA_4742 | ||
1091 | bool "PJ4B Errata 4742: IDLE Wake Up Commands can Cause the CPU Core to Cease Operation" | ||
1092 | depends on CPU_PJ4B && MACH_ARMADA_370 | ||
1093 | default y | ||
1094 | help | ||
1095 | When coming out of either a Wait for Interrupt (WFI) or a Wait for | ||
1096 | Event (WFE) IDLE states, a specific timing sensitivity exists between | ||
1097 | the retiring WFI/WFE instructions and the newly issued subsequent | ||
1098 | instructions. This sensitivity can result in a CPU hang scenario. | ||
1099 | Workaround: | ||
1100 | The software must insert either a Data Synchronization Barrier (DSB) | ||
1101 | or Data Memory Barrier (DMB) command immediately after the WFI/WFE | ||
1102 | instruction | ||
1103 | |||
1090 | config ARM_ERRATA_326103 | 1104 | config ARM_ERRATA_326103 |
1091 | bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory" | 1105 | bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory" |
1092 | depends on CPU_V6 | 1106 | depends on CPU_V6 |
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index 7652712d1d14..dba62cb1ad08 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
@@ -32,6 +32,8 @@ | |||
32 | 32 | ||
33 | #define MPIDR_HWID_BITMASK 0xFFFFFF | 33 | #define MPIDR_HWID_BITMASK 0xFFFFFF |
34 | 34 | ||
35 | #define MPIDR_INVALID (~MPIDR_HWID_BITMASK) | ||
36 | |||
35 | #define MPIDR_LEVEL_BITS 8 | 37 | #define MPIDR_LEVEL_BITS 8 |
36 | #define MPIDR_LEVEL_MASK ((1 << MPIDR_LEVEL_BITS) - 1) | 38 | #define MPIDR_LEVEL_MASK ((1 << MPIDR_LEVEL_BITS) - 1) |
37 | 39 | ||
diff --git a/arch/arm/include/asm/glue-proc.h b/arch/arm/include/asm/glue-proc.h index ac1dd54724b6..8017e94acc5e 100644 --- a/arch/arm/include/asm/glue-proc.h +++ b/arch/arm/include/asm/glue-proc.h | |||
@@ -230,6 +230,15 @@ | |||
230 | # endif | 230 | # endif |
231 | #endif | 231 | #endif |
232 | 232 | ||
233 | #ifdef CONFIG_CPU_PJ4B | ||
234 | # ifdef CPU_NAME | ||
235 | # undef MULTI_CPU | ||
236 | # define MULTI_CPU | ||
237 | # else | ||
238 | # define CPU_NAME cpu_pj4b | ||
239 | # endif | ||
240 | #endif | ||
241 | |||
233 | #ifndef MULTI_CPU | 242 | #ifndef MULTI_CPU |
234 | #define cpu_proc_init __glue(CPU_NAME,_proc_init) | 243 | #define cpu_proc_init __glue(CPU_NAME,_proc_init) |
235 | #define cpu_proc_fin __glue(CPU_NAME,_proc_fin) | 244 | #define cpu_proc_fin __glue(CPU_NAME,_proc_fin) |
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h index aaa61b6f50ff..e78983202737 100644 --- a/arch/arm/include/asm/smp_plat.h +++ b/arch/arm/include/asm/smp_plat.h | |||
@@ -49,7 +49,7 @@ static inline int cache_ops_need_broadcast(void) | |||
49 | /* | 49 | /* |
50 | * Logical CPU mapping. | 50 | * Logical CPU mapping. |
51 | */ | 51 | */ |
52 | extern int __cpu_logical_map[]; | 52 | extern u32 __cpu_logical_map[]; |
53 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] | 53 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] |
54 | /* | 54 | /* |
55 | * Retrieve logical cpu index corresponding to a given MPIDR[23:0] | 55 | * Retrieve logical cpu index corresponding to a given MPIDR[23:0] |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 5af04f6daa33..0905502bee15 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c | |||
@@ -82,7 +82,7 @@ void __init arm_dt_init_cpu_maps(void) | |||
82 | u32 i, j, cpuidx = 1; | 82 | u32 i, j, cpuidx = 1; |
83 | u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; | 83 | u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; |
84 | 84 | ||
85 | u32 tmp_map[NR_CPUS] = { [0 ... NR_CPUS-1] = UINT_MAX }; | 85 | u32 tmp_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; |
86 | bool bootcpu_valid = false; | 86 | bool bootcpu_valid = false; |
87 | cpus = of_find_node_by_path("/cpus"); | 87 | cpus = of_find_node_by_path("/cpus"); |
88 | 88 | ||
@@ -92,6 +92,9 @@ void __init arm_dt_init_cpu_maps(void) | |||
92 | for_each_child_of_node(cpus, cpu) { | 92 | for_each_child_of_node(cpus, cpu) { |
93 | u32 hwid; | 93 | u32 hwid; |
94 | 94 | ||
95 | if (of_node_cmp(cpu->type, "cpu")) | ||
96 | continue; | ||
97 | |||
95 | pr_debug(" * %s...\n", cpu->full_name); | 98 | pr_debug(" * %s...\n", cpu->full_name); |
96 | /* | 99 | /* |
97 | * A device tree containing CPU nodes with missing "reg" | 100 | * A device tree containing CPU nodes with missing "reg" |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 1522c7ae31b0..b4b1d397592b 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -444,7 +444,7 @@ void notrace cpu_init(void) | |||
444 | : "r14"); | 444 | : "r14"); |
445 | } | 445 | } |
446 | 446 | ||
447 | int __cpu_logical_map[NR_CPUS]; | 447 | u32 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; |
448 | 448 | ||
449 | void __init smp_setup_processor_id(void) | 449 | void __init smp_setup_processor_id(void) |
450 | { | 450 | { |
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index d51225f90ae2..eb5293a69a84 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c | |||
@@ -57,6 +57,12 @@ void flush_dcache_page(struct page *page) | |||
57 | } | 57 | } |
58 | EXPORT_SYMBOL(flush_dcache_page); | 58 | EXPORT_SYMBOL(flush_dcache_page); |
59 | 59 | ||
60 | void flush_kernel_dcache_page(struct page *page) | ||
61 | { | ||
62 | __cpuc_flush_dcache_area(page_address(page), PAGE_SIZE); | ||
63 | } | ||
64 | EXPORT_SYMBOL(flush_kernel_dcache_page); | ||
65 | |||
60 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, | 66 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, |
61 | unsigned long uaddr, void *dst, const void *src, | 67 | unsigned long uaddr, void *dst, const void *src, |
62 | unsigned long len) | 68 | unsigned long len) |
diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S index d217e9795d74..aaeb6c127c7a 100644 --- a/arch/arm/mm/proc-fa526.S +++ b/arch/arm/mm/proc-fa526.S | |||
@@ -81,7 +81,6 @@ ENDPROC(cpu_fa526_reset) | |||
81 | */ | 81 | */ |
82 | .align 4 | 82 | .align 4 |
83 | ENTRY(cpu_fa526_do_idle) | 83 | ENTRY(cpu_fa526_do_idle) |
84 | mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt | ||
85 | mov pc, lr | 84 | mov pc, lr |
86 | 85 | ||
87 | 86 | ||
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index f9a0aa725ea9..e3c48a3fe063 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S | |||
@@ -333,3 +333,8 @@ ENTRY(\name\()_tlb_fns) | |||
333 | .endif | 333 | .endif |
334 | .size \name\()_tlb_fns, . - \name\()_tlb_fns | 334 | .size \name\()_tlb_fns, . - \name\()_tlb_fns |
335 | .endm | 335 | .endm |
336 | |||
337 | .macro globl_equ x, y | ||
338 | .globl \x | ||
339 | .equ \x, \y | ||
340 | .endm | ||
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 4c8c9c10a388..e35fec34453e 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -140,6 +140,29 @@ ENTRY(cpu_v7_do_resume) | |||
140 | ENDPROC(cpu_v7_do_resume) | 140 | ENDPROC(cpu_v7_do_resume) |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #ifdef CONFIG_CPU_PJ4B | ||
144 | globl_equ cpu_pj4b_switch_mm, cpu_v7_switch_mm | ||
145 | globl_equ cpu_pj4b_set_pte_ext, cpu_v7_set_pte_ext | ||
146 | globl_equ cpu_pj4b_proc_init, cpu_v7_proc_init | ||
147 | globl_equ cpu_pj4b_proc_fin, cpu_v7_proc_fin | ||
148 | globl_equ cpu_pj4b_reset, cpu_v7_reset | ||
149 | #ifdef CONFIG_PJ4B_ERRATA_4742 | ||
150 | ENTRY(cpu_pj4b_do_idle) | ||
151 | dsb @ WFI may enter a low-power mode | ||
152 | wfi | ||
153 | dsb @barrier | ||
154 | mov pc, lr | ||
155 | ENDPROC(cpu_pj4b_do_idle) | ||
156 | #else | ||
157 | globl_equ cpu_pj4b_do_idle, cpu_v7_do_idle | ||
158 | #endif | ||
159 | globl_equ cpu_pj4b_dcache_clean_area, cpu_v7_dcache_clean_area | ||
160 | globl_equ cpu_pj4b_do_suspend, cpu_v7_do_suspend | ||
161 | globl_equ cpu_pj4b_do_resume, cpu_v7_do_resume | ||
162 | globl_equ cpu_pj4b_suspend_size, cpu_v7_suspend_size | ||
163 | |||
164 | #endif | ||
165 | |||
143 | __CPUINIT | 166 | __CPUINIT |
144 | 167 | ||
145 | /* | 168 | /* |
@@ -350,6 +373,9 @@ __v7_setup_stack: | |||
350 | 373 | ||
351 | @ define struct processor (see <asm/proc-fns.h> and proc-macros.S) | 374 | @ define struct processor (see <asm/proc-fns.h> and proc-macros.S) |
352 | define_processor_functions v7, dabort=v7_early_abort, pabort=v7_pabort, suspend=1 | 375 | define_processor_functions v7, dabort=v7_early_abort, pabort=v7_pabort, suspend=1 |
376 | #ifdef CONFIG_CPU_PJ4B | ||
377 | define_processor_functions pj4b, dabort=v7_early_abort, pabort=v7_pabort, suspend=1 | ||
378 | #endif | ||
353 | 379 | ||
354 | .section ".rodata" | 380 | .section ".rodata" |
355 | 381 | ||
@@ -362,7 +388,7 @@ __v7_setup_stack: | |||
362 | /* | 388 | /* |
363 | * Standard v7 proc info content | 389 | * Standard v7 proc info content |
364 | */ | 390 | */ |
365 | .macro __v7_proc initfunc, mm_mmuflags = 0, io_mmuflags = 0, hwcaps = 0 | 391 | .macro __v7_proc initfunc, mm_mmuflags = 0, io_mmuflags = 0, hwcaps = 0, proc_fns = v7_processor_functions |
366 | ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ | 392 | ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ |
367 | PMD_SECT_AF | PMD_FLAGS_SMP | \mm_mmuflags) | 393 | PMD_SECT_AF | PMD_FLAGS_SMP | \mm_mmuflags) |
368 | ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ | 394 | ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | \ |
@@ -375,7 +401,7 @@ __v7_setup_stack: | |||
375 | .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_FAST_MULT | \ | 401 | .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_FAST_MULT | \ |
376 | HWCAP_EDSP | HWCAP_TLS | \hwcaps | 402 | HWCAP_EDSP | HWCAP_TLS | \hwcaps |
377 | .long cpu_v7_name | 403 | .long cpu_v7_name |
378 | .long v7_processor_functions | 404 | .long \proc_fns |
379 | .long v7wbi_tlb_fns | 405 | .long v7wbi_tlb_fns |
380 | .long v6_user_fns | 406 | .long v6_user_fns |
381 | .long v7_cache_fns | 407 | .long v7_cache_fns |
@@ -407,12 +433,14 @@ __v7_ca9mp_proc_info: | |||
407 | /* | 433 | /* |
408 | * Marvell PJ4B processor. | 434 | * Marvell PJ4B processor. |
409 | */ | 435 | */ |
436 | #ifdef CONFIG_CPU_PJ4B | ||
410 | .type __v7_pj4b_proc_info, #object | 437 | .type __v7_pj4b_proc_info, #object |
411 | __v7_pj4b_proc_info: | 438 | __v7_pj4b_proc_info: |
412 | .long 0x560f5800 | 439 | .long 0x560f5800 |
413 | .long 0xff0fff00 | 440 | .long 0xff0fff00 |
414 | __v7_proc __v7_pj4b_setup | 441 | __v7_proc __v7_pj4b_setup, proc_fns = pj4b_processor_functions |
415 | .size __v7_pj4b_proc_info, . - __v7_pj4b_proc_info | 442 | .size __v7_pj4b_proc_info, . - __v7_pj4b_proc_info |
443 | #endif | ||
416 | 444 | ||
417 | /* | 445 | /* |
418 | * ARM Ltd. Cortex A7 processor. | 446 | * ARM Ltd. Cortex A7 processor. |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 028ac1f71b51..46ac1ddea683 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -97,22 +97,14 @@ static int fsl_indirect_read_config(struct pci_bus *bus, unsigned int devfn, | |||
97 | return indirect_read_config(bus, devfn, offset, len, val); | 97 | return indirect_read_config(bus, devfn, offset, len, val); |
98 | } | 98 | } |
99 | 99 | ||
100 | static struct pci_ops fsl_indirect_pci_ops = | 100 | #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) |
101 | |||
102 | static struct pci_ops fsl_indirect_pcie_ops = | ||
101 | { | 103 | { |
102 | .read = fsl_indirect_read_config, | 104 | .read = fsl_indirect_read_config, |
103 | .write = indirect_write_config, | 105 | .write = indirect_write_config, |
104 | }; | 106 | }; |
105 | 107 | ||
106 | static void __init fsl_setup_indirect_pci(struct pci_controller* hose, | ||
107 | resource_size_t cfg_addr, | ||
108 | resource_size_t cfg_data, u32 flags) | ||
109 | { | ||
110 | setup_indirect_pci(hose, cfg_addr, cfg_data, flags); | ||
111 | hose->ops = &fsl_indirect_pci_ops; | ||
112 | } | ||
113 | |||
114 | #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) | ||
115 | |||
116 | #define MAX_PHYS_ADDR_BITS 40 | 108 | #define MAX_PHYS_ADDR_BITS 40 |
117 | static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS; | 109 | static u64 pci64_dma_offset = 1ull << MAX_PHYS_ADDR_BITS; |
118 | 110 | ||
@@ -504,13 +496,15 @@ int __init fsl_add_bridge(struct platform_device *pdev, int is_primary) | |||
504 | if (!hose->private_data) | 496 | if (!hose->private_data) |
505 | goto no_bridge; | 497 | goto no_bridge; |
506 | 498 | ||
507 | fsl_setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4, | 499 | setup_indirect_pci(hose, rsrc.start, rsrc.start + 0x4, |
508 | PPC_INDIRECT_TYPE_BIG_ENDIAN); | 500 | PPC_INDIRECT_TYPE_BIG_ENDIAN); |
509 | 501 | ||
510 | if (in_be32(&pci->block_rev1) < PCIE_IP_REV_3_0) | 502 | if (in_be32(&pci->block_rev1) < PCIE_IP_REV_3_0) |
511 | hose->indirect_type |= PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK; | 503 | hose->indirect_type |= PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK; |
512 | 504 | ||
513 | if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { | 505 | if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { |
506 | /* use fsl_indirect_read_config for PCIe */ | ||
507 | hose->ops = &fsl_indirect_pcie_ops; | ||
514 | /* For PCIE read HEADER_TYPE to identify controler mode */ | 508 | /* For PCIE read HEADER_TYPE to identify controler mode */ |
515 | early_read_config_byte(hose, 0, 0, PCI_HEADER_TYPE, &hdr_type); | 509 | early_read_config_byte(hose, 0, 0, PCI_HEADER_TYPE, &hdr_type); |
516 | if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE) | 510 | if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE) |
@@ -814,8 +808,8 @@ int __init mpc83xx_add_bridge(struct device_node *dev) | |||
814 | if (ret) | 808 | if (ret) |
815 | goto err0; | 809 | goto err0; |
816 | } else { | 810 | } else { |
817 | fsl_setup_indirect_pci(hose, rsrc_cfg.start, | 811 | setup_indirect_pci(hose, rsrc_cfg.start, |
818 | rsrc_cfg.start + 4, 0); | 812 | rsrc_cfg.start + 4, 0); |
819 | } | 813 | } |
820 | 814 | ||
821 | printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. " | 815 | printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. " |
diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h index 886ac7d4937a..2f8c1abeb086 100644 --- a/arch/s390/include/asm/dma-mapping.h +++ b/arch/s390/include/asm/dma-mapping.h | |||
@@ -50,9 +50,10 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
50 | { | 50 | { |
51 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 51 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
52 | 52 | ||
53 | debug_dma_mapping_error(dev, dma_addr); | ||
53 | if (dma_ops->mapping_error) | 54 | if (dma_ops->mapping_error) |
54 | return dma_ops->mapping_error(dev, dma_addr); | 55 | return dma_ops->mapping_error(dev, dma_addr); |
55 | return (dma_addr == 0UL); | 56 | return (dma_addr == DMA_ERROR_CODE); |
56 | } | 57 | } |
57 | 58 | ||
58 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 59 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index d8a6a385d048..feb719d3c851 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -754,9 +754,9 @@ static struct bin_attribute sys_reipl_fcp_scp_data_attr = { | |||
754 | .write = reipl_fcp_scpdata_write, | 754 | .write = reipl_fcp_scpdata_write, |
755 | }; | 755 | }; |
756 | 756 | ||
757 | DEFINE_IPL_ATTR_RW(reipl_fcp, wwpn, "0x%016llx\n", "%016llx\n", | 757 | DEFINE_IPL_ATTR_RW(reipl_fcp, wwpn, "0x%016llx\n", "%llx\n", |
758 | reipl_block_fcp->ipl_info.fcp.wwpn); | 758 | reipl_block_fcp->ipl_info.fcp.wwpn); |
759 | DEFINE_IPL_ATTR_RW(reipl_fcp, lun, "0x%016llx\n", "%016llx\n", | 759 | DEFINE_IPL_ATTR_RW(reipl_fcp, lun, "0x%016llx\n", "%llx\n", |
760 | reipl_block_fcp->ipl_info.fcp.lun); | 760 | reipl_block_fcp->ipl_info.fcp.lun); |
761 | DEFINE_IPL_ATTR_RW(reipl_fcp, bootprog, "%lld\n", "%lld\n", | 761 | DEFINE_IPL_ATTR_RW(reipl_fcp, bootprog, "%lld\n", "%lld\n", |
762 | reipl_block_fcp->ipl_info.fcp.bootprog); | 762 | reipl_block_fcp->ipl_info.fcp.bootprog); |
@@ -1323,9 +1323,9 @@ static struct shutdown_action __refdata reipl_action = { | |||
1323 | 1323 | ||
1324 | /* FCP dump device attributes */ | 1324 | /* FCP dump device attributes */ |
1325 | 1325 | ||
1326 | DEFINE_IPL_ATTR_RW(dump_fcp, wwpn, "0x%016llx\n", "%016llx\n", | 1326 | DEFINE_IPL_ATTR_RW(dump_fcp, wwpn, "0x%016llx\n", "%llx\n", |
1327 | dump_block_fcp->ipl_info.fcp.wwpn); | 1327 | dump_block_fcp->ipl_info.fcp.wwpn); |
1328 | DEFINE_IPL_ATTR_RW(dump_fcp, lun, "0x%016llx\n", "%016llx\n", | 1328 | DEFINE_IPL_ATTR_RW(dump_fcp, lun, "0x%016llx\n", "%llx\n", |
1329 | dump_block_fcp->ipl_info.fcp.lun); | 1329 | dump_block_fcp->ipl_info.fcp.lun); |
1330 | DEFINE_IPL_ATTR_RW(dump_fcp, bootprog, "%lld\n", "%lld\n", | 1330 | DEFINE_IPL_ATTR_RW(dump_fcp, bootprog, "%lld\n", "%lld\n", |
1331 | dump_block_fcp->ipl_info.fcp.bootprog); | 1331 | dump_block_fcp->ipl_info.fcp.bootprog); |
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 408e866ae548..dd3c1994b8bd 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
@@ -312,6 +312,7 @@ void measurement_alert_subclass_unregister(void) | |||
312 | } | 312 | } |
313 | EXPORT_SYMBOL(measurement_alert_subclass_unregister); | 313 | EXPORT_SYMBOL(measurement_alert_subclass_unregister); |
314 | 314 | ||
315 | #ifdef CONFIG_SMP | ||
315 | void synchronize_irq(unsigned int irq) | 316 | void synchronize_irq(unsigned int irq) |
316 | { | 317 | { |
317 | /* | 318 | /* |
@@ -320,6 +321,7 @@ void synchronize_irq(unsigned int irq) | |||
320 | */ | 321 | */ |
321 | } | 322 | } |
322 | EXPORT_SYMBOL_GPL(synchronize_irq); | 323 | EXPORT_SYMBOL_GPL(synchronize_irq); |
324 | #endif | ||
323 | 325 | ||
324 | #ifndef CONFIG_PCI | 326 | #ifndef CONFIG_PCI |
325 | 327 | ||
diff --git a/arch/s390/mm/mem_detect.c b/arch/s390/mm/mem_detect.c index 3cbd3b8bf311..cca388253a39 100644 --- a/arch/s390/mm/mem_detect.c +++ b/arch/s390/mm/mem_detect.c | |||
@@ -123,7 +123,8 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr, | |||
123 | continue; | 123 | continue; |
124 | } else if ((addr <= chunk->addr) && | 124 | } else if ((addr <= chunk->addr) && |
125 | (addr + size >= chunk->addr + chunk->size)) { | 125 | (addr + size >= chunk->addr + chunk->size)) { |
126 | memset(chunk, 0 , sizeof(*chunk)); | 126 | memmove(chunk, chunk + 1, (MEMORY_CHUNKS-i-1) * sizeof(*chunk)); |
127 | memset(&mem_chunk[MEMORY_CHUNKS-1], 0, sizeof(*chunk)); | ||
127 | } else if (addr + size < chunk->addr + chunk->size) { | 128 | } else if (addr + size < chunk->addr + chunk->size) { |
128 | chunk->size = chunk->addr + chunk->size - addr - size; | 129 | chunk->size = chunk->addr + chunk->size - addr - size; |
129 | chunk->addr = addr + size; | 130 | chunk->addr = addr + size; |
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 9895a9a41380..211bce445522 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c | |||
@@ -365,10 +365,14 @@ int __kprobes __copy_instruction(u8 *dest, u8 *src) | |||
365 | return insn.length; | 365 | return insn.length; |
366 | } | 366 | } |
367 | 367 | ||
368 | static void __kprobes arch_copy_kprobe(struct kprobe *p) | 368 | static int __kprobes arch_copy_kprobe(struct kprobe *p) |
369 | { | 369 | { |
370 | int ret; | ||
371 | |||
370 | /* Copy an instruction with recovering if other optprobe modifies it.*/ | 372 | /* Copy an instruction with recovering if other optprobe modifies it.*/ |
371 | __copy_instruction(p->ainsn.insn, p->addr); | 373 | ret = __copy_instruction(p->ainsn.insn, p->addr); |
374 | if (!ret) | ||
375 | return -EINVAL; | ||
372 | 376 | ||
373 | /* | 377 | /* |
374 | * __copy_instruction can modify the displacement of the instruction, | 378 | * __copy_instruction can modify the displacement of the instruction, |
@@ -384,6 +388,8 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p) | |||
384 | 388 | ||
385 | /* Also, displacement change doesn't affect the first byte */ | 389 | /* Also, displacement change doesn't affect the first byte */ |
386 | p->opcode = p->ainsn.insn[0]; | 390 | p->opcode = p->ainsn.insn[0]; |
391 | |||
392 | return 0; | ||
387 | } | 393 | } |
388 | 394 | ||
389 | int __kprobes arch_prepare_kprobe(struct kprobe *p) | 395 | int __kprobes arch_prepare_kprobe(struct kprobe *p) |
@@ -397,8 +403,8 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
397 | p->ainsn.insn = get_insn_slot(); | 403 | p->ainsn.insn = get_insn_slot(); |
398 | if (!p->ainsn.insn) | 404 | if (!p->ainsn.insn) |
399 | return -ENOMEM; | 405 | return -ENOMEM; |
400 | arch_copy_kprobe(p); | 406 | |
401 | return 0; | 407 | return arch_copy_kprobe(p); |
402 | } | 408 | } |
403 | 409 | ||
404 | void __kprobes arch_arm_kprobe(struct kprobe *p) | 410 | void __kprobes arch_arm_kprobe(struct kprobe *p) |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index ec117c6c996c..14de9f46972e 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -66,20 +66,21 @@ struct dock_station { | |||
66 | spinlock_t dd_lock; | 66 | spinlock_t dd_lock; |
67 | struct mutex hp_lock; | 67 | struct mutex hp_lock; |
68 | struct list_head dependent_devices; | 68 | struct list_head dependent_devices; |
69 | struct list_head hotplug_devices; | ||
70 | 69 | ||
71 | struct list_head sibling; | 70 | struct list_head sibling; |
72 | struct platform_device *dock_device; | 71 | struct platform_device *dock_device; |
73 | }; | 72 | }; |
74 | static LIST_HEAD(dock_stations); | 73 | static LIST_HEAD(dock_stations); |
75 | static int dock_station_count; | 74 | static int dock_station_count; |
75 | static DEFINE_MUTEX(hotplug_lock); | ||
76 | 76 | ||
77 | struct dock_dependent_device { | 77 | struct dock_dependent_device { |
78 | struct list_head list; | 78 | struct list_head list; |
79 | struct list_head hotplug_list; | ||
80 | acpi_handle handle; | 79 | acpi_handle handle; |
81 | const struct acpi_dock_ops *ops; | 80 | const struct acpi_dock_ops *hp_ops; |
82 | void *context; | 81 | void *hp_context; |
82 | unsigned int hp_refcount; | ||
83 | void (*hp_release)(void *); | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | #define DOCK_DOCKING 0x00000001 | 86 | #define DOCK_DOCKING 0x00000001 |
@@ -111,7 +112,6 @@ add_dock_dependent_device(struct dock_station *ds, acpi_handle handle) | |||
111 | 112 | ||
112 | dd->handle = handle; | 113 | dd->handle = handle; |
113 | INIT_LIST_HEAD(&dd->list); | 114 | INIT_LIST_HEAD(&dd->list); |
114 | INIT_LIST_HEAD(&dd->hotplug_list); | ||
115 | 115 | ||
116 | spin_lock(&ds->dd_lock); | 116 | spin_lock(&ds->dd_lock); |
117 | list_add_tail(&dd->list, &ds->dependent_devices); | 117 | list_add_tail(&dd->list, &ds->dependent_devices); |
@@ -121,35 +121,90 @@ add_dock_dependent_device(struct dock_station *ds, acpi_handle handle) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * dock_add_hotplug_device - associate a hotplug handler with the dock station | 124 | * dock_init_hotplug - Initialize a hotplug device on a docking station. |
125 | * @ds: The dock station | 125 | * @dd: Dock-dependent device. |
126 | * @dd: The dependent device struct | 126 | * @ops: Dock operations to attach to the dependent device. |
127 | * | 127 | * @context: Data to pass to the @ops callbacks and @release. |
128 | * Add the dependent device to the dock's hotplug device list | 128 | * @init: Optional initialization routine to run after setting up context. |
129 | * @release: Optional release routine to run on removal. | ||
129 | */ | 130 | */ |
130 | static void | 131 | static int dock_init_hotplug(struct dock_dependent_device *dd, |
131 | dock_add_hotplug_device(struct dock_station *ds, | 132 | const struct acpi_dock_ops *ops, void *context, |
132 | struct dock_dependent_device *dd) | 133 | void (*init)(void *), void (*release)(void *)) |
133 | { | 134 | { |
134 | mutex_lock(&ds->hp_lock); | 135 | int ret = 0; |
135 | list_add_tail(&dd->hotplug_list, &ds->hotplug_devices); | 136 | |
136 | mutex_unlock(&ds->hp_lock); | 137 | mutex_lock(&hotplug_lock); |
138 | |||
139 | if (dd->hp_context) { | ||
140 | ret = -EEXIST; | ||
141 | } else { | ||
142 | dd->hp_refcount = 1; | ||
143 | dd->hp_ops = ops; | ||
144 | dd->hp_context = context; | ||
145 | dd->hp_release = release; | ||
146 | } | ||
147 | |||
148 | if (!WARN_ON(ret) && init) | ||
149 | init(context); | ||
150 | |||
151 | mutex_unlock(&hotplug_lock); | ||
152 | return ret; | ||
137 | } | 153 | } |
138 | 154 | ||
139 | /** | 155 | /** |
140 | * dock_del_hotplug_device - remove a hotplug handler from the dock station | 156 | * dock_release_hotplug - Decrement hotplug reference counter of dock device. |
141 | * @ds: The dock station | 157 | * @dd: Dock-dependent device. |
142 | * @dd: the dependent device struct | ||
143 | * | 158 | * |
144 | * Delete the dependent device from the dock's hotplug device list | 159 | * Decrement the reference counter of @dd and if 0, detach its hotplug |
160 | * operations from it, reset its context pointer and run the optional release | ||
161 | * routine if present. | ||
145 | */ | 162 | */ |
146 | static void | 163 | static void dock_release_hotplug(struct dock_dependent_device *dd) |
147 | dock_del_hotplug_device(struct dock_station *ds, | ||
148 | struct dock_dependent_device *dd) | ||
149 | { | 164 | { |
150 | mutex_lock(&ds->hp_lock); | 165 | void (*release)(void *) = NULL; |
151 | list_del(&dd->hotplug_list); | 166 | void *context = NULL; |
152 | mutex_unlock(&ds->hp_lock); | 167 | |
168 | mutex_lock(&hotplug_lock); | ||
169 | |||
170 | if (dd->hp_context && !--dd->hp_refcount) { | ||
171 | dd->hp_ops = NULL; | ||
172 | context = dd->hp_context; | ||
173 | dd->hp_context = NULL; | ||
174 | release = dd->hp_release; | ||
175 | dd->hp_release = NULL; | ||
176 | } | ||
177 | |||
178 | if (release && context) | ||
179 | release(context); | ||
180 | |||
181 | mutex_unlock(&hotplug_lock); | ||
182 | } | ||
183 | |||
184 | static void dock_hotplug_event(struct dock_dependent_device *dd, u32 event, | ||
185 | bool uevent) | ||
186 | { | ||
187 | acpi_notify_handler cb = NULL; | ||
188 | bool run = false; | ||
189 | |||
190 | mutex_lock(&hotplug_lock); | ||
191 | |||
192 | if (dd->hp_context) { | ||
193 | run = true; | ||
194 | dd->hp_refcount++; | ||
195 | if (dd->hp_ops) | ||
196 | cb = uevent ? dd->hp_ops->uevent : dd->hp_ops->handler; | ||
197 | } | ||
198 | |||
199 | mutex_unlock(&hotplug_lock); | ||
200 | |||
201 | if (!run) | ||
202 | return; | ||
203 | |||
204 | if (cb) | ||
205 | cb(dd->handle, event, dd->hp_context); | ||
206 | |||
207 | dock_release_hotplug(dd); | ||
153 | } | 208 | } |
154 | 209 | ||
155 | /** | 210 | /** |
@@ -360,9 +415,8 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event) | |||
360 | /* | 415 | /* |
361 | * First call driver specific hotplug functions | 416 | * First call driver specific hotplug functions |
362 | */ | 417 | */ |
363 | list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list) | 418 | list_for_each_entry(dd, &ds->dependent_devices, list) |
364 | if (dd->ops && dd->ops->handler) | 419 | dock_hotplug_event(dd, event, false); |
365 | dd->ops->handler(dd->handle, event, dd->context); | ||
366 | 420 | ||
367 | /* | 421 | /* |
368 | * Now make sure that an acpi_device is created for each | 422 | * Now make sure that an acpi_device is created for each |
@@ -398,9 +452,8 @@ static void dock_event(struct dock_station *ds, u32 event, int num) | |||
398 | if (num == DOCK_EVENT) | 452 | if (num == DOCK_EVENT) |
399 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); | 453 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); |
400 | 454 | ||
401 | list_for_each_entry(dd, &ds->hotplug_devices, hotplug_list) | 455 | list_for_each_entry(dd, &ds->dependent_devices, list) |
402 | if (dd->ops && dd->ops->uevent) | 456 | dock_hotplug_event(dd, event, true); |
403 | dd->ops->uevent(dd->handle, event, dd->context); | ||
404 | 457 | ||
405 | if (num != DOCK_EVENT) | 458 | if (num != DOCK_EVENT) |
406 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); | 459 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); |
@@ -570,19 +623,24 @@ EXPORT_SYMBOL_GPL(unregister_dock_notifier); | |||
570 | * @handle: the handle of the device | 623 | * @handle: the handle of the device |
571 | * @ops: handlers to call after docking | 624 | * @ops: handlers to call after docking |
572 | * @context: device specific data | 625 | * @context: device specific data |
626 | * @init: Optional initialization routine to run after registration | ||
627 | * @release: Optional release routine to run on unregistration | ||
573 | * | 628 | * |
574 | * If a driver would like to perform a hotplug operation after a dock | 629 | * If a driver would like to perform a hotplug operation after a dock |
575 | * event, they can register an acpi_notifiy_handler to be called by | 630 | * event, they can register an acpi_notifiy_handler to be called by |
576 | * the dock driver after _DCK is executed. | 631 | * the dock driver after _DCK is executed. |
577 | */ | 632 | */ |
578 | int | 633 | int register_hotplug_dock_device(acpi_handle handle, |
579 | register_hotplug_dock_device(acpi_handle handle, const struct acpi_dock_ops *ops, | 634 | const struct acpi_dock_ops *ops, void *context, |
580 | void *context) | 635 | void (*init)(void *), void (*release)(void *)) |
581 | { | 636 | { |
582 | struct dock_dependent_device *dd; | 637 | struct dock_dependent_device *dd; |
583 | struct dock_station *dock_station; | 638 | struct dock_station *dock_station; |
584 | int ret = -EINVAL; | 639 | int ret = -EINVAL; |
585 | 640 | ||
641 | if (WARN_ON(!context)) | ||
642 | return -EINVAL; | ||
643 | |||
586 | if (!dock_station_count) | 644 | if (!dock_station_count) |
587 | return -ENODEV; | 645 | return -ENODEV; |
588 | 646 | ||
@@ -597,12 +655,8 @@ register_hotplug_dock_device(acpi_handle handle, const struct acpi_dock_ops *ops | |||
597 | * ops | 655 | * ops |
598 | */ | 656 | */ |
599 | dd = find_dock_dependent_device(dock_station, handle); | 657 | dd = find_dock_dependent_device(dock_station, handle); |
600 | if (dd) { | 658 | if (dd && !dock_init_hotplug(dd, ops, context, init, release)) |
601 | dd->ops = ops; | ||
602 | dd->context = context; | ||
603 | dock_add_hotplug_device(dock_station, dd); | ||
604 | ret = 0; | 659 | ret = 0; |
605 | } | ||
606 | } | 660 | } |
607 | 661 | ||
608 | return ret; | 662 | return ret; |
@@ -624,7 +678,7 @@ void unregister_hotplug_dock_device(acpi_handle handle) | |||
624 | list_for_each_entry(dock_station, &dock_stations, sibling) { | 678 | list_for_each_entry(dock_station, &dock_stations, sibling) { |
625 | dd = find_dock_dependent_device(dock_station, handle); | 679 | dd = find_dock_dependent_device(dock_station, handle); |
626 | if (dd) | 680 | if (dd) |
627 | dock_del_hotplug_device(dock_station, dd); | 681 | dock_release_hotplug(dd); |
628 | } | 682 | } |
629 | } | 683 | } |
630 | EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device); | 684 | EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device); |
@@ -953,7 +1007,6 @@ static int __init dock_add(acpi_handle handle) | |||
953 | mutex_init(&dock_station->hp_lock); | 1007 | mutex_init(&dock_station->hp_lock); |
954 | spin_lock_init(&dock_station->dd_lock); | 1008 | spin_lock_init(&dock_station->dd_lock); |
955 | INIT_LIST_HEAD(&dock_station->sibling); | 1009 | INIT_LIST_HEAD(&dock_station->sibling); |
956 | INIT_LIST_HEAD(&dock_station->hotplug_devices); | ||
957 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); | 1010 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); |
958 | INIT_LIST_HEAD(&dock_station->dependent_devices); | 1011 | INIT_LIST_HEAD(&dock_station->dependent_devices); |
959 | 1012 | ||
@@ -994,30 +1047,6 @@ err_unregister: | |||
994 | } | 1047 | } |
995 | 1048 | ||
996 | /** | 1049 | /** |
997 | * dock_remove - free up resources related to the dock station | ||
998 | */ | ||
999 | static int dock_remove(struct dock_station *ds) | ||
1000 | { | ||
1001 | struct dock_dependent_device *dd, *tmp; | ||
1002 | struct platform_device *dock_device = ds->dock_device; | ||
1003 | |||
1004 | if (!dock_station_count) | ||
1005 | return 0; | ||
1006 | |||
1007 | /* remove dependent devices */ | ||
1008 | list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list) | ||
1009 | kfree(dd); | ||
1010 | |||
1011 | list_del(&ds->sibling); | ||
1012 | |||
1013 | /* cleanup sysfs */ | ||
1014 | sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group); | ||
1015 | platform_device_unregister(dock_device); | ||
1016 | |||
1017 | return 0; | ||
1018 | } | ||
1019 | |||
1020 | /** | ||
1021 | * find_dock_and_bay - look for dock stations and bays | 1050 | * find_dock_and_bay - look for dock stations and bays |
1022 | * @handle: acpi handle of a device | 1051 | * @handle: acpi handle of a device |
1023 | * @lvl: unused | 1052 | * @lvl: unused |
@@ -1035,7 +1064,7 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
1035 | return AE_OK; | 1064 | return AE_OK; |
1036 | } | 1065 | } |
1037 | 1066 | ||
1038 | static int __init dock_init(void) | 1067 | int __init acpi_dock_init(void) |
1039 | { | 1068 | { |
1040 | if (acpi_disabled) | 1069 | if (acpi_disabled) |
1041 | return 0; | 1070 | return 0; |
@@ -1054,19 +1083,3 @@ static int __init dock_init(void) | |||
1054 | ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count); | 1083 | ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count); |
1055 | return 0; | 1084 | return 0; |
1056 | } | 1085 | } |
1057 | |||
1058 | static void __exit dock_exit(void) | ||
1059 | { | ||
1060 | struct dock_station *tmp, *dock_station; | ||
1061 | |||
1062 | unregister_acpi_bus_notifier(&dock_acpi_notifier); | ||
1063 | list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling) | ||
1064 | dock_remove(dock_station); | ||
1065 | } | ||
1066 | |||
1067 | /* | ||
1068 | * Must be called before drivers of devices in dock, otherwise we can't know | ||
1069 | * which devices are in a dock | ||
1070 | */ | ||
1071 | subsys_initcall(dock_init); | ||
1072 | module_exit(dock_exit); | ||
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 297cbf456f86..c610a76d92c4 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -40,6 +40,11 @@ void acpi_container_init(void); | |||
40 | #else | 40 | #else |
41 | static inline void acpi_container_init(void) {} | 41 | static inline void acpi_container_init(void) {} |
42 | #endif | 42 | #endif |
43 | #ifdef CONFIG_ACPI_DOCK | ||
44 | void acpi_dock_init(void); | ||
45 | #else | ||
46 | static inline void acpi_dock_init(void) {} | ||
47 | #endif | ||
43 | #ifdef CONFIG_ACPI_HOTPLUG_MEMORY | 48 | #ifdef CONFIG_ACPI_HOTPLUG_MEMORY |
44 | void acpi_memory_hotplug_init(void); | 49 | void acpi_memory_hotplug_init(void); |
45 | #else | 50 | #else |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index b14ac46948c9..27da63061e11 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -2042,6 +2042,7 @@ int __init acpi_scan_init(void) | |||
2042 | acpi_lpss_init(); | 2042 | acpi_lpss_init(); |
2043 | acpi_container_init(); | 2043 | acpi_container_init(); |
2044 | acpi_memory_hotplug_init(); | 2044 | acpi_memory_hotplug_init(); |
2045 | acpi_dock_init(); | ||
2045 | 2046 | ||
2046 | mutex_lock(&acpi_scan_lock); | 2047 | mutex_lock(&acpi_scan_lock); |
2047 | /* | 2048 | /* |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 87f2f395d79a..cf4e7020adac 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -156,8 +156,10 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, | |||
156 | 156 | ||
157 | spin_unlock_irqrestore(ap->lock, flags); | 157 | spin_unlock_irqrestore(ap->lock, flags); |
158 | 158 | ||
159 | if (wait) | 159 | if (wait) { |
160 | ata_port_wait_eh(ap); | 160 | ata_port_wait_eh(ap); |
161 | flush_work(&ap->hotplug_task.work); | ||
162 | } | ||
161 | } | 163 | } |
162 | 164 | ||
163 | static void ata_acpi_dev_notify_dock(acpi_handle handle, u32 event, void *data) | 165 | static void ata_acpi_dev_notify_dock(acpi_handle handle, u32 event, void *data) |
@@ -214,6 +216,39 @@ static const struct acpi_dock_ops ata_acpi_ap_dock_ops = { | |||
214 | .uevent = ata_acpi_ap_uevent, | 216 | .uevent = ata_acpi_ap_uevent, |
215 | }; | 217 | }; |
216 | 218 | ||
219 | void ata_acpi_hotplug_init(struct ata_host *host) | ||
220 | { | ||
221 | int i; | ||
222 | |||
223 | for (i = 0; i < host->n_ports; i++) { | ||
224 | struct ata_port *ap = host->ports[i]; | ||
225 | acpi_handle handle; | ||
226 | struct ata_device *dev; | ||
227 | |||
228 | if (!ap) | ||
229 | continue; | ||
230 | |||
231 | handle = ata_ap_acpi_handle(ap); | ||
232 | if (handle) { | ||
233 | /* we might be on a docking station */ | ||
234 | register_hotplug_dock_device(handle, | ||
235 | &ata_acpi_ap_dock_ops, ap, | ||
236 | NULL, NULL); | ||
237 | } | ||
238 | |||
239 | ata_for_each_dev(dev, &ap->link, ALL) { | ||
240 | handle = ata_dev_acpi_handle(dev); | ||
241 | if (!handle) | ||
242 | continue; | ||
243 | |||
244 | /* we might be on a docking station */ | ||
245 | register_hotplug_dock_device(handle, | ||
246 | &ata_acpi_dev_dock_ops, | ||
247 | dev, NULL, NULL); | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | |||
217 | /** | 252 | /** |
218 | * ata_acpi_dissociate - dissociate ATA host from ACPI objects | 253 | * ata_acpi_dissociate - dissociate ATA host from ACPI objects |
219 | * @host: target ATA host | 254 | * @host: target ATA host |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f2184276539d..adf002a3c584 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -6148,6 +6148,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
6148 | if (rc) | 6148 | if (rc) |
6149 | goto err_tadd; | 6149 | goto err_tadd; |
6150 | 6150 | ||
6151 | ata_acpi_hotplug_init(host); | ||
6152 | |||
6151 | /* set cable, sata_spd_limit and report */ | 6153 | /* set cable, sata_spd_limit and report */ |
6152 | for (i = 0; i < host->n_ports; i++) { | 6154 | for (i = 0; i < host->n_ports; i++) { |
6153 | struct ata_port *ap = host->ports[i]; | 6155 | struct ata_port *ap = host->ports[i]; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index c949dd311b2e..577d902bc4de 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -122,6 +122,7 @@ extern int ata_acpi_register(void); | |||
122 | extern void ata_acpi_unregister(void); | 122 | extern void ata_acpi_unregister(void); |
123 | extern void ata_acpi_bind(struct ata_device *dev); | 123 | extern void ata_acpi_bind(struct ata_device *dev); |
124 | extern void ata_acpi_unbind(struct ata_device *dev); | 124 | extern void ata_acpi_unbind(struct ata_device *dev); |
125 | extern void ata_acpi_hotplug_init(struct ata_host *host); | ||
125 | #else | 126 | #else |
126 | static inline void ata_acpi_dissociate(struct ata_host *host) { } | 127 | static inline void ata_acpi_dissociate(struct ata_host *host) { } |
127 | static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; } | 128 | static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; } |
@@ -134,6 +135,7 @@ static inline int ata_acpi_register(void) { return 0; } | |||
134 | static inline void ata_acpi_unregister(void) { } | 135 | static inline void ata_acpi_unregister(void) { } |
135 | static inline void ata_acpi_bind(struct ata_device *dev) { } | 136 | static inline void ata_acpi_bind(struct ata_device *dev) { } |
136 | static inline void ata_acpi_unbind(struct ata_device *dev) { } | 137 | static inline void ata_acpi_unbind(struct ata_device *dev) { } |
138 | static inline void ata_acpi_hotplug_init(struct ata_host *host) {} | ||
137 | #endif | 139 | #endif |
138 | 140 | ||
139 | /* libata-scsi.c */ | 141 | /* libata-scsi.c */ |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 49394e3f31bc..247bf3099731 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -4243,6 +4243,10 @@ static int rbd_dev_v2_header_info(struct rbd_device *rbd_dev) | |||
4243 | 4243 | ||
4244 | down_write(&rbd_dev->header_rwsem); | 4244 | down_write(&rbd_dev->header_rwsem); |
4245 | 4245 | ||
4246 | ret = rbd_dev_v2_image_size(rbd_dev); | ||
4247 | if (ret) | ||
4248 | goto out; | ||
4249 | |||
4246 | if (first_time) { | 4250 | if (first_time) { |
4247 | ret = rbd_dev_v2_header_onetime(rbd_dev); | 4251 | ret = rbd_dev_v2_header_onetime(rbd_dev); |
4248 | if (ret) | 4252 | if (ret) |
@@ -4276,10 +4280,6 @@ static int rbd_dev_v2_header_info(struct rbd_device *rbd_dev) | |||
4276 | "is EXPERIMENTAL!"); | 4280 | "is EXPERIMENTAL!"); |
4277 | } | 4281 | } |
4278 | 4282 | ||
4279 | ret = rbd_dev_v2_image_size(rbd_dev); | ||
4280 | if (ret) | ||
4281 | goto out; | ||
4282 | |||
4283 | if (rbd_dev->spec->snap_id == CEPH_NOSNAP) | 4283 | if (rbd_dev->spec->snap_id == CEPH_NOSNAP) |
4284 | if (rbd_dev->mapping.size != rbd_dev->header.image_size) | 4284 | if (rbd_dev->mapping.size != rbd_dev->header.image_size) |
4285 | rbd_dev->mapping.size = rbd_dev->header.image_size; | 4285 | rbd_dev->mapping.size = rbd_dev->header.image_size; |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 4b9bb5def6f1..93eb5cbcc1f6 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -47,6 +47,8 @@ static struct od_ops od_ops; | |||
47 | static struct cpufreq_governor cpufreq_gov_ondemand; | 47 | static struct cpufreq_governor cpufreq_gov_ondemand; |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | static unsigned int default_powersave_bias; | ||
51 | |||
50 | static void ondemand_powersave_bias_init_cpu(int cpu) | 52 | static void ondemand_powersave_bias_init_cpu(int cpu) |
51 | { | 53 | { |
52 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); | 54 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); |
@@ -543,7 +545,7 @@ static int od_init(struct dbs_data *dbs_data) | |||
543 | 545 | ||
544 | tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR; | 546 | tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR; |
545 | tuners->ignore_nice = 0; | 547 | tuners->ignore_nice = 0; |
546 | tuners->powersave_bias = 0; | 548 | tuners->powersave_bias = default_powersave_bias; |
547 | tuners->io_is_busy = should_io_be_busy(); | 549 | tuners->io_is_busy = should_io_be_busy(); |
548 | 550 | ||
549 | dbs_data->tuners = tuners; | 551 | dbs_data->tuners = tuners; |
@@ -585,6 +587,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias) | |||
585 | unsigned int cpu; | 587 | unsigned int cpu; |
586 | cpumask_t done; | 588 | cpumask_t done; |
587 | 589 | ||
590 | default_powersave_bias = powersave_bias; | ||
588 | cpumask_clear(&done); | 591 | cpumask_clear(&done); |
589 | 592 | ||
590 | get_online_cpus(); | 593 | get_online_cpus(); |
@@ -593,11 +596,17 @@ static void od_set_powersave_bias(unsigned int powersave_bias) | |||
593 | continue; | 596 | continue; |
594 | 597 | ||
595 | policy = per_cpu(od_cpu_dbs_info, cpu).cdbs.cur_policy; | 598 | policy = per_cpu(od_cpu_dbs_info, cpu).cdbs.cur_policy; |
596 | dbs_data = policy->governor_data; | 599 | if (!policy) |
597 | od_tuners = dbs_data->tuners; | 600 | continue; |
598 | od_tuners->powersave_bias = powersave_bias; | ||
599 | 601 | ||
600 | cpumask_or(&done, &done, policy->cpus); | 602 | cpumask_or(&done, &done, policy->cpus); |
603 | |||
604 | if (policy->governor != &cpufreq_gov_ondemand) | ||
605 | continue; | ||
606 | |||
607 | dbs_data = policy->governor_data; | ||
608 | od_tuners = dbs_data->tuners; | ||
609 | od_tuners->powersave_bias = default_powersave_bias; | ||
601 | } | 610 | } |
602 | put_online_cpus(); | 611 | put_online_cpus(); |
603 | } | 612 | } |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d3f7d2db870f..4a430360af5a 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1094,6 +1094,9 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
1094 | const struct omap_gpio_platform_data *pdata; | 1094 | const struct omap_gpio_platform_data *pdata; |
1095 | struct resource *res; | 1095 | struct resource *res; |
1096 | struct gpio_bank *bank; | 1096 | struct gpio_bank *bank; |
1097 | #ifdef CONFIG_ARCH_OMAP1 | ||
1098 | int irq_base; | ||
1099 | #endif | ||
1097 | 1100 | ||
1098 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); | 1101 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); |
1099 | 1102 | ||
@@ -1135,11 +1138,28 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
1135 | pdata->get_context_loss_count; | 1138 | pdata->get_context_loss_count; |
1136 | } | 1139 | } |
1137 | 1140 | ||
1141 | #ifdef CONFIG_ARCH_OMAP1 | ||
1142 | /* | ||
1143 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop | ||
1144 | * irq_alloc_descs() and irq_domain_add_legacy() and just use a | ||
1145 | * linear IRQ domain mapping for all OMAP platforms. | ||
1146 | */ | ||
1147 | irq_base = irq_alloc_descs(-1, 0, bank->width, 0); | ||
1148 | if (irq_base < 0) { | ||
1149 | dev_err(dev, "Couldn't allocate IRQ numbers\n"); | ||
1150 | return -ENODEV; | ||
1151 | } | ||
1138 | 1152 | ||
1153 | bank->domain = irq_domain_add_legacy(node, bank->width, irq_base, | ||
1154 | 0, &irq_domain_simple_ops, NULL); | ||
1155 | #else | ||
1139 | bank->domain = irq_domain_add_linear(node, bank->width, | 1156 | bank->domain = irq_domain_add_linear(node, bank->width, |
1140 | &irq_domain_simple_ops, NULL); | 1157 | &irq_domain_simple_ops, NULL); |
1141 | if (!bank->domain) | 1158 | #endif |
1159 | if (!bank->domain) { | ||
1160 | dev_err(dev, "Couldn't register an IRQ domain\n"); | ||
1142 | return -ENODEV; | 1161 | return -ENODEV; |
1162 | } | ||
1143 | 1163 | ||
1144 | if (bank->regs->set_dataout && bank->regs->clr_dataout) | 1164 | if (bank->regs->set_dataout && bank->regs->clr_dataout) |
1145 | bank->set_dataout = _set_gpio_dataout_reg; | 1165 | bank->set_dataout = _set_gpio_dataout_reg; |
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index 721b9186a5d1..4b93ed4d5cd6 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
@@ -107,7 +107,7 @@ static struct mfd_cell tps6586x_cell[] = { | |||
107 | .name = "tps6586x-gpio", | 107 | .name = "tps6586x-gpio", |
108 | }, | 108 | }, |
109 | { | 109 | { |
110 | .name = "tps6586x-pmic", | 110 | .name = "tps6586x-regulator", |
111 | }, | 111 | }, |
112 | { | 112 | { |
113 | .name = "tps6586x-rtc", | 113 | .name = "tps6586x-rtc", |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 716aa93fff76..59df8575a48c 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -61,6 +61,7 @@ static DEFINE_MUTEX(bridge_mutex); | |||
61 | static void handle_hotplug_event_bridge (acpi_handle, u32, void *); | 61 | static void handle_hotplug_event_bridge (acpi_handle, u32, void *); |
62 | static void acpiphp_sanitize_bus(struct pci_bus *bus); | 62 | static void acpiphp_sanitize_bus(struct pci_bus *bus); |
63 | static void acpiphp_set_hpp_values(struct pci_bus *bus); | 63 | static void acpiphp_set_hpp_values(struct pci_bus *bus); |
64 | static void hotplug_event_func(acpi_handle handle, u32 type, void *context); | ||
64 | static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context); | 65 | static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *context); |
65 | static void free_bridge(struct kref *kref); | 66 | static void free_bridge(struct kref *kref); |
66 | 67 | ||
@@ -147,7 +148,7 @@ static int post_dock_fixups(struct notifier_block *nb, unsigned long val, | |||
147 | 148 | ||
148 | 149 | ||
149 | static const struct acpi_dock_ops acpiphp_dock_ops = { | 150 | static const struct acpi_dock_ops acpiphp_dock_ops = { |
150 | .handler = handle_hotplug_event_func, | 151 | .handler = hotplug_event_func, |
151 | }; | 152 | }; |
152 | 153 | ||
153 | /* Check whether the PCI device is managed by native PCIe hotplug driver */ | 154 | /* Check whether the PCI device is managed by native PCIe hotplug driver */ |
@@ -179,6 +180,20 @@ static bool device_is_managed_by_native_pciehp(struct pci_dev *pdev) | |||
179 | return true; | 180 | return true; |
180 | } | 181 | } |
181 | 182 | ||
183 | static void acpiphp_dock_init(void *data) | ||
184 | { | ||
185 | struct acpiphp_func *func = data; | ||
186 | |||
187 | get_bridge(func->slot->bridge); | ||
188 | } | ||
189 | |||
190 | static void acpiphp_dock_release(void *data) | ||
191 | { | ||
192 | struct acpiphp_func *func = data; | ||
193 | |||
194 | put_bridge(func->slot->bridge); | ||
195 | } | ||
196 | |||
182 | /* callback routine to register each ACPI PCI slot object */ | 197 | /* callback routine to register each ACPI PCI slot object */ |
183 | static acpi_status | 198 | static acpi_status |
184 | register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | 199 | register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) |
@@ -298,7 +313,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
298 | */ | 313 | */ |
299 | newfunc->flags &= ~FUNC_HAS_EJ0; | 314 | newfunc->flags &= ~FUNC_HAS_EJ0; |
300 | if (register_hotplug_dock_device(handle, | 315 | if (register_hotplug_dock_device(handle, |
301 | &acpiphp_dock_ops, newfunc)) | 316 | &acpiphp_dock_ops, newfunc, |
317 | acpiphp_dock_init, acpiphp_dock_release)) | ||
302 | dbg("failed to register dock device\n"); | 318 | dbg("failed to register dock device\n"); |
303 | 319 | ||
304 | /* we need to be notified when dock events happen | 320 | /* we need to be notified when dock events happen |
@@ -670,6 +686,7 @@ static int __ref enable_device(struct acpiphp_slot *slot) | |||
670 | struct pci_bus *bus = slot->bridge->pci_bus; | 686 | struct pci_bus *bus = slot->bridge->pci_bus; |
671 | struct acpiphp_func *func; | 687 | struct acpiphp_func *func; |
672 | int num, max, pass; | 688 | int num, max, pass; |
689 | LIST_HEAD(add_list); | ||
673 | 690 | ||
674 | if (slot->flags & SLOT_ENABLED) | 691 | if (slot->flags & SLOT_ENABLED) |
675 | goto err_exit; | 692 | goto err_exit; |
@@ -694,13 +711,15 @@ static int __ref enable_device(struct acpiphp_slot *slot) | |||
694 | max = pci_scan_bridge(bus, dev, max, pass); | 711 | max = pci_scan_bridge(bus, dev, max, pass); |
695 | if (pass && dev->subordinate) { | 712 | if (pass && dev->subordinate) { |
696 | check_hotplug_bridge(slot, dev); | 713 | check_hotplug_bridge(slot, dev); |
697 | pci_bus_size_bridges(dev->subordinate); | 714 | pcibios_resource_survey_bus(dev->subordinate); |
715 | __pci_bus_size_bridges(dev->subordinate, | ||
716 | &add_list); | ||
698 | } | 717 | } |
699 | } | 718 | } |
700 | } | 719 | } |
701 | } | 720 | } |
702 | 721 | ||
703 | pci_bus_assign_resources(bus); | 722 | __pci_bus_assign_resources(bus, &add_list, NULL); |
704 | acpiphp_sanitize_bus(bus); | 723 | acpiphp_sanitize_bus(bus); |
705 | acpiphp_set_hpp_values(bus); | 724 | acpiphp_set_hpp_values(bus); |
706 | acpiphp_set_acpi_region(slot); | 725 | acpiphp_set_acpi_region(slot); |
@@ -1065,22 +1084,12 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, | |||
1065 | alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_bridge); | 1084 | alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_bridge); |
1066 | } | 1085 | } |
1067 | 1086 | ||
1068 | static void _handle_hotplug_event_func(struct work_struct *work) | 1087 | static void hotplug_event_func(acpi_handle handle, u32 type, void *context) |
1069 | { | 1088 | { |
1070 | struct acpiphp_func *func; | 1089 | struct acpiphp_func *func = context; |
1071 | char objname[64]; | 1090 | char objname[64]; |
1072 | struct acpi_buffer buffer = { .length = sizeof(objname), | 1091 | struct acpi_buffer buffer = { .length = sizeof(objname), |
1073 | .pointer = objname }; | 1092 | .pointer = objname }; |
1074 | struct acpi_hp_work *hp_work; | ||
1075 | acpi_handle handle; | ||
1076 | u32 type; | ||
1077 | |||
1078 | hp_work = container_of(work, struct acpi_hp_work, work); | ||
1079 | handle = hp_work->handle; | ||
1080 | type = hp_work->type; | ||
1081 | func = (struct acpiphp_func *)hp_work->context; | ||
1082 | |||
1083 | acpi_scan_lock_acquire(); | ||
1084 | 1093 | ||
1085 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); | 1094 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); |
1086 | 1095 | ||
@@ -1113,6 +1122,18 @@ static void _handle_hotplug_event_func(struct work_struct *work) | |||
1113 | warn("notify_handler: unknown event type 0x%x for %s\n", type, objname); | 1122 | warn("notify_handler: unknown event type 0x%x for %s\n", type, objname); |
1114 | break; | 1123 | break; |
1115 | } | 1124 | } |
1125 | } | ||
1126 | |||
1127 | static void _handle_hotplug_event_func(struct work_struct *work) | ||
1128 | { | ||
1129 | struct acpi_hp_work *hp_work; | ||
1130 | struct acpiphp_func *func; | ||
1131 | |||
1132 | hp_work = container_of(work, struct acpi_hp_work, work); | ||
1133 | func = hp_work->context; | ||
1134 | acpi_scan_lock_acquire(); | ||
1135 | |||
1136 | hotplug_event_func(hp_work->handle, hp_work->type, func); | ||
1116 | 1137 | ||
1117 | acpi_scan_lock_release(); | 1138 | acpi_scan_lock_release(); |
1118 | kfree(hp_work); /* allocated in handle_hotplug_event_func */ | 1139 | kfree(hp_work); /* allocated in handle_hotplug_event_func */ |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 68678ed76b0d..d1182c4a754e 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -202,6 +202,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
202 | struct resource *res, unsigned int reg); | 202 | struct resource *res, unsigned int reg); |
203 | int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type); | 203 | int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type); |
204 | void pci_configure_ari(struct pci_dev *dev); | 204 | void pci_configure_ari(struct pci_dev *dev); |
205 | void __ref __pci_bus_size_bridges(struct pci_bus *bus, | ||
206 | struct list_head *realloc_head); | ||
207 | void __ref __pci_bus_assign_resources(const struct pci_bus *bus, | ||
208 | struct list_head *realloc_head, | ||
209 | struct list_head *fail_head); | ||
205 | 210 | ||
206 | /** | 211 | /** |
207 | * pci_ari_enabled - query ARI forwarding status | 212 | * pci_ari_enabled - query ARI forwarding status |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 16abaaa1f83c..d254e2379533 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -1044,7 +1044,7 @@ handle_done: | |||
1044 | ; | 1044 | ; |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static void __ref __pci_bus_size_bridges(struct pci_bus *bus, | 1047 | void __ref __pci_bus_size_bridges(struct pci_bus *bus, |
1048 | struct list_head *realloc_head) | 1048 | struct list_head *realloc_head) |
1049 | { | 1049 | { |
1050 | struct pci_dev *dev; | 1050 | struct pci_dev *dev; |
@@ -1115,9 +1115,9 @@ void __ref pci_bus_size_bridges(struct pci_bus *bus) | |||
1115 | } | 1115 | } |
1116 | EXPORT_SYMBOL(pci_bus_size_bridges); | 1116 | EXPORT_SYMBOL(pci_bus_size_bridges); |
1117 | 1117 | ||
1118 | static void __ref __pci_bus_assign_resources(const struct pci_bus *bus, | 1118 | void __ref __pci_bus_assign_resources(const struct pci_bus *bus, |
1119 | struct list_head *realloc_head, | 1119 | struct list_head *realloc_head, |
1120 | struct list_head *fail_head) | 1120 | struct list_head *fail_head) |
1121 | { | 1121 | { |
1122 | struct pci_bus *b; | 1122 | struct pci_bus *b; |
1123 | struct pci_dev *dev; | 1123 | struct pci_dev *dev; |
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index d8fa37d5c734..2c9155b66f09 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c | |||
@@ -439,7 +439,7 @@ static int tps6586x_regulator_remove(struct platform_device *pdev) | |||
439 | 439 | ||
440 | static struct platform_driver tps6586x_regulator_driver = { | 440 | static struct platform_driver tps6586x_regulator_driver = { |
441 | .driver = { | 441 | .driver = { |
442 | .name = "tps6586x-pmic", | 442 | .name = "tps6586x-regulator", |
443 | .owner = THIS_MODULE, | 443 | .owner = THIS_MODULE, |
444 | }, | 444 | }, |
445 | .probe = tps6586x_regulator_probe, | 445 | .probe = tps6586x_regulator_probe, |
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 292b24f9bf93..32ae6c67ea3a 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -1656,9 +1656,12 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) | |||
1656 | 1656 | ||
1657 | if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN && | 1657 | if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN && |
1658 | fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) { | 1658 | fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) { |
1659 | skb->vlan_tci = VLAN_TAG_PRESENT | | 1659 | /* must set skb->dev before calling vlan_put_tag */ |
1660 | vlan_dev_vlan_id(fcoe->netdev); | ||
1661 | skb->dev = fcoe->realdev; | 1660 | skb->dev = fcoe->realdev; |
1661 | skb = __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), | ||
1662 | vlan_dev_vlan_id(fcoe->netdev)); | ||
1663 | if (!skb) | ||
1664 | return -ENOMEM; | ||
1662 | } else | 1665 | } else |
1663 | skb->dev = fcoe->netdev; | 1666 | skb->dev = fcoe->netdev; |
1664 | 1667 | ||
diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index c735c5a008a2..6427600b5bbe 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c | |||
@@ -59,7 +59,7 @@ static int pxa2xx_spi_map_dma_buffer(struct driver_data *drv_data, | |||
59 | int ret; | 59 | int ret; |
60 | 60 | ||
61 | sg_free_table(sgt); | 61 | sg_free_table(sgt); |
62 | ret = sg_alloc_table(sgt, nents, GFP_KERNEL); | 62 | ret = sg_alloc_table(sgt, nents, GFP_ATOMIC); |
63 | if (ret) | 63 | if (ret) |
64 | return ret; | 64 | return ret; |
65 | } | 65 | } |
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index f5d84d6f8222..48b396fced0a 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1075,7 +1075,7 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) | |||
1075 | acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) | 1075 | acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) |
1076 | return NULL; | 1076 | return NULL; |
1077 | 1077 | ||
1078 | pdata = devm_kzalloc(&pdev->dev, sizeof(*ssp), GFP_KERNEL); | 1078 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
1079 | if (!pdata) { | 1079 | if (!pdata) { |
1080 | dev_err(&pdev->dev, | 1080 | dev_err(&pdev->dev, |
1081 | "failed to allocate memory for platform data\n"); | 1081 | "failed to allocate memory for platform data\n"); |
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 5000586cb98d..71cc3e6ef47c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -444,7 +444,7 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) | |||
444 | } | 444 | } |
445 | 445 | ||
446 | ret = pm_runtime_get_sync(&sdd->pdev->dev); | 446 | ret = pm_runtime_get_sync(&sdd->pdev->dev); |
447 | if (ret != 0) { | 447 | if (ret < 0) { |
448 | dev_err(dev, "Failed to enable device: %d\n", ret); | 448 | dev_err(dev, "Failed to enable device: %d\n", ret); |
449 | goto out_tx; | 449 | goto out_tx; |
450 | } | 450 | } |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e570081f9f76..35f281033142 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -2470,13 +2470,16 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, | |||
2470 | .mode = mode | 2470 | .mode = mode |
2471 | }; | 2471 | }; |
2472 | int err; | 2472 | int err; |
2473 | bool lock_inode = !(mode & FALLOC_FL_KEEP_SIZE) || | ||
2474 | (mode & FALLOC_FL_PUNCH_HOLE); | ||
2473 | 2475 | ||
2474 | if (fc->no_fallocate) | 2476 | if (fc->no_fallocate) |
2475 | return -EOPNOTSUPP; | 2477 | return -EOPNOTSUPP; |
2476 | 2478 | ||
2477 | if (mode & FALLOC_FL_PUNCH_HOLE) { | 2479 | if (lock_inode) { |
2478 | mutex_lock(&inode->i_mutex); | 2480 | mutex_lock(&inode->i_mutex); |
2479 | fuse_set_nowrite(inode); | 2481 | if (mode & FALLOC_FL_PUNCH_HOLE) |
2482 | fuse_set_nowrite(inode); | ||
2480 | } | 2483 | } |
2481 | 2484 | ||
2482 | req = fuse_get_req_nopages(fc); | 2485 | req = fuse_get_req_nopages(fc); |
@@ -2511,8 +2514,9 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, | |||
2511 | fuse_invalidate_attr(inode); | 2514 | fuse_invalidate_attr(inode); |
2512 | 2515 | ||
2513 | out: | 2516 | out: |
2514 | if (mode & FALLOC_FL_PUNCH_HOLE) { | 2517 | if (lock_inode) { |
2515 | fuse_release_nowrite(inode); | 2518 | if (mode & FALLOC_FL_PUNCH_HOLE) |
2519 | fuse_release_nowrite(inode); | ||
2516 | mutex_unlock(&inode->i_mutex); | 2520 | mutex_unlock(&inode->i_mutex); |
2517 | } | 2521 | } |
2518 | 2522 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e6168a24b9f0..b420939f5eb5 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -123,7 +123,9 @@ extern int register_dock_notifier(struct notifier_block *nb); | |||
123 | extern void unregister_dock_notifier(struct notifier_block *nb); | 123 | extern void unregister_dock_notifier(struct notifier_block *nb); |
124 | extern int register_hotplug_dock_device(acpi_handle handle, | 124 | extern int register_hotplug_dock_device(acpi_handle handle, |
125 | const struct acpi_dock_ops *ops, | 125 | const struct acpi_dock_ops *ops, |
126 | void *context); | 126 | void *context, |
127 | void (*init)(void *), | ||
128 | void (*release)(void *)); | ||
127 | extern void unregister_hotplug_dock_device(acpi_handle handle); | 129 | extern void unregister_hotplug_dock_device(acpi_handle handle); |
128 | #else | 130 | #else |
129 | static inline int is_dock_device(acpi_handle handle) | 131 | static inline int is_dock_device(acpi_handle handle) |
@@ -139,7 +141,9 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) | |||
139 | } | 141 | } |
140 | static inline int register_hotplug_dock_device(acpi_handle handle, | 142 | static inline int register_hotplug_dock_device(acpi_handle handle, |
141 | const struct acpi_dock_ops *ops, | 143 | const struct acpi_dock_ops *ops, |
142 | void *context) | 144 | void *context, |
145 | void (*init)(void *), | ||
146 | void (*release)(void *)) | ||
143 | { | 147 | { |
144 | return -ENODEV; | 148 | return -ENODEV; |
145 | } | 149 | } |
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c index a64f8aeb5c1f..20185ea64aa6 100644 --- a/kernel/events/hw_breakpoint.c +++ b/kernel/events/hw_breakpoint.c | |||
@@ -120,7 +120,7 @@ static int task_bp_pinned(int cpu, struct perf_event *bp, enum bp_type_idx type) | |||
120 | list_for_each_entry(iter, &bp_task_head, hw.bp_list) { | 120 | list_for_each_entry(iter, &bp_task_head, hw.bp_list) { |
121 | if (iter->hw.bp_target == tsk && | 121 | if (iter->hw.bp_target == tsk && |
122 | find_slot_idx(iter) == type && | 122 | find_slot_idx(iter) == type && |
123 | cpu == iter->cpu) | 123 | (iter->cpu < 0 || cpu == iter->cpu)) |
124 | count += hw_breakpoint_weight(iter); | 124 | count += hw_breakpoint_weight(iter); |
125 | } | 125 | } |
126 | 126 | ||
@@ -149,7 +149,7 @@ fetch_bp_busy_slots(struct bp_busy_slots *slots, struct perf_event *bp, | |||
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | 151 | ||
152 | for_each_online_cpu(cpu) { | 152 | for_each_possible_cpu(cpu) { |
153 | unsigned int nr; | 153 | unsigned int nr; |
154 | 154 | ||
155 | nr = per_cpu(nr_cpu_bp_pinned[type], cpu); | 155 | nr = per_cpu(nr_cpu_bp_pinned[type], cpu); |
@@ -235,7 +235,7 @@ toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type, | |||
235 | if (cpu >= 0) { | 235 | if (cpu >= 0) { |
236 | toggle_bp_task_slot(bp, cpu, enable, type, weight); | 236 | toggle_bp_task_slot(bp, cpu, enable, type, weight); |
237 | } else { | 237 | } else { |
238 | for_each_online_cpu(cpu) | 238 | for_each_possible_cpu(cpu) |
239 | toggle_bp_task_slot(bp, cpu, enable, type, weight); | 239 | toggle_bp_task_slot(bp, cpu, enable, type, weight); |
240 | } | 240 | } |
241 | 241 | ||